/* ==================== TOKENS ==================== */
:root {
  --navy: #1E2761;
  --navy-dark: #141B4D;
  --navy-mid: #252E63;
  --ice: #CADCFC;
  --ice-soft: #E9EEFB;
  --gold: #C9A227;
  --gold-light: #E0C568;
  --charcoal: #2B2B38;
  --grey: #6B7280;
  --card: #F3F5FC;
  --off: #F7F8FC;
  --white: #FFFFFF;
  --font-head: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-w: 1120px;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.75rem;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; color: var(--navy); }

.on-dark { color: var(--white); }

/* ==================== PROGRESS BAR ==================== */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  z-index: 1000;
  transition: width 0.1s linear;
}

/* ==================== NAV ==================== */
#mainNav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  background: rgba(20, 27, 77, 0.0);
  backdrop-filter: blur(0px);
  transition: background 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
  padding: 1.1rem 0;
}
#mainNav.scrolled {
  background: rgba(20, 27, 77, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
  padding: 0.7rem 0;
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--white);
  text-decoration: none;
  font-size: 1.1rem;
}
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  color: var(--ice);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
  position: relative;
  padding-bottom: 4px;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold-light); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
}

/* ==================== HERO ==================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy) 55%, #22297a 100%);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.orb { position: absolute; border-radius: 50%; filter: blur(0px); opacity: 0.55; }
.orb-1 { width: 520px; height: 520px; background: #2A3474; top: -180px; right: -120px; }
.orb-2 { width: 340px; height: 340px; background: #324086; top: 60px; right: 180px; opacity: 0.4; }
.orb-3 { width: 380px; height: 380px; background: #2A3474; bottom: -180px; left: -160px; }

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 6rem 1.75rem;
  text-align: left;
}
.hero-eyebrow {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.35em;
  font-size: 0.85rem;
  margin-bottom: 1.1rem;
}
.hero-title {
  font-size: clamp(3.5rem, 9vw, 6.5rem);
  color: var(--white);
  line-height: 1;
  margin-bottom: 1rem;
}
.hero-subtitle {
  font-family: var(--font-head);
  font-style: italic;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: var(--ice);
  margin-bottom: 1.5rem;
}
.hero-desc {
  color: #C3CCED;
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: 2.5rem;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gold);
  color: var(--navy-dark);
  font-weight: 700;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.25);
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(201, 162, 39, 0.35); }
.hero-cta .arrow { transition: transform 0.2s ease; }
.hero-cta:hover .arrow { transform: translateY(3px); }

.scroll-hint {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}
.scroll-hint span {
  display: block;
  width: 22px;
  height: 36px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 12px;
  position: relative;
}
.scroll-hint span::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  width: 4px;
  height: 8px;
  background: var(--gold);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollDot 1.6s infinite;
}
@keyframes scrollDot {
  0% { opacity: 1; top: 6px; }
  70% { opacity: 0; top: 18px; }
  100% { opacity: 0; top: 6px; }
}

/* ==================== SECTION SHELL ==================== */
.eyebrow {
  display: inline-block;
  background: var(--ice);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.3rem;
}
.eyebrow.light {
  background: rgba(255,255,255,0.1);
  color: var(--gold-light);
}
.content-block, .agenda { padding: 5.5rem 0; }
.content-block.light, .agenda { background: var(--white); }
.content-block.off { background: var(--off); }
.content-block.dark { background: linear-gradient(160deg, var(--navy-dark), var(--navy)); }

.content-block h2, .agenda h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 1rem; }
.lede { color: var(--grey); font-size: 1.1rem; max-width: 680px; margin-bottom: 2.5rem; }
.footnote { color: var(--grey); font-size: 0.95rem; font-style: italic; margin-top: 2rem; max-width: 800px; }
.footnote.light { color: #9AA5D4; }

/* ==================== AGENDA ==================== */
.agenda-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.agenda-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem 1.7rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: block;
}
.agenda-card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(30,39,97,0.12); }
.agenda-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: var(--navy);
  color: var(--gold);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: 50%;
  margin-bottom: 1.2rem;
}
.agenda-card h3 { font-size: 1.3rem; margin-bottom: 0.6rem; }
.agenda-card p { color: var(--charcoal); font-size: 0.95rem; }

/* ==================== PART DIVIDER ==================== */
.part-divider {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.divider-orb {
  position: absolute;
  width: 480px; height: 480px;
  background: #2A3474;
  border-radius: 50%;
  right: -160px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
}
.part-roman {
  font-family: var(--font-head);
  font-size: clamp(5rem, 14vw, 9rem);
  font-weight: 700;
  color: #324086;
  line-height: 1;
  display: block;
}
.part-label {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.3em;
  font-size: 0.85rem;
  margin: 0.5rem 0 0.6rem;
}
.part-divider h2 { color: var(--white); font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 0.8rem; }
.part-sub { color: var(--ice); font-style: italic; font-size: 1.1rem; max-width: 640px; }

/* ==================== ETYMOLOGY ==================== */
.etym-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
  align-items: center;
}
.etym-box {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 2rem;
  color: var(--white);
}
.etym-greek { font-family: var(--font-head); font-size: 1.9rem; font-weight: 700; color: var(--gold-light); }
.etym-greek.small { font-size: 1.4rem; margin-top: 0.6rem; }
.etym-translit { font-size: 0.95rem; color: var(--ice); font-weight: 400; }
.etym-def { color: #D6DEF5; font-size: 0.95rem; margin: 0.3rem 0 0.6rem; }
.etym-plus { color: var(--white); font-size: 1.1rem; }
.etym-lit { font-size: 1.15rem; margin-bottom: 0.8rem; }
.etym-lit em { color: var(--navy); font-family: var(--font-head); }
.etym-text p:not(.etym-lit) { color: var(--grey); }

.mini-timeline { margin-bottom: 2rem; }
.mini-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1.2rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid #ECEEF6;
  align-items: baseline;
}
.mini-item:last-child { border-bottom: none; }
.mini-year { font-family: var(--font-head); font-weight: 700; color: var(--gold); font-size: 1.15rem; }
.mini-item div { color: var(--grey); font-size: 0.95rem; }
.mini-item strong { color: var(--charcoal); }

.callout {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem 1.8rem;
  font-size: 0.95rem;
  color: var(--charcoal);
}
.callout strong { color: var(--navy); }

/* ==================== Q GRID ==================== */
.q-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.q-grid.three { grid-template-columns: repeat(3, 1fr); }
.q-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.8rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.q-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(30,39,97,0.1); }
.q-card.top-accent { border-top: 4px solid var(--navy); }
.q-card.c1 { border-top-color: var(--navy); }
.q-card.c2 { border-top-color: #324086; }
.q-card.c3 { border-top-color: var(--gold); }
.q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: 1rem;
  font-size: 1rem;
}
.q-num.c1 { background: var(--navy); }
.q-num.c2 { background: #324086; }
.q-num.c3 { background: var(--gold); color: var(--navy-dark); }
.q-card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.q-card p { color: var(--grey); font-size: 0.92rem; }

/* ==================== TIMELINE ==================== */
.timeline { position: relative; padding-left: 2.2rem; margin-top: 2rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0.6rem; top: 0.4rem; bottom: 0.4rem;
  width: 3px;
  background: var(--ice);
  border-radius: 3px;
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1.5rem;
  padding-bottom: 2rem;
  align-items: start;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -2.2rem;
  top: 0.1rem;
  width: 16px; height: 16px;
  background: var(--navy);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--ice);
  border-radius: 50%;
}
.timeline-period { font-family: var(--font-head); font-weight: 700; color: var(--gold); font-size: 1.1rem; padding-top: 0.1rem; }
.timeline-body h4 { font-size: 1.15rem; margin-bottom: 0.3rem; color: var(--navy); }
.timeline-body p { color: var(--charcoal); font-size: 0.94rem; }

/* ==================== BRANCHES ==================== */
.branch-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; }
.branch-row {
  background: var(--card);
  border-left: 5px solid var(--accent);
  border-radius: 10px;
  padding: 1.4rem 1.8rem;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
  align-items: center;
}
.branch-row h3 { font-size: 1.1rem; color: var(--navy); }
.branch-row p { color: var(--charcoal); font-size: 0.93rem; }

/* ==================== DEBATE GRID ==================== */
.debate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 2rem; }
.debate-card {
  background: var(--navy-mid);
  border-radius: var(--radius);
  padding: 1.8rem;
  transition: transform 0.25s ease;
}
.debate-card:hover { transform: translateY(-4px); }
.debate-card h4 { color: var(--gold-light); font-size: 1.05rem; margin-bottom: 0.6rem; }
.debate-card p { color: #D6DEF5; font-size: 0.92rem; }

/* ==================== PULL QUOTE ==================== */
.pull-quote {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 2.2rem 2.5rem;
  font-family: var(--font-head);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.4;
  margin: 2rem 0 2.5rem;
}
.pull-quote strong { color: var(--gold-light); font-style: normal; }
.pull-quote cite {
  display: block;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.85rem;
  color: var(--ice);
  margin-top: 1rem;
}

.term-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.term-card { background: var(--card); border-radius: 10px; padding: 1.4rem; }
.term-card h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.term-card p { color: var(--grey); font-size: 0.88rem; }

/* ==================== STACK ==================== */
.stack { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 1rem; }
.stack-layer {
  width: var(--w);
  background: var(--c);
  border-radius: 8px;
  padding: 0.9rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  color: var(--white);
  transition: width 0.3s ease;
}
.stack-name { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; min-width: 130px; }
.stack-year { font-size: 0.8rem; color: var(--ice); min-width: 90px; }
.stack-desc { font-size: 0.88rem; color: #E9EEFB; }
.stack-layer:last-child .stack-desc, .stack-layer:last-child .stack-name { color: var(--navy-dark); }
.stack-layer:last-child .stack-year { color: #4A3D0E; }

/* ==================== TABLES ==================== */
.table-wrap { overflow-x: auto; margin-top: 1.5rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
thead th {
  background: var(--navy);
  color: var(--white);
  text-align: left;
  padding: 0.9rem 1.1rem;
  font-weight: 600;
}
tbody td { padding: 0.95rem 1.1rem; border-bottom: 1px solid #ECEEF6; color: var(--charcoal); }
.row-label { font-weight: 700; color: var(--navy); background: var(--card); }
.row-highlight td { background: #E3E9FA; }
.row-highlight .row-label { background: #E3E9FA; }

.synth-table thead th.hp { background: var(--navy); }
.synth-table thead th.hc { background: #324086; }
.synth-table thead th.hg { background: var(--gold); color: var(--navy-dark); }

/* ==================== FIELD GRID ==================== */
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; margin-top: 2rem; }
.field-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
}
.field-card.full { margin-top: 1.2rem; background: var(--navy); color: var(--white); }
.field-card.full h4 { color: var(--gold-light); }
.field-card.full p { color: #E9EEFB; }
.field-card h4 { font-size: 1.05rem; margin-bottom: 0.5rem; color: var(--navy); }
.field-card p { color: var(--charcoal); font-size: 0.92rem; }

/* ==================== MISCONCEPTIONS ==================== */
.mis-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; margin-top: 2rem; }
.mis-card {
  background: var(--navy-mid);
  border-radius: var(--radius);
  padding: 1.8rem;
  position: relative;
}
.mis-x { color: var(--gold); font-size: 1.4rem; font-weight: 700; display: block; margin-bottom: 0.6rem; }
.mis-card h4 { color: var(--white); font-size: 1.05rem; margin-bottom: 0.6rem; }
.mis-card p { color: #D6DEF5; font-size: 0.92rem; }

/* ==================== LLM LIST ==================== */
.llm-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; margin-bottom: 2rem; }
.llm-row {
  background: var(--navy-mid);
  border-radius: 10px;
  padding: 1.3rem 1.8rem;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: center;
}
.llm-row h4 { color: var(--gold-light); font-size: 1.05rem; }
.llm-row p { color: #D6DEF5; font-size: 0.92rem; }

/* ==================== CLOSING ==================== */
.closing {
  position: relative;
  background: linear-gradient(160deg, var(--navy-dark), var(--navy));
  padding: 6rem 0 4rem;
  overflow: hidden;
}
.closing .orb-a { position: absolute; width: 340px; height: 340px; background: #2A3474; border-radius: 50%; top: -140px; left: -140px; opacity: 0.6; }
.closing .orb-b { position: absolute; width: 380px; height: 380px; background: #2A3474; border-radius: 50%; bottom: -160px; right: -140px; opacity: 0.5; }
.closing .container { position: relative; z-index: 1; }
.closing h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 2.5rem; }

.takeaway-list { list-style: none; display: flex; flex-direction: column; gap: 1.6rem; margin-bottom: 3rem; }
.takeaway-list li { display: grid; grid-template-columns: 40px 1fr; gap: 1.2rem; align-items: start; }
.tk-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--gold);
  color: var(--navy-dark);
  font-family: var(--font-head);
  font-weight: 700;
  border-radius: 50%;
  font-size: 0.95rem;
}
.takeaway-list p { color: #E9EEFB; font-size: 1.02rem; padding-top: 0.15rem; }

.colophon { color: #8C97C4; font-size: 0.85rem; font-style: italic; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 1.5rem; margin-bottom: 1.5rem; }
.back-top { color: var(--gold-light); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.back-top:hover { text-decoration: underline; }

/* ==================== SCROLL REVEAL ==================== */
/* Safe-by-default: content is fully visible even if JS fails or a tool takes
   a full-page screenshot without scrolling. JS only adds a brief entrance
   transition via .js-reveal-ready + .visible; see script.js. */
.reveal { opacity: 1; transform: none; }
.js-reveal-ready .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js-reveal-ready .reveal.visible { opacity: 1; transform: translateY(0); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .agenda-cards { grid-template-columns: 1fr; }
  .q-grid, .q-grid.three, .debate-grid, .term-grid, .field-grid, .mis-grid { grid-template-columns: 1fr; }
  .etym-grid { grid-template-columns: 1fr; }
  .branch-row, .llm-row { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 100px 1fr; }
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: 260px;
    background: var(--navy-dark);
    flex-direction: column;
    padding: 6rem 2rem 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: block; }
}
@media (max-width: 600px) {
  .content-block, .agenda { padding: 3.5rem 0; }
  .part-divider { min-height: 45vh; }
  .timeline-item { grid-template-columns: 1fr; }
  .timeline { padding-left: 1.6rem; }
  .timeline-dot { left: -1.6rem; }
  .mini-item { grid-template-columns: 70px 1fr; }
}
