/* ============================================================
   The Superspectrum and the Interference Thesis
   Miracle Academy microsite stylesheet
   Palette, typography, layout, components, print
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  --primary: #CC5733;
  --primary-deep: #AB492B;
  --secondary: #B7B1A4;
  --accent: #FFE375;
  --accent-deep: #F4C842;
  --bg: #EBE9E5;
  --bg-paper: #F4F2EE;
  --bg-card: #FFFFFF;
  --ink: #3E3B32;
  --ink-soft: #6B6557;
  --ink-faint: #9A9486;
  --good: #5d9b6c;

  --font-head: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  --font-quote: 'Cormorant Garamond', Georgia, serif;

  --nav-h: 64px;
  --maxw: 1120px;
  --radius: 10px;
  --radius-sm: 6px;
  --line: 1px solid rgba(62, 59, 50, 0.14);
  --line-strong: 1px solid rgba(62, 59, 50, 0.26);
  --shadow-sm: 0 1px 2px rgba(62, 59, 50, 0.06), 0 2px 8px rgba(62, 59, 50, 0.05);
  --shadow-md: 0 2px 6px rgba(62, 59, 50, 0.08), 0 10px 28px rgba(62, 59, 50, 0.08);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 2. Reset and base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 18px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-attachment: scroll;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.68;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.16;
  color: var(--ink);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.55rem, 4vw, 2.35rem); }
h3 { font-size: clamp(1.15rem, 2.6vw, 1.4rem); }
h4 { font-size: 1.03rem; letter-spacing: 0.02em; }

p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

a { color: var(--primary-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--primary); }

ul, ol { margin: 0 0 1.05em; padding-left: 1.25em; }
li { margin-bottom: 0.4em; }

code, .mono { font-family: var(--font-mono); font-size: 0.86em; }

hr { border: 0; border-top: var(--line); margin: 2.2rem 0; }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: var(--bg-paper);
  padding: 12px 18px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

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

/* ---------- 3. Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

.section {
  padding: clamp(52px, 8vw, 92px) 0;
  scroll-margin-top: calc(var(--nav-h) + 18px);
  border-top: var(--line);
}
.section--paper { background: var(--bg-paper); }
.section--first { border-top: 0; }

.section-head { max-width: 74ch; margin-bottom: 2rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary-deep);
  display: block;
  margin-bottom: 0.7rem;
}

.lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 68ch; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: var(--bg-card);
  border: var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-top: 0; }
.card--flat { box-shadow: none; background: transparent; }

/* ---------- 4. Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(244, 242, 238, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: var(--line);
}
.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}
.nav__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.nav__brand img { height: 30px; width: auto; display: block; }

.nav__links { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav__links a {
  font-family: var(--font-head);
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 10px 9px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}
.nav__links a:hover, .nav__links a:focus-visible { color: var(--primary-deep); background: rgba(204, 87, 51, 0.09); }
.nav__links a[aria-current="true"] { color: var(--primary-deep); box-shadow: inset 0 -2px 0 var(--primary); }

.nav__toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-card);
  border: var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 12px;
  cursor: pointer;
}
.nav__toggle-bars { display: inline-block; width: 16px; height: 2px; background: currentColor; position: relative; }
.nav__toggle-bars::before, .nav__toggle-bars::after {
  content: ""; position: absolute; left: 0; width: 16px; height: 2px; background: currentColor;
}
.nav__toggle-bars::before { top: -5px; }
.nav__toggle-bars::after { top: 5px; }

@media (max-width: 900px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-paper);
    border-bottom: var(--line-strong);
    box-shadow: var(--shadow-md);
    padding: 8px 16px 16px;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .nav__links[hidden] { display: none; }
  .nav__links a { min-height: 44px; font-size: 0.95rem; border-bottom: var(--line); border-radius: 0; }
}

/* ---------- 5. Hero ---------- */
.hero {
  position: relative;
  padding: clamp(48px, 9vw, 96px) 0 clamp(40px, 6vw, 72px);
  background: linear-gradient(180deg, var(--bg-paper) 0%, var(--bg) 100%);
  overflow: hidden;
}
.hero__inner { position: relative; z-index: 2; display: grid; gap: 34px; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr); align-items: center; }
@media (max-width: 860px) { .hero__inner { grid-template-columns: 1fr; } }

.hero__title { margin-bottom: 0.35em; }
.hero__subtitle {
  font-family: var(--font-head);
  font-weight: 300;
  font-size: clamp(1.05rem, 2.6vw, 1.4rem);
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  margin: 0 0 1.2rem;
  max-width: 40ch;
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
.hero__meta li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg-card);
  border: var(--line);
  border-radius: 100px;
  padding: 7px 13px;
  color: var(--ink-soft);
  margin: 0;
}
.hero__meta strong { color: var(--ink); font-weight: 600; }

.thesis-box {
  background: var(--bg-card);
  border: var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  max-width: 62ch;
}
.thesis-box h2 {
  font-size: 0.74rem;
  font-family: var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary-deep);
  margin-bottom: 0.6rem;
}
.thesis-box p { font-size: 1.02rem; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 20px;
  border-radius: 100px;
  border: 1px solid transparent;
  font-family: var(--font-head);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}
.btn:hover { background: var(--primary-deep); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink-faint); }
.btn--ghost:hover { background: rgba(62, 59, 50, 0.06); color: var(--ink); border-color: var(--ink-soft); }

/* Sacred geometry motif: exact concentric triangles and 13-point ring */
.geo-figure { display: block; width: 100%; max-width: 360px; margin: 0 auto; }
.geo-figure .geo-stroke { fill: none; stroke: var(--primary); stroke-width: 1.1; opacity: 0.65; }
.geo-figure .geo-stroke-soft { fill: none; stroke: var(--secondary); stroke-width: 1; opacity: 0.9; }
.geo-figure .geo-node { fill: var(--primary-deep); }
.geo-figure .geo-node-center { fill: var(--accent-deep); stroke: var(--primary-deep); stroke-width: 1; }
.geo-figure .geo-chord { stroke: var(--ink-faint); stroke-width: 0.4; opacity: 0.5; fill: none; }

/* ---------- 6. Evidence labels ---------- */
.label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 100px;
  border: 1px solid currentColor;
  white-space: nowrap;
  line-height: 1.3;
  vertical-align: middle;
}
.label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.label[data-evidence="documented-artifact"] { color: #2f6f8f; background: rgba(47, 111, 143, 0.08); }
.label[data-evidence="established-mechanism"] { color: var(--good); background: rgba(93, 155, 108, 0.1); }
.label[data-evidence="phenomenological-report"] { color: #7a5aa8; background: rgba(122, 90, 168, 0.09); }
.label[data-evidence="interpretive-synthesis"] { color: var(--primary-deep); background: rgba(204, 87, 51, 0.09); }
.label[data-evidence="proposed-protocol"] { color: #8a6d1f; background: rgba(244, 200, 66, 0.16); }
.label[data-evidence="theology-metaphor"] { color: #6B6557; background: rgba(183, 177, 164, 0.22); }
.label[data-evidence="unestablished-claim"] { color: #a03a2f; background: rgba(160, 58, 47, 0.08); }

.labels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

/* Claim lens: emphasis only, never display:none, so AT keeps everything */
[data-evidence] { transition: opacity 180ms var(--ease), filter 180ms var(--ease); }
body.lens-active [data-evidence]:not(.lens-match) { opacity: 0.34; }
body.lens-active .lens-match {
  box-shadow: 0 0 0 2px var(--accent-deep);
  border-radius: var(--radius-sm);
}
body.lens-active .label.lens-match { box-shadow: 0 0 0 2px var(--accent-deep); }

.lens {
  background: var(--bg-card);
  border: var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.lens__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 100px;
  border: var(--line-strong);
  background: var(--bg-paper);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
}
.chip:hover { border-color: var(--primary); color: var(--primary-deep); }
.chip[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---------- 7. Tabs ---------- */
.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: var(--line-strong);
  margin-bottom: 20px;
  padding: 0;
}
.tabs__tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  min-height: 44px;
  padding: 10px 14px;
  font-family: var(--font-head);
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  cursor: pointer;
  margin-bottom: -1px;
}
.tabs__tab:hover { color: var(--primary-deep); }
.tabs__tab[aria-selected="true"] { color: var(--primary-deep); border-bottom-color: var(--primary); font-weight: 600; }
.tabs__panel[hidden] { display: none; }

/* ---------- 8. Accordion ---------- */
.acc { border: var(--line); border-radius: var(--radius); background: var(--bg-card); overflow: hidden; }
.acc + .acc { margin-top: 12px; }
.acc__btn {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 15px 18px;
  font-family: var(--font-head);
  font-size: 1.03rem;
  color: var(--ink);
  cursor: pointer;
}
.acc__btn:hover { background: rgba(204, 87, 51, 0.05); }
.acc__mark { flex: none; width: 18px; height: 18px; position: relative; color: var(--primary); }
.acc__mark::before, .acc__mark::after {
  content: ""; position: absolute; background: currentColor; transition: transform 180ms var(--ease);
}
.acc__mark::before { top: 8px; left: 0; width: 18px; height: 2px; }
.acc__mark::after { left: 8px; top: 0; width: 2px; height: 18px; }
.acc__btn[aria-expanded="true"] .acc__mark::after { transform: scaleY(0); }
.acc__panel { padding: 0 18px 18px; border-top: var(--line); padding-top: 16px; }
.acc__panel[hidden] { display: none; }

/* ---------- 9. Explorers (equation, layers, stack, 7/14/49) ---------- */
.explorer { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
@media (max-width: 860px) { .explorer { grid-template-columns: 1fr; } }

.node-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.node-list li { margin: 0; }

.node {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: var(--line);
  border-left: 3px solid var(--secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.97rem;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}
.node:hover { border-left-color: var(--primary); background: var(--bg-paper); }
.node[aria-pressed="true"], .node[aria-selected="true"] {
  border-left-color: var(--primary);
  background: rgba(204, 87, 51, 0.07);
  font-weight: 600;
}
.node__idx {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--primary-deep);
  background: rgba(255, 227, 117, 0.4);
  border-radius: 4px;
  padding: 3px 7px;
  flex: none;
}
.node__op { font-family: var(--font-mono); color: var(--ink-faint); }

.detail {
  background: var(--bg-card);
  border: var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  min-height: 240px;
}
.detail h3 { margin-top: 0; }
.detail dl { margin: 0; }
.detail dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 14px;
}
.detail dd { margin: 4px 0 0; }

.certainty { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.certainty__track { flex: 1; height: 7px; border-radius: 100px; background: rgba(183, 177, 164, 0.45); overflow: hidden; max-width: 220px; }
.certainty__fill { display: block; height: 100%; background: var(--primary); border-radius: 100px; }
.certainty__text { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft); }

/* Equation strip */
.equation {
  background: var(--bg-card);
  border: var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
  overflow-x: auto;
}
.equation__row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.eq-term {
  flex: 1 1 120px;
  min-width: 116px;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: var(--line);
  background: var(--bg-paper);
  cursor: pointer;
  color: var(--ink);
  text-align: left;
  font-family: var(--font-body);
}
.eq-term:hover { border-color: var(--primary); }
.eq-term[aria-pressed="true"] { background: rgba(255, 227, 117, 0.35); border-color: var(--primary); }
.eq-term__k { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary-deep); }
.eq-term__n { font-size: 0.9rem; font-weight: 600; line-height: 1.25; }
.eq-op { align-self: center; font-family: var(--font-mono); color: var(--ink-faint); padding: 0 2px; }
.eq-result {
  flex: 1 1 100%;
  margin-top: 6px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(93, 155, 108, 0.1);
  border: 1px solid rgba(93, 155, 108, 0.4);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  text-align: center;
  color: #37603f;
}

/* ---------- 10. Loop diagram ---------- */
.loop {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}
.loop li { margin: 0; display: flex; align-items: center; gap: 8px; }
.loop__step {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 100px;
  border: var(--line);
  background: var(--bg-card);
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--font-body);
  text-align: left;
}
.loop__step:hover { border-color: var(--primary); }
.loop__step[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.loop__arrow { font-family: var(--font-mono); color: var(--ink-faint); }

/* ---------- 11. Tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: var(--line); border-radius: var(--radius); background: var(--bg-card); }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 0.94rem; }
caption { text-align: left; padding: 12px 14px; color: var(--ink-soft); font-size: 0.88rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: var(--line); vertical-align: top; }
thead th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--bg-paper);
}
tbody tr:last-child td { border-bottom: 0; }

/* ---------- 12. Quotes and notes ---------- */
.quote {
  font-family: var(--font-quote);
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  line-height: 1.35;
  color: var(--ink);
  border-left: 3px solid var(--accent-deep);
  padding: 6px 0 6px 20px;
  margin: 1.5rem 0;
  max-width: 46ch;
}
.quote cite { display: block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-top: 10px; font-style: normal; }

.note {
  background: rgba(183, 177, 164, 0.18);
  border: var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.note strong { color: var(--ink); }
.note--boundary { background: rgba(204, 87, 51, 0.07); border-color: rgba(204, 87, 51, 0.3); }

.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 16px; margin: 0; }
.kv dt { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); padding-top: 3px; }
.kv dd { margin: 0; }

/* ---------- 13. Glossary and sources ---------- */
.search-field { display: flex; flex-direction: column; gap: 6px; max-width: 420px; margin-bottom: 18px; }
.search-field label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.search-field input {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: var(--line-strong);
  background: var(--bg-card);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
}
.search-field input:focus-visible { border-color: var(--primary); }

.glossary { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); list-style: none; margin: 0; padding: 0; }
.glossary li { margin: 0; }
.glossary__item { background: var(--bg-card); border: var(--line); border-radius: var(--radius-sm); padding: 14px 16px; height: 100%; }
.glossary__item[hidden] { display: none; }
.glossary__term { font-family: var(--font-head); font-size: 1rem; margin: 0 0 4px; }
.glossary__def { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }

.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sources li { margin: 0; }
.source-item { background: var(--bg-card); border: var(--line); border-radius: var(--radius-sm); padding: 13px 16px; }
.source-item[hidden] { display: none; }
.source-item__title { font-weight: 600; font-size: 0.96rem; }
.source-item__meta { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-top: 4px; display: block; }
.source-item a { word-break: break-word; font-size: 0.86rem; }

.empty-msg { color: var(--ink-soft); font-style: italic; }
.empty-msg[hidden] { display: none; }

/* ---------- 14. Memory map ---------- */
.memory-map { background: var(--bg-card); border: var(--line-strong); border-radius: var(--radius); padding: 24px; }
.memory-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); list-style: none; margin: 0 0 18px; padding: 0; }
.memory-grid li { margin: 0; border: var(--line); border-radius: var(--radius-sm); padding: 11px 13px; background: var(--bg-paper); }
.memory-grid b { font-family: var(--font-head); font-weight: 600; display: block; font-size: 0.98rem; }
.memory-grid span { font-size: 0.88rem; color: var(--ink-soft); }
.memory-remember { border-top: var(--line-strong); padding-top: 16px; font-family: var(--font-quote); font-size: 1.2rem; }

/* ---------- 15. Footer ---------- */
.footer { background: var(--bg-paper); border-top: var(--line-strong); padding: 40px 0 56px; font-size: 0.9rem; color: var(--ink-soft); }
.footer img { height: 26px; margin-bottom: 12px; }

/* ---------- 16. Steps and lessons ---------- */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 15px 18px 15px 58px;
  background: var(--bg-card);
  border: var(--line);
  border-radius: var(--radius-sm);
  margin: 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 15px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary-deep);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.steps h3 { font-size: 1rem; margin: 0 0 4px; }

/* ---------- 17. Three-dimensional brain geometry ---------- */
.brain-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr);
  gap: 20px;
  align-items: stretch;
}
.brain-viewport {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid rgba(62, 59, 50, .22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 227, 117, .22), transparent 30%),
    linear-gradient(155deg, #24211c 0%, #14130f 58%, #0a0a08 100%);
  box-shadow: var(--shadow-md);
}
#brain-canvas { display: block; width: 100%; height: 100%; min-height: 560px; touch-action: none; cursor: grab; }
#brain-canvas:active { cursor: grabbing; }
.brain-fallback { display: none; position: absolute; inset: 15%; color: var(--accent-deep); opacity: .72; }
.brain-overlay { position: absolute; left: 20px; right: 20px; top: 18px; display: flex; justify-content: space-between; align-items: center; color: #f4f2ee; pointer-events: none; }
.brain-kicker { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .13em; text-transform: uppercase; color: #d9d3c6; }
#brain-status { font-family: var(--font-head); font-size: .88rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.brain-panel { display: flex; flex-direction: column; gap: 14px; }
.brain-modes { display: grid; gap: 8px; }
.brain-mode { min-height: 52px; display: flex; align-items: center; gap: 11px; padding: 11px 14px; border: var(--line); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--ink); font: 500 .92rem var(--font-body); text-align: left; cursor: pointer; }
.brain-mode span { font: .68rem var(--font-mono); color: var(--primary-deep); }
.brain-mode:hover { border-color: var(--primary); }
.brain-mode[aria-pressed="true"] { color: #fff; border-color: var(--primary-deep); background: var(--primary-deep); }
.brain-mode[aria-pressed="true"] span { color: var(--accent); }
.brain-copy { min-height: 205px; padding: 18px; border: var(--line); border-radius: var(--radius); background: var(--bg-card); }
.brain-copy h3 { margin-top: 12px; }
.brain-pause { justify-self: start; min-height: 44px; }
.brain-legend { margin-top: 20px; }
.brain-legend .label { margin-bottom: 12px; }
@media (max-width: 860px) {
  .brain-stage { grid-template-columns: 1fr; }
  .brain-viewport, #brain-canvas { min-height: 480px; }
  .brain-modes { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .brain-viewport, #brain-canvas { min-height: 430px; }
  .brain-overlay { left: 14px; right: 14px; }
  .brain-modes { grid-template-columns: 1fr 1fr; }
  .brain-mode { min-height: 58px; padding: 9px 10px; flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* ---------- 18. Motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .nav, .footer, .hero__cta, .lens, .no-print, .tabs__list, .search-field { display: none !important; }
  .hero, .section:not(#memory) { display: none !important; }
  #memory { display: block !important; padding: 0; border: 0; page-break-inside: avoid; }
  #memory .memory-map { border: 0; padding: 0; box-shadow: none; }
  #print-map { display: none !important; }
  .memory-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .memory-grid li { border: 1px solid #999; background: #fff; padding: 6px 8px; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #444; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ---------- 18. Small screens ---------- */
@media (max-width: 420px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .card, .detail, .memory-map { padding: 16px; }
  .eq-term { min-width: 100%; }
  table { min-width: 440px; }
}
