/* ============================================================
   PHILOSOPHY SITE — VISUAL THEME  "Observatory"

   A refined, editorial dark theme with a quiet cosmic atmosphere:
   deep ink background with a faint starfield, elegant serif display
   headings over a clean sans body, a periwinkle accent, and a
   sparing gold second accent for small editorial details.

   Everything is driven by the variables in :root. Retune the look
   by changing those (e.g. --accent, --bg). A light theme could later
   be layered on by overriding these variables.
   ============================================================ */

:root {
  /* Surfaces & ink */
  --bg:        #090b12;
  --surface:   #12151f;
  --surface-2: #171b28;
  --text:      #e7e7ef;
  --heading:   #f5f5fb;
  --muted:     #9698ad;
  --faint:     #6b6e83;
  --border:    #222637;
  --border-2:  #2d3247;

  /* Accents */
  --accent:      #8f90f2;                       /* periwinkle-violet */
  --accent-2:    #aeb0ff;                       /* brighter (hover)  */
  --accent-soft: rgba(143,144,242,0.13);
  --gold:        #d8c48f;                        /* sparing editorial gold */
  --gold-soft:   rgba(216,196,143,0.12);
  --good:        #63d3a0;
  --good-soft:   rgba(99,211,160,0.14);
  --bad:         #ef8494;
  --bad-soft:    rgba(239,132,148,0.14);

  /* Type */
  --font-serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  /* No Arial anywhere: if the web fonts don't load, we fall back to the
     nicest system faces available instead of the browser default. */
  --font-sans:  "Inter", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Helvetica, sans-serif;

  /* Shape & depth */
  --maxw: 45rem;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 18px 50px rgba(0,0,0,.45);
  --glow: 0 0 0 1px rgba(143,144,242,.28), 0 14px 40px rgba(60,64,150,.22);
  --pattern-dot: rgba(255,255,255,0.075);
  --rule: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ----------  LIGHT THEME  ("paper")  ---------- */
:root[data-theme="light"] {
  --bg:        #f6f4ec;
  --surface:   #ffffff;
  --surface-2: #efece1;
  --text:      #23252b;
  --heading:   #14161b;
  --muted:     #5c616d;
  --faint:     #888d9a;
  --border:    #e4dfd1;
  --border-2:  #d4cebd;
  --accent:      #4a4ec2;
  --accent-2:    #33369f;
  --accent-soft: rgba(74,78,194,0.10);
  --gold:        #8f6c1d;
  --gold-soft:   rgba(143,108,29,0.13);
  --good:        #1c7a50;
  --good-soft:   rgba(28,122,80,0.13);
  --bad:         #b0384a;
  --bad-soft:    rgba(176,56,74,0.10);
  --shadow: 0 1px 2px rgba(40,32,10,.05), 0 16px 44px rgba(40,34,18,.10);
  --glow: 0 0 0 1px rgba(74,78,194,.22), 0 12px 34px rgba(74,78,160,.14);
  --pattern-dot: rgba(40,34,12,0.10);
}
:root[data-theme="light"] body::before {
  background:
    radial-gradient(1100px 640px at 50% -14%, rgba(74,78,194,.06), transparent),
    radial-gradient(900px 520px at 100% 0%, rgba(150,120,40,.05), transparent);
}
:root[data-theme="light"] nav { background: rgba(246,244,236,0.86); }
:root[data-theme="light"] body.map-home #graph {
  background-color: var(--bg);
  background-image:
    radial-gradient(var(--pattern-dot) 1.5px, transparent 2.2px),
    radial-gradient(1100px 700px at 50% -10%, rgba(74,78,194,.06), transparent);
  background-size: 23px 23px, auto;
}
:root[data-theme="light"] .graph-toolbar,
:root[data-theme="light"] body.map-home .legend,
:root[data-theme="light"] .map-info { background: rgba(255,255,255,0.9); }
:root[data-theme="light"] .options button.correct { color: #145f3d; }
:root[data-theme="light"] .options button.incorrect { color: #8a2230; }

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 1.09rem;
  line-height: 1.75;
  color: var(--text);
  background: transparent;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.35rem 6rem;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Faint starfield + deep nebula, fixed behind everything (subtle) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1px 1px at 16% 24%, rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px at 74% 16%, rgba(255,255,255,.40), transparent),
    radial-gradient(1.3px 1.3px at 42% 62%, rgba(255,255,255,.45), transparent),
    radial-gradient(1px 1px at 88% 56%, rgba(255,255,255,.35), transparent),
    radial-gradient(1px 1px at 57% 84%, rgba(255,255,255,.35), transparent),
    radial-gradient(1px 1px at 8%  72%, rgba(255,255,255,.32), transparent),
    radial-gradient(1.3px 1.3px at 93% 30%, rgba(255,255,255,.40), transparent),
    radial-gradient(1200px 700px at 50% -18%, rgba(74,70,150,.16), transparent),
    radial-gradient(1000px 560px at 108% 4%, rgba(60,86,150,.08), transparent);
}

/* Faint "graph-paper / constellation" dot grid over everything (both themes) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(var(--pattern-dot) 1.5px, transparent 2.2px);
  background-size: 23px 23px;
}

/* ----------  TYPOGRAPHY  ---------- */
h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--heading); font-weight: 600; }
h1 { font-size: clamp(2.15rem, 1.4rem + 3vw, 3rem); line-height: 1.12; letter-spacing: -0.015em; margin: 0.15em 0 0.35em; }
h2 { font-size: 1.55rem; line-height: 1.2; letter-spacing: -0.01em; margin: 2.2em 0 0.5em; }
h3 { font-size: 1.16rem; line-height: 1.3; margin: 1.6em 0 0.4em; color: var(--text); }
p { margin: 0.95em 0; }
ul, ol { padding-left: 1.3rem; }
li { margin: 0.35em 0; }
[id] { scroll-margin-top: 5.5rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
strong { color: var(--heading); font-weight: 600; }
::selection { background: var(--accent-soft); }

.lead {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0.6em 0 1.2em;
}
/* Editorial drop cap on the opening paragraph */
.lead::first-letter {
  font-family: var(--font-serif);
  float: left;
  font-size: 3.1em;
  line-height: 0.82;
  padding: 0.02em 0.14em 0 0;
  color: var(--gold);
  font-weight: 600;
}

/* Gold ornament before section headings on article pages */
body > h2 { position: relative; }
body > h2::before {
  content: "✦";
  color: var(--gold);
  font-size: 0.58em;
  vertical-align: 0.28em;
  margin-right: 0.55rem;
  opacity: 0.75;
}

/* Hairline rule under the page title */
h1 + .original-title, h1 + .lead { position: relative; }

/* Card top-accent shimmer on hover */
.card { position: relative; overflow: hidden; }
.card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--rule);
  opacity: 0;
  transition: opacity .2s ease;
}
.card:hover::before { opacity: 0.85; }
.original-title { color: var(--muted); margin-top: -0.5em; font-size: 1.02rem; }

/* Small-caps eyebrow used for category labels and section kickers */
.category-label {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.category-label a { color: var(--muted); }

/* ----------  NAVIGATION  ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.35rem;
  padding: 0.95rem 0;
  margin-bottom: 2.75rem;
  background: rgba(9,11,18,0.82);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border-bottom: 1px solid var(--border);
}
nav::before {
  content: "✦";
  color: var(--gold);
  font-size: 0.95rem;
  margin-right: 0.15rem;
}
nav a {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: var(--muted);
}
nav a:hover { color: var(--accent-2); text-decoration: none; }
nav a.nav-active { color: var(--heading); font-weight: 600; }
nav a.nav-active::after { content: ""; display: block; height: 2px; border-radius: 2px; margin-top: 2px; background: linear-gradient(90deg, var(--accent), var(--gold)); }

/* ----------  CARD GRID (home + reference hubs)  ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.45rem;
  box-shadow: var(--shadow);
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--glow); text-decoration: none; }
.card h2 { margin: 0 0 0.3rem; font-size: 1.22rem; color: var(--accent-2); letter-spacing: 0; }
.card p { margin: 0; color: var(--muted); font-size: 0.97rem; line-height: 1.55; }
.section-link { display: inline-block; margin: 1rem 0 0.25rem; font-size: 1.1rem; }

/* ----------  LISTS  ---------- */
.list { list-style: none; padding-left: 0; }
.list li {
  margin: 0;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.list li a { font-weight: 500; }
.category { margin: 2.75rem 0; }
.category h2 { margin-bottom: 0.15rem; }
.category > .category-label { margin-top: 0; }

/* ----------  TAGS  ---------- */
.tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-2);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  padding: 0.12rem 0.65rem;
  margin: 0 0.3rem 0.35rem 0;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.tag:hover { background: var(--surface-2); text-decoration: none; }

/* ----------  RELATED BLOCK  ---------- */
.related { border-top: 1px solid var(--border); margin-top: 2.75rem; padding-top: 1.1rem; }
.related h2 { font-size: 1.05rem; margin: 0.4rem 0 0.6rem; color: var(--gold); letter-spacing: 0.02em; }
.related p { margin: 0.35rem 0; color: var(--muted); }
.related-inline { border-top: 1px dashed var(--border); margin-top: 0.6rem; padding-top: 0.3rem; }
.related-inline h2 { font-size: 0.9rem; margin: 0.3rem 0; }

/* ----------  RICH PAGE ELEMENTS  ---------- */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  margin: 1.9rem 0;
}
.toc strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.toc ul { margin: 0; padding-left: 1.1rem; columns: 2; column-gap: 1.5rem; }
.toc li { margin: 0.2rem 0; }

.quick-facts {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.35rem;
}
.quick-facts p { margin: 0.35rem 0; color: var(--muted); }
.quick-facts strong { color: var(--text); }

.key-args li { margin: 0.5rem 0; }

/* Primary-source excerpt with an editorial opening quote */
.excerpt {
  position: relative;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.2rem 1.4rem 1.2rem 1.6rem;
  margin: 1.4rem 0;
  font-family: var(--font-serif);
  font-size: 1.14rem;
  line-height: 1.7;
  box-shadow: var(--shadow);
}
.excerpt::before {
  content: "\201C";
  position: absolute;
  top: 0.1em;
  left: 0.35rem;
  font-family: var(--font-serif);
  font-size: 2.4rem;
  line-height: 1;
  color: var(--gold);
  opacity: 0.5;
}
.excerpt p { margin: 0.55em 0; color: var(--text); }
.source-note { font-size: 0.9rem; color: var(--muted); }
.discussion li { margin: 0.55rem 0; }
.cite { font-size: 0.9rem; color: var(--muted); }
.example { color: var(--muted); }
.example em { color: var(--gold); font-style: normal; letter-spacing: 0.02em; }

/* ----------  DEBATES  ---------- */
p.question { font-family: var(--font-serif); font-style: italic; font-size: 1.25rem; color: var(--heading); }
.position {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.05rem 1.3rem;
  margin: 1rem 0;
}
.position h3 { margin-top: 0; color: var(--accent-2); }

/* ----------  LEARNING PATHS  ---------- */
.path {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.45rem;
  margin: 1.35rem 0;
}
.path h2 { margin-top: 0; }
.path-steps { margin: 0.6rem 0 0; padding-left: 1.4rem; }
.path-steps li { margin: 0.4rem 0; }
.step-type { color: var(--faint); font-size: 0.82rem; letter-spacing: 0.04em; }

/* ----------  LESSONS AS A VISUAL PATH  ---------- */
.track { margin: 2.4rem 0; }
.track-branch {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.8rem;
}
.track-path { position: relative; display: flex; flex-direction: column; gap: 0.85rem; }
.track-path::before {
  content: "";
  position: absolute;
  left: 2.2rem;
  top: 1.7rem;
  bottom: 1.7rem;
  width: 2px;
  background: var(--border-2);
  z-index: 0;
}
.stop {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.8rem 1.1rem;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.stop:hover { transform: translateX(5px); border-color: var(--accent); box-shadow: var(--glow); text-decoration: none; }
.stop-dot {
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-2);
  border: 1px solid var(--border-2);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
}
.stop.done { border-color: var(--good); }
.stop.done .stop-dot { background: var(--good); color: #05130d; border-color: var(--good); }
.stop-body { display: flex; flex-direction: column; }
.stop-title { font-family: var(--font-serif); font-weight: 600; color: var(--heading); font-size: 1.08rem; line-height: 1.2; }
.stop-sum { color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }
.stop-kind { align-self: flex-start; margin-top: 0.2rem; font-family: var(--font-sans); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
/* lesson stops read a touch bolder than concept stops */
.stop-lesson .stop-dot { background: var(--gold-soft); color: var(--gold); }
.stop-lesson .stop-kind { color: var(--gold); }

/* ----------  STRUCTURED CURRICULUM (collapsible Lessons page)  ---------- */
.branch-course { margin: 0 0 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.branch-course[open] { border-color: var(--border-2); }
.branch-summary { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.3rem; cursor: pointer; list-style: none; user-select: none; transition: background .15s; }
.branch-summary::-webkit-details-marker { display: none; }
.branch-summary:hover { background: var(--surface-2); }
.branch-summary::after { content: "⌄"; margin-left: auto; font-size: 1.3rem; color: var(--muted); transition: transform .25s; }
.branch-course[open] > .branch-summary::after { transform: rotate(180deg); }
.branch-course-num {
  flex: 0 0 auto; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 700; font-size: 1.2rem;
  color: var(--accent-2); background: var(--accent-soft); border: 1px solid var(--border-2);
}
.bs-main { display: flex; flex-direction: column; min-width: 0; }
.bs-name { font-family: var(--font-serif); font-weight: 600; color: var(--heading); font-size: 1.3rem; line-height: 1.2; }
.bs-intro { color: var(--muted); font-size: 0.9rem; margin-top: 0.15rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.bs-count { flex: 0 0 auto; font-family: var(--font-sans); font-size: 0.82rem; font-weight: 600; color: var(--gold); background: var(--gold-soft); border-radius: 999px; padding: 0.2rem 0.7rem; }

.unit-d { border-top: 1px solid var(--border); margin: 0 1.1rem; }
.unit-summary { display: flex; align-items: baseline; gap: 0.7rem; padding: 0.8rem 0.4rem; cursor: pointer; list-style: none; }
.unit-summary::-webkit-details-marker { display: none; }
.unit-summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 1.1rem; }
.unit-d[open] > .unit-summary::after { content: "–"; }
.unit-summary:hover .us-title { color: var(--accent-2); }
.us-title { font-family: var(--font-serif); font-weight: 600; font-size: 1.06rem; color: var(--heading); }
.us-title::before { content: "✦"; color: var(--gold); font-size: 0.58em; vertical-align: 0.2em; margin-right: 0.45rem; opacity: 0.7; }
.us-blurb { color: var(--muted); font-size: 0.86rem; }
.us-count { margin-left: auto; font-family: var(--font-sans); font-size: 0.74rem; color: var(--faint); }
.unit-d .track-path { padding: 0.2rem 0 1rem 0.2rem; }
.unit-d[open] { animation: unitreveal .25s ease; }
@keyframes unitreveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.unit-checkpoint { margin: 0 1.1rem; padding: 0.8rem 0 1.1rem; border-top: 1px solid var(--border); }

/* Prev / next navigation on a concept lesson */
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; margin: 2.4rem 0 0; flex-wrap: wrap; }
.lesson-nav a {
  flex: 1 1 42%; min-width: 12rem; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 0.85rem 1.1rem; box-shadow: var(--shadow); text-decoration: none;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.lesson-nav a:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--glow); text-decoration: none; }
.lesson-nav-next { text-align: right; }
.ln-dir { font-family: var(--font-sans); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.ln-title { font-family: var(--font-serif); font-weight: 600; color: var(--heading); margin-top: 0.2rem; }

/* ----------  QUIZ  ---------- */
.quiz {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.6rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}
.question { margin-bottom: 1.6rem; }
.question .prompt { font-family: var(--font-sans); font-weight: 600; color: var(--heading); }
.options { list-style: none; padding-left: 0; }
.options li { margin: 0.5rem 0; }
.options button {
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background .13s, border-color .13s;
}
.options button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.options button.correct   { border-color: var(--good); background: var(--good-soft); color: #c7f4e2; font-weight: 600; }
.options button.incorrect { border-color: var(--bad);  background: var(--bad-soft);  color: #ffd2d9; }
.feedback { margin-top: 0.65rem; color: var(--muted); }
.results { border-top: 1px solid var(--border); margin-top: 1.1rem; padding-top: 1.1rem; }
.score { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 700; color: var(--gold); }
.summary-list { list-style: none; padding-left: 0; }
.summary-list li { margin: 0.22rem 0; color: var(--muted); }
.reset {
  margin-top: 0.85rem;
  padding: 0.55rem 1.15rem;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #0a0d16;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.reset:hover { background: var(--accent-2); border-color: var(--accent-2); }

/* ----------  SEARCH  ---------- */
#search-input {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 11px;
}
#search-input::placeholder { color: var(--faint); }
#search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.result-type { color: var(--faint); font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; }

/* ----------  DASHBOARD TABLE  ---------- */
table { border-collapse: collapse; width: 100%; margin-top: 0.5rem; }
th, td { border: 1px solid var(--border); padding: 0.6rem 0.75rem; text-align: left; }
th { background: var(--surface); color: var(--heading); font-family: var(--font-sans); font-size: 0.9rem; letter-spacing: 0.03em; }
.note { color: var(--muted); font-size: 0.9rem; }

/* ----------  TIMELINE  ---------- */
.timeline { margin: 2rem 0; }
.timeline-track { display: flex; gap: 0.5rem; position: relative; margin-bottom: 2rem; }
.timeline-track::before {
  content: "";
  position: absolute;
  top: 12px; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-2) 15%, var(--border-2) 85%, transparent);
  z-index: 0;
}
.era {
  flex: 1 1 0; background: none; border: none; font: inherit; color: var(--muted);
  cursor: pointer; padding: 0; position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem; text-align: center;
}
.era-dot {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--accent); background: var(--bg);
  transition: background .15s, box-shadow .15s;
}
.era:hover .era-dot { background: var(--accent-soft); }
.era.active .era-dot { background: var(--accent); box-shadow: 0 0 14px rgba(143,144,242,.7); }
.era-name { font-family: var(--font-serif); color: var(--text); }
.era.active .era-name { color: var(--heading); }
.era-span { font-size: 0.76rem; color: var(--faint); }
.timeline-detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.45rem; }
.timeline-span { margin-top: 0; color: var(--muted); }

/* ----------  CONCEPT MAP  ---------- */
.graph-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1.25rem 0 0.75rem; }
.graph-controls button {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.graph-controls button:hover { border-color: var(--accent); color: var(--accent-2); }
.graph-controls .spacer { flex: 1; }
.graph-controls label { font-size: 0.85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }

.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; margin: 0 0 0.85rem; font-size: 0.8rem; color: var(--muted); }
.legend .chip { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend .dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }

.map-wrap { position: relative; }
#graph {
  width: 100%;
  height: 68vh;
  min-height: 440px;
  display: block;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(900px 500px at 30% 0%, rgba(74,70,150,.12), transparent),
    var(--surface);
  touch-action: none;
  cursor: grab;
  overflow: hidden;
}
#graph.grabbing { cursor: grabbing; }
.edge { stroke: var(--border-2); stroke-width: 1; }
.edge.hot { stroke: var(--accent); stroke-width: 1.6; }
.node { cursor: pointer; }
.node circle { transition: filter .12s, stroke-width .12s; }
.node.dim { opacity: 0.20; }
.node.hot circle, .node.selected circle { filter: brightness(1.2); }
.node.selected circle { stroke: var(--heading); stroke-width: 2.6; }
.node-label { font-family: var(--font-sans); fill: var(--text); pointer-events: none; user-select: none; }
.node-label.branch { fill: var(--gold); font-weight: 600; letter-spacing: 0.01em; }

.map-info {
  max-width: 34rem; margin: 1.1rem auto 0; text-align: center;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.map-info[hidden] { display: none; }
.map-info .mi-type { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.map-info .mi-name { font-family: var(--font-serif); font-size: 1.2rem; color: var(--heading); margin: 0.1rem 0 0.35rem; }
.map-info .mi-blurb { color: var(--text); font-size: 0.9rem; line-height: 1.45; margin: 0 0 0.55rem; }
.map-info .mi-links { color: var(--muted); font-size: 0.82rem; margin: 0.1rem 0 0.6rem; }
.map-hint { color: var(--faint); font-size: 0.85rem; }

/* ----------  FOOTER  ---------- */
footer {
  border-top: 1px solid var(--border);
  margin-top: 3.5rem;
  padding-top: 1.1rem;
  font-size: 0.88rem;
  color: var(--faint);
}
footer a { color: var(--muted); }

/* ----------  CONCEPT MAP AS FULL-SCREEN HOME  ---------- */
body.map-home {
  max-width: none;
  margin: 0;
  padding: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.map-home nav {
  position: static;
  margin: 0;
  padding: 0.85rem 1.5rem;
  flex: 0 0 auto;
}
.map-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
body.map-home #graph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(var(--pattern-dot) 1.5px, transparent 2.2px),
    radial-gradient(1200px 720px at 50% -12%, rgba(74,70,150,.16), transparent),
    radial-gradient(900px 620px at 100% 100%, rgba(60,86,150,.09), transparent);
  background-size: 23px 23px, auto, auto;
}

.map-masthead {
  position: absolute;
  top: 1.4rem;
  left: 1.7rem;
  max-width: min(62%, 30rem);
  pointer-events: none;
  z-index: 3;
}
.map-eyebrow {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.map-masthead h1 { margin: 0.12rem 0 0.35rem; font-size: clamp(2rem, 1.2rem + 2.4vw, 3.1rem); }
.map-sub { margin: 0; color: var(--muted); font-size: 0.98rem; max-width: 25rem; }

.graph-toolbar {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  background: rgba(18,21,31,0.82);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-2);
  border-radius: 999px;
}
.graph-toolbar button {
  min-width: 2rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.graph-toolbar button:hover { border-color: var(--accent); color: var(--accent-2); }
.graph-toolbar label { color: var(--muted); font-size: 0.85rem; display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.25rem; cursor: pointer; }

body.map-home .legend {
  position: absolute;
  left: 1.7rem;
  bottom: 1.2rem;
  z-index: 3;
  margin: 0;
  max-width: 92%;
  padding: 0.5rem 0.8rem;
  background: rgba(18,21,31,0.74);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 10px;
}
body.map-home .map-info { top: 5.3rem; bottom: auto; right: 1.4rem; }

/* ----------  THEME TOGGLE BUTTON  ---------- */
.theme-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--gold);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-2); }

/* ============================================================
   DESIGNED LANDING PAGE
   ============================================================ */
body.landing { max-width: none; margin: 0; padding: 0; }
body.landing nav { padding: 0.9rem 1.6rem; }
.section-inner { max-width: 64rem; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.eyebrow { font-family: var(--font-sans); font-size: 0.76rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin: 0 0 0.5rem; }
.landing .section h2 { font-size: clamp(1.7rem, 1.1rem + 2vw, 2.6rem); margin: 0 0 0.6rem; }
.landing .section h2::before { content: none; }
.section-lead { color: var(--muted); font-size: 1.12rem; max-width: 44rem; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-inner { max-width: 64rem; margin: 0 auto; padding: 0 1.5rem; position: relative; z-index: 2; }
.hero-eyebrow { font-family: var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.8rem; color: var(--gold); margin: 0 0 1rem; }
.hero-title { font-family: var(--font-serif); font-size: clamp(2.6rem, 1.5rem + 6vw, 5.4rem); line-height: 1.02; letter-spacing: -0.02em; margin: 0 0 1rem; color: var(--heading); }
.grad { background: linear-gradient(100deg, var(--accent-2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 1.2rem; color: var(--muted); max-width: 40rem; line-height: 1.6; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.9rem; }

.btn { display: inline-block; padding: 0.75rem 1.45rem; border-radius: 999px; border: 1px solid var(--border-2); color: var(--text); font-family: var(--font-sans); font-weight: 500; font-size: 0.98rem; text-decoration: none; transition: transform .15s, border-color .15s, background .15s, color .15s; }
.btn:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); color: #0a0d16; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #0a0d16; }

/* Hero orbit illustration */
.hero-orbits { position: absolute; top: 50%; right: -5rem; transform: translateY(-50%); width: 34rem; height: 34rem; z-index: 1; pointer-events: none; }
.orbit { position: absolute; top: 50%; left: 50%; border-radius: 50%; border: 1px solid var(--border-2); transform: translate(-50%, -50%); }
.orbit.o1 { width: 12rem; height: 12rem; animation: mapspin 26s linear infinite; }
.orbit.o2 { width: 22rem; height: 22rem; border-color: var(--border); animation: mapspin 46s linear infinite reverse; }
.orbit.o3 { width: 32rem; height: 32rem; border-color: var(--border); animation: mapspin 70s linear infinite; }
.orbit::before { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); top: -5px; left: 50%; margin-left: -5px; box-shadow: 0 0 12px var(--accent); }
.orbit.o2::before { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.orbit.o3::before { background: #64c298; box-shadow: 0 0 12px #64c298; }
.hero-phi { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: var(--font-serif); font-size: 6rem; color: var(--accent-2); opacity: 0.45; }
@keyframes mapspin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@media (max-width: 900px) { .hero-orbits { opacity: 0.25; right: -12rem; } }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } .orbit { animation: none; } }

/* Map stage — full-bleed and transparent, so the bubbles sit directly
   on the page (starfield + dot texture showing through), one cohesive map. */
.map-stage {
  position: relative;
  width: 100vw; margin-left: calc(50% - 50vw);
  height: min(82vh, 780px); min-height: 480px;
  margin-top: 0.5rem;
  overflow: hidden;
  background: transparent;
  cursor: grab;
  touch-action: none;
}
.map-stage:active { cursor: grabbing; }
.map-stage #graph { width: 100%; height: 100%; display: block; background: transparent; }
#map-reset {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 4;
  padding: 0.42rem 1rem; border-radius: 999px; border: 1px solid var(--border-2);
  background: rgba(18,21,31,0.7); backdrop-filter: blur(8px); color: var(--text);
  font: inherit; font-size: 0.88rem; cursor: pointer;
}
#map-reset:hover { border-color: var(--accent); color: var(--accent-2); }
:root[data-theme="light"] #map-reset { background: rgba(255,255,255,0.82); }
.map-hint { text-align: center; color: var(--muted); font-size: 0.92rem; margin-top: 1rem; letter-spacing: 0.01em; }
/* Map labels: white with a dark halo on the night sky, flipped to dark ink
   with a light halo in paper mode so they never look overbold. */
.node-label { font-family: var(--font-sans); pointer-events: none; user-select: none; fill: #ffffff; stroke: rgba(6,8,18,0.72); }
:root[data-theme="light"] .node-label { fill: #12151f; stroke: rgba(255,255,255,0.92); }
.node circle { transition: filter .15s; }
.node.hot circle { filter: brightness(1.06); }
.map-info a { display: inline-block; margin-top: 0.6rem; font-weight: 600; }

/* Branch cards */
.branch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; margin-top: 1.75rem; }
.branch-card { position: relative; display: block; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--c, var(--accent)); border-radius: 16px; padding: 1.3rem 1.4rem; color: inherit; text-decoration: none; box-shadow: var(--shadow); transition: transform .16s, box-shadow .16s; }
.branch-card:hover { transform: translateY(-4px); box-shadow: var(--glow); text-decoration: none; }
.branch-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--accent)); box-shadow: 0 0 10px var(--c, var(--accent)); }
.branch-card h3 { margin: 0.5rem 0 0.35rem; font-size: 1.25rem; }
.branch-card p { margin: 0 0 0.7rem; color: var(--muted); font-size: 0.96rem; line-height: 1.5; }
.branch-meta { font-family: var(--font-sans); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; text-align: center; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.6rem 1rem; }
.stat-num { display: block; font-family: var(--font-serif); font-size: clamp(2.2rem, 1.5rem + 2vw, 3.2rem); font-weight: 700; color: var(--gold); line-height: 1; }
.stat-label { display: block; margin-top: 0.4rem; color: var(--muted); font-size: 0.86rem; letter-spacing: 0.05em; text-transform: uppercase; }
body.landing footer { margin-top: 0; border-top: 1px solid var(--border); padding: 2rem 0; }

/* ============================================================
   RICH SECTION PAGES — bring every hub/section page up to the
   landing page's level of polish, with no per-page rewrites.
   ============================================================ */
/* Elegant gold hairline under every page title (article + hub pages) */
body:not(.landing) > h1 { position: relative; }
body:not(.landing) > h1::after {
  content: ""; display: block; width: 3.4rem; height: 3px; margin-top: 0.75rem;
  border-radius: 3px; background: linear-gradient(90deg, var(--gold), transparent);
}
/* The intro paragraph right after a page title reads as a lead */
body:not(.landing) > h1 + p { font-size: 1.16rem; line-height: 1.6; color: var(--muted); max-width: 46rem; margin-top: 0.9rem; }

/* Optional richer header block (eyebrow + title + lead) */
.page-head { margin: 0.4rem 0 2.4rem; }
.page-head .eyebrow { margin-bottom: 0.55rem; }
.page-head h1 { margin: 0 0 0.2rem; }

/* Cards: warm the heading on hover to match the landing's feel */
.card h2 { transition: color .18s ease; }
.card:hover h2 { color: var(--gold); }

/* Site-wide gentle scroll reveal. theme.js adds .reveal-auto ONLY when
   it runs, so if JS is off the content still shows normally. */
.reveal-auto { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal-auto.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal-auto { opacity: 1 !important; transform: none !important; transition: none; } }

/* ----------  SMALL SCREENS  ---------- */
@media (max-width: 600px) {
  body.map-home .map-masthead { max-width: 74%; }
  .map-masthead .map-sub { display: none; }
  .graph-toolbar { top: auto; bottom: 5.2rem; right: 1rem; }
  body.map-home .legend { font-size: 0.72rem; padding: 0.4rem 0.6rem; }
}

/* ----------  AUTHOR PORTRAITS  ---------- */
.portrait { flex: 0 0 auto; width: 5.5rem; height: 5.5rem; border-radius: 50%; overflow: hidden; box-shadow: var(--shadow); }
.portrait svg, .portrait-img { width: 100%; height: 100%; display: block; object-fit: cover; }
.thinker-hero { display: flex; align-items: center; gap: 1.2rem; margin: 0.4rem 0 1.2rem; }
.thinker-meta { display: flex; flex-direction: column; gap: 0.15rem; }
.thinker-dates { margin: 0; font-family: var(--font-serif); font-size: 1.1rem; color: var(--heading); }
.thinker-areas { margin: 0; font-family: var(--font-sans); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }

.thinker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin: 1.6rem 0; }
.thinker-card { display: flex; align-items: center; gap: 0.9rem; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 0.9rem 1rem; box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: transform .16s, border-color .16s, box-shadow .16s; }
.thinker-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--glow); text-decoration: none; }
.thinker-card .portrait { width: 3.4rem; height: 3.4rem; }
.tc-body { display: flex; flex-direction: column; min-width: 0; }
.tc-name { font-family: var(--font-serif); font-weight: 600; color: var(--heading); font-size: 1.05rem; }
.tc-dates { font-family: var(--font-sans); font-size: 0.76rem; letter-spacing: 0.04em; color: var(--gold); }
.tc-sum { color: var(--muted); font-size: 0.85rem; line-height: 1.4; margin-top: 0.2rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Era headings on the Thinkers / Key Texts indexes */
.era-head { display: flex; align-items: baseline; gap: 0.8rem; margin: 2.2rem 0 0.9rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.era-head h2 { margin: 0; }
.era-head h2::before { content: none; }
.era-head .era-span { font-family: var(--font-sans); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.era-head-simple { margin: 2.2rem 0 0.7rem; }

/* Glossary as a directory into the lessons */
.glossary-entry h3 a { color: var(--heading); }
.glossary-entry h3 a:hover { color: var(--accent-2); text-decoration: none; }
.glossary-more { display: inline-block; margin-top: 0.2rem; font-size: 0.85rem; font-weight: 600; }

/* Key-text (work) cards */
.card-byline { color: var(--gold); font-size: 0.85rem; font-family: var(--font-sans); margin: 0.1rem 0 0.4rem; }
.work-card { position: relative; }
.work-title { margin: 0.2rem 0 0.1rem; font-size: 1.16rem; color: var(--accent-2); }
.work-badge { position: absolute; top: 0.85rem; right: 0.9rem; font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--border-2); padding: 0.12rem 0.45rem; border-radius: 999px; }
.work-badge-alt { color: var(--accent-2); }

/* ============================================================
   GLOSSARY — filterable, animated directory of concepts
   ============================================================ */
.gloss-controls { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin: 1.2rem 0 0.5rem; }
.gloss-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gloss-chip { font-family: var(--font-sans); font-size: 0.82rem; font-weight: 500; padding: 0.35rem 0.9rem; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); color: var(--muted); cursor: pointer; transition: color .15s, background .15s, border-color .15s; }
.gloss-chip:hover { color: var(--text); border-color: var(--c, var(--accent)); }
.gloss-chip.active { color: #0a0d16; background: var(--c, var(--accent)); border-color: var(--c, var(--accent)); }
.gloss-search { font-family: var(--font-sans); font-size: 0.95rem; padding: 0.5rem 0.95rem; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); min-width: 12rem; }
.gloss-search:focus { outline: none; border-color: var(--accent); }
.gloss-count { color: var(--faint); font-size: 0.85rem; margin: 0 0 1rem; }
.gloss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.gloss-card { position: relative; display: flex; flex-direction: column; gap: 0.3rem; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--c, var(--accent)); border-radius: 14px; padding: 1rem 1.1rem; box-shadow: var(--shadow); animation: glossin .45s both; transition: transform .16s, box-shadow .16s; }
.gloss-card:hover { transform: translateY(-3px); box-shadow: var(--glow); text-decoration: none; }
@keyframes glossin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .gloss-card, .debate-card { animation: none; } }
.gc-tag { font-family: var(--font-sans); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c, var(--gold)); font-weight: 600; }
.gc-term { font-family: var(--font-serif); font-weight: 600; font-size: 1.12rem; color: var(--heading); line-height: 1.15; }
.gc-def { color: var(--muted); font-size: 0.88rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gc-more { font-family: var(--font-sans); font-size: 0.78rem; font-weight: 600; color: var(--accent-2); margin-top: 0.2rem; opacity: 0; transform: translateX(-4px); transition: opacity .16s, transform .16s; }
.gloss-card:hover .gc-more { opacity: 1; transform: none; }

/* ============================================================
   DEBATES — emblematic cards + animated position cards
   ============================================================ */
.debate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; margin: 1.6rem 0; }
.debate-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 0.35rem; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.5rem 1.3rem 1.2rem; box-shadow: var(--shadow); animation: glossin .5s both; transition: transform .16s, box-shadow .16s, border-color .16s; }
.debate-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--c), transparent); }
.debate-card:hover { transform: translateY(-4px); border-color: var(--c, var(--accent)); box-shadow: var(--glow); text-decoration: none; }
.debate-emblem { font-size: 1.9rem; color: var(--c, var(--gold)); filter: drop-shadow(0 0 10px var(--c)); }
.debate-q { font-family: var(--font-serif); font-weight: 600; font-size: 1.2rem; color: var(--heading); line-height: 1.2; }
.debate-sub { color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.debate-meta { margin-top: 0.3rem; font-family: var(--font-sans); font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }

.position-grid { display: grid; gap: 1.2rem; margin: 1.2rem 0 1.6rem; }
.position { position: relative; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c, var(--accent)); border-radius: 14px; padding: 1.15rem 1.3rem 1.1rem 1.5rem; box-shadow: var(--shadow); }
.position-num { position: absolute; top: -0.7rem; left: -0.7rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--c, var(--accent)); color: #0a0d16; font-family: var(--font-serif); font-weight: 700; font-size: 0.92rem; box-shadow: 0 0 12px var(--c); }
.position h3 { margin: 0 0 0.3rem; color: var(--c, var(--accent-2)); }
.position h3::before { content: none; }
.position-sum { font-weight: 500; color: var(--text); margin: 0 0 0.5rem; }
.position ul { margin: 0; }

.muted-note { color: var(--muted); font-size: 0.95rem; }
.score-msg { color: var(--gold); font-family: var(--font-serif); font-style: italic; margin-top: 0.2rem; }

/* Checkpoint stop on the Lessons page */
.stop-checkpoint { border-style: dashed; border-color: var(--gold); background: linear-gradient(180deg, var(--gold-soft), transparent); }
.stop-checkpoint .stop-dot { background: var(--gold); color: #2a1e04; border-color: var(--gold); }
.stop-checkpoint .stop-kind { color: var(--gold); }
.unit-checkpoint { border-left-color: var(--gold); }

/* ============================================================
   QUIZ ARENA — the Quizzes section gets its own look.
   ============================================================ */
body.quiz-hub, body.dashboard { max-width: 60rem; }
.quiz-hub .quiz-hero {
  position: relative; text-align: center; margin: 0.5rem 0 2.6rem;
  padding: 2.6rem 1.5rem; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--border-2);
  background:
    radial-gradient(700px 320px at 50% -20%, rgba(224,169,63,.18), transparent),
    radial-gradient(var(--pattern-dot) 1.5px, transparent 2.2px),
    var(--surface);
  background-size: auto, 23px 23px, auto;
}
.quiz-eyebrow { font-family: var(--font-sans); letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.76rem; color: var(--gold); margin: 0 0 0.6rem; }
.quiz-hub .quiz-hero h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.3rem); margin: 0 0 0.5rem; }
.quiz-hub .quiz-hero h1::after { display: none; }
.quiz-sub { color: var(--muted); max-width: 40rem; margin: 0 auto; font-size: 1.05rem; }
.quiz-stat-bar { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.4rem; margin-top: 1.4rem; color: var(--muted); font-size: 0.9rem; }
.quiz-stat-bar b { color: var(--gold); font-family: var(--font-serif); font-size: 1.2rem; }
.quiz-sec-title { font-size: 1.4rem; }
.quiz-sec-lead { color: var(--muted); margin-top: -0.3rem; }
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin: 1.2rem 0 2.4rem; }
.quiz-card {
  display: flex; flex-direction: column; gap: 0.35rem; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.quiz-card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--glow); text-decoration: none; }
.quiz-card-checkpoint { border-left: 3px solid var(--gold); }
.quiz-card-tag { font-family: var(--font-sans); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.quiz-card-title { font-family: var(--font-serif); font-size: 1.16rem; font-weight: 600; color: var(--heading); line-height: 1.2; }
.quiz-card-meta { color: var(--muted); font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.2rem; }
/* Themed (cross-branch) challenge cards — the widest quiz tier */
.quiz-card-theme { border-left: 3px solid var(--accent, #8f96ff); }
.quiz-card-theme .quiz-card-tag { color: var(--accent, #8f96ff); }
.quiz-card-blurb { color: var(--muted); font-size: 0.88rem; line-height: 1.45; margin-top: 0.1rem; }

.qb { font-size: 0.72rem; padding: 0.12rem 0.5rem; border-radius: 999px; border: 1px solid var(--border-2); font-weight: 600; }
.qb-new { color: var(--faint); }
.qb-gold { color: #2a1e04; background: var(--gold); border-color: var(--gold); }
.qb-ok { color: var(--good); border-color: var(--good); }
.qb-low { color: var(--bad); border-color: var(--bad); }

/* ============================================================
   PROGRESS DASHBOARD — gamified.
   ============================================================ */
.dashboard .dash-hero {
  display: flex; align-items: center; gap: 1.4rem; margin: 0.5rem 0 1.8rem;
  padding: 1.7rem 1.6rem; border-radius: 20px; border: 1px solid var(--border-2);
  background: radial-gradient(600px 260px at 12% -30%, rgba(143,144,242,.18), transparent), var(--surface);
}
.level-badge {
  flex: 0 0 auto; width: 5rem; height: 5rem; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(from 220deg, var(--accent), var(--gold), var(--accent));
  color: #0a0d16; box-shadow: 0 0 26px rgba(143,144,242,.4);
}
.level-num { font-family: var(--font-serif); font-weight: 700; font-size: 1.8rem; line-height: 1; }
.level-word { font-family: var(--font-sans); font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; }
.dash-hero-main { flex: 1 1 auto; }
.dash-eyebrow { font-family: var(--font-sans); letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.72rem; color: var(--gold); margin: 0 0 0.2rem; }
.dash-hero-main h1 { margin: 0 0 0.6rem; font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); }
.dash-hero-main h1::after { display: none; }
.xp-bar { height: 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-2); overflow: hidden; }
.xp-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 999px; transition: width .5s ease; }
.xp-label { color: var(--muted); font-size: 0.85rem; margin: 0.4rem 0 0; }
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.9rem; margin: 0 0 1rem; }
.dstat { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1rem 0.6rem; }
.dstat-num { display: block; font-family: var(--font-serif); font-weight: 700; font-size: 1.9rem; color: var(--gold); line-height: 1; }
.dstat-num small { font-size: 0.9rem; color: var(--faint); }
.dstat-label { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.branch-bars { display: flex; flex-direction: column; gap: 0.9rem; margin: 1rem 0 0; }
.branch-bar-head { display: flex; justify-content: space-between; font-size: 0.92rem; color: var(--text); margin-bottom: 0.3rem; }
.branch-bar.complete .branch-bar-head { color: var(--gold); }
.pbar { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.pbar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; transition: width .5s ease; }
.branch-bar.complete .pbar > span { background: linear-gradient(90deg, var(--gold), #f0d79a); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.9rem; margin: 1rem 0 0; }
.badge { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 0.7rem; opacity: 0.45; filter: grayscale(0.6); transition: transform .16s; }
.badge.earned { opacity: 1; filter: none; border-color: var(--gold); box-shadow: 0 0 0 1px rgba(216,196,143,.25); }
.badge.earned:hover { transform: translateY(-3px); }
.badge-icon { display: block; font-size: 1.7rem; color: var(--gold); line-height: 1; }
.badge-name { display: block; font-family: var(--font-serif); font-weight: 600; color: var(--heading); margin-top: 0.35rem; font-size: 0.98rem; }
.badge-desc { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 0.15rem; }

/* ----------  SMALL SCREENS  ---------- */
@media (max-width: 480px) {
  body { font-size: 1.04rem; padding: 0 1.1rem 4rem; }
  .lead { font-size: 1.16rem; }
  .toc ul { columns: 1; }
  .era-span { display: none; }
  .map-info { position: static; width: auto; max-width: none; margin-top: 0.75rem; }
  .dashboard .dash-hero { flex-direction: column; text-align: center; }
}

/* ---- Key-text long-form sections (work.html) ---- */
.at-glance { border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 10px; padding: 1rem 1.25rem 0.6rem; margin: 1.6rem 0 2rem;
  background: var(--panel, rgba(255,255,255,0.02)); }
.at-glance h2 { margin-top: 0.2rem; font-size: 1.05rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--faint); }
.glance-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.1rem; margin: 0.6rem 0 0.8rem; }
.glance-list dt { font-family: var(--font-sans); font-size: 0.78rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--faint); padding-top: 0.15rem; }
.glance-list dd { margin: 0; color: var(--text); }
.work-deflist { margin: 0.8rem 0 1.6rem; }
.work-deflist dt { font-family: var(--font-serif); font-weight: 600; color: var(--heading);
  margin-top: 1rem; font-size: 1.04rem; }
.work-deflist dd { margin: 0.3rem 0 0; color: var(--text); line-height: 1.7; }
.work-structure dt { color: var(--gold); font-size: 0.98rem; }
.study-guide { margin: 0.8rem 0 1.6rem; padding-left: 1.3rem; }
.study-guide li { margin-bottom: 0.7rem; line-height: 1.65; }
.cite-line { font-size: 0.9rem; color: var(--muted); border-left: 2px solid var(--line);
  padding-left: 0.9rem; }

/* ---- Section quiz stop at the end of each curriculum section ---- */
.unit-sectionquiz { margin: 0.5rem 0 0.2rem; }
.stop-sectionquiz { border-style: dashed; border-color: var(--gold); }
.stop-sectionquiz .stop-dot { background: transparent; border: 1px dashed var(--gold); color: var(--gold); }
.stop-sectionquiz.done .stop-dot { background: var(--gold); color: var(--bg); border-style: solid; }
.stop-sectionquiz .stop-kind { color: var(--gold); }
/* Branch grouping headings in the Quiz Arena */
.quiz-group-title { font-family: var(--font-serif); font-size: 1.06rem; font-weight: 600;
  color: var(--faint); letter-spacing: 0.04em; text-transform: uppercase;
  margin: 1.7rem 0 0.6rem; }

/* ---- Noesis wordmark (nav) ---- */
.wordmark {
  display: inline-flex; align-items: center; gap: 0.42rem;
  font-family: var(--font-serif);
  font-size: 1rem; font-weight: 600;
  letter-spacing: 0.17em; text-transform: uppercase;
  color: var(--heading);
  padding-right: 1.1rem; margin-right: 0.15rem;
  border-right: 1px solid var(--line);
}
.wordmark:hover { color: var(--heading); text-decoration: none; }
.wordmark:hover .wordmark-mark { transform: rotate(-12deg) scale(1.08); }
.wordmark-mark {
  font-size: 1.16rem; line-height: 1; letter-spacing: 0;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
}
.footer-mark {
  font-family: var(--font-serif); font-size: 1.28rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--heading); margin-bottom: 0.3rem;
}
@media (max-width: 560px) {
  .wordmark { border-right: none; padding-right: 0; width: 100%; margin-bottom: 0.1rem; }
}

/* ---- Footer credit + legal ---- */
.footer-tag { color: var(--muted); margin-bottom: 0.9rem; }
.footer-credit { font-size: 0.94rem; color: var(--text); margin-bottom: 0.35rem; }
.footer-credit strong { color: var(--heading); font-weight: 600; }
.footer-legal { font-size: 0.82rem; color: var(--faint); line-height: 1.6; }
.footer-legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.footer-legal a:hover { color: var(--accent-2); }

/* ---- Feedback form (about page) ---- */
.feedback-form { max-width: 34rem; margin: 1.2rem 0 2rem; display: flex; flex-direction: column; gap: 0.4rem; }
.feedback-form label { font-family: var(--font-sans); font-size: 0.86rem; color: var(--muted);
  margin-top: 0.7rem; letter-spacing: 0.02em; }
.feedback-form .opt { color: var(--faint); }
.feedback-form input, .feedback-form select, .feedback-form textarea {
  font-family: var(--font-sans); font-size: 0.97rem; color: var(--text);
  background: var(--panel, rgba(255,255,255,0.03)); border: 1px solid var(--line);
  border-radius: 8px; padding: 0.6rem 0.75rem; width: 100%; }
.feedback-form textarea { resize: vertical; line-height: 1.6; }
.feedback-form input:focus, .feedback-form select:focus, .feedback-form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.feedback-form button { align-self: flex-start; margin-top: 1.1rem; cursor: pointer; }
.form-note { font-size: 0.82rem; color: var(--faint); margin-top: 0.7rem; }
.hp { position: absolute; left: -9999px; }
