/* ==========================================================================
   AI JOURNEY — styles (engine shared with Seeker)
   Cool paper palette: blueprint ink, indigo signal, magenta and cyan accents.
   ========================================================================== */

:root {
  --bg: #F6F7FB;
  --bg-2: #ECEFF6;
  --surface: #FFFFFF;
  --ink: #131A2E;
  --ink-soft: #34405C;
  --muted: #687291;
  --line: #E0E5EF;
  --line-strong: #CAD2E2;
  --accent: #4F46E5;
  --accent-ink: #3730A3;
  --accent-soft: #E7E6FD;
  --accent-2: #DB2777;
  --accent-3: #0891B2;
  --code-bg: #0F172A;
  --code-ink: #E2E8F0;
  --code-muted: #94A3B8;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .07);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, .06), 0 20px 50px rgba(15, 23, 42, .14);
  --radius: 14px;
  --radius-sm: 9px;

  --f-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --f-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  --header-h: 62px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1020; --bg-2: #111830; --surface: #151D36; --ink: #E7ECF7; --ink-soft: #C2CBE0;
    --muted: #8A95B4; --line: #232D4A; --line-strong: #33405F; --accent: #8E8CFF; --accent-ink: #B9B8FF;
    --accent-soft: #232659; --accent-2: #F472B6; --accent-3: #22D3EE; --code-bg: #070B16;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 20px 50px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1020; --bg-2: #111830; --surface: #151D36; --ink: #E7ECF7; --ink-soft: #C2CBE0;
  --muted: #8A95B4; --line: #232D4A; --line-strong: #33405F; --accent: #8E8CFF; --accent-ink: #B9B8FF;
  --accent-soft: #232659; --accent-2: #F472B6; --accent-3: #22D3EE; --code-bg: #070B16;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 20px 50px rgba(0,0,0,.45);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.7;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@media (max-width: 600px) { body { font-size: 17px; } }

img, svg { max-width: 100%; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; color: var(--ink); margin: 0 0 .5em; }
p { margin: 0 0 1.1em; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.dev { font-family: var(--f-mono); font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
@media (min-width: 720px) { .wrap { padding: 0 max(28px, env(safe-area-inset-right)) 0 max(28px, env(safe-area-inset-left)); } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 12px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, #22D3EE, var(--accent) 55%, var(--accent-2));
  color: #fff; line-height: 1;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent);
}
.brand-name { font-family: var(--f-display); font-size: 21px; font-weight: 600; letter-spacing: .01em; }
.brand-name small { display: block; font-family: var(--f-ui); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: -2px; }

@media (max-width: 420px) { .brand-name small { display: none; } }
.main-nav { display: none; gap: 2px; font-family: var(--f-ui); font-size: 14.5px; }
.main-nav a { color: var(--ink-soft); text-decoration: none; padding: 8px 12px; border-radius: 999px; }
.main-nav a:hover { background: var(--bg-2); color: var(--ink); }
.main-nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); }
@media (min-width: 900px) { .main-nav { display: flex; } }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--accent-ink); border-color: var(--line-strong); }
.icon-btn svg { width: 19px; height: 19px; }
.search-btn { display: inline-flex; align-items: center; gap: 8px; width: auto; padding: 0 12px 0 11px; border-radius: 999px; font-family: var(--f-ui); font-size: 14px; color: var(--muted); }
.search-btn kbd { font-family: var(--f-ui); font-size: 11px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 5px; color: var(--muted); }
.search-btn .lbl { display: none; }
@media (min-width: 600px) { .search-btn .lbl { display: inline; } }
@media (max-width: 599px) { .search-btn { width: 40px; padding: 0; justify-content: center; } .search-btn kbd { display: none; } }
.menu-btn { display: inline-grid; }
@media (min-width: 900px) { .menu-btn { display: none; } }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}

.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: linear-gradient(90deg, var(--accent-3), var(--accent), var(--accent-2)); transition: width .1s linear; }

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(8, 12, 28, .45); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .25s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 71;
  width: min(380px, 88vw);
  background: var(--surface); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
body.drawer-open .drawer { transform: none; }
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
body.drawer-open { overflow: hidden; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); font-family: var(--f-ui); font-weight: 600; }
.drawer-body { overflow-y: auto; padding: 8px 8px 32px; font-family: var(--f-ui); font-size: 15px; }
.drawer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.drawer-links a { text-decoration: none; color: var(--ink); background: var(--bg-2); border-radius: var(--radius-sm); padding: 10px 12px; font-weight: 500; }
.nav-sec { border-radius: var(--radius-sm); }
.nav-sec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: var(--radius-sm); font-weight: 600; }
.nav-sec > summary::-webkit-details-marker { display: none; }
.nav-sec > summary:hover { background: var(--bg-2); }
.nav-sec > summary .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.nav-sec > summary .chev { margin-left: auto; transition: transform .2s; color: var(--muted); }
.nav-sec[open] > summary .chev { transform: rotate(90deg); }
.nav-sec ul { list-style: none; margin: 0 0 8px; padding: 0 0 0 27px; }
.nav-sec li a, .nav-sec li span { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; text-decoration: none; color: var(--ink-soft); font-size: 14.5px; }
.nav-sec li a:hover { background: var(--bg-2); color: var(--ink); }
.nav-sec li span { color: var(--muted); opacity: .75; }
.nav-sec li a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-sec .sec-link { font-size: 13px; color: var(--accent-ink); }

/* ---------- badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-family: var(--f-ui); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; white-space: nowrap; line-height: 1.6; }
.badge.live { background: color-mix(in srgb, #16A34A 14%, transparent); color: #15803D; }
.badge.next { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent-ink); }
.badge.planned { background: var(--bg-2); color: var(--muted); }
.badge.read { background: color-mix(in srgb, var(--accent-3) 18%, transparent); color: var(--accent-3); }
:root[data-theme="dark"] .badge.live { color: #4ADE80; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.live { color: #4ADE80; } }
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-ui); font-size: 13.5px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); cursor: pointer; text-decoration: none; }
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-ui); font-size: 15px; font-weight: 600; padding: 12px 20px; border-radius: 999px; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.btn-primary { background: var(--accent); color: #FFF8F0; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:hover { color: #fff; transform: translateY(-1px); }
:root[data-theme="dark"] .btn-primary { color: #1A0F08; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #1A0F08; } }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ---------- hero (home) ---------- */
.hero { position: relative; overflow: hidden; padding: 48px 0 40px; border-bottom: 1px solid var(--line); background:
  radial-gradient(900px 400px at 85% 10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
  radial-gradient(700px 400px at 0% 100%, color-mix(in srgb, var(--accent-3) 10%, transparent), transparent 70%); }
.hero .wrap { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .hero { padding: 80px 0 72px; } .hero .wrap { grid-template-columns: 1.15fr .85fr; } }
.eyebrow { font-family: var(--f-ui); font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.hero h1 { font-size: clamp(36px, 7vw, 64px); line-height: 1.05; margin-bottom: 18px; }
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 500; }
.hero .lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--ink-soft); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-verse { margin-top: 30px; padding-left: 16px; border-left: 2px solid var(--accent-3); color: var(--muted); font-size: 16px; }
.hero-verse .q { display: block; font-family: var(--f-display); font-size: 19px; color: var(--ink-soft); margin-bottom: 4px; }
.hero-art { position: relative; justify-self: center; width: min(420px, 78vw); aspect-ratio: 1; }
.hero-art svg { width: 100%; height: 100%; }
.spin { animation: spin 160s linear infinite; transform-origin: 50% 50%; }
.spin-rev { animation: spin 220s linear infinite reverse; transform-origin: 50% 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 899px) { .hero-art { order: -1; width: min(220px, 55vw); } }

/* ---------- sections / blocks ---------- */
.block { padding: 56px 0; }
.block + .block { padding-top: 8px; }
.block-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.block-head h2 { font-size: clamp(26px, 3.6vw, 36px); margin: 0; }
.block-head p { color: var(--muted); margin: 6px 0 0; font-size: 16.5px; }

/* start-here path */
.path { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: step; }
@media (min-width: 720px) { .path { grid-template-columns: repeat(3, 1fr); } }
.path li { counter-increment: step; }
.path a, .path .path-card { position: relative; display: block; height: 100%; padding: 18px 18px 18px 64px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; }
.path a:hover { border-color: var(--c, var(--accent)); transform: translateY(-2px); box-shadow: var(--shadow); }
.path a::before, .path .path-card::before { content: counter(step); position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-ui); font-weight: 700; font-size: 14px; background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent); color: var(--c, var(--accent)); }
.path .is-read::before { content: "✓"; background: var(--c, var(--accent)); color: #fff; }
.path .path-card { opacity: .7; }
.path strong { display: block; font-family: var(--f-display); font-size: 18.5px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.path small { display: block; font-family: var(--f-ui); font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.path .badge { margin-top: 10px; }

/* section cards */
.cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  --c: var(--accent);
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: 22px 22px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c); opacity: .85; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); color: var(--ink); }
.card-glyph { font-family: var(--f-mono); font-weight: 600; font-size: 34px; line-height: 1.1; color: var(--c); margin-bottom: 4px; }
.card-tr { font-family: var(--f-ui); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.card h3 { font-size: 22px; margin: 10px 0 6px; }
.card p { font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 16px; }
.card-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; font-family: var(--f-ui); font-size: 12.5px; color: var(--muted); }
.meter { flex: 1; height: 5px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 99px; }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .path a { --c-fix: 1; }
.card-glyph, .path a::before { filter: var(--glyph-filter, none); }
:root[data-theme="dark"] { --glyph-filter: brightness(1.45) saturate(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --glyph-filter: brightness(1.45) saturate(.9); } }

.quote-band { margin: 24px 0 0; padding: 40px 0; text-align: center; background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quote-band .dev { font-size: clamp(22px, 3.5vw, 30px); color: var(--accent-ink); display: block; margin-bottom: 8px; }
.quote-band .tr { font-style: italic; color: var(--muted); }
.quote-band p { font-family: var(--f-display); font-size: clamp(19px, 2.6vw, 24px); max-width: 34em; margin: 10px auto 0; }
.quote-band cite { display: block; font-family: var(--f-ui); font-style: normal; font-size: 13px; color: var(--muted); margin-top: 10px; letter-spacing: .04em; }

/* ---------- page header (section/sitemap/glossary) ---------- */
.page-head { position: relative; overflow: hidden; padding: 40px 0 32px; border-bottom: 1px solid var(--line); background: radial-gradient(700px 300px at 90% 0%, color-mix(in srgb, var(--c, var(--accent)) 12%, transparent), transparent 70%); }
@media (min-width: 720px) { .page-head { padding: 64px 0 48px; } }
.page-head h1 { font-size: clamp(32px, 5.5vw, 52px); margin-bottom: 10px; }
.page-head .lead { font-size: clamp(17px, 2vw, 20px); color: var(--ink-soft); max-width: 40em; margin: 0; }
.page-head .glyph { font-family: var(--f-mono); font-weight: 600; font-size: clamp(38px, 6vw, 54px); line-height: 1.1; color: var(--c, var(--accent)); filter: var(--glyph-filter, none); }
.page-head .watermark { position: absolute; right: -60px; top: -60px; width: 340px; height: 340px; opacity: .5; pointer-events: none; }
@media (max-width: 720px) { .page-head .watermark { width: 220px; height: 220px; right: -70px; top: -40px; } }
.crumbs { font-family: var(--f-ui); font-size: 13.5px; color: var(--muted); margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); }
.crumbs .sep { opacity: .5; }

/* topic list (section page) */
.topic-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.topic-list li a, .topic-list li .topic-row { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.topic-list li a:hover { border-color: var(--c, var(--accent)); box-shadow: var(--shadow); }
.topic-list .num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-ui); font-size: 13px; font-weight: 700; background: color-mix(in srgb, var(--c, var(--accent)) 12%, transparent); color: var(--c, var(--accent)); filter: var(--glyph-filter, none); }
.topic-list .is-read .num { background: var(--c, var(--accent)); color: #fff; filter: none; }
.topic-list .txt { flex: 1; min-width: 0; }
.topic-list strong { display: block; font-family: var(--f-display); font-weight: 600; font-size: 18.5px; line-height: 1.3; }
.topic-list small { display: block; font-family: var(--f-ui); font-size: 13.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.topic-list .topic-row { opacity: .72; }

/* ---------- article layout ---------- */
.article-layout { display: grid; gap: 40px; padding-top: 28px; padding-bottom: 64px; }
@media (min-width: 1080px) { .article-layout { grid-template-columns: 230px minmax(0, 1fr); padding-top: 48px; } }
.article { max-width: 70ch; min-width: 0; }
@media (min-width: 1080px) { .article { margin: 0 auto 0 32px; } }
.article-head .kicker { font-family: var(--f-ui); font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--c, var(--accent-ink)); filter: var(--glyph-filter, none); }
.article-head h1 { font-size: clamp(34px, 6vw, 54px); line-height: 1.08; margin: 12px 0 14px; }
.article-head .dek { font-size: clamp(19px, 2.3vw, 22px); line-height: 1.55; color: var(--ink-soft); font-family: var(--f-display); font-weight: 400; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-family: var(--f-ui); font-size: 13.5px; color: var(--muted); padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 22px 0 34px; }
.article-meta .grow { flex: 1; }
.article h2 { font-size: clamp(25px, 3.4vw, 31px); margin: 2.2em 0 .7em; padding-top: .2em; }
.article h3 { font-size: 21px; margin: 1.8em 0 .5em; }
.article ul, .article ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.article li { margin-bottom: .4em; }
.article li::marker { color: var(--accent); }
.article strong { font-weight: 600; color: var(--ink); }
.article .lede::first-letter { float: left; font-family: var(--f-display); font-size: 4.1em; line-height: .85; padding: .06em .1em 0 0; color: var(--accent); font-weight: 600; }

/* TOC */
.toc { display: none; }
@media (min-width: 1080px) {
  .toc { display: block; position: sticky; top: calc(var(--header-h) + 32px); align-self: start; max-height: calc(100vh - var(--header-h) - 64px); overflow-y: auto; font-family: var(--f-ui); font-size: 13.5px; }
}
.toc h4, .toc-mobile summary { font-family: var(--f-ui); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.toc ol, .toc-mobile ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a, .toc-mobile a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 600; }
.toc-mobile { margin: 0 0 28px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-family: var(--f-ui); font-size: 14.5px; }
.toc-mobile summary { cursor: pointer; margin: 0; list-style: none; display: flex; justify-content: space-between; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: "+"; font-size: 16px; }
.toc-mobile[open] summary::after { content: "−"; }
.toc-mobile ol { margin-top: 10px; }
@media (min-width: 1080px) { .toc-mobile { display: none; } }

/* verse */
.verse { margin: 1.8em 0; padding: 22px 22px 18px; border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in srgb, var(--accent-3) 9%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--accent-3) 30%, var(--line)); position: relative; }
.verse .dev { display: block; font-size: 21px; line-height: 1.75; color: var(--ink); }
.verse .tr { display: block; font-style: italic; color: var(--muted); font-size: 16px; margin-top: 8px; line-height: 1.6; }
.verse .en { display: block; margin-top: 12px; font-family: var(--f-display); font-size: 19px; line-height: 1.5; }
.verse .src { display: block; margin-top: 10px; font-family: var(--f-ui); font-size: 12.5px; letter-spacing: .05em; color: var(--accent-3); text-transform: uppercase; font-weight: 600; }

/* callout */
.callout { margin: 1.6em 0; padding: 16px 18px 4px 18px; border-radius: var(--radius-sm); background: var(--accent-soft); border-left: 3px solid var(--accent); }
.callout-title { font-family: var(--f-ui); font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 6px; }
.callout.note { background: var(--bg-2); border-left-color: var(--accent-3); }
.callout.note .callout-title { color: var(--accent-3); }

/* idea cards (expandable) */
.ideas { display: grid; gap: 10px; margin: 1.4em 0 1.8em; }
@media (min-width: 640px) { .ideas { grid-template-columns: 1fr 1fr; } }
.idea { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.idea[open] { border-color: var(--line-strong); box-shadow: var(--shadow); }
.idea summary { list-style: none; cursor: pointer; display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
.idea summary::-webkit-details-marker { display: none; }
.idea .glyph { flex: none; min-width: 52px; padding: 0 8px; white-space: nowrap; height: 52px; border-radius: 12px; display: grid; place-items: center; font-family: var(--f-mono); font-size: 21px; background: var(--accent-soft); color: var(--accent-ink); }
.idea .t { font-family: var(--f-display); font-weight: 600; font-size: 18.5px; line-height: 1.25; }
.idea .s { display: block; font-family: var(--f-ui); font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.idea summary::after { content: "+"; margin-left: auto; font-family: var(--f-ui); color: var(--muted); font-size: 20px; transition: transform .2s; }
.idea[open] summary::after { transform: rotate(45deg); }
.idea .body { padding: 0 16px 14px; font-size: 16.5px; line-height: 1.65; color: var(--ink-soft); }
.idea .body p:last-child { margin-bottom: 0; }
.idea .more { font-family: var(--f-ui); font-size: 13.5px; }

/* perspectives tabs */
.tabs { margin: 1.6em 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.tablist { display: flex; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.tablist button { flex: 1; font-family: var(--f-ui); font-size: 14px; font-weight: 600; padding: 12px 10px; border: 0; background: none; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tablist button[aria-selected="true"] { color: var(--accent-ink); border-bottom-color: var(--accent); background: var(--surface); }
.tabpanel { padding: 18px 20px 4px; font-size: 17px; }
.tabpanel[hidden] { display: none; }

/* FAQ accordion */
.faq { margin: 1.2em 0 1.6em; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 36px 16px 0; position: relative; font-family: var(--f-display); font-size: 19px; font-weight: 600; line-height: 1.35; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details > div { padding: 0 0 8px; color: var(--ink-soft); }

/* reflect */
.reflect { margin: 2.4em 0 1.4em; padding: 22px; border-radius: var(--radius); border: 1px dashed var(--line-strong); background: var(--surface); }
.reflect h3 { margin: 0 0 12px; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.reflect ol { margin: 0; }
.reflect textarea { width: 100%; min-height: 90px; margin-top: 12px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; resize: vertical; }
.reflect .hint { font-family: var(--f-ui); font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

/* key terms */
.keyterms { display: flex; flex-wrap: wrap; gap: 8px; margin: 1em 0 2em; }

/* glossary term (inline) */
.term { border-bottom: 1px dotted var(--accent); cursor: help; color: inherit; }
.term:hover { color: var(--accent-ink); }
.popover { position: absolute; z-index: 80; width: min(320px, calc(100vw - 32px)); padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); font-family: var(--f-ui); font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.popover .pt { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.popover .pt b { font-family: var(--f-display); font-size: 18px; color: var(--ink); }
.popover .pt .dev { font-size: 17px; color: var(--accent-ink); }
.popover .pt i { color: var(--muted); font-size: 13px; }
.popover a { font-size: 13px; font-weight: 600; }

/* marks: numbered tap-to-reveal tiles */
.marks { list-style: none; margin: 1.4em 0 1.8em; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .marks { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.marks button { width: 100%; height: 100%; min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 14px 8px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-align: center; font: inherit; transition: border-color .15s, box-shadow .15s, background .15s; }
.marks button:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.marks .n { font-family: var(--f-ui); font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .1em; }
.marks .d { font-family: var(--f-mono); font-size: 21px; line-height: 1.3; color: var(--accent-ink); }
.marks .e { font-family: var(--f-display); font-weight: 600; font-size: 16.5px; line-height: 1.25; }
.marks .x { display: none; font-family: var(--f-ui); font-size: 13px; line-height: 1.45; color: var(--ink-soft); margin-top: 4px; }
.marks button[aria-expanded="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.marks button[aria-expanded="true"] .x { display: block; }

.article .marks, .article .ladder { padding-left: 0; }
.article .marks li, .article .ladder li { margin-bottom: 0; }

/* ladder: ranked list (e.g. sources of authority) */
.ladder { list-style: none; margin: 1.4em 0 1.8em; padding: 0; counter-reset: rung; display: grid; gap: 8px; }
.ladder li { counter-increment: rung; position: relative; padding: 14px 16px 14px 60px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); margin: 0; }
.ladder li::before { content: counter(rung); position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-ui); font-size: 13px; font-weight: 700; color: #fff; background: var(--accent); opacity: calc(1 - (var(--i, 0) * .17)); }
.ladder b { display: block; font-family: var(--f-display); font-size: 18px; font-weight: 600; }
.ladder b .dev { color: var(--accent-ink); font-weight: 400; margin-left: 6px; }
.ladder span.m { display: block; font-size: 16px; color: var(--ink-soft); line-height: 1.55; margin-top: 2px; }

/* dilemma: choose, then see perspectives */
.dilemma { margin: 1.8em 0; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); overflow: hidden; }
.dilemma-head { padding: 18px 20px 6px; background: linear-gradient(135deg, var(--accent-soft), transparent 70%); }
.dilemma-head .lab { font-family: var(--f-ui); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.dilemma-head h3 { margin: 6px 0 10px; font-size: 21px; }
.dilemma-head p { font-size: 16.5px; color: var(--ink-soft); }
.dilemma .choices { display: grid; gap: 8px; padding: 6px 20px 18px; }
.dilemma .choices button { text-align: left; font-family: var(--f-ui); font-size: 15px; line-height: 1.4; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); cursor: pointer; }
.dilemma .choices button:hover { border-color: var(--accent); }
.dilemma .choices button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.dilemma .outcome { padding: 4px 20px 6px; border-top: 1px solid var(--line); font-size: 16.5px; color: var(--ink-soft); }
.dilemma .outcome[hidden] { display: none; }
.dilemma .outcome h4 { font-family: var(--f-ui); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
.dilemma .reveal-epic { padding: 0 20px 18px; }
.dilemma .reveal-epic summary { cursor: pointer; font-family: var(--f-ui); font-size: 14px; font-weight: 600; color: var(--accent-ink); padding: 10px 0; }
.dilemma .reveal-epic p { font-size: 16.5px; color: var(--ink-soft); }

/* cycle: clickable circular process diagram */
.cycle { margin: 1.6em 0 1.8em; padding: 18px 16px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.cycle-ring { position: relative; width: min(100%, 400px); aspect-ratio: 1; margin: 0 auto; }
.cycle-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cycle-ring .orbit { transform-origin: 50% 50%; animation: spin 14s linear infinite; }
.cycle-hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 38%; text-align: center; pointer-events: none; }
.cycle-hub .dev { display: block; font-size: clamp(22px, 6vw, 30px); color: var(--accent-ink); line-height: 1.3; }
.cycle-hub small { display: block; font-family: var(--f-ui); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.cycle-step { position: absolute; transform: translate(-50%, -50%); width: 30%; min-width: 84px; padding: 8px 6px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); cursor: pointer; font-family: var(--f-ui); font-size: 13px; font-weight: 600; line-height: 1.25; text-align: center; transition: background .2s, border-color .2s, transform .2s, box-shadow .2s; }
.cycle-step .dev { display: block; font-size: 15px; font-weight: 400; color: var(--accent-ink); }
.cycle-step:hover { border-color: var(--accent); }
.cycle-step[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #FFF8F0; transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.cycle-step[aria-pressed="true"] .dev { color: #FFF8F0; }
:root[data-theme="dark"] .cycle-step[aria-pressed="true"], :root[data-theme="dark"] .cycle-step[aria-pressed="true"] .dev { color: #1A0F08; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cycle-step[aria-pressed="true"], :root:not([data-theme="light"]) .cycle-step[aria-pressed="true"] .dev { color: #1A0F08; } }
.cycle-desc { max-width: 34em; margin: 14px auto 0; min-height: 5.5em; text-align: center; font-size: 16.5px; color: var(--ink-soft); }
.cycle-desc b { display: block; font-family: var(--f-display); font-size: 19px; color: var(--ink); margin-bottom: 4px; }
.cycle-nav { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }

/* quiz: quick self-check */
.quiz { margin: 1.6em 0 1.8em; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); padding: 6px 20px 18px; }
.quiz-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 0 4px; }
.quiz-head .lab { font-family: var(--f-ui); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.quiz-score { font-family: var(--f-ui); font-size: 13px; color: var(--muted); }
.q { padding: 14px 0; border-top: 1px solid var(--line); }
.quiz-head + .q { border-top: 0; }
.q p { margin: 0 0 10px; font-size: 17px; }
.q .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.q .opts button { font-family: var(--f-ui); font-size: 14px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); cursor: pointer; }
.q .opts button:hover:not(:disabled) { border-color: var(--accent); }
.q .opts button:disabled { cursor: default; opacity: .55; }
.q .opts button.right { opacity: 1; border-color: #16A34A; background: color-mix(in srgb, #16A34A 14%, transparent); font-weight: 600; }
.q .opts button.wrong { opacity: 1; border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 12%, transparent); text-decoration: line-through; }
.q .why { display: none; margin: 10px 0 0; font-size: 15.5px; color: var(--ink-soft); }
.q.done .why { display: block; }

/* chain: linear word/idea journey */
.chain { margin: 1.6em 0 1.8em; padding: 18px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.chain-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.chain-step { display: flex; flex-direction: column; align-items: center; min-width: 76px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); cursor: pointer; font-family: var(--f-display); font-size: 18px; font-weight: 600; line-height: 1.2; transition: background .2s, border-color .2s; }
.chain-step small { font-family: var(--f-ui); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.chain-step .dev { font-weight: 400; }
.chain-step:hover { border-color: var(--accent); }
.chain-step[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.chain-arrow { color: var(--muted); font-family: var(--f-ui); font-size: 16px; }
.chain-link { display: inline-flex; align-items: center; gap: 6px; }
.chain-desc { max-width: 34em; margin: 14px auto 0; min-height: 4.5em; text-align: center; font-size: 16.5px; color: var(--ink-soft); }
.chain-desc b { display: block; font-family: var(--f-display); font-size: 18.5px; color: var(--ink); margin-bottom: 4px; }

/* timeline */
.timeline { list-style: none; margin: 1.6em 0 1.8em; padding: 0 0 0 4px; position: relative; }
.article .timeline { padding-left: 4px; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent-3), var(--accent), var(--accent-2)); opacity: .5; border-radius: 2px; }
.timeline li { position: relative; padding: 0 0 18px 34px; margin: 0; }
.timeline li::before { content: ""; position: absolute; left: 1px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.timeline .when { display: block; font-family: var(--f-ui); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.timeline .what { display: block; font-family: var(--f-display); font-size: 18px; font-weight: 600; line-height: 1.35; margin: 2px 0 2px; }
.timeline .more { display: block; font-size: 16px; line-height: 1.55; color: var(--ink-soft); }

/* peel: concentric layers removed one by one */
.peel { margin: 1.6em 0 1.8em; padding: 20px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.peel-stage { position: relative; width: min(100%, 340px); aspect-ratio: 1; margin: 0 auto; }
.peel-layer, .peel-core { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); transition: opacity .5s ease, transform .5s ease; }
.peel-layer { aspect-ratio: 1; display: flex; justify-content: center; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) var(--a, 8%), var(--surface)); }
.peel-layer span { margin-top: 2.6%; font-family: var(--f-ui); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); white-space: nowrap; }
.peel-layer.gone { opacity: 0; transform: translate(-50%, -50%) scale(1.12); pointer-events: none; }
.peel-core { width: 22%; aspect-ratio: 1; display: grid; place-items: center; background: radial-gradient(circle, #FDE68A, var(--accent-3) 60%, var(--accent)); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-3) 50%, transparent); color: #3B1D06; font-family: var(--f-mono); font-size: clamp(14px, 4.4vw, 18px); }
.peel.done .peel-core { box-shadow: 0 0 40px 14px color-mix(in srgb, var(--accent-3) 45%, transparent); transform: translate(-50%, -50%) scale(1.25); }
.peel-desc { max-width: 34em; margin: 16px auto 0; min-height: 5.5em; text-align: center; font-size: 16.5px; color: var(--ink-soft); }
.peel-desc b { display: block; font-family: var(--f-display); font-size: 19px; color: var(--ink); margin-bottom: 4px; }
.peel-desc .dev { color: var(--accent-ink); }
.peel-nav { display: flex; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* prev/next & mark read */
.done-box { margin: 3em 0 1.5em; padding: 22px; border-radius: var(--radius); text-align: center; background: var(--bg-2); border: 1px solid var(--line); }
.done-box p { font-family: var(--f-ui); font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.pager { display: grid; gap: 12px; grid-template-columns: 1fr; margin-top: 18px; }
@media (min-width: 600px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a, .pager .soon { display: block; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--accent); }
.pager .dir { display: block; font-family: var(--f-ui); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.pager strong { font-family: var(--f-display); font-size: 18px; font-weight: 600; }
.pager .next { text-align: right; }
.pager .soon { opacity: .65; }

.sources { font-size: 15.5px; color: var(--ink-soft); }
.sources li { margin-bottom: .5em; }

/* ---------- sitemap ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 26px; max-width: 760px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--f-display); font-size: 30px; font-weight: 600; line-height: 1.1; }
.stat span { font-family: var(--f-ui); font-size: 12.5px; color: var(--muted); }
.toolbar { position: relative; z-index: 20; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); margin-bottom: 20px; }
@media (min-width: 720px) { .toolbar { position: sticky; top: var(--header-h); } }
.toolbar input { flex: 1 1 220px; min-width: 0; font-family: var(--f-ui); font-size: 15px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.toolbar .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar .tools { display: flex; gap: 6px; margin-left: auto; }
.tree { display: grid; gap: 14px; }
.tree-sec { --c: var(--accent); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.tree-sec > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; border-left: 4px solid var(--c); }
.tree-sec > summary::-webkit-details-marker { display: none; }
.tree-sec .g { font-family: var(--f-mono); font-weight: 600; font-size: 22px; line-height: 1; color: var(--c); filter: var(--glyph-filter, none); width: 64px; text-align: center; }
.tree-sec h3 { margin: 0; font-size: 20px; }
.tree-sec .sum-sub { font-family: var(--f-ui); font-size: 13px; color: var(--muted); margin-top: 2px; }
.tree-sec .sum-right { display: flex; flex-direction: column; align-items: end; gap: 6px; font-family: var(--f-ui); font-size: 12px; color: var(--muted); min-width: 70px; }
.tree-sec .sum-right .meter { width: 70px; flex: none; }
@media (max-width: 520px) { .tree-sec .g { width: 40px; font-size: 24px; } .tree-sec > summary { gap: 10px; padding: 14px; } .tree-sec .sum-right { min-width: 54px; } .tree-sec .sum-right .meter { width: 54px; } }
.tree-sec ul { list-style: none; margin: 0; padding: 4px 18px 16px 18px; border-left: 4px solid var(--c); }
.tree-sec li { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 0 9px 26px; border-top: 1px solid var(--line); font-family: var(--f-ui); font-size: 15px; }
.tree-sec li::before { content: ""; position: absolute; left: 6px; top: 50%; width: 12px; height: 1px; background: var(--line-strong); }
.tree-sec li .nm { flex: 1; min-width: 0; }
.tree-sec li .nm a { color: var(--ink); font-weight: 600; text-decoration: none; }
.tree-sec li .nm a:hover { color: var(--accent-ink); text-decoration: underline; }
.tree-sec li .nm small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
.tree-sec li .nm .pl { color: var(--ink-soft); }
.tree-sec li .badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: end; }
.tree-sec .open-sec { display: inline-block; margin: 0 0 0 26px; padding-top: 10px; font-family: var(--f-ui); font-size: 13.5px; }
.empty { text-align: center; color: var(--muted); font-family: var(--f-ui); padding: 40px 0; }
mark { background: color-mix(in srgb, var(--accent-3) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

.roadmap { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 900px) { .roadmap { grid-template-columns: repeat(5, 1fr); } }
.roadmap li { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.roadmap .ph { font-family: var(--f-ui); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.roadmap h4 { font-size: 19px; margin: 4px 0 6px; }
.roadmap p { font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 10px; }
.roadmap .secs { display: flex; flex-wrap: wrap; gap: 5px; }
.roadmap .secs span { font-family: var(--f-ui); font-size: 12px; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--c) 13%, transparent); color: color-mix(in srgb, var(--c) 70%, var(--ink)); }

/* ---------- glossary page ---------- */
.az { display: flex; flex-wrap: wrap; gap: 4px; }
.az button { font-family: var(--f-ui); font-size: 13px; font-weight: 600; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.az button:disabled { opacity: .3; cursor: default; }
.az button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.gloss { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .gloss { grid-template-columns: 1fr 1fr; } }
.gl { padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 80px); }
.gl:target { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.gl .h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.gl h3 { font-size: 21px; margin: 0; }
.gl .dev { font-size: 21px; color: var(--accent-ink); }
.gl .tr { font-style: italic; color: var(--muted); font-size: 15px; }
.gl p { margin: 8px 0 0; font-size: 16.5px; line-height: 1.6; color: var(--ink-soft); }
.gl .lk { display: inline-block; margin-top: 8px; font-family: var(--f-ui); font-size: 13px; }

/* ---------- search ---------- */
.search-modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: rgba(8, 12, 28, .5); backdrop-filter: blur(3px); }
.search-modal.open { display: flex; }
.search-box { width: 100%; max-width: 620px; max-height: 76vh; display: flex; flex-direction: column; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid var(--line-strong); overflow: hidden; }
.search-box .in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search-box .in svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-family: var(--f-ui); font-size: 17px; color: var(--ink); }
.search-box .esc { font-family: var(--f-ui); font-size: 12px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 8px; background: none; color: var(--muted); cursor: pointer; }
.results { overflow-y: auto; padding: 6px; font-family: var(--f-ui); }
.results .grp { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.results a, .results .r { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 9px; text-decoration: none; color: var(--ink); }
.results a.sel, .results a:hover { background: var(--accent-soft); }
.results .r { opacity: .6; }
.results .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.results .rt { flex: 1; min-width: 0; }
.results .rt b { display: block; font-weight: 600; font-size: 15px; }
.results .rt small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .none { padding: 24px; text-align: center; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 40px 0 32px; font-family: var(--f-ui); font-size: 14px; color: var(--muted); }
.site-footer .cols { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .site-footer .cols { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h5 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent-ink); }
.site-footer .fine { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.site-footer .shanti { font-family: var(--f-mono); font-size: 13px; letter-spacing: .04em; color: var(--ink-soft); }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
@media print {
  .site-header, .site-footer, .toc, .toc-mobile, .done-box, .pager, .read-progress { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ==========================================================================
   App shell — installed-app feel on phones
   ========================================================================== */
html { -webkit-tap-highlight-color: transparent; }
button, a, summary, .chip, .term { touch-action: manipulation; }
.drawer-body, .results, .search-modal { overscroll-behavior: contain; }

/* smooth cross-page transitions (Chrome 126+, Safari 18.2+; ignored elsewhere) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* bottom tab bar */
.tabbar { display: none; }
@media (max-width: 899px) {
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--line);
    transition: transform .25s ease;
    -webkit-user-select: none; user-select: none;
  }
  .tabbar.hide { transform: translateY(105%); }
  .tabbar a, .tabbar button {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 2px 0; border: 0; background: none; color: var(--muted); cursor: pointer;
    font-family: var(--f-ui); font-size: 10.5px; font-weight: 600; letter-spacing: .01em; text-decoration: none;
  }
  .tabbar .ico { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 99px; transition: background .2s, color .2s; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar [aria-current="page"] { color: var(--accent-ink); }
  .tabbar [aria-current="page"] .ico { background: var(--accent-soft); }
  .tabbar a:active .ico, .tabbar button:active .ico { background: var(--bg-2); }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .site-header .search-btn, .site-header .menu-btn { display: none; }
  /* 16px+ inputs stop iOS from zooming in on focus */
  .toolbar input, .search-box input, .reflect textarea { font-size: 16px; }
}

/* install hint sheet */
.install-sheet {
  position: fixed; z-index: 46; left: 12px; right: 12px; margin: 0 auto; max-width: 460px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  display: flex; gap: 12px; align-items: center; padding: 12px 12px 12px 14px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
  font-family: var(--f-ui); font-size: 13.5px; line-height: 1.45; color: var(--muted);
  animation: sheet-in .35s cubic-bezier(.2,.8,.2,1);
}
@media (min-width: 900px) { .install-sheet { bottom: 20px; } }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
.install-sheet img { width: 46px; height: 46px; border-radius: 11px; flex: none; }
.install-sheet .txt { flex: 1; min-width: 0; }
.install-sheet b { display: block; color: var(--ink); font-size: 14.5px; }
.install-sheet .share { display: inline-block; width: 15px; height: 15px; vertical-align: -2px; color: var(--accent-ink); }
.install-sheet .go { flex: none; padding: 8px 14px; font-size: 14px; }
.install-sheet .x { flex: none; align-self: flex-start; width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--bg-2); color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }

/* ==========================================================================
   Source labels — mark whose view a passage gives (legend on about.html)
   ========================================================================== */
.src-tag { display: inline-flex; align-items: center; gap: 4px; margin: 0 2px; padding: 1px 8px; border-radius: 99px; font-family: var(--f-ui); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.7; white-space: nowrap; text-decoration: none; vertical-align: 2px; border: 1px solid transparent; }
.src-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
a.src-tag:hover { border-color: currentColor; }
.src-tag.consensus   { color: #047857; background: color-mix(in srgb, #047857 11%, transparent); }
.src-tag.debated     { color: #B45309; background: color-mix(in srgb, #B45309 12%, transparent); }
.src-tag.speculative { color: #7C3AED; background: color-mix(in srgb, #7C3AED 11%, transparent); }
.src-tag.myth        { color: #BE123C; background: color-mix(in srgb, #BE123C 10%, transparent); }
.src-tag.synthesis   { color: #475569; background: color-mix(in srgb, #475569 12%, transparent); }
:root[data-theme="dark"] .src-tag.consensus { color: #6EE7B7; } :root[data-theme="dark"] .src-tag.debated { color: #FCD34D; }
:root[data-theme="dark"] .src-tag.speculative { color: #C4B5FD; } :root[data-theme="dark"] .src-tag.myth { color: #FDA4AF; } :root[data-theme="dark"] .src-tag.synthesis { color: #CBD5E1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .src-tag.consensus { color: #6EE7B7; } :root:not([data-theme="light"]) .src-tag.debated { color: #FCD34D; }
  :root:not([data-theme="light"]) .src-tag.speculative { color: #C4B5FD; } :root:not([data-theme="light"]) .src-tag.myth { color: #FDA4AF; } :root:not([data-theme="light"]) .src-tag.synthesis { color: #CBD5E1; }
}
.callout.schools { background: color-mix(in srgb, #4338CA 7%, var(--surface)); border-left-color: #6366F1; }
.callout.schools .callout-title { color: #4F46E5; }
:root[data-theme="dark"] .callout.schools .callout-title { color: #A5B4FC; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .callout.schools .callout-title { color: #A5B4FC; } }
.callout.schools ul { margin-bottom: 1em; }
.verse .ctx { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-family: var(--f-ui); font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.trans-note { font-family: var(--f-ui); font-size: 13px; color: var(--muted); margin-top: -.4em; }

/* ybars: proportional horizontal bars */
.ybars { list-style: none; margin: 1.4em 0 1.8em; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); display: grid; gap: 14px; }
.article .ybars { padding-left: 18px; }
.ybars li { margin: 0; }
.ybars .yh { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-family: var(--f-ui); font-size: 13px; color: var(--muted); }
.ybars .yh b { font-family: var(--f-display); font-size: 17px; color: var(--ink); font-weight: 600; }
.ybars .yh b .dev { color: var(--accent-ink); font-weight: 400; margin-left: 6px; font-size: 15px; }
.ybars .track { height: 14px; margin-top: 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.ybars .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-3), var(--accent)); width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.ybars.in .fill { width: var(--w); }
.ybars .legs { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-family: var(--f-ui); }

/* shelf: tappable book spines grouped on shelves */
.shelf { margin: 1.4em 0 1.6em; padding: 16px 14px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.shelf-head b { font-family: var(--f-display); font-size: 19px; }
.shelf-head b .dev { color: var(--accent-ink); font-weight: 400; margin-left: 6px; font-size: 16px; }
.shelf-head span { font-family: var(--f-ui); font-size: 12px; color: var(--muted); }
.shelf-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 3px; padding: 0 4px 6px; border-bottom: 7px solid color-mix(in srgb, #8B5A2B 70%, var(--line-strong)); border-radius: 0 0 3px 3px; }
.book { --bc: #9A3412; position: relative; width: 36px; height: var(--h, 128px); padding: 8px 0; border: 0; border-radius: 3px 3px 1px 1px; cursor: pointer; color: #FFF8EE; font-family: var(--f-ui); font-size: 11.5px; font-weight: 600; letter-spacing: .03em; writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; white-space: nowrap; overflow: hidden;
  background: linear-gradient(90deg, color-mix(in srgb, var(--bc) 78%, #000) 0 4px, var(--bc) 4px calc(100% - 4px), color-mix(in srgb, var(--bc) 70%, #000) calc(100% - 4px));
  box-shadow: inset 0 10px 0 -7px rgba(255,255,255,.35), inset 0 -10px 0 -7px rgba(255,255,255,.35); transition: transform .2s, filter .2s; }
.book:hover { filter: brightness(1.12); }
.book[aria-pressed="true"] { transform: rotate(180deg) translateY(10px); filter: brightness(1.18) saturate(1.1); outline: 2px solid var(--accent); outline-offset: 1px; }
.book.wide { width: 46px; }
.shelf-desc { margin-top: 12px; min-height: 4.8em; font-size: 16px; color: var(--ink-soft); }
.shelf-desc b { display: block; font-family: var(--f-display); font-size: 18px; color: var(--ink); margin-bottom: 2px; }
.shelf-desc .hint { font-family: var(--f-ui); font-size: 13px; color: var(--muted); }
@media (max-width: 420px) { .shelf { padding-left: 10px; padding-right: 10px; } .shelf-row { gap: 4px 2px; padding: 0 2px 6px; } .book { width: 33px; font-size: 11px; } .book.wide { width: 40px; } }


/* finder: personality-style questionnaire that tallies answers across options */
.finder { margin: 1.6em 0 1.8em; padding: 6px 20px 18px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); }
.finder-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 0 4px; }
.finder-head .lab { font-family: var(--f-ui); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.finder-progress { font-family: var(--f-ui); font-size: 13px; color: var(--muted); }
.fq { padding: 14px 0; border-top: 1px solid var(--line); }
.finder-head + .fq { border-top: 0; }
.fq p { margin: 0 0 10px; font-size: 17px; }
.fq .opts { display: grid; gap: 6px; }
.fq .opts button { text-align: left; font-family: var(--f-ui); font-size: 14.5px; line-height: 1.4; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); cursor: pointer; }
.fq .opts button:hover { border-color: var(--accent); }
.fq .opts button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.finder-result { margin-top: 10px; padding: 18px; border-radius: var(--radius); background: linear-gradient(135deg, var(--accent-soft), transparent 80%); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.finder-result[hidden] { display: none; }
.finder-result h4 { font-family: var(--f-ui); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 10px; }
.finder-bars { display: grid; gap: 8px; margin-bottom: 16px; }
.finder-bars .row { display: grid; grid-template-columns: 92px 1fr 28px; gap: 10px; align-items: center; font-family: var(--f-ui); font-size: 13.5px; }
.finder-bars .row b { font-weight: 600; }
.finder-bars .track { display: block; height: 10px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.finder-bars .fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-3), var(--accent)); transition: width .6s ease; }
.finder-bars .row.top b { color: var(--accent-ink); }
.finder-bars .n { text-align: right; color: var(--muted); }
.finder-outcome { font-size: 16.5px; color: var(--ink-soft); }
.finder-outcome h3 { margin: 0 0 6px; font-size: 21px; }
.finder-reset { margin-top: 12px; }

/* learning paths (.lpath) + my journey (#journey) */
.lpath { margin: 1em 0 2em; padding: 14px 16px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.lpath-head, .journey-secs a { display: flex; align-items: center; gap: 12px; }
.lpath-count { white-space: nowrap; font: 600 .85rem/1.2 Inter, system-ui, sans-serif; color: var(--muted); }
.lpath .track, .journey-secs .track { display: block; flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.lpath .fill, .journey-secs .fill { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s; }
.lpath-list { list-style: none; margin: 12px 0 14px; padding: 0; }
.lpath-list li a { display: flex; gap: 12px; align-items: flex-start; padding: 9px 4px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.lpath-list .num { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 600 .8rem Inter, system-ui, sans-serif; background: var(--accent-soft); color: var(--accent-ink); }
.lpath-list li.is-read .num { background: var(--accent); color: #fff; }
.lpath-list .txt { min-width: 0; }
.lpath-list strong { display: block; font-weight: 600; }
.lpath-list small { display: block; color: var(--muted); font-size: .85rem; }
.lpath-next { display: inline-block; max-width: 100%; }
.lpath-done { margin: 0; font-weight: 600; }
.journey-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 1em 0; }
.journey-stats .stat { padding: 12px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; }
.journey-stats b { display: block; font-size: 1.6rem; line-height: 1.1; }
.journey-stats span { font: .78rem Inter, system-ui, sans-serif; color: var(--muted); }
.journey-secs { list-style: none; padding: 0; margin: 0; }
.journey-secs a { padding: 9px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.journey-secs .nm { flex: 0 0 48%; min-width: 0; }
.journey-secs strong { display: block; font-weight: 600; }
.journey-secs small { color: var(--muted); font-size: .82rem; }
.journey-notes { display: grid; gap: 10px; }
.jnote { padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.jnote header { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.jnote p { margin: .4em 0 0; overflow-wrap: anywhere; }
.jdel { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 0 4px; }
.journey-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.journey-actions label.btn { cursor: pointer; }
.article .lpath-list, .article .journey-secs { padding-left: 0; margin-left: 0; list-style: none; }
.article .lpath-list li, .article .journey-secs li { margin: 0; padding-left: 0; }
.article .lpath-list li::before, .article .journey-secs li::before { content: none; }

/* highlights, notes & bookmarks */
:root { --hl-yellow: rgba(250, 204, 21, .38); --hl-green: rgba(74, 222, 128, .32); --hl-blue: rgba(96, 165, 250, .32); --hl-pink: rgba(244, 114, 182, .32); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hl-yellow: rgba(250, 204, 21, .28); --hl-green: rgba(74, 222, 128, .24); --hl-blue: rgba(96, 165, 250, .26); --hl-pink: rgba(244, 114, 182, .26); } }
:root[data-theme="dark"] { --hl-yellow: rgba(250, 204, 21, .28); --hl-green: rgba(74, 222, 128, .24); --hl-blue: rgba(96, 165, 250, .26); --hl-pink: rgba(244, 114, 182, .26); }
mark.hl { color: inherit; border-radius: 3px; padding: 0 1px; cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: box-shadow .3s; }
mark.hl-yellow, .hl-dot.hl-yellow, .hl-sheet-q.hl-yellow, .hl-item.hl-yellow { background: var(--hl-yellow); }
mark.hl-green, .hl-dot.hl-green, .hl-sheet-q.hl-green, .hl-item.hl-green { background: var(--hl-green); }
mark.hl-blue, .hl-dot.hl-blue, .hl-sheet-q.hl-blue, .hl-item.hl-blue { background: var(--hl-blue); }
mark.hl-pink, .hl-dot.hl-pink, .hl-sheet-q.hl-pink, .hl-item.hl-pink { background: var(--hl-pink); }
mark.hl-noted::after { content: "✎"; font-family: var(--f-ui); font-size: .7em; vertical-align: super; margin-left: 2px; color: var(--accent-ink); }
mark.hl:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
mark.hl-flash { box-shadow: 0 0 0 3px var(--accent); }

.hl-bar { position: absolute; z-index: 85; display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); font-family: var(--f-ui); }
.hl-pop { flex-direction: column; align-items: stretch; border-radius: 16px; padding: 10px; max-width: min(340px, calc(100vw - 24px)); }
.hl-pop-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hl-pop-note { font-size: 14px; line-height: 1.5; color: var(--ink-soft); padding: 2px 4px 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; overflow-wrap: anywhere; }
.hl-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; flex: 0 0 auto; }
.hl-dot.on { border-color: var(--ink); }
.hl-sep { width: 1px; align-self: stretch; background: var(--line-strong); margin: 0 2px; }
.hl-act { border: 0; background: none; color: var(--ink); font: 600 13.5px var(--f-ui); padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.hl-act:hover { background: var(--bg-2); }
.hl-del { color: var(--accent-2, #be123c); }

.hl-sheet-back { position: fixed; inset: 0; z-index: 95; background: rgba(8, 12, 28, .45); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
@media (min-width: 700px) { .hl-sheet-back { align-items: center; } }
.hl-sheet { width: 100%; max-width: 520px; max-height: 80vh; overflow: auto; background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--shadow-lg); font-family: var(--f-ui); }
.hl-sheet h3 { margin: 0 0 10px; font-size: 1.05rem; }
.hl-sheet-q { padding: 10px 12px; border-radius: 10px; font-family: var(--f-body, inherit); font-size: 15px; line-height: 1.5; margin-bottom: 10px; overflow-wrap: anywhere; }
.hl-sheet textarea { width: 100%; box-sizing: border-box; font: 15px/1.5 var(--f-ui); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); resize: vertical; }
.hl-sheet-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.hl-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.hl-item { display: block; padding: 9px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.hl-item-note { margin: 4px 4px 0; font-size: 13.5px; color: var(--muted); }
.hl-toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 99; background: var(--ink); color: var(--bg); font: 600 14px var(--f-ui); padding: 9px 16px; border-radius: 999px; box-shadow: var(--shadow-lg); transition: opacity .3s; }
.hl-toast.out { opacity: 0; }
@media (min-width: 900px) { .hl-toast { bottom: 32px; } }

.note-tools { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.nt-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); font: 600 12.5px var(--f-ui); padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.nt-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.nt-btn.on { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.nt-btn.on svg { fill: currentColor; }
.nt-mark { width: 14px; height: 10px; border-radius: 3px; background: var(--hl-yellow); }

.j-bm { list-style: none; padding: 0; margin: 0; }
.article .j-bm { padding-left: 0; }
.j-bm li { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); margin: 0; }
.j-bm li::before { content: none; }
.j-bm a { flex: 1; display: flex; gap: 12px; align-items: center; padding: 10px 0; color: inherit; text-decoration: none; min-width: 0; }
.j-bm strong { display: block; font-weight: 600; }
.j-bm small { color: var(--muted); font-size: .85rem; }
.nt-ribbon { flex: 0 0 12px; height: 18px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); }
.j-hl-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.j-hl-filter .chip.on { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.j-hl-filter .hl-dot { width: 16px; height: 16px; display: inline-block; }
.j-hl-page h3 { font-size: 1rem; margin: 18px 0 8px; }
.j-hl { position: relative; margin-bottom: 8px; padding-right: 36px; }
.j-hl .jdel { position: absolute; top: 10px; right: 8px; }
.j-hl.hl-edge-yellow { border-left-color: rgb(234, 179, 8); } .j-hl.hl-edge-green { border-left-color: rgb(34, 197, 94); }
.j-hl.hl-edge-blue { border-left-color: rgb(59, 130, 246); } .j-hl.hl-edge-pink { border-left-color: rgb(236, 72, 153); }
.j-hl-q { color: var(--ink); text-decoration: none; display: block; overflow-wrap: anywhere; }
.j-hl-n { margin: 6px 0 0; font-family: var(--f-ui); font-size: 14px; color: var(--ink-soft); }

/* bookmark jump */
.bm-flash { animation: bmflash 2.2s ease-out; border-radius: 6px; }
@keyframes bmflash { 0% { box-shadow: -6px 0 0 0 var(--accent), 0 0 0 6px var(--accent-soft); background: var(--accent-soft); } 100% { box-shadow: -6px 0 0 0 transparent, 0 0 0 6px transparent; background: transparent; } }
.hl-toast.bm-go { border: 0; cursor: pointer; }

/* home: welcome back card */
.welcome-back { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 22px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow); font-family: var(--f-ui); }
.welcome-back[hidden] { display: none; }
.wb-text b { display: block; font-size: 15px; }
.wb-text span { font-size: 13.5px; color: var(--muted); }
.wb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wb-actions .btn { padding: 9px 14px; font-size: 14px; max-width: 100%; }

/* text size: scale the reading area only (header, tab bar and pop-ups keep their size) */
main { zoom: var(--zoom, 1); }
.size-btn span { font: 700 15px/1 var(--f-display); letter-spacing: -.02em; }
.size-btn small { font-size: 11px; margin-left: 1px; }
.ts-panel { position: absolute; z-index: 88; width: 248px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); font-family: var(--f-ui); color: var(--ink); }
.ts-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.ts-head span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ts-row { display: flex; align-items: center; gap: 10px; }
.ts-step { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font: 700 14px var(--f-display); cursor: pointer; }
.ts-step.ts-big { font-size: 19px; }
.ts-step:disabled { opacity: .35; cursor: default; }
.ts-dots { flex: 1; display: flex; justify-content: space-between; align-items: center; }
.ts-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); background: transparent; padding: 0; cursor: pointer; }
.ts-dot.on { background: var(--accent); border-color: var(--accent); transform: scale(1.25); }
.ts-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.ts-reset { margin-top: 8px; border: 0; background: none; color: var(--accent-ink); font: 600 13px var(--f-ui); padding: 0; cursor: pointer; }
/* keep large text sizes inside narrow screens */
.idea summary > .t { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
main p, main li, main h1, main h2, main h3, main summary, .gl, .gl .h { overflow-wrap: break-word; min-width: 0; }
.page-head { overflow: hidden; }

/* ==========================================================================
   AI Journey blocks
   ========================================================================== */

/* hero art: neural network with travelling signals */
.netart .node { transform-box: fill-box; transform-origin: center; animation: pulse 3.2s ease-in-out infinite; }
.netart .sig { stroke-dasharray: 10 400; stroke-dashoffset: 410; animation: signal 3.6s linear infinite; opacity: .9; }
.netart.still .node, .netart.still .sig { animation: none; }
.netart.still .sig { display: none; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes signal { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .netart .node, .netart .sig { animation: none; } .netart .sig { display: none; } }

/* brand mark */
.brand-mark svg { width: 20px; height: 20px; }

/* home: track staircase */
.ladder-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 900px) {
  .ladder-steps { grid-template-columns: repeat(5, 1fr); align-items: end; }
  .ladder-steps .step { min-height: calc(214px + var(--i) * 26px); }
}
.ladder-steps .step { display: flex; flex-direction: column; gap: 8px; padding: 18px 16px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.ladder-steps .step:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--ink); }
.ladder-steps .lvl { font-family: var(--f-mono); font-size: 30px; font-weight: 600; line-height: 1; color: var(--c); filter: var(--glyph-filter, none); }
.ladder-steps .txt small { display: block; font-family: var(--f-ui); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ladder-steps .txt strong { display: block; font-family: var(--f-display); font-size: 20px; line-height: 1.2; margin: 2px 0 4px; }
.ladder-steps .who { display: block; font-family: var(--f-ui); font-size: 13.5px; line-height: 1.45; color: var(--ink-soft); }
.ladder-steps .st { margin-top: auto; display: flex; align-items: center; gap: 8px; font-family: var(--f-ui); font-size: 12px; color: var(--muted); }
.ladder-steps .meter { flex: 0 0 56px; }

/* section page: level card for tracks */
.level-card { display: grid; gap: 4px 28px; margin: 0 0 28px; padding: 18px 20px; border-radius: var(--radius); background: color-mix(in srgb, var(--c) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 28%, var(--line)); }
@media (min-width: 720px) { .level-card { grid-template-columns: 1fr 1fr; } }
.level-card h4 { font-family: var(--f-ui); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--c); filter: var(--glyph-filter, none); margin: 6px 0 4px; }
.level-card p, .level-card ul { font-size: 16px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 8px; }
.level-card ul { padding-left: 1.1em; }

/* code */
code { font-family: var(--f-mono); font-size: .86em; padding: .1em .35em; border-radius: 5px; background: var(--bg-2); border: 1px solid var(--line); }
.code-wrap { margin: 1.4em 0 1.6em; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); overflow: hidden; background: var(--code-bg); }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 6px 14px; font-family: var(--f-ui); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--code-muted); border-bottom: 1px solid color-mix(in srgb, var(--code-ink) 12%, transparent); }
.code-copy, .prompt-copy { font-family: var(--f-ui); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; padding: 3px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); background: transparent; color: inherit; cursor: pointer; }
pre.code { margin: 0; padding: 14px 16px 16px; overflow-x: auto; font-family: var(--f-mono); font-size: 14px; line-height: 1.6; color: var(--code-ink); tab-size: 4; }
pre.code code { font-size: inherit; padding: 0; background: none; border: 0; }
.c-com { color: var(--code-muted); font-style: italic; } .c-str { color: #86EFAC; } .c-num { color: #FCA5A5; } .c-kw { color: #C4B5FD; font-weight: 600; } .c-fn { color: #7DD3FC; }

/* prompts */
.prompt { position: relative; margin: 1.4em 0 1.6em; padding: 14px 18px 16px; border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.prompt-label { font-family: var(--f-ui); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin: 0 70px 6px 0; }
.prompt-text { font-family: var(--f-mono); font-size: 14.5px; line-height: 1.65; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt-text p { margin: 0 0 .6em; } .prompt-text p:last-child { margin: 0; }
.prompt-copy { position: absolute; top: 10px; right: 12px; color: var(--accent-ink); }
.prompt.bad { border-color: color-mix(in srgb, #DC2626 40%, var(--line)); background: color-mix(in srgb, #DC2626 5%, var(--surface)); }
.prompt.bad .prompt-label { color: #B91C1C; }
.prompt.good { border-color: color-mix(in srgb, #16A34A 40%, var(--line)); background: color-mix(in srgb, #16A34A 5%, var(--surface)); }
.prompt.good .prompt-label { color: #15803D; }
:root[data-theme="dark"] .prompt.bad .prompt-label { color: #FCA5A5; } :root[data-theme="dark"] .prompt.good .prompt-label { color: #86EFAC; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .prompt.bad .prompt-label { color: #FCA5A5; } :root:not([data-theme="light"]) .prompt.good .prompt-label { color: #86EFAC; } }

/* filterable timeline */
.tl-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 1em 0 .4em; }
.tl-filter .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tl-count { font-family: var(--f-ui); font-size: 12.5px; color: var(--muted); margin-left: 4px; }
.timeline li[hidden] { display: none; }

/* demos (next word, gradient descent, tokens) */
.demo-next, .demo-gd, .demo-tokens { margin: 1.6em 0 1.8em; padding: 6px 20px 18px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); }
.demo-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 12px 0 6px; }
.demo-head .lab { font-family: var(--f-ui); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.dn-prompt { font-family: var(--f-mono); font-size: 16px; margin: 6px 0 12px; }
.dn-blank { display: inline-block; min-width: 3ch; padding: 0 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.dn-temp { display: flex; align-items: center; gap: 10px; font-family: var(--f-ui); font-size: 14px; color: var(--ink-soft); }
.dn-temp input { flex: 1; accent-color: var(--accent); min-width: 0; height: 28px; }
.dn-temp b { min-width: 3.2ch; text-align: right; font-family: var(--f-mono); color: var(--ink); }
.dn-bars { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 7px; }
.dn-bars li { display: grid; grid-template-columns: minmax(70px, 30%) 1fr 48px; align-items: center; gap: 10px; margin: 0; font-family: var(--f-ui); font-size: 14px; }
.dn-bars .w { font-family: var(--f-mono); overflow-wrap: anywhere; }
.dn-bars .track, .finder-bars .track { display: block; height: 10px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.dn-bars .fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s ease; }
.dn-bars .pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 4px; }
.demo-actions .btn { padding: 9px 16px; font-size: 14px; }
.dn-out, .gd-out { font-family: var(--f-ui); font-size: 14px; margin: 8px 0 0; min-height: 2.8em; }
.gd-plot { display: block; width: 100%; max-width: 520px; height: auto; margin: 4px auto 10px; overflow: visible; }
.gd-ball { transition: cx .2s ease, cy .2s ease; }
.demo-tokens textarea { width: 100%; font: 15px/1.5 var(--f-mono); padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); resize: vertical; }
.tk-count { font-family: var(--f-ui); font-size: 12.5px; color: var(--muted); }
.tk-out { margin: 12px 0 6px; font-family: var(--f-mono); font-size: 15px; line-height: 2.1; overflow-wrap: anywhere; }
.tk { padding: 3px 1px; border-radius: 4px; margin-right: 1px; }
.tk0 { background: color-mix(in srgb, #6366F1 22%, transparent); } .tk1 { background: color-mix(in srgb, #10B981 22%, transparent); } .tk2 { background: color-mix(in srgb, #F59E0B 24%, transparent); }
.tk3 { background: color-mix(in srgb, #EC4899 20%, transparent); } .tk4 { background: color-mix(in srgb, #06B6D4 22%, transparent); }
.tk-note { font-family: var(--f-ui); font-size: 12.5px; margin: 0; }

/* "as of" stamp for fast-moving facts */
.asof { display: inline-block; margin: 0 2px; padding: 0 7px; border-radius: 99px; font-family: var(--f-ui); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.8; vertical-align: 2px; color: var(--muted); border: 1px dashed var(--line-strong); white-space: nowrap; }

/* tables inside articles (scroll sideways on narrow screens rather than widening the page) */
.article table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.4em 0 1.6em; font-family: var(--f-ui); font-size: 14.5px; line-height: 1.5; }
.article th, .article td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.article th { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--line-strong); white-space: nowrap; }
.article tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-2) 55%, transparent); }
.article caption { caption-side: bottom; padding-top: 6px; font-size: 12.5px; color: var(--muted); text-align: left; }

/* home: "I want to…" task index */
.task-search input { width: 100%; max-width: 560px; font: 16px var(--f-ui); padding: 12px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); margin-bottom: 18px; }
.task-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.task-groups { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .task-groups { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .task-groups { grid-template-columns: repeat(4, 1fr); } }
.task-group { padding: 16px 18px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.task-group[hidden] { display: none; }
.task-group h3 { font-size: 13px; font-family: var(--f-ui); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 8px; }
.task-group ul { list-style: none; margin: 0; padding: 0; }
.task-group li { border-top: 1px solid var(--line); }
.task-group li:first-child { border-top: 0; }
.task-group li[hidden] { display: none; }
.task-group a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; font-family: var(--f-ui); font-size: 14.5px; line-height: 1.4; color: var(--ink); text-decoration: none; }
.task-group a::after { content: "→"; color: var(--muted); transition: transform .15s, color .15s; }
.task-group a:hover { color: var(--accent-ink); }
.task-group a:hover::after { color: var(--accent); transform: translateX(3px); }
.task-none { margin-top: 12px; font-family: var(--f-ui); }

/* home: latest change line */
.latest { margin: 18px 0 0; font-family: var(--f-ui); font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.latest[hidden] { display: none; }

/* what's new: change log */
.changelog { list-style: none; margin: 1.2em 0 2em; padding: 0; display: grid; gap: 14px; }
.article .changelog { padding-left: 0; }
.changelog li { margin: 0; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); }
.changelog li.kind-field { border-left-color: var(--accent-2); }
.cl-head { display: flex; align-items: center; gap: 10px; font-family: var(--f-ui); font-size: 13px; color: var(--muted); }
.changelog h3 { margin: 8px 0 4px; font-size: 19px; }
.changelog p { margin: 0 0 10px; font-size: 16px; color: var(--ink-soft); }
.cl-pages { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-pages .chip { font-size: 12.5px; padding: 4px 10px; }
.cl-pages .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
