@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --bg: #ebe8e0;
  --bg-rgb: 235, 232, 224;
  --surface: #ffffff;
  --surface-alt: #f4f1ea;
  --ink: #16181e;
  --muted: #626670;
  --line: #dcd7cb;
  --accent: #d9383a;
  --accent-rgb: 217, 56, 58;
  --accent2: #2563eb;
  --accent2-rgb: 37, 99, 235;
  --f-display: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-body: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-mono: 'Space Grotesk', 'Pretendard', sans-serif;
  --r-card: 16px;
  --r-sm: 10px;
  --r-pill: 999px;
  --sec-gap: 84px;
  --max-w: 1160px;
  --shadow: 0 10px 30px rgba(24, 20, 14, 0.08);
  --glass: rgba(255, 255, 255, 0.88);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--f-display); font-weight: 700; letter-spacing: -0.02em; word-break: keep-all; }
p { margin: 0; word-break: keep-all; }

/* Atmosphere canvas */
#atmo-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.site-wrap {
  position: relative;
  z-index: 2;
}

.container {
  width: min(var(--max-w), calc(100% - 48px));
  margin-inline: auto;
}

/* ---------------- Splash Gate ---------------- */
.splash-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}
.splash-gate.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.22;
  filter: blur(4px) scale(1.04);
}
.splash-card {
  position: relative;
  width: min(760px, 100%);
  padding: clamp(32px, 5vw, 56px);
  background: var(--glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
  text-align: center;
}
.splash-eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.splash-title {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.2;
}
.splash-sub {
  color: var(--muted);
  max-width: 520px;
  margin-inline: auto;
}
.splash-polaroids {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.splash-polaroids img {
  width: 96px;
  height: 118px;
  object-fit: cover;
  object-position: top;
  padding: 5px 5px 18px;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.16);
}
.splash-polaroids img:nth-child(odd) { transform: rotate(-3deg); }
.splash-polaroids img:nth-child(even) { transform: rotate(3deg); }
.splash-note { font-size: 12.5px; color: var(--muted); }

/* ---------------- Navigation Shells ---------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.site-nav-inner {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  min-width: 0;
  white-space: nowrap;
}
.brand > span:not(.brand-mark):not(.brand-eng) {
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-mark {
  color: var(--accent);
  font-family: var(--f-mono);
  font-size: 15px;
  flex-shrink: 0;
}
.brand-eng {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
@media (max-width: 1220px) {
  .brand-eng { display: none; }
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-item {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
  border: 1px solid transparent;
}
.nav-item:hover { color: var(--ink); }
.nav-item.is-active {
  color: var(--ink);
  background: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--accent-rgb), 0.35);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.18s, background 0.18s, border-color 0.18s, opacity 0.18s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--accent); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* Hamburger Drawer (for nav_shell == hamburger_drawer) */
.drawer-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  display: inline-grid;
  place-items: center;
  font-size: 18px;
}
.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  z-index: 80;
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 28px 24px;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
}
.nav-drawer.is-open { transform: translateX(0); }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.drawer-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--f-display);
  font-size: 17px;
}
.drawer-link span { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }

/* Tabbed Mode Views (for nav_shell == top_tabs) */
body[data-nav="top_tabs"] .tab-pane { display: none; }
body[data-nav="top_tabs"] .tab-pane.is-active { display: block; animation: fadeUp 0.35s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Hero Variants ---------------- */
.hero { position: relative; overflow: hidden; }

/* 1. Fullbleed Flank (starlight / academy) */
.hero--fullbleed_flank {
  min-height: clamp(540px, 76vh, 760px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 72px 24px;
}
.hero--fullbleed_flank .hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0.46;
}
.hero--fullbleed_flank::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(var(--bg-rgb), 0.35) 0%, rgba(var(--bg-rgb), 0.65) 60%, var(--bg) 100%);
}
.hero-flank-grid {
  position: relative;
  z-index: 2;
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 24px;
}
.hero-flank {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--f-display);
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: 0.28em;
  color: rgba(255,255,255,0.88);
  text-shadow: 0 0 24px rgba(var(--accent-rgb), 0.55);
  justify-self: center;
  border-top: 1px solid rgba(var(--accent-rgb), 0.6);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.6);
  padding: 18px 4px;
}

/* 2. Panoramic Editorial (ledger / obsidian) */
.hero--panoramic_editorial {
  padding: 58px 0 0;
}
.hero-pano-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 36px;
  padding-inline: 24px;
  display: grid;
  gap: 14px;
}
.hero-pano-frame {
  width: 100%;
  height: clamp(280px, 40vh, 430px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}
.hero-pano-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.hero-pano-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

/* 3. Minimal Glow (ink hanji / pitch minimal) */
.hero--minimal_glow {
  min-height: clamp(500px, 72vh, 700px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 72px 24px;
}
.hero--minimal_glow .hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.22;
  filter: grayscale(25%);
}
.hero--minimal_glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(var(--accent-rgb), 0.14), rgba(var(--bg-rgb), 0.94) 68%);
}
.hero-minimal-inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
  display: grid;
  gap: 18px;
}
.hero--minimal_glow .hero-title {
  text-shadow: 0 0 36px rgba(var(--accent-rgb), 0.35);
  letter-spacing: 0.04em;
}

/* 4. Split Webtoon / Magazine (stone magazine / crimson portal) */
.hero--split_webtoon {
  padding: 56px 0 44px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.07), transparent 55%);
}
.hero-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 36px;
  align-items: center;
}
.hero-webtoon-card {
  position: relative;
  border-radius: var(--r-card);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.22s ease;
  text-align: left;
  padding: 0;
  width: 100%;
}
.hero-webtoon-card:hover { transform: translateY(-4px); }
.hero-webtoon-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 22%;
}
.hero-webtoon-cap {
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.hero-webtoon-cap b { display: block; font-size: 15px; }
.hero-webtoon-cap > div span { font-size: 12.5px; color: var(--muted); }

/* 5. Daylight Note (bright editorial) */
.hero--daylight_note {
  min-height: clamp(500px, 68vh, 660px);
  display: flex;
  align-items: flex-end;
  padding: 56px 0;
}
.hero--daylight_note .hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
}
.hero--daylight_note::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(var(--bg-rgb), 0.25) 0%, var(--bg) 96%);
}
.hero-note-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 28px;
  align-items: end;
}
.story-note-card {
  background: var(--glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 22px;
  display: grid;
  gap: 14px;
}
.story-note-kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.story-note-kv div {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.story-note-kv dt { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.story-note-kv dd { margin: 3px 0 0; font-size: 13px; font-weight: 600; }

/* Shared Hero Typography */
.hero-eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-title {
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.18;
}
.hero-sub {
  font-size: clamp(15px, 1.5vw, 17.5px);
  color: var(--muted);
  max-width: 600px;
}
.hero-center .hero-sub { margin-inline: auto; }
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.hero-center .hero-cta-row { justify-content: center; }
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

/* ---------------- Sections ---------------- */
.sec {
  padding-top: var(--sec-gap);
}
.sec-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.sec-kicker {
  display: block;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.sec-title {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.25;
}
.sec-sub {
  color: var(--muted);
  margin-top: 6px;
  max-width: 640px;
}

/* ---------------- World Primer ---------------- */
.anchor-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.anchor-card {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--r-sm);
}
.anchor-card dt {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.anchor-card dd {
  margin: 6px 0 0;
  font-weight: 600;
  font-size: 14.5px;
}
.primer-body {
  max-width: 780px;
  display: grid;
  gap: 16px;
}
.primer-lead {
  font-family: var(--f-display);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.65;
  color: var(--ink);
}
.primer-body p { color: var(--muted); }

/* ---------------- In-Universe Document Artifact ---------------- */
.doc-artifact {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(26px, 4vw, 44px);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.doc-artifact::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.doc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px dashed var(--line);
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
}
.doc-stamp {
  padding: 3px 10px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
  border-radius: var(--r-sm);
  letter-spacing: 0.08em;
}
.doc-title { font-size: clamp(21px, 2.4vw, 28px); margin-bottom: 6px; }
.doc-salutation { color: var(--accent); font-family: var(--f-display); margin: 14px 0 10px; font-size: 16px; }
.doc-paras { display: grid; gap: 12px; color: var(--ink); }
.doc-bullets {
  margin: 22px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.doc-bullets dt { font-size: 12px; font-family: var(--f-mono); color: var(--accent); }
.doc-bullets dd { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.doc-sign {
  margin-top: 22px;
  text-align: right;
  font-family: var(--f-display);
  font-style: italic;
  color: var(--muted);
}

/* ---------------- Faction Compare & System Matrix ---------------- */
.faction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}
.faction-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  display: grid;
  gap: 12px;
  align-content: start;
}
.faction-card:nth-child(even) { border-top: 3px solid var(--accent2); }
.faction-card:nth-child(odd) { border-top: 3px solid var(--accent); }
.faction-badge {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
}
.faction-card ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); display: grid; gap: 6px; font-size: 14.5px; }

.sys-groups { display: grid; gap: 28px; }
.sys-group-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.sys-group-head span { font-family: var(--f-mono); font-size: 12px; color: var(--accent); }
.sys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.sys-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  display: grid;
  gap: 6px;
}
.sys-card b { font-family: var(--f-display); font-size: 16px; }
.sys-tag { font-family: var(--f-mono); font-size: 11px; color: var(--accent); }
.sys-card p { font-size: 13.5px; color: var(--muted); }

/* ---------------- Chronicle Timeline ---------------- */
.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
}
.timeline time {
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 600;
}
.timeline h4 { font-size: 16.5px; margin-bottom: 4px; }
.timeline p { font-size: 14px; color: var(--muted); }

/* ---------------- Cast Roster ---------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.filter-pill {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  transition: all 0.16s;
}
.filter-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}
.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.cast-card {
  text-align: left;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.cast-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.cast-card.is-hidden { display: none; }
.cast-thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--surface-alt);
  overflow: hidden;
}
.cast-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  transition: transform 0.35s ease;
}
.cast-card:hover .cast-thumb img { transform: scale(1.04); }
.cast-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: rgba(10, 12, 18, 0.78);
  color: #fff;
  font-family: var(--f-mono);
  font-size: 11px;
  border: 1px solid rgba(255,255,255,0.18);
}
.cast-expr-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: rgba(10, 12, 18, 0.72);
  color: #f3eadb;
  font-size: 11px;
}
.cast-info {
  padding: 14px 16px 16px;
  display: grid;
  gap: 4px;
}
.cast-role { font-size: 11.5px; color: var(--accent); font-weight: 600; }
.cast-name-row { display: flex; align-items: baseline; gap: 8px; }
.cast-name-row b { font-family: var(--f-display); font-size: 18px; }
.cast-name-row span { font-family: var(--f-mono); font-size: 11px; color: var(--muted); text-transform: uppercase; }
.cast-tagline { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ---------------- Relationship Web ---------------- */
.rel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.rel-card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  display: grid;
  gap: 10px;
}
.rel-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rel-jump {
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: rgba(var(--accent-rgb), 0.14);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}
.rel-jump:hover { background: var(--accent); color: #fff; }
.rel-card h4 { font-size: 16px; }
.rel-card p { font-size: 13.5px; color: var(--muted); }

/* ---------------- Place Switcher ---------------- */
.place-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.place-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-alt);
  overflow: hidden;
}
.place-media img { width: 100%; height: 100%; object-fit: cover; }
.place-caption {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}
.place-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.place-tab {
  padding: 7px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}
.place-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ---------------- Interactive Map / Floorplan ---------------- */
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: start;
}
.map-board {
  position: relative;
  border-radius: var(--r-card);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  aspect-ratio: 16 / 10;
}
.map-board img { width: 100%; height: 100%; object-fit: cover; }
.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: rgba(12, 15, 24, 0.88);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--accent);
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  white-space: nowrap;
}
.map-pin.is-active { background: var(--accent); color: #fff; }
.map-detail {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  display: grid;
  gap: 10px;
}
.map-detail img { border-radius: var(--r-sm); aspect-ratio: 16 / 10; object-fit: cover; }

/* ---------------- Tier Explorer ---------------- */
.tier-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 22px;
  align-items: start;
}
.tier-tracks { display: grid; gap: 18px; }
.tier-track-title { font-size: 15px; margin-bottom: 8px; color: var(--accent); }
.tier-steps { display: grid; gap: 6px; }
.tier-step-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-align: left;
  transition: border-color 0.16s, background 0.16s;
}
.tier-step-btn.is-active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.14);
}
.tier-result {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  display: grid;
  gap: 14px;
}
.tier-chars { display: flex; flex-wrap: wrap; gap: 10px; }
.tier-char-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-alt);
  font-size: 13.5px;
}
.tier-char-chip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: top; }

/* ---------------- Stat Simulator ---------------- */
.stat-sim-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 24px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  align-items: center;
}
.stat-sliders { display: grid; gap: 14px; }
.stat-row { display: grid; gap: 5px; }
.stat-row-head { display: flex; justify-content: space-between; font-size: 13.5px; }
.stat-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.stat-radar-wrap { text-align: center; display: grid; gap: 12px; justify-items: center; }
.stat-archetype-box {
  padding: 14px 16px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  width: 100%;
}

/* ---------------- Spoiler Seal ---------------- */
.spoiler-box {
  padding: 28px;
  background: var(--surface);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: var(--r-card);
  text-align: center;
}
.spoiler-content {
  display: none;
  text-align: left;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
  gap: 14px;
}
.spoiler-box.is-open .spoiler-content { display: grid; }
.spoiler-entry {
  padding: 16px 18px;
  background: var(--surface-alt);
  border-radius: var(--r-sm);
}
.spoiler-entry h4 { font-size: 16px; color: var(--accent); margin-bottom: 6px; }
.spoiler-entry p { font-size: 14px; color: var(--muted); }

/* ---------------- Start Scenarios & Commands ---------------- */
.start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.start-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.start-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.start-card-body { padding: 18px; display: grid; gap: 8px; }
.cmd-list { display: grid; gap: 10px; }
.cmd-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  flex-wrap: wrap;
}
.cmd-code {
  font-family: var(--f-mono);
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
}

/* ---------------- Author Colophon & Cross-Work Links ---------------- */
.colophon {
  margin-top: var(--sec-gap);
  padding: 44px 0 64px;
  border-top: 1px solid var(--line);
}
.colophon-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 28px;
  align-items: start;
}
.colophon-author { display: grid; gap: 8px; }
.colophon-label { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.16em; color: var(--accent); }
.colophon-pen { font-family: var(--f-display); font-size: 24px; }
.other-works { display: grid; gap: 10px; }
.other-work-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color 0.18s, transform 0.18s;
}
.other-work-link:hover { border-color: var(--accent); transform: translateX(3px); }

/* ---------------- Character & Webtoon Modals ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 8, 14, 0.78);
  backdrop-filter: blur(8px);
  display: none;
  place-items: center;
  padding: 20px;
}
.modal-overlay.is-open { display: grid; }
.modal-shell {
  position: relative;
  width: min(920px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(0, 1.08fr);
}
.modal-shell--dossier_book {
  border: 2px solid var(--accent);
}
.modal-shell--dossier_book .modal-left {
  background: var(--surface-alt);
  border-right: 2px solid var(--line);
}
.modal-left {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.modal-portrait-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
}
.modal-portrait-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
}
.expr-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.expr-btn {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}
.expr-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.modal-right {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.modal-nav-btns { display: flex; gap: 6px; }
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 16px;
}
.modal-quote {
  padding: 12px 14px;
  background: rgba(var(--accent-rgb), 0.1);
  border-left: 3px solid var(--accent);
  font-family: var(--f-display);
  font-size: 15px;
}
.modal-traits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.modal-traits div {
  padding: 8px 10px;
  background: var(--surface-alt);
  border-radius: var(--r-sm);
}
.modal-traits dt { font-size: 11px; color: var(--muted); }
.modal-traits dd { margin: 2px 0 0; font-size: 13.5px; font-weight: 600; }
.dual-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px;
  background: var(--surface-alt);
  align-self: flex-start;
}
.dual-btn {
  padding: 5px 14px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  color: var(--muted);
}
.dual-btn.is-active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.secret-reveal-box {
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
}

/* Webtoon Lightbox */
.webtoon-shell {
  width: min(740px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #0d0e12;
  color: #f4f2ec;
  border-radius: var(--r-card);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 20px;
}
.webtoon-panels { display: grid; gap: 6px; margin-top: 14px; }
.webtoon-panels img { width: 100%; border-radius: 4px; }
.webtoon-cap { text-align: center; font-size: 13px; color: #b7b3aa; padding: 6px 0 12px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .hero-flank-grid { grid-template-columns: 1fr; }
  .hero-flank { display: none; }
  .hero-split-grid,
  .hero-note-grid,
  .place-stage,
  .map-layout,
  .tier-grid,
  .stat-sim-grid,
  .colophon-grid,
  .modal-shell { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; }
  .container { width: min(var(--max-w), calc(100% - 28px)); }
}
@media (max-width: 640px) {
  .site-header { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 8px; }
  .brand { flex: 1 1 auto; max-width: calc(100% - 140px); }
  .nav-tabs, .nav-anchors { order: 3; flex: 1 0 100%; overflow-x: auto; padding-bottom: 2px; }
  .header-actions { margin-left: auto; }
}
