/* 창귀전 — SITE-PLAN 토큰. 본편 glass/hero-blue 금지. */

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard-dynamic-subset.min.css");
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Noto+Serif+KR:wght@400;600;700;900&family=Song+Myung&display=swap");

@font-face {
  font-family: "NostalgicPoliceVibe";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2601-6@1.0/Griun_PolSensibility-Rg.woff2") format("woff2");
  font-weight: normal;
  font-display: swap;
}

:root {
  --bg: #000000;
  --ink: #c8bdb4;
  --ink-dim: #7a716a;
  --ink-bright: #e8dfd6;
  --danger: #8b1a1a;
  --danger-hot: #c41e1a;
  --line: rgba(255, 255, 255, 0.08);
  --tape: #3a3420;
  --tape-mark: #c4a035;
  --seal: #9a1c1c;
  --paper: #c4b59a;
  --paper-ink: #1a1210;
  --blue-glow: #eafcff;
  --red-glow: #b3132a;
  --gold-glow: #f0d28a;
  --mono: "IBM Plex Mono", "Consolas", monospace;
  --serif: "Noto Serif KR", "Nanum Myeongjo", "Batang", serif;
  --sans: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --display: "Song Myung", "Noto Serif KR", "Batang", serif;
  --nav-h: 52px;
  --wrap: min(1200px, calc(100% - 48px));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 88% 48% at 50% -12%, rgba(92, 19, 19, 0.2), transparent 58%),
    radial-gradient(ellipse 70% 46% at 82% 108%, rgba(68, 61, 51, 0.2), transparent 58%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.014)),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(255, 255, 255, 0.012) 5px 6px);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--ink-bright);
}

.wrap {
  width: var(--wrap);
  margin: 0 auto;
}

/* —— nav —— */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.top-nav .inner {
  width: var(--wrap);
  margin: 0 auto;
  min-height: var(--nav-h);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  padding: 10px 0;
}

.brand {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.1em;
  color: var(--ink-bright);
  margin-right: auto;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 0.92rem;
  color: var(--ink-dim);
}

.nav-links a[aria-current="page"] {
  color: var(--ink-bright);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

.nav-links a:hover {
  color: var(--ink-bright);
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* —— type —— */
.blue-glow {
  color: var(--blue-glow);
  text-shadow: 0 0 12px rgba(61, 171, 210, 0.55);
}

.red-glow {
  color: var(--red-glow);
  text-shadow: 0 0 14px rgba(179, 19, 42, 0.65);
}

.gold-glow {
  color: var(--gold-glow);
  text-shadow: 0 0 12px rgba(240, 210, 138, 0.45);
}

/* —— hero / opening —— */
.opening {
  min-height: 430px;
  display: grid;
  align-items: center;
  padding: 78px 0 70px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 46% 60% at 50% 48%, rgba(112, 22, 22, 0.16), transparent 68%),
    linear-gradient(180deg, rgba(12, 10, 9, 0.18), rgba(0, 0, 0, 0.68));
}

.opening::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(196, 181, 154, 0.025) 8% 8.2%, transparent 8.2% 92%, rgba(196, 181, 154, 0.025) 92% 92.2%, transparent 92.2%),
    repeating-linear-gradient(90deg, transparent 0 118px, rgba(255, 255, 255, 0.012) 118px 119px);
  pointer-events: none;
}

.opening::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(900px, 80vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 26, 26, 0.72), transparent);
  transform: translateX(-50%);
}

.opening-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.opening-kicker {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: rgba(196, 181, 154, 0.52);
}

.opening-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(4rem, 11vw, 8rem);
  font-weight: 400;
  letter-spacing: 0.16em;
  line-height: 0.95;
  color: var(--ink-bright);
  text-indent: 0.16em;
  text-shadow:
    0 0 2px rgba(232, 223, 214, 0.28),
    0 10px 34px rgba(116, 20, 20, 0.26);
  filter: drop-shadow(2px 0 0 rgba(139, 26, 26, 0.18));
  animation: inkIn 1.1s ease both;
}

.opening-sub {
  margin: 24px 0 0;
  font-family: var(--serif);
  font-size: clamp(0.94rem, 1.8vw, 1.12rem);
  letter-spacing: 0.06em;
  color: rgba(200, 189, 180, 0.7);
  animation: inkIn 1.1s ease 0.2s both;
}

@keyframes inkIn {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}

/* —— talisman frame —— */
.talisman {
  position: relative;
  width: min(960px, 100%);
  margin: 72px auto;
  padding: clamp(30px, 5vw, 54px);
  background:
    linear-gradient(135deg, rgba(196, 181, 154, 0.12), rgba(91, 78, 60, 0.045)),
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(255, 255, 255, 0.012) 4px 5px);
  color: var(--ink);
  border: 1px solid rgba(196, 181, 154, 0.22);
  border-left-color: rgba(139, 26, 26, 0.58);
  box-shadow:
    inset 0 0 58px rgba(0, 0, 0, 0.38),
    0 28px 70px rgba(0, 0, 0, 0.35);
}

.talisman::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 2px solid var(--seal);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(154, 28, 28, 0.35);
  opacity: 0.85;
}

.talisman::after {
  content: "印";
  position: absolute;
  top: 16px;
  right: 18px;
  font-family: var(--serif);
  font-size: 0.85rem;
  color: var(--seal);
  opacity: 0.9;
}

.talisman p {
  margin: 0 0 1.25em;
  font-family: var(--serif);
  font-size: clamp(0.98rem, 1.6vw, 1.08rem);
  line-height: 1.95;
}

.talisman p:last-child {
  margin-bottom: 0;
}

/* —— hazard tape —— */
.tape {
  margin: 24px 0 78px;
  padding: 14px 0;
  background:
    repeating-linear-gradient(
      -45deg,
      #1a160c,
      #1a160c 10px,
      #2e2814 10px,
      #2e2814 20px
    );
  border-top: 1px solid rgba(196, 160, 53, 0.35);
  border-bottom: 1px solid rgba(196, 160, 53, 0.35);
  overflow: hidden;
}

.tape span {
  display: block;
  width: max-content;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tape-mark);
  white-space: nowrap;
  animation: tapeScroll 28s linear infinite;
}

@keyframes tapeScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* —— UI preview —— */
.section-label {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.preview-section {
  margin-bottom: 72px;
}

.preview-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.preview-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  color: var(--ink-bright);
}

.record-link {
  flex: 0 0 auto;
  padding: 10px 14px;
  color: #d7c8ba;
  font-size: 0.86rem;
  border: 1px solid rgba(139, 26, 26, 0.58);
  background: linear-gradient(90deg, rgba(92, 17, 17, 0.64), rgba(72, 52, 29, 0.52));
}

.record-link:hover {
  color: white;
  border-color: rgba(196, 160, 53, 0.62);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.preview-card {
  min-width: 0;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(12, 11, 10, 0.94), rgba(4, 4, 4, 0.98));
  border: 1px solid rgba(196, 181, 154, 0.15);
  border-top-color: rgba(139, 26, 26, 0.68);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.42);
}

.preview-card h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 1rem;
  color: #d7c8ba;
}

.preview-card img {
  display: block;
  width: 100%;
  height: auto;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.preview-pair {
  display: grid;
  gap: 8px;
}

.preview-card p {
  margin: 12px 0 0;
  color: var(--ink-dim);
  font-size: 0.86rem;
}

.film-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.film-frame {
  flex: 0 0 min(280px, 78vw);
  scroll-snap-align: start;
  background: #050505;
  border: 1px solid rgba(139, 26, 26, 0.45);
  padding: 8px;
}

.film-frame img {
  display: block;
  width: 100%;
  height: auto;
  background: #0a0a0a;
}

.film-cap {
  margin: 8px 4px 2px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

/* —— details (SITE-PLAN) —— */
.fold {
  margin: 40px auto 0;
  padding-bottom: 52px;
}

.fold details {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
}

.fold summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
  transition: color 0.15s ease;
}

.fold summary::-webkit-details-marker {
  display: none;
}

.fold summary:hover {
  color: var(--ink-bright);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.fold .fold-body {
  padding: 4px 0 22px;
  color: var(--ink-dim);
  font-size: 0.95rem;
  animation: fadeIn 0.15s ease;
}

.fold .fold-body p {
  margin: 0 0 0.75em;
}

.fold .fold-body p:last-child {
  margin-bottom: 0;
}

.fold .fold-body code,
.fold .mono {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--ink-bright);
}

.fold .fold-body strong {
  color: var(--ink-bright);
  font-family: var(--serif);
}

.inline-link {
  color: var(--ink-bright);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.webtoon-preview {
  display: block;
  width: 100%;
  height: auto;
}

.site-footer {
  padding: 34px 0 54px;
  color: rgba(122, 113, 106, 0.72);
  font-family: var(--serif);
  font-size: 0.82rem;
  text-align: center;
  border-top: 1px solid var(--line);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.update-log {
  list-style: none;
  margin: 0;
  padding: 0;
}

.update-log li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.update-log time {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--danger-hot);
}

.foot-note {
  margin: 64px 0 48px;
  font-size: 0.8rem;
  color: var(--ink-dim);
}

.foot-note a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* —— page head —— */
.page-head {
  padding: 48px 0 28px;
}

.page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: 0.08em;
  color: var(--ink-bright);
}

.page-head p {
  margin: 10px 0 0;
  color: var(--ink-dim);
  font-family: var(--serif);
}

.stub-msg {
  padding: 48px 0 80px;
  color: var(--ink-dim);
  font-family: var(--serif);
}

/* —— shared archive structure: world / dex / gallery —— */
.archive-main {
  padding-bottom: 80px;
}

.record-head {
  padding-bottom: 48px;
}

.archive-section {
  margin: 0 0 72px;
}

.archive-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 24px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.archive-section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  color: var(--ink-bright);
}

.archive-section-head p {
  max-width: 520px;
  margin: 0;
  color: var(--ink-dim);
  text-align: right;
}

.world-chronicle {
  display: grid;
}

.world-chronicle-block {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.world-chronicle-key,
.world-chronicle-body {
  min-width: 0;
}

.world-chronicle-era,
.world-chronicle-note {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-dim);
}

.world-chronicle-key h3 {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--ink-bright);
}

.world-chronicle-body p {
  margin: 0;
}

.world-chronicle-body p + p {
  margin-top: 1em;
}

.world-ency-list,
.world-rank-list {
  display: grid;
  gap: 18px;
}

.world-ency-item h4 {
  margin: 0 0 6px;
  color: var(--ink-bright);
}

.world-ency-item p {
  margin: 0;
}

.world-rank-row {
  display: grid;
  grid-template-columns: minmax(72px, 96px) 1fr;
  gap: 18px;
}

.world-rank-row dt,
.world-rank-row dd {
  margin: 0;
}

.world-rank-row dt {
  font-weight: 800;
  color: var(--ink-bright);
}

.world-rank-equiv {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.82rem;
  color: var(--ink-dim);
}

.world-glossary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--line);
}

.world-glossary-entry {
  min-width: 0;
  padding: 24px;
  background: var(--bg);
}

.world-glossary-entry dt {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink-bright);
}

.world-glossary-entry dd {
  margin: 0;
}

.dex-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dex-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
}

.dex-card h3 {
  margin: 0 0 14px;
  font-family: var(--serif);
  color: var(--ink-bright);
}

.dex-card img {
  display: block;
  width: 100%;
  height: auto;
}

.format-record {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.format-record p {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
}

.format-record code {
  font-family: var(--mono);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.code-group + .code-group {
  margin-top: 34px;
}

.code-group h3 {
  margin: 0 0 14px;
  font-family: var(--serif);
  color: var(--ink-bright);
}

.code-table {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.code-row {
  display: grid;
  grid-template-columns: minmax(42px, 64px) 1fr;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 12px 14px;
  background: var(--bg);
}

.code-row b {
  font-family: var(--mono);
  color: var(--ink-bright);
}

.gallery-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 320px));
  gap: 14px;
  margin-bottom: 24px;
}

.gallery-filters label {
  display: grid;
  gap: 7px;
}

.gallery-filters label > span {
  font-size: 0.78rem;
  color: var(--ink-dim);
}

.gallery-filters select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  font: inherit;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.gallery-card {
  display: grid;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: inherit;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  cursor: pointer;
}

.gallery-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.gallery-card > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
}

.gallery-card strong {
  font-family: var(--mono);
}

.gallery-card small {
  color: var(--ink-dim);
}

.gallery-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px 0;
  color: var(--ink-dim);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 90;
  padding: 11px 16px;
  color: var(--ink-bright);
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid var(--line);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 48px;
  background: rgba(0, 0, 0, 0.9);
}

.image-modal[hidden] {
  display: none;
}

.image-modal img {
  display: block;
  max-width: min(1200px, 94vw);
  max-height: 88vh;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  padding: 4px 12px;
  color: white;
  background: transparent;
  border: 0;
  font-size: 2.3rem;
  cursor: pointer;
}

.modal-open {
  overflow: hidden;
}

/* —— characters: full ID-card archive —— */
.identity-section {
  margin: 0 0 64px;
}

.identity-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(196, 181, 154, 0.2);
}

.identity-section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.6vw, 1.8rem);
  color: var(--ink-bright);
}

.identity-section-head span {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
}

.identity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.identity-card {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 8px;
  background:
    linear-gradient(135deg, rgba(196, 181, 154, 0.08), rgba(0, 0, 0, 0.42));
  border: 1px solid rgba(196, 181, 154, 0.17);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
}

.identity-card::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 7%;
  width: 58px;
  height: 12px;
  z-index: 1;
  background: rgba(58, 52, 32, 0.9);
  border: 1px solid rgba(196, 160, 53, 0.25);
  transform: rotate(-4deg);
  pointer-events: none;
}

.identity-card img {
  display: block;
  width: 100%;
  height: auto;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 640px) {
  :root {
    --wrap: min(100% - 28px, 1200px);
  }

  .opening {
    min-height: 340px;
    padding: 58px 0 52px;
  }

  .opening-title {
    font-size: clamp(3.5rem, 20vw, 5.4rem);
  }

  .opening-sub {
    line-height: 1.7;
  }

  .talisman {
    margin: 48px auto;
    padding: 28px 22px 32px;
  }

  .talisman::before {
    width: 30px;
    height: 30px;
  }

  .talisman::after {
    top: 14px;
    right: 17px;
    font-size: 0.72rem;
  }

  .preview-head {
    display: block;
  }

  .record-link {
    display: inline-block;
    margin-top: 14px;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .archive-section-head {
    display: block;
  }

  .archive-section-head p {
    margin-top: 8px;
    text-align: left;
  }

  .world-chronicle-block,
  .world-glossary,
  .dex-grid,
  .format-record,
  .code-table,
  .gallery-filters,
  .gallery-grid,
  .identity-grid {
    grid-template-columns: 1fr;
  }

  .world-chronicle-block {
    gap: 14px;
  }

  .image-modal {
    padding: 40px 14px 20px;
  }

  .top-nav .inner {
    gap: 6px 16px;
  }

  .nav-links {
    gap: 6px 14px;
    font-size: 0.85rem;
  }
}

/* —— 2026-08 visual pass: Changui sealed-record theme —— */
body {
  color: #d8cec6;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.72;
}

.red-glow {
  color: #d22b40;
  font-weight: 800;
  text-shadow:
    0 0 5px rgba(179, 19, 42, 0.68),
    0 0 15px rgba(80, 0, 16, 0.72),
    0 0 28px rgba(20, 0, 8, 0.8);
}

.opening {
  min-height: 0;
  padding: clamp(44px, 6vw, 78px) 0 54px;
  border-bottom: 0;
  background:
    radial-gradient(circle at 78% 30%, rgba(142, 19, 29, 0.17), transparent 30rem),
    linear-gradient(180deg, rgba(13, 8, 8, 0.74), rgba(0, 0, 0, 0.96));
}

.opening::before {
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(255, 255, 255, 0.011) 4px 5px),
    linear-gradient(90deg, rgba(112, 13, 22, 0.08), transparent 28%, transparent 74%, rgba(112, 13, 22, 0.08));
}

.opening::after {
  display: none;
}

.opening-inner {
  text-align: left;
}

.hero-cluster {
  --hero-height: min(760px, calc((100vw - 80px) / 1.25));
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
}

.hero-media {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: clamp(12px, 2vw, 22px);
  width: max-content;
  height: var(--hero-height);
}

.hero-title-image {
  display: block;
  flex: 0 0 auto;
  width: auto;
  height: 100%;
  max-height: none;
  margin: 0;
  object-fit: contain;
  filter:
    drop-shadow(0 0 12px rgba(211, 35, 53, 0.3))
    drop-shadow(0 18px 30px rgba(0, 0, 0, 0.75));
}

.hero-video-frame {
  position: relative;
  z-index: 1;
  flex: 0 0 var(--hero-height);
  width: var(--hero-height);
  height: var(--hero-height);
  overflow: hidden;
  aspect-ratio: 1;
  background: #080505;
  border: 1px solid rgba(213, 63, 72, 0.42);
  box-shadow:
    0 0 0 8px rgba(0, 0, 0, 0.32),
    0 0 34px rgba(143, 16, 29, 0.3);
}

.hero-video-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 42px rgba(0, 0, 0, 0.55);
}

.hero-video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-play {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 3;
  min-width: 132px;
  min-height: 48px;
  padding: 11px 18px;
  color: #fff2e8;
  font: 800 15px/1 var(--sans);
  background: rgba(111, 12, 23, 0.92);
  border: 1px solid rgba(239, 91, 102, 0.68);
  box-shadow: 0 0 24px rgba(161, 18, 34, 0.54);
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.hero-play[hidden] {
  display: none;
}

.opening-subtitle {
  width: 100%;
  margin: 26px 0 0;
  color: #c62537;
  font-family: var(--serif);
  font-size: clamp(17px, 2.5vw, 22px);
  font-weight: 900;
  letter-spacing: -0.025em;
  text-shadow:
    0 0 8px rgba(195, 28, 47, 0.62),
    0 0 25px rgba(91, 7, 17, 0.76);
}

.intro-record {
  padding: 64px 0 28px;
}

.opening-scene,
.narrative-block {
  color: rgba(255, 243, 223, 0.88);
  font-family: var(--serif);
  font-size: clamp(15px, 1.9vw, 18px);
  font-weight: 600;
  line-height: 1.9;
  filter: drop-shadow(0 0 7px rgba(159, 35, 52, 0.28));
}

.opening-scene {
  width: min(72%, 720px);
  margin: 0 auto 64px;
  text-align: center;
  text-wrap: balance;
}

.gate-figure {
  position: relative;
  width: min(92%, 980px);
  margin: 0 auto 64px;
  padding: 10px;
  background: rgba(9, 5, 5, 0.92);
  border: 1px solid rgba(175, 42, 52, 0.4);
  box-shadow:
    0 30px 78px rgba(0, 0, 0, 0.62),
    0 0 38px rgba(139, 19, 31, 0.18);
}

.gate-figure img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.82) contrast(1.06) brightness(0.82);
}

.gate-figure::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  box-shadow: inset 0 0 62px rgba(0, 0, 0, 0.56);
}

.narrative-block {
  width: min(84%, 900px);
  text-align: left;
}

.narrative-block--right {
  margin: 0 4% 0 auto;
  text-align: left;
}

.narrative-block p {
  margin: 0;
}

.narrative-block p + p {
  margin-top: 28px;
}

.narrative-descent {
  display: block;
  margin-top: clamp(76px, 8vw, 118px) !important;
  text-align: right;
}

.world-intro {
  width: 100%;
  margin: clamp(132px, 14vw, 190px) auto 96px;
  overflow: hidden;
}

.world-intro p {
  color: #ded4cc;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.9;
}

.world-intro::before,
.world-intro::after {
  z-index: 1;
}

.preview-head h2 {
  color: #f2e4d7;
  font-family: var(--serif);
  font-weight: 600;
  text-shadow: 0 0 18px rgba(123, 14, 25, 0.3);
}

.page-head {
  padding: clamp(72px, 8vw, 108px) 0 clamp(48px, 5vw, 68px);
}

.page-head h1 {
  margin: 0;
  color: #c40000;
  font-family: "NostalgicPoliceVibe", var(--serif);
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.72);
}

.archive-main {
  padding-bottom: 112px;
}

.record-head {
  padding-bottom: clamp(52px, 6vw, 76px);
}

.archive-section,
.identity-section {
  position: relative;
  margin-bottom: clamp(44px, 6vw, 72px);
  padding: clamp(24px, 3.2vw, 38px);
  background:
    linear-gradient(145deg, rgba(25, 20, 19, 0.97), rgba(10, 10, 10, 0.98));
  border: 1px solid rgba(130, 108, 91, 0.22);
  box-shadow:
    inset 0 1px rgba(255, 244, 224, 0.025),
    0 24px 58px rgba(0, 0, 0, 0.28);
}

.archive-section-head,
.identity-section-head {
  margin-bottom: 26px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(159, 35, 52, 0.46);
}

.archive-section-head h2,
.identity-section-head h2 {
  color: #b90000;
  font-family: var(--serif);
  font-size: clamp(23px, 2.7vw, 32px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.72);
}

/* World chronology: preserve the original timeline flow. */
.world-page-content .archive-section {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.world-page-content .world-chronicle {
  position: relative;
  display: grid;
  gap: 0;
  padding-left: 28px;
  border-left: 2px solid rgba(215, 25, 63, 0.42);
}

.world-page-content .world-chronicle-block {
  position: relative;
  display: grid;
  grid-template-columns: minmax(9rem, 12rem) minmax(0, 1fr);
  gap: 28px 36px;
  padding: 28px 0 32px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(238, 225, 216, 0.12);
  box-shadow: none;
}

.world-page-content .world-chronicle-block::before {
  content: "";
  position: absolute;
  top: 36px;
  left: calc(-28px - 7px);
  width: 12px;
  height: 12px;
  background: #090909;
  border: 2px solid #c40000;
  border-radius: 50%;
  box-shadow:
    0 0 8px rgba(226, 29, 63, 0.72),
    0 0 22px rgba(154, 0, 36, 0.46);
}

.world-page-content .world-chronicle-block:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.world-page-content .world-chronicle-era,
.world-page-content .world-chronicle-note {
  margin-bottom: 6px;
  color: #cf0000;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.world-page-content .world-chronicle-key h3,
.world-page-content .world-ency-item h4,
.world-page-content .world-rank-row dt {
  color: #c40000;
  text-shadow:
    0 0 8px rgba(226, 29, 63, 0.42),
    0 0 18px rgba(125, 0, 28, 0.3);
}

.world-page-content .world-chronicle-key h3 {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 700;
  line-height: 1.35;
}

.world-page-content .world-chronicle-body,
.world-page-content .world-ency-item p,
.world-page-content .world-rank-row dd {
  color: #f0e7df;
  font-weight: 600;
  line-height: 1.88;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.95);
}

.dex-card,
.format-record p,
.world-chronicle-block,
.world-glossary-entry,
.code-row,
.gallery-card,
.identity-card {
  background:
    linear-gradient(135deg, rgba(32, 27, 25, 0.97), rgba(14, 14, 14, 0.99));
  border-color: rgba(138, 117, 98, 0.26);
  box-shadow:
    inset 0 0 32px rgba(0, 0, 0, 0.23),
    0 14px 34px rgba(0, 0, 0, 0.2);
}

.preview-card {
  padding: 18px;
  border-top: 2px solid rgba(183, 45, 57, 0.72);
}

.preview-card h3,
.dex-card h3,
.code-group h3,
.world-chronicle-key h3,
.world-ency-item h4,
.world-glossary-entry dt {
  color: #bd0000;
  font-family: var(--serif);
  font-weight: 600;
}

.preview-card h3,
.dex-card h3 {
  font-size: 16px;
}

.preview-card p,
.archive-section-head p,
.world-chronicle-body,
.world-glossary-entry dd,
.format-record,
.code-row,
.gallery-card,
.gallery-empty {
  color: #e3dbd2;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.8;
}

.world-chronicle {
  gap: 14px;
}

.world-chronicle-block {
  padding: 26px;
  border: 1px solid rgba(138, 117, 98, 0.22);
  border-left: 3px solid rgba(159, 35, 52, 0.78);
}

.world-chronicle-era,
.world-chronicle-note,
.world-rank-equiv {
  color: #bcae9f;
  font-weight: 700;
}

.world-rank-row dt {
  color: #bd0000;
}

.world-glossary {
  gap: 12px;
  background: transparent;
}

.world-glossary-entry {
  border: 1px solid rgba(138, 117, 98, 0.22);
  border-top: 2px solid rgba(159, 35, 52, 0.72);
}

.dex-grid {
  gap: 18px;
}

.dex-card {
  padding: 18px;
  border: 1px solid rgba(138, 117, 98, 0.24);
  border-top: 2px solid rgba(159, 35, 52, 0.78);
}

.format-record p,
.code-row {
  border: 1px solid rgba(138, 117, 98, 0.22);
}

.code-table {
  gap: 8px;
  background: transparent;
}

.code-row b,
.format-record b {
  color: #bd0000;
  font-weight: 800;
}

.gallery-filters label > span {
  color: #eaded4;
  font-size: 14px;
  font-weight: 700;
}

.gallery-filters select {
  min-height: 48px;
  color: #f2e9e1;
  background: #171312;
  border: 1px solid rgba(138, 117, 98, 0.42);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
}

.gallery-filters option {
  color: #f2e9e1;
  background: #171312;
}

.gallery-card {
  border: 1px solid rgba(138, 117, 98, 0.3);
}

.gallery-card:hover {
  border-color: rgba(159, 35, 52, 0.72);
  box-shadow: 0 0 26px rgba(103, 14, 27, 0.26);
}

.identity-card {
  padding: 10px;
  border: 1px solid rgba(138, 117, 98, 0.28);
}

.fold details {
  border-bottom: 1px solid rgba(138, 117, 98, 0.3);
}

.fold summary {
  position: relative;
  padding: 18px 46px 18px 16px;
  color: #f0e3d8;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  text-shadow: 0 0 12px rgba(99, 14, 26, 0.3);
}

.fold summary::after {
  content: "＋";
  position: absolute;
  top: 50%;
  right: 16px;
  color: #bd0000;
  font-family: var(--sans);
  font-weight: 700;
  transform: translateY(-50%);
}

.fold details[open] summary::after {
  content: "－";
}

.fold .fold-body {
  padding: 18px 22px 26px;
  color: #ded4cc;
  background:
    linear-gradient(90deg, rgba(91, 16, 24, 0.16), rgba(11, 8, 8, 0.84) 24%, rgba(5, 5, 5, 0.92));
  border-left: 3px solid rgba(159, 35, 52, 0.68);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.9;
}

.fold .fold-body p {
  margin-bottom: 1.1em;
}

.fold .fold-body strong {
  color: #f3e8df;
  font-family: var(--sans);
  font-weight: 800;
}

.fold .fold-body code {
  color: #bd0000;
  font-family: var(--sans);
  font-weight: 800;
  text-shadow: 0 0 10px rgba(179, 19, 42, 0.32);
}

@media (max-width: 760px) {
  .page-head {
    padding: 58px 0 42px;
  }

  .record-head {
    padding-bottom: 48px;
  }

  .archive-section,
  .identity-section {
    padding: 22px 18px;
  }

  .archive-section-head,
  .identity-section-head {
    margin-bottom: 22px;
  }

  .world-page-content .world-chronicle {
    padding-left: 20px;
  }

  .world-page-content .world-chronicle-block {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 24px 0 28px;
  }

  .world-page-content .world-chronicle-block::before {
    top: 28px;
    left: calc(-20px - 7px);
  }

  .hero-cluster {
    --hero-height: min(520px, calc((100vw - 44px) / 1.25));
  }

  .hero-media {
    gap: 8px;
  }

  .hero-title-image {
    max-height: none;
  }

  .opening-subtitle {
    margin-top: 20px;
  }

  .opening-scene,
  .narrative-block {
    width: 88%;
  }

  .opening-scene {
    text-align: center;
  }

  .narrative-block--right {
    width: 88%;
    margin: 0 2% 0 auto;
    text-align: left;
  }

  .gate-figure {
    width: 100%;
    padding: 6px;
  }

  .gate-figure::after {
    inset: 6px;
  }

  .world-chronicle-block {
    padding: 20px 18px;
  }
}

@media (max-width: 480px) {
  .page-head {
    padding: 48px 0 34px;
  }

  .record-head {
    padding-bottom: 40px;
  }

  .archive-section,
  .identity-section {
    margin-bottom: 34px;
    padding: 18px 14px;
  }

  .archive-section-head h2,
  .identity-section-head h2 {
    font-size: 22px;
  }

  .hero-cluster {
    --hero-height: calc((100vw - 36px) / 1.25);
  }

  .hero-media {
    gap: 6px;
  }

  .opening-subtitle {
    font-size: 17px;
  }

  .page-head h1 {
    font-size: 42px;
  }
}
