/* ============================================================
   ResearchFellow — styles.css
   Design system: "Clinical Editorial" — Oxford Navy + Gold.
   Medical-journal aesthetics: serif headlines, paper grain,
   ruled structure, research outputs framed as plates.
   Serif display: Fraunces (Latin) + Noto Serif KR (Korean).
   Body: Pretendard. Technical/labels: IBM Plex Mono.
   Self-hosted OFL files: assets/fonts/ (see PROVENANCE.md).
   ============================================================ */

/* ---------- Self-hosted webfonts ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/fraunces/Fraunces-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  font-optical-sizing: auto;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/fraunces/Fraunces-Italic-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  font-optical-sizing: auto;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Noto Serif KR";
  src: url("assets/fonts/noto-serif-kr/NotoSerifKR-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif KR";
  src: url("assets/fonts/noto-serif-kr/NotoSerifKR-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif KR";
  src: url("assets/fonts/noto-serif-kr/NotoSerifKR-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Pretendard Variable";
  src: url("assets/fonts/pretendard/PretendardVariable.woff2") format("woff2");
  font-weight: 45 930;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --paper:      #F7F4EC;   /* warm paper — primary background */
  --paper-2:    #F1EBDC;   /* deeper paper — alternating bands */
  --paper-3:    #EBE3D1;   /* deepest paper — insets */
  --ink:        #14181F;   /* near-black ink — body text */
  --navy:       #1B2A4A;   /* Oxford navy — ink accent / dark spreads */
  --navy-2:     #16223C;   /* deeper navy — gradient floor */
  --navy-line:  #35426060; /* hairline on navy */
  --gold:       #B08D2E;   /* gold — the sole accent, used sparingly */
  --gold-2:     #C6A23C;   /* brighter gold — on navy */
  --gold-soft:  #EEE4CB;   /* faint gold wash — notices */
  --line:       #D9CFB6;   /* hairline on paper */
  --line-2:     #C7BC9C;   /* stronger hairline / rules */
  --muted:      #575E6B;   /* secondary text on paper */
  --muted-navy: #A7B0C4;   /* secondary text on navy */

  --max: 1180px;
  --pad: clamp(20px, 5vw, 56px);

  --font-display: 'Fraunces', 'Noto Serif KR', 'Iowan Old Style', Georgia, serif;
  --font-serif:   'Noto Serif KR', 'Fraunces', Georgia, serif;
  --font-body:    'Pretendard Variable', 'Pretendard', system-ui, -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  word-break: keep-all;       /* Korean: never break inside an eojeol */
  overflow-wrap: break-word;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.12; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }

::selection { background: var(--navy); color: var(--paper); }
::-webkit-scrollbar { height: 9px; width: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-2); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Paper grain — a subtle fixed overlay over the whole page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}
.container--wide { max-width: 1320px; }

.section { padding-top: clamp(72px, 9vw, 128px); padding-bottom: clamp(72px, 9vw, 128px); }
.section-tight { padding-top: clamp(48px, 6vw, 76px); padding-bottom: clamp(48px, 6vw, 76px); }

.section--alt  { background: var(--paper-2); }
.section--navy {
  background: linear-gradient(168deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--paper);
}
.section--navy .lead { color: var(--muted-navy); }

/* Ruled divider between paper sections */
.section + .section:not(.section--navy)::before,
.section--alt + .section:not(.section--navy)::before { content: none; }

/* asymmetric 5:7 two-column */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 84px);
  align-items: start;
}
.split > * { min-width: 0; max-width: 100%; }
.cols-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

/* ---------- Rules (journal hairlines) ---------- */
.rule {
  border: 0;
  border-top: 1px solid var(--line-2);
  margin: 0;
}
.rule-double {
  border: 0;
  height: 4px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line-2);
  margin: 0;
}
.section--navy .rule { border-top-color: var(--navy-line); }
.section--navy .rule-double { border-top-color: var(--gold); border-bottom-color: var(--navy-line); }

/* ---------- Typography ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 22px;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
  flex: 0 0 auto;
}
.section--navy .eyebrow { color: var(--gold-2); }
.section--navy .eyebrow::before { background: var(--gold-2); }

.h-display {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(2.5rem, 6.4vw, 5rem);
  line-height: 1.08;
  letter-spacing: -0.005em;
}
.h-display em, .h-display i { font-style: italic; color: var(--gold); }

.h-section {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(1.75rem, 3.6vw, 2.85rem);
  line-height: 1.18;
  letter-spacing: -0.005em;
}
.h-section em, .h-section i { font-style: italic; color: var(--gold); }

.h-sub {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  line-height: 1.3;
  margin: 0 0 8px;
}

.lead {
  font-size: clamp(1.06rem, 1.5vw, 1.24rem);
  line-height: 1.82;
  color: var(--muted);
  max-width: 64ch;
}
.lead strong, .lead b { color: var(--ink); font-weight: 600; }
.section--navy .lead strong, .section--navy .lead b { color: var(--paper); }

.prose p { max-width: 68ch; }
.prose p + p { margin-top: 1.1em; }
.prose strong { font-weight: 600; }

.mono { font-family: var(--font-mono); font-size: 0.86em; letter-spacing: 0.01em; }
.text-gold { color: var(--gold); }
.muted { color: var(--muted); }

/* Editorial drop cap */
.dropcap::first-letter {
  font-family: var(--font-display);
  font-weight: 500;
  float: left;
  font-size: 3.4em;
  line-height: 0.78;
  padding: 0.06em 0.12em 0 0;
  color: var(--navy);
}

/* Section header block */
.section-head { max-width: 74ch; margin-bottom: clamp(40px, 5vw, 60px); }
.section-head .h-section { margin-bottom: 18px; }
.section-head .lead { margin-top: 0; }

/* Journal kicker line: eyebrow + big serif section index */
.kicker-row {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.kicker-row .eyebrow { margin: 0; }
.sec-index {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 0.02em;
}

/* ---------- Masthead / nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 20px;
}
.brand {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 1.28rem;
  letter-spacing: -0.01em;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  position: relative;
  width: 18px; height: 18px;
  background: var(--navy);
  flex: 0 0 auto;
}
.brand-mark::after {
  content: "";
  position: absolute;
  right: -3px; top: -3px;
  width: 7px; height: 7px;
  background: var(--gold);
}
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.18s ease;
}
.nav-links a:hover { color: var(--navy); }
.nav-gh {
  border: 1px solid var(--line-2);
  padding: 8px 13px;
  color: var(--navy) !important;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.nav-gh:hover { border-color: var(--navy); background: var(--navy); color: var(--paper) !important; }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--line-2);
  background: transparent;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 18px; height: 1.5px;
  background: var(--navy);
  position: relative;
  transition: transform 0.18s ease;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after  { position: absolute; top: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  padding: 15px 26px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: var(--paper);
  cursor: pointer;
  border-radius: 0;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline:hover { background: var(--navy); color: var(--paper); }

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }

/* On navy spreads */
.hero .btn-outline,
.section--navy .btn-outline,
.on-navy .btn-outline {
  color: var(--paper);
  border-color: color-mix(in srgb, var(--paper) 55%, transparent);
}
.hero .btn-outline:hover { background: var(--paper); color: var(--navy); }
.section--navy .btn-outline:hover,
.on-navy .btn-outline:hover { background: var(--paper); color: var(--navy); border-color: var(--paper); }

.btn[disabled], .btn-disabled, .btn:disabled {
  background: var(--paper-3);
  border-color: var(--line);
  color: #9C9583;
  cursor: not-allowed;
  transform: none !important;
  pointer-events: none;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ---------- Hero (journal front page, navy spread) ---------- */
.hero {
  position: relative;
  background: linear-gradient(165deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--paper);
  overflow: hidden;
}
.hero::before {
  /* faint radial warmth top-left */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 12% 0%, rgba(198,162,60,0.10), transparent 60%);
  pointer-events: none;
}
.hero > a { display: block; position: relative; }
.hero-head {
  position: relative;
  padding-top: clamp(52px, 7vw, 92px);
  padding-bottom: clamp(34px, 4vw, 52px);
}
.hero-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-2);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.hero-kicker::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: var(--navy-line);
  max-width: 220px;
}
.hero h1.h-display {
  max-width: 18ch;
  margin-bottom: 26px;
  color: var(--paper);
}
.hero .lead {
  color: var(--muted-navy);
  max-width: 56ch;
  margin-bottom: 34px;
  font-size: clamp(1.08rem, 1.5vw, 1.28rem);
}
.hero .btn-row { margin-bottom: 8px; }

/* full-bleed journey figure — the 13-step research path as a journal Fig. */
.hero-stage {
  position: relative;
  width: 100%;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(27,42,74,0.08), transparent 55%),
    var(--paper-2);
  border-top: 1px solid var(--navy-line);
  padding: clamp(40px, 5vw, 72px) var(--pad) clamp(40px, 5vw, 64px);
}
.journey {
  max-width: var(--max);
  margin: 0 auto;
}
.journey-cap {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(22px, 3vw, 34px);
  display: flex;
  align-items: center;
  gap: 12px;
}
.fig-tag {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gold);
}
.journey-rail {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line-2);
  background: var(--paper);
}
.j-terminal {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 26px 22px;
  background: var(--navy);
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: 1.02rem;
  line-height: 1.4;
  min-width: 128px;
}
.j-terminal .j-k {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-2);
}
.j-phase {
  flex: 8 1 0;
  padding: 20px 22px 22px;
  border-left: 1px solid var(--line-2);
}
.j-phase.j-real { flex: 5 1 0; }
.j-phase-head {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.02rem;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}
.j-phase-title {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
}
.j-phase-head span {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.j-real .j-phase-title {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
}
.j-phase-head span { color: var(--gold); }
.j-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  counter-reset: jstep;
  position: relative;
}
.j-steps[start="9"] { counter-reset: jstep 8; }
.j-steps li {
  counter-increment: jstep;
  font-size: 0.88rem;
  color: var(--ink);
  white-space: nowrap;
}
.j-steps li::before {
  content: counter(jstep, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--gold);
  margin-right: 6px;
}
.j-gate {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 18px;
  border-left: 1px dashed var(--line-2);
  border-right: 1px dashed var(--line-2);
  background: var(--gold-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  text-align: center;
  max-width: 190px;
}
.j-gate-marks { color: var(--gold); letter-spacing: 0.3em; font-size: 13px; }
.j-gate-sub {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
  line-height: 1.5;
}
.journey-note {
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--muted);
  padding-left: 14px;
  border-left: 2px solid var(--gold);
  max-width: 62ch;
}
@media (max-width: 960px) {
  .journey-rail { flex-direction: column; border-top-width: 3px; }
  .j-terminal { min-width: 0; flex-direction: row; align-items: baseline; padding: 16px 20px; }
  .j-terminal br { display: none; }
  .j-phase, .j-gate { border-left: 0; border-top: 1px solid var(--line-2); }
  .j-gate {
    max-width: none;
    border-top: 1px dashed var(--line-2);
    border-bottom: 1px dashed var(--line-2);
    border-right: 0;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    text-align: left;
    padding: 14px 20px;
  }
  .j-gate-sub br { display: none; }
}
.hero-cap {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-navy);
  padding: 16px 0 clamp(30px, 4vw, 48px);
  display: flex;
  gap: 14px;
  align-items: center;
}
.hero-cap .tick { color: var(--gold-2); }

/* ---------- Compare (problem / method) ---------- */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 2px solid var(--ink); }
.compare-col { padding: 30px clamp(16px, 3vw, 40px) 8px; }
.compare-col + .compare-col { border-left: 1px solid var(--line-2); }
.compare-col h3 {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}
.compare-col--solution h3 { color: var(--gold); }
.compare-list li {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}
.compare-list li::before {
  content: "—";
  color: var(--line-2);
  flex: 0 0 auto;
  font-family: var(--font-mono);
}
.compare-col--solution .compare-list li { color: var(--ink); }
.compare-col--solution .compare-list li::before { content: "→"; color: var(--gold); }

/* ---------- 13-step index grid ---------- */
.index-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-2);
  border-left: 1px solid var(--line-2);
}
.index-cell {
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 118px;
  background: var(--paper);
  transition: background 0.2s ease;
}
.index-cell:hover { background: var(--paper-2); }
.index-cell .step-idx {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.index-cell .step-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1.2;
  margin-top: auto;
}
.index-cell--gate {
  background: var(--navy);
  color: var(--paper);
}
.index-cell--gate:hover { background: var(--navy-2); }
.index-cell--gate .step-idx { color: var(--gold-2); }
.index-cell--gate .step-name { color: var(--paper); }
.index-cell--gate .step-tag {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-2);
  border: 1px solid var(--gold);
  padding: 3px 6px;
  align-self: flex-start;
}
.index-legend {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.index-legend .swatch { display: inline-block; width: 11px; height: 11px; margin-right: 8px; vertical-align: -1px; }
.index-legend .swatch--gate { background: var(--navy); }
.index-legend .swatch--std { background: var(--paper-2); border: 1px solid var(--line-2); }

/* ---------- Entry points 5+1 (editorial enumerated list) ---------- */
.entries { border-top: 2px solid var(--ink); }
.entry {
  display: grid;
  grid-template-columns: minmax(64px, 0.7fr) minmax(140px, 2fr) 5fr;
  gap: clamp(16px, 3vw, 48px);
  align-items: baseline;
  padding: 26px 4px;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.2s ease;
}
.entry:hover { padding-left: 12px; }
.entry-num {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  color: var(--gold);
  line-height: 1;
}
.entry-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
}
.entry-desc { color: var(--muted); font-size: 0.98rem; line-height: 1.7; }
.entry--resume { background: var(--gold-soft); }
.entry--resume .entry-num { color: var(--gold); }

/* ---------- Figures / plates ---------- */
.figures {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(28px, 4vw, 52px);
  align-items: start;
}
.figure { margin: 0; }
.figure-frame {
  border: 1px solid var(--line-2);
  padding: 12px;
  background: var(--paper);
  position: relative;
}
.figure-frame img { width: 100%; height: auto; display: block; }
.figcap {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.figcap .figcap-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
  display: block;
}
.figcap .figcap-title { font-weight: 600; }
.figcap .figcap-body { color: var(--muted); font-size: 0.92rem; }
.figure-note {
  margin-top: clamp(26px, 4vw, 40px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 90ch;
}
.figure-note strong { color: var(--ink); font-weight: 600; }

/* Full-bleed atmospheric plate band (navy fallback) */
.plate-band {
  position: relative;
  min-height: clamp(360px, 46vw, 560px);
  background-color: var(--navy-2);
  background-image: linear-gradient(120deg, rgba(20,30,52,0.35) 0%, rgba(20,30,52,0.08) 60%, transparent 100%);
  color: var(--paper);
  display: flex;
  align-items: center;
}
.plate-band .plate-inner { padding: clamp(48px, 7vw, 96px) 0; max-width: 42rem; }
.plate-band .code-block { max-width: 34rem; }

/* ---------- Tenets (integrity spread, navy) ---------- */
.tenets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--navy-line);
}
.tenet {
  padding: 30px clamp(18px, 3vw, 44px) 30px 0;
  border-bottom: 1px solid var(--navy-line);
  display: flex;
  gap: 22px;
  align-items: flex-start;
}
.tenet:nth-child(odd)  { padding-right: clamp(24px, 3vw, 56px); }
.tenet:nth-child(even) { padding-left: clamp(18px, 3vw, 44px); border-left: 1px solid var(--navy-line); }
.tenet-num {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--gold-2);
  line-height: 1;
  flex: 0 0 auto;
  min-width: 1.6em;
}
.tenet h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.16rem;
  margin-bottom: 10px;
  color: var(--paper);
  line-height: 1.28;
}
.tenet p { color: var(--muted-navy); font-size: 0.95rem; line-height: 1.72; }
.tenet .mono { color: var(--gold-2); }
.tenet--flag h3 { color: var(--gold-2); }

/* ---------- Plain journal table ---------- */
.reveal:has(> .table-plain) {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-plain { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.table-plain th, .table-plain td {
  text-align: left;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.table-plain thead th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 2px solid var(--ink);
}
.table-plain tbody td { color: var(--muted); }
.table-plain tbody td:first-child { color: var(--ink); font-weight: 500; }
.table-plain tbody tr:hover td { background: var(--paper-2); }

/* ---------- Code block / kbd ---------- */
.code-block {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.75;
  background: var(--navy);
  color: #EDE7D6;
  padding: 22px 24px;
  border-radius: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  white-space: pre;
  border-left: 3px solid var(--gold);
  margin: 22px 0;
}
.code-block .c-comment { color: #8592AD; }
.code-block .c-prompt  { color: var(--gold-2); user-select: none; }
.kbd {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  padding: 2px 7px;
  color: var(--ink);
  white-space: nowrap;
}

.code-with-copy {
  position: relative;
  margin: 22px 0;
  max-width: 100%;
  min-width: 0;
}
.code-with-copy .code-block { margin: 0; padding-right: 5.6rem; }
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  padding: 8px 10px;
  color: var(--gold-2);
  background: rgba(22, 34, 60, 0.88);
  border: 1px solid color-mix(in srgb, var(--gold-2) 55%, transparent);
  cursor: pointer;
  border-radius: 0;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.copy-btn:hover,
.copy-btn:focus-visible {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
  outline: none;
}
.copy-btn.is-copied {
  color: var(--paper);
  border-color: color-mix(in srgb, var(--paper) 55%, transparent);
  background: transparent;
}
.copy-btn.is-failed {
  color: var(--paper);
  border-color: var(--gold);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--line-2);
  padding: 4px 8px;
  color: var(--muted);
  line-height: 1;
}
.badge-soon { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }

/* ---------- Notice (background allowed) ---------- */
.notice {
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
  padding: 18px 22px;
  font-size: 0.93rem;
  color: var(--ink);
  line-height: 1.78;
  margin: 24px 0;
}
.notice p + p { margin-top: 12px; }
.notice a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.notice strong { font-weight: 600; }

/* Repository callout (not a card — a ruled block) */
.repo-callout {
  border: 1px solid var(--line-2);
  border-top: 3px solid var(--gold);
  padding: clamp(24px, 3vw, 34px);
  margin: 26px 0;
}
.repo-callout .repo-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.repo-callout h3 { font-family: var(--font-mono); font-size: 1.05rem; margin-bottom: 8px; }
.repo-callout p { color: var(--muted); font-size: 0.95rem; margin-bottom: 16px; }

/* ---------- Usage "where do you start" ruled grid ---------- */
.start-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-2);
  border-left: 1px solid var(--line-2);
  margin: 8px 0 30px;
}
.start-cell {
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  padding: 24px 22px 26px;
}
.start-cell .badge { margin-bottom: 14px; }
.start-cell h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  margin-bottom: 10px;
}
.start-cell p { color: var(--muted); font-size: 0.93rem; line-height: 1.7; }
.start-cell em { color: var(--navy); font-style: italic; }

/* ---------- Forms ---------- */
.form-row { display: flex; flex-direction: column; gap: 9px; margin-bottom: 20px; }
.form-row--inline { flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; }
.label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.input, .textarea, select.input {
  font-family: var(--font-body);
  font-size: 0.96rem;
  color: var(--ink);
  background: #FCFAF3;
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 13px 15px;
  width: 100%;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.input:focus, .textarea:focus, select.input:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
}
.textarea { resize: vertical; min-height: 130px; }
.input:disabled, .textarea:disabled, .input[disabled], .textarea[disabled] {
  background: var(--paper-3);
  color: #9C9583;
  cursor: not-allowed;
}

/* ---------- FAQ ---------- */
.faq { border-top: 2px solid var(--ink); margin-top: 8px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer;
  padding: 22px 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 1.4rem;
  transition: transform 0.18s ease;
  flex: 0 0 auto;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-body { padding: 0 0 24px; color: var(--muted); max-width: 70ch; line-height: 1.8; }

/* ---------- Newsletter ---------- */
.newsletter-form { display: flex; gap: 12px; max-width: 480px; margin: 22px 0 18px; }
.newsletter-form .input { flex: 1 1 auto; }
.newsletter-form .btn { flex: 0 0 auto; }

/* ---------- Footer ---------- */
.footer {
  background: var(--navy);
  color: var(--muted-navy);
  padding: clamp(44px, 6vw, 72px) 0;
  border-top: 3px solid var(--gold);
}
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; flex-wrap: wrap; }
.footer-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--paper);
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-brand .brand-mark { background: var(--paper); }
.footer-brand .brand-mark::after { background: var(--gold-2); }
.footer-tag { font-size: 0.9rem; color: var(--muted-navy); margin-top: 12px; max-width: 40ch; }
.footer-meta { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.03em; line-height: 2; text-align: right; }
.footer-meta a { color: var(--muted-navy); text-decoration: underline; text-underline-offset: 3px; }
.footer-meta a:hover { color: var(--gold-2); }

/* ---------- Privacy page helpers ---------- */
.check-list { list-style: none; padding: 0; margin: 26px 0; border-top: 2px solid var(--ink); }
.check-list li {
  padding: 16px 0 16px 38px;
  border-bottom: 1px solid var(--line);
  position: relative;
  color: var(--ink);
}
.check-list li strong { font-weight: 600; }
.check-list li::before {
  content: "✕";
  position: absolute;
  left: 4px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-weight: 500;
}
.footnote {
  font-size: 13.5px;
  color: var(--muted);
  border-left: 2px solid var(--line-2);
  padding-left: 16px;
  line-height: 1.75;
}
.privacy-events {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.9;
  color: var(--navy);
  background: var(--paper-2);
  border-left: 3px solid var(--gold);
  padding: 16px 20px;
  margin-top: 20px;
  word-break: break-word;
}

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(20px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1); }
.js .reveal.d1 { transition-delay: 0.06s; }
.js .reveal.d2 { transition-delay: 0.12s; }
.js .reveal.d3 { transition-delay: 0.18s; }

/* Hero staggered entrance (CSS only, plays on load) */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes plate-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
.hero-anim { opacity: 0; animation: rise 0.8s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-anim.a1 { animation-delay: 0.05s; }
.hero-anim.a2 { animation-delay: 0.16s; }
.hero-anim.a3 { animation-delay: 0.27s; }
.hero-anim.a4 { animation-delay: 0.38s; }
.hero-stage.hero-anim { animation: plate-in 1.1s cubic-bezier(.2,.7,.2,1) 0.34s forwards; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .js .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line-2);
    padding: 8px var(--pad) 22px;
  }
  .js .nav-links { display: none; }
  .js .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
  .nav-gh { align-self: flex-start; margin-top: 14px; }

  .split, .cols-2, .figures { grid-template-columns: minmax(0, 1fr); }
  .index-grid { grid-template-columns: repeat(2, 1fr); }
  .tenets { grid-template-columns: 1fr; }
  .tenet:nth-child(even) { border-left: 0; padding-left: 0; }
  .tenet:nth-child(odd) { padding-right: 0; }
  .start-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  body { font-size: 15.5px; }
  .compare { grid-template-columns: 1fr; border-top: 2px solid var(--ink); }
  .compare-col + .compare-col { border-left: 0; border-top: 1px solid var(--line-2); }
  .compare-col { padding-left: 0; padding-right: 0; }
  .entry { grid-template-columns: auto 1fr; gap: 10px 20px; }
  .entry-desc { grid-column: 1 / -1; }
  .start-grid { grid-template-columns: 1fr; }
  .index-grid { grid-template-columns: 1fr 1fr; }
  .btn-row .btn { flex: 1 1 auto; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form .btn { width: 100%; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-meta { text-align: left; }
  .hero-stage { max-height: 54vh; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .hero-anim { opacity: 1 !important; }
}

/* ---------- Intro film: hero replay trigger ---------- */
.film-replay {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-top: 22px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-navy);
  transition: color 0.18s ease;
}
.film-replay:hover,
.film-replay:focus-visible { color: var(--gold-2); outline: none; }
.film-replay-tick {
  width: 24px; height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold);
  color: var(--gold-2);
  font-size: 8px;
  padding-left: 2px; /* optical centering of the ▶ glyph */
  transition: background 0.18s ease, color 0.18s ease;
}
.film-replay:hover .film-replay-tick { background: var(--gold); color: var(--navy); }

/* ---------- Intro film modal ---------- */
.intro-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  padding: clamp(16px, 4vw, 40px);
}
.intro-modal[hidden] { display: none; }
body.intro-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.intro-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 22, 0.9);
  backdrop-filter: blur(3px) saturate(115%);
  animation: intro-fade 0.3s ease both;
}

.intro-dialog {
  position: relative;
  width: min(960px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  animation: intro-rise 0.42s cubic-bezier(.2,.7,.2,1) both;
}

.intro-close {
  align-self: flex-end;
  width: 40px; height: 40px;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--paper) 34%, transparent);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.intro-close:hover,
.intro-close:focus-visible {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--navy);
  outline: none;
}

.intro-frame { position: relative; line-height: 0; }
.intro-video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 150px);
  object-fit: contain;        /* letterbox rather than crop */
  background: #05070C;
  border: 1px solid var(--line-2);
  border-top: 3px solid var(--gold);
}

.intro-unmute {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--gold);
  border: 1px solid var(--gold);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  animation: intro-unmute-pulse 2.4s ease-in-out infinite;
}
.intro-unmute[hidden] { display: none; }
.intro-unmute:hover,
.intro-unmute:focus-visible {
  background: var(--gold-2);
  border-color: var(--gold-2);
  transform: translateY(-1px);
  outline: none;
}
.intro-unmute-ico { display: block; }

.intro-cap {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-navy);
  padding-top: 14px;
  display: flex;
  gap: 12px;
  align-items: baseline;
  line-height: 1.5;
}
.intro-cap .tick { color: var(--gold-2); }

@keyframes intro-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes intro-rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes intro-unmute-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(198, 162, 60, 0.45); }
  50%      { box-shadow: 0 0 0 7px rgba(198, 162, 60, 0); }
}

@media (max-width: 680px) {
  .intro-close { width: 38px; height: 38px; margin-bottom: 10px; }
  .intro-unmute { left: 10px; bottom: 10px; padding: 8px 12px; font-size: 0.7rem; }
  .intro-video { max-height: calc(100dvh - 130px); }
}

/* ── Hero plate — pixel-art mascot banner (DESIGN-CONTRACT §이미지 자산) ── */
.hero-plate {
  position: relative;
  /* Match the complete 1536×1024 artwork; viewport caps crop its title. */
  box-sizing: content-box;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: var(--navy-2) url("assets/hero.png") center / contain no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-top: 1px solid var(--navy-line);
  border-bottom: 1px solid var(--navy-line);
}
@media (prefers-reduced-motion: no-preference) {
  .hero-plate.hero-anim { animation: plate-in 1.1s cubic-bezier(.2,.7,.2,1) 0.3s forwards; }
}
