/* ==========================================================================
   Quest 4 Religious Truth — design system
   Layout concept: a trail guide. Dusk-sky bands frame the page, a 760px
   reading column carries each lesson, wide "map" panels hold charts.
   ========================================================================== */

:root {
  /* Color */
  --bg: #F4F6FB;           /* morning sky */
  --surface: #FFFFFF;
  --surface-2: #EBEFF8;
  --ink: #1A2040;          /* dusk indigo */
  --ink-2: #454E72;
  --ink-3: #626A8C;
  --line: #D6DCEC;
  --dusk: #1D2348;
  --dusk-2: #2A3266;
  --on-dusk: #F7F4EE;
  --on-dusk-2: #C9CDE6;
  --ember: #C24A15;        /* the hiker's jacket */
  --ember-ink: #B03F0C;
  --sun: #F2B33D;          /* sunset gold */
  --pine: #2B7A54;
  --rose: #BE3434;
  --jud: #1F5FA8;          /* tekhelet blue */
  --jud-soft: #E3EDFA;
  --chr: #7A3D92;          /* liturgical purple */
  --chr-soft: #F2E8F7;
  --mark: #FFE9A8;
  --shadow-1: 0 1px 2px rgba(26, 32, 64, .06), 0 4px 14px rgba(26, 32, 64, .07);
  --shadow-2: 0 2px 6px rgba(26, 32, 64, .08), 0 18px 40px rgba(26, 32, 64, .12);
  --m: #E0672A;            /* module accent, set per page */

  /* Type */
  --font-display: "Abril Fatface", "Rockwell", "Georgia", serif;
  --font-body: "Atkinson Hyperlegible", "Verdana", "Segoe UI", system-ui, sans-serif;
  --font-hebrew: "Frank Ruhl Libre", "Times New Roman", "David", serif;
  --t-xs: .875rem;
  --t-sm: 1rem;
  --t-body: 1.25rem;
  --t-lg: 1.4rem;
  --t-h3: 1.55rem;
  --t-h2: clamp(1.9rem, 1.35rem + 1.8vw, 2.6rem);
  --t-h1: clamp(2.3rem, 1.4rem + 3.4vw, 4rem);
  --lh: 1.65;

  /* Space & shape */
  --gutter: clamp(16px, 4vw, 32px);
  --read: 46rem;
  --wide: 66rem;
  --max: 76rem;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --elev-h: 46px;
  --header-h: 72px;

  --m-soft: color-mix(in srgb, var(--m) 13%, var(--surface));
  --m-ink: color-mix(in srgb, var(--m) 78%, var(--ink));
  --m-line: color-mix(in srgb, var(--m) 35%, var(--line));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1328; --surface: #181E3B; --surface-2: #20274A;
    --ink: #EEF1FA; --ink-2: #BEC5E2; --ink-3: #98A0C4; --line: #2E3764;
    --dusk: #0B0E21; --dusk-2: #161B3A; --on-dusk: #F7F4EE; --on-dusk-2: #C1C6E2;
    --ember: #CF5520; --ember-ink: #F7A06A; --sun: #F5BF55; --pine: #5FC796; --rose: #F27E7E;
    --jud: #86B6F2; --jud-soft: #1A2A4C; --chr: #D29BE6; --chr-soft: #2E2147; --mark: #5A4A16;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1328; --surface: #181E3B; --surface-2: #20274A;
  --ink: #EEF1FA; --ink-2: #BEC5E2; --ink-3: #98A0C4; --line: #2E3764;
  --dusk: #0B0E21; --dusk-2: #161B3A; --on-dusk: #F7F4EE; --on-dusk-2: #C1C6E2;
  --ember: #CF5520; --ember-ink: #F7A06A; --sun: #F5BF55; --pine: #5FC796; --rose: #F27E7E;
  --jud: #86B6F2; --jud-soft: #1A2A4C; --chr: #D29BE6; --chr-soft: #2E2147; --mark: #5A4A16;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

/* Text-size steps (Reading comfort panel) */
html { font-size: 100%; }
html[data-text="1"] { font-size: 112.5%; }
html[data-text="2"] { font-size: 125%; }
html[data-text="3"] { font-size: 140%; }
html[data-spacing="roomy"] { --lh: 1.9; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--elev-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--ember-ink); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .14em; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0; text-wrap: balance; color: var(--ink); }
h1, h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: .005em; }
h3, h4 { font-family: var(--font-body); font-weight: 700; }
p { margin: 0; }
strong { font-weight: 700; color: var(--ink); }
mark { background: var(--mark); color: inherit; padding: 0 .15em; border-radius: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.he { font-family: var(--font-hebrew); direction: rtl; unicode-bidi: isolate; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 12px; }
.ico { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.ico.fill { fill: currentColor; stroke: none; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.read { width: 100%; max-width: calc(var(--read) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 8vw, 104px); }
.section-head { display: grid; gap: 14px; max-width: 46rem; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head.center { margin-inline: auto; text-align: center; justify-items: center; }
.section-head h2 { font-size: var(--t-h2); }
.section-head p { color: var(--ink-2); font-size: var(--t-lg); }
.eyebrow { font-size: var(--t-sm); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--m-ink); }

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: 12px 24px; border-radius: 999px;
  font-weight: 700; font-size: 1.1rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ember); color: #FFFFFF; box-shadow: 0 6px 18px color-mix(in srgb, var(--ember) 35%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--ember) 88%, #000); }
.btn-module { background: var(--m-ink); color: var(--surface); }
.btn-ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn-soft { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-soft:hover { border-color: var(--m-line); }
.btn-sm { min-height: 42px; padding: 8px 16px; font-size: 1rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.chip {
  display: inline-flex; align-items: center; gap: .4em; padding: 4px 12px; border-radius: 999px;
  font-size: var(--t-sm); font-weight: 700; background: var(--surface-2); color: var(--ink-2); line-height: 1.5; white-space: nowrap;
}
.chip-done { background: color-mix(in srgb, var(--pine) 16%, var(--surface)); color: var(--pine); }
.chip-progress { background: color-mix(in srgb, var(--sun) 22%, var(--surface)); color: var(--ink); }
.stars { display: inline-flex; gap: 2px; color: var(--sun); }
.stars .ico { width: 1.05em; height: 1.05em; }
.stars .off { color: var(--line); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-mark { width: 42px; height: 42px; flex: none; }
.brand-text { display: grid; line-height: 1; }
.brand-quest { font-family: var(--font-display); font-size: 1.65rem; letter-spacing: .04em; color: var(--ink); }
.brand-sub { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 10px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: 1.05rem;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink);
}
.icon-btn:hover { border-color: var(--ink-3); }
.icon-btn .ico { width: 24px; height: 24px; }
.icon-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.icon-btn .aa { font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; }
.menu-btn { display: none; }
@media (max-width: 960px) {
  .menu-btn { display: inline-grid; }
  .nav {
    position: absolute; inset: 100% 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px var(--gutter) 18px; box-shadow: var(--shadow-2);
  }
  .nav a { padding: 14px 16px; font-size: 1.2rem; }
  .nav:not(.open) { display: none; }
}
@media (max-width: 520px) {
  .brand-sub { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .header-actions { gap: 4px; }
  .icon-btn { width: 44px; height: 44px; }
}

/* ---------- Reading comfort panel ---------- */
.comfort {
  position: absolute; right: var(--gutter); top: calc(100% + 8px); z-index: 60;
  width: min(380px, calc(100vw - 2 * var(--gutter)));
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2);
  padding: 20px; display: grid; gap: 18px;
}
.comfort h2 { font-family: var(--font-body); font-weight: 700; font-size: 1.2rem; }
.comfort-row { display: grid; gap: 8px; }
.comfort-label { font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.seg button {
  min-height: 44px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-weight: 700; font-size: 1rem; color: var(--ink-2);
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle-row label { font-weight: 700; font-size: 1.05rem; }
.toggle-row small { display: block; font-weight: 400; color: var(--ink-3); font-size: var(--t-xs); }
.switch { position: relative; width: 58px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch input:checked + span { background: var(--pine); }
.switch input:checked + span::after { transform: translateX(26px); }
.switch input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }
.range { width: 100%; accent-color: var(--ember); }

/* ---------- Hero (home) ---------- */
.hero { position: relative; isolation: isolate; color: var(--on-dusk); background: var(--dusk); overflow: hidden; }
.hero-photo { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: 72% 40%; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(20, 24, 54, .96) 0%, rgba(20, 24, 54, .86) 38%, rgba(20, 24, 54, .25) 72%, rgba(20, 24, 54, .1) 100%),
    linear-gradient(0deg, rgba(20, 24, 54, .75) 0%, transparent 35%);
}
.hero-inner { display: grid; gap: 28px; padding-block: clamp(56px, 9vw, 120px) clamp(48px, 7vw, 96px); }
.hero-copy { max-width: 40rem; display: grid; gap: 22px; }
.hero .eyebrow { color: var(--sun); }
.lockup { display: grid; gap: .1em; line-height: .95; text-transform: uppercase; }
.lockup .lk-quest {
  font-family: var(--font-display); font-size: clamp(4.2rem, 2.4rem + 8vw, 8.5rem); letter-spacing: .06em;
  color: transparent; -webkit-text-stroke: 2px var(--on-dusk); paint-order: stroke fill; margin-bottom: .16em;
}
@supports not (-webkit-text-stroke: 2px white) { .lockup .lk-quest { color: var(--on-dusk); } }
.lockup .lk-sub { font-family: var(--font-display); font-size: clamp(1.45rem, .9rem + 2.4vw, 2.7rem); letter-spacing: .05em; color: var(--on-dusk); }
.lockup .lk-sub b { color: var(--sun); font-weight: 400; }
.hero .lede { font-size: clamp(1.3rem, 1.1rem + .6vw, 1.6rem); color: var(--on-dusk); max-width: 34rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .btn-ghost { color: var(--on-dusk); }
.hero-facts { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--on-dusk-2); font-size: 1.05rem; }
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts .ico { color: var(--sun); }

/* ---------- Stats strip ---------- */
.strip { background: var(--surface); border-bottom: 1px solid var(--line); }
.strip-inner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.strip-item { padding: 22px 12px; text-align: center; border-left: 1px solid var(--line); }
.strip-item:first-child { border-left: 0; }
.strip-num { font-family: var(--font-display); font-size: 2.3rem; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.strip-label { font-size: 1rem; color: var(--ink-2); margin-top: 6px; }
@media (max-width: 640px) {
  .strip-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip-item:nth-child(3) { border-left: 0; }
  .strip-item:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- Quest trail (home) ---------- */
.trail-section { position: relative; background: linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--sun) 10%, var(--bg)) 100%); }
.trail-top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.trail-status { display: flex; flex-wrap: wrap; gap: 10px; }
.trail-status .chip { font-size: 1.05rem; padding: 8px 14px; background: var(--surface); border: 1px solid var(--line); }
.trail-map {
  position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
.trail-art { display: block; width: 100%; height: auto; }
.trail-art .sky { fill: color-mix(in srgb, var(--sun) 16%, var(--surface)); }
.trail-art .ridge-far { fill: color-mix(in srgb, var(--chr) 16%, var(--surface)); }
.trail-art .ridge-mid { fill: color-mix(in srgb, var(--jud) 18%, var(--surface)); }
.trail-art .ridge-near { fill: color-mix(in srgb, var(--pine) 20%, var(--surface)); }
.trail-art .sunball { fill: color-mix(in srgb, var(--sun) 55%, var(--surface)); }
.trail-art .path-bg { fill: none; stroke: var(--surface); stroke-width: 14; stroke-linecap: round; opacity: .9; }
.trail-art .path { fill: none; stroke: var(--ink-3); stroke-width: 4; stroke-dasharray: 2 12; stroke-linecap: round; }
.trail-art .path-done { fill: none; stroke: var(--ember); stroke-width: 5; stroke-linecap: round; }
.trail-art .contour { fill: none; stroke: var(--ink-3); stroke-width: 1; opacity: .18; }
.waypoints { list-style: none; margin: 0; padding: 0; }
.wp { position: absolute; transform: translate(-50%, -50%); width: 150px; display: grid; justify-items: center; text-align: center; gap: 6px; }
.wp a { text-decoration: none; color: var(--ink); display: grid; justify-items: center; gap: 6px; }
.wp-marker {
  position: relative; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--m); border: 4px solid var(--m); box-shadow: var(--shadow-1);
  transition: transform .2s ease;
}
.wp-marker .ico { width: 30px; height: 30px; stroke-width: 2.2; }
.wp a:hover .wp-marker, .wp a:focus-visible .wp-marker { transform: scale(1.08); }
.wp-num { position: absolute; top: -8px; left: -8px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: .85rem; font-weight: 700; display: grid; place-items: center; }
.wp-check { position: absolute; bottom: -6px; right: -8px; width: 28px; height: 28px; border-radius: 50%; background: var(--sun); color: var(--ink); display: none; place-items: center; border: 2px solid var(--surface); }
.wp-check .ico { width: 16px; height: 16px; stroke-width: 3; }
.wp.is-done .wp-marker { background: var(--m); color: #FFFFFF; }
.wp.is-done .wp-check { display: grid; }
.wp.is-next .wp-marker::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 3px solid var(--m); opacity: .6;
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(.85); opacity: .8; } 100% { transform: scale(1.35); opacity: 0; } }
.wp-label { display: grid; gap: 0; background: color-mix(in srgb, var(--surface) 92%, transparent); padding: 4px 10px 6px; border-radius: 10px; line-height: 1.25; }
.wp-stop { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--m-ink); }
.wp-title { font-size: .98rem; font-weight: 700; color: var(--ink); }
.wp-hiker { position: absolute; width: 46px; height: 58px; transform: translate(-50%, -100%); pointer-events: none; transition: left .6s ease, top .6s ease; }
@media (max-width: 860px) {
  .trail-art { display: none; }
  .trail-map { background: var(--surface); padding: 20px 16px; }
  .waypoints { display: grid; gap: 0; position: relative; }
  .waypoints::before { content: ""; position: absolute; left: 31px; top: 30px; bottom: 30px; border-left: 4px dotted var(--line); }
  .wp { position: relative; transform: none; width: auto; left: auto !important; top: auto !important; justify-items: stretch; text-align: left; padding-block: 10px; }
  .wp a { grid-template-columns: 64px 1fr; align-items: center; justify-items: start; gap: 16px; }
  .wp-label { background: none; padding: 0; }
  .wp-title { font-size: 1.15rem; }
  .wp-hiker { display: none; }
}

/* ---------- Generic cards/grids ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.how-step { position: relative; display: grid; gap: 12px; align-content: start; padding: 26px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.how-step .how-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--m-soft); color: var(--m-ink); }
.how-step .how-icon .ico { width: 28px; height: 28px; }
.how-step h3 { font-size: 1.3rem; }
.how-step p { color: var(--ink-2); font-size: 1.1rem; }
.how-step .how-time { position: absolute; top: 22px; right: 20px; font-size: var(--t-sm); font-weight: 700; color: var(--ink-3); }

/* Meet the guide */
.meet { background: var(--dusk); color: var(--on-dusk); overflow: hidden; }
.meet-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.meet h2 { color: var(--on-dusk); font-size: var(--t-h2); }
.meet .eyebrow { color: var(--sun); }
.meet p { color: var(--on-dusk-2); font-size: var(--t-lg); }
.meet-copy { display: grid; gap: 18px; }
.meet-stage { position: relative; aspect-ratio: 1 / 1; max-width: 460px; width: 100%; margin-inline: auto; perspective: 900px; }
.meet-stage::before { content: ""; position: absolute; inset: 8% 6% 0; border-radius: 50%; background: radial-gradient(circle at 50% 45%, rgba(242, 179, 61, .45), rgba(242, 179, 61, 0) 65%); }
.meet-stage .netiva { position: relative; width: 100%; height: 100%; }
.meet-bubble {
  position: relative; background: var(--surface); color: var(--ink); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow-2); font-size: 1.15rem;
}
.meet-bubble::after { content: ""; position: absolute; left: -10px; top: 26px; border: 10px solid transparent; border-right-color: var(--surface); border-left: 0; }
.meet-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--on-dusk-2); font-size: 1.1rem; }
.meet-facts li { display: flex; gap: 10px; align-items: baseline; }
.meet-facts .ico { color: var(--sun); }
@media (max-width: 860px) { .meet-grid { grid-template-columns: minmax(0, 1fr); } .meet-stage { max-width: 320px; } .meet-bubble::after { display: none; } }

/* Symbols flip cards */
.symbols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1080px) { .symbols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .symbols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.flip { perspective: 900px; min-height: 260px; }
.flip-btn { all: unset; display: block; position: relative; width: 100%; height: 100%; min-height: 260px; cursor: pointer; border-radius: var(--r); }
.flip-btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.flip-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.flip.is-flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); display: grid; align-content: center; justify-items: center; gap: 10px; padding: 16px; text-align: center;
}
.flip-face svg:not(.ico) { width: 100%; height: 130px; }
.flip-face h3 { font-size: 1.1rem; }
.flip-tag { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 2px 10px; border-radius: 999px; }
.tag-j { background: var(--jud-soft); color: var(--jud); }
.tag-c { background: var(--chr-soft); color: var(--chr); }
.tag-b { background: color-mix(in srgb, var(--pine) 15%, var(--surface)); color: var(--pine); }
.flip-back { transform: rotateY(180deg); background: var(--surface-2); align-content: center; }
.flip-back p { font-size: 1rem; line-height: 1.5; color: var(--ink); }
.flip-hint { font-size: .85rem; color: var(--ink-3); }
.tilt { transition: transform .2s ease; transform-style: preserve-3d; }

/* Features */
.feature { display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: start; }
.feature .f-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ember-ink); }
.feature .f-ico .ico { width: 26px; height: 26px; }
.feature h3 { font-size: 1.25rem; margin-bottom: 4px; }
.feature p { color: var(--ink-2); font-size: 1.08rem; }

/* FAQ */
.faq { display: grid; gap: 12px; max-width: 52rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0 22px; }
.faq summary { cursor: pointer; list-style: none; padding: 20px 0; font-weight: 700; font-size: 1.2rem; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ico { transition: transform .2s; color: var(--ink-3); }
.faq details[open] summary .ico { transform: rotate(180deg); }
.faq details p { padding-bottom: 20px; color: var(--ink-2); }

.cta-band { background: var(--dusk); color: var(--on-dusk); border-radius: var(--r-lg); padding: clamp(32px, 5vw, 56px); display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.cta-band h2 { color: var(--on-dusk); font-size: var(--t-h2); }
.cta-band p { color: var(--on-dusk-2); margin-top: 8px; }
@media (max-width: 760px) { .cta-band { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--dusk); color: var(--on-dusk-2); padding-block: 56px 40px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer h2 { font-family: var(--font-body); font-weight: 700; font-size: 1rem; letter-spacing: .1em; text-transform: uppercase; color: var(--on-dusk); margin-bottom: 12px; }
.site-footer a { color: var(--on-dusk); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 1.05rem; }
.footer-brand .brand-quest { color: var(--on-dusk); }
.footer-brand p { margin-top: 12px; max-width: 30rem; font-size: 1.05rem; }
.footer-base { margin-top: 36px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .14); display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; font-size: .95rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Page header (inner pages) ---------- */
.page-head { background: var(--m-soft); border-bottom: 1px solid var(--m-line); padding-block: clamp(40px, 6vw, 72px); }
.page-head h1 { font-size: var(--t-h1); }
.page-head p { font-size: var(--t-lg); color: var(--ink-2); max-width: 44rem; margin-top: 14px; }
.crumbs { font-size: 1rem; margin-bottom: 14px; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); }

/* Lessons index */
.lesson-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 760px) { .lesson-cards { grid-template-columns: minmax(0, 1fr); } }
.lesson-card {
  display: grid; grid-template-columns: 150px 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; text-decoration: none; color: var(--ink); transition: box-shadow .2s, transform .2s;
}
.lesson-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.lc-art { background: var(--m-soft); display: grid; place-items: center; padding: 12px; border-right: 1px solid var(--m-line); }
.lc-art svg { width: 100%; height: auto; }
.lc-body { padding: 20px 22px; display: grid; gap: 8px; align-content: start; }
.lc-body h2 { font-size: 1.6rem; }
.lc-body p { color: var(--ink-2); font-size: 1.05rem; line-height: 1.5; }
.lc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
@media (max-width: 480px) { .lesson-card { grid-template-columns: 1fr; } .lc-art { border-right: 0; border-bottom: 1px solid var(--m-line); max-height: 170px; } .lc-art svg { height: 140px; } }

/* ---------- Lesson page ---------- */
.lesson-hero { background: var(--m-soft); border-bottom: 1px solid var(--m-line); position: relative; overflow: hidden; }
.lesson-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: repeating-radial-gradient(circle at 85% 120%, transparent 0 22px, color-mix(in srgb, var(--m) 14%, transparent) 22px 23px);
}
.lesson-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(20px, 4vw, 56px); align-items: center; padding-block: clamp(32px, 5vw, 64px); }
.lesson-hero h1 { font-size: var(--t-h1); margin-top: 10px; }
.lesson-hero .lede { font-size: var(--t-lg); color: var(--ink-2); margin-top: 14px; max-width: 36rem; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.lesson-meta .chip { background: var(--surface); border: 1px solid var(--m-line); }
.scene-frame { background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--m-line); padding: 14px; box-shadow: var(--shadow-1); transform-style: preserve-3d; }
.scene-frame svg { width: 100%; height: auto; display: block; }
@media (max-width: 820px) { .lesson-hero-grid { grid-template-columns: minmax(0, 1fr); } .scene-frame { max-width: 420px; } }

/* Listen bar */
.listen { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.listen .btn-listen { background: var(--m-ink); color: var(--surface); }
.listen-speed { display: inline-flex; align-items: center; gap: 8px; font-size: 1rem; color: var(--ink-2); }
.listen-speed select { font: inherit; font-size: 1rem; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); min-height: 44px; }
.listen-status { font-size: 1rem; color: var(--ink-3); }

/* Elevation progress bar */
.elev {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--header-h)); z-index: 40;
  height: var(--elev-h); background: color-mix(in srgb, var(--surface) 94%, transparent); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.elev-inner { display: flex; align-items: center; gap: 14px; height: 100%; }
.elev-svg { flex: 1; height: 34px; min-width: 0; }
.elev-svg .elev-base { fill: color-mix(in srgb, var(--m) 14%, var(--surface-2)); }
.elev-svg .elev-fill { fill: var(--m); }
.elev-svg .elev-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2.5; }
.elev-svg .elev-flag { fill: var(--ember); }
.elev-text { font-size: .95rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .elev-text .elev-steps { display: none; } }

/* Steps */
.lesson-body { padding-block: clamp(32px, 5vw, 56px) 24px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(28px, 4vw, 44px); }
.step { position: relative; display: grid; gap: 22px; transition: opacity .3s ease, filter .3s ease; }
.step-head { display: flex; align-items: center; gap: 14px; }
.step-num {
  flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--m); color: #FFFFFF; font-family: var(--font-display); font-size: 1.4rem;
}
.step-head h2 { font-size: clamp(1.65rem, 1.3rem + 1vw, 2.1rem); }
.step > * { min-width: 0; }
.step p { max-width: var(--read); }
html[data-focus="on"] .step:not(.is-current) { opacity: .32; filter: saturate(.4); }
html[data-focus="on"] .step:not(.is-current):hover { opacity: .7; }
.is-reading { background: var(--mark); box-shadow: 0 0 0 8px var(--mark); border-radius: 4px; transition: background .2s; }
.lesson-body .wide { width: min(var(--wide), calc(100vw - 2 * var(--gutter))); margin-inline: calc((min(var(--wide), calc(100vw - 2 * var(--gutter))) - 100%) / -2); }

/* Blocks */
.verse { margin: 0; padding: 22px 24px 22px 28px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--m); position: relative; }
.verse .v-heb { font-family: var(--font-hebrew); font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.3rem); line-height: 1.6; text-align: right; direction: rtl; color: var(--ink); margin-bottom: 8px; font-weight: 500; }
.verse .v-text { font-size: 1.35rem; line-height: 1.55; font-style: italic; }
.verse cite { display: block; margin-top: 10px; font-style: normal; font-weight: 700; font-size: 1rem; color: var(--m-ink); letter-spacing: .03em; }
.callout { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 20px 22px; border-radius: var(--r); align-items: start; }
.callout .c-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.callout .c-ico .ico { width: 24px; height: 24px; }
.callout .c-label { font-size: .85rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; }
.callout-key { background: var(--m-soft); border: 1px solid var(--m-line); }
.callout-key .c-ico { background: var(--m); color: #FFFFFF; }
.callout-key .c-label { color: var(--m-ink); }
.callout-fact { background: color-mix(in srgb, var(--sun) 15%, var(--surface)); border: 1px solid color-mix(in srgb, var(--sun) 45%, var(--line)); }
.callout-fact .c-ico { background: var(--sun); color: #3A2A06; }
.callout-fact .c-label { color: color-mix(in srgb, var(--sun) 45%, var(--ink)); }
.callout-ponder { background: var(--surface); border: 2px dashed var(--m-line); }
.callout-ponder .c-ico { background: var(--surface-2); color: var(--m-ink); }
.callout-ponder .c-label { color: var(--m-ink); }
.ponder-write { margin-top: 12px; width: 100%; min-height: 84px; resize: vertical; font: inherit; font-size: 1.1rem; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); }
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.list li { position: relative; padding-left: 38px; }
.list li::before { content: ""; position: absolute; left: 6px; top: .5em; width: 14px; height: 14px; border-radius: 4px; background: var(--m); transform: rotate(45deg); }
.block-title { font-family: var(--font-body); font-weight: 700; font-size: 1.15rem; color: var(--ink-2); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.block-title::before { content: ""; width: 18px; height: 4px; border-radius: 2px; background: var(--m); }
.verses { display: grid; gap: 12px; }
.verses blockquote { margin: 0; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); display: grid; gap: 6px; }
.verses blockquote p { font-style: italic; font-size: 1.25rem; line-height: 1.5; }
.verses cite { font-style: normal; font-weight: 700; color: var(--m-ink); font-size: 1rem; }

/* Comparison table */
.compare { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.compare-title { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.compare-title h3 { font-size: 1.2rem; }
.compare-scroll { overflow-x: auto; }
.compare table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 1.1rem; line-height: 1.45; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.compare tr:last-child th, .compare tr:last-child td { border-bottom: 0; }
.compare thead th { font-size: 1rem; letter-spacing: .04em; padding-block: 12px; }
.compare thead th.col-j { background: var(--jud-soft); color: var(--jud); }
.compare thead th.col-c { background: var(--chr-soft); color: var(--chr); }
.compare thead th .ico { margin-right: 6px; }
.compare tbody th { width: 24%; font-weight: 700; color: var(--ink); background: var(--surface-2); }
.compare td.col-j { border-left: 4px solid var(--jud); width: 38%; }
.compare td.col-c { border-left: 4px solid var(--chr); width: 38%; }
@media (max-width: 640px) {
  .compare table, .compare thead, .compare tbody, .compare tr, .compare th, .compare td { display: block; min-width: 0; width: auto !important; }
  .compare thead { display: none; }
  .compare tbody tr { border-bottom: 1px solid var(--line); }
  .compare tbody th { padding: 14px 16px 8px; background: none; font-size: 1.15rem; }
  .compare td { border-bottom: 0; padding: 8px 16px 8px 18px; margin: 0 16px 10px 16px; border-radius: 0 10px 10px 0; }
  .compare td.col-j { background: var(--jud-soft); }
  .compare td.col-c { background: var(--chr-soft); }
  .compare td::before { content: attr(data-label); display: block; font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 2px; }
  .compare td.col-j::before { color: var(--jud); }
  .compare td.col-c::before { color: var(--chr); }
}

/* Charts (SVG drawn at build time) */
.chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 20px 16px; }
.chart h3 { font-size: 1.2rem; margin-bottom: 14px; }
.chart svg:not(.ico) { width: 100%; height: auto; display: block; overflow: visible; }
.chart .note { font-size: 1rem; color: var(--ink-3); margin-top: 12px; line-height: 1.5; }
.chart-scroll { overflow-x: auto; }
.chart-scroll > svg { min-width: 560px; }
.c-text { fill: var(--ink); font-family: var(--font-body); }
.c-muted { fill: var(--ink-3); font-family: var(--font-body); }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-track { fill: var(--surface-2); }
.c-j { fill: var(--jud); }
.c-c { fill: var(--chr); }
.c-m { fill: var(--m); }
.c-b { fill: var(--pine); }
.c-stroke-j { stroke: var(--jud); }
.c-stroke-c { stroke: var(--chr); }
.c-stroke-m { stroke: var(--m); }
.c-axis { stroke: var(--ink-3); stroke-width: 2; }
.c-surface { fill: var(--surface); }
.c-soft { fill: var(--m-soft); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 1rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.legend .l-j { background: var(--jud); } .legend .l-c { background: var(--chr); } .legend .l-m { background: var(--m); } .legend .l-b { background: var(--pine); }
.bar-fill { transform-box: fill-box; transform-origin: left center; }
.js .chart.will-animate .bar-fill { transform: scaleX(0); }
.js .chart.in-view .bar-fill { transform: scaleX(1); transition: transform 1s cubic-bezier(.2, .8, .2, 1); }
.js .chart.will-animate .donut-seg { stroke-dashoffset: var(--len); }
.js .chart.in-view .donut-seg { stroke-dashoffset: 0; transition: stroke-dashoffset 1.2s cubic-bezier(.2, .8, .2, 1); }

/* Venn */
.venn-wrap { display: grid; grid-template-columns: 1fr; gap: 10px; }
.venn-svg text { font-family: var(--font-body); }
.venn-lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.venn-col { border-radius: 12px; padding: 14px 16px; }
.venn-col h4 { font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.venn-col ul { margin: 0; padding-left: 1.1em; font-size: 1.05rem; line-height: 1.45; display: grid; gap: 4px; }
.venn-j { background: var(--jud-soft); } .venn-j h4 { color: var(--jud); }
.venn-c { background: var(--chr-soft); } .venn-c h4 { color: var(--chr); }
.venn-b { background: color-mix(in srgb, var(--pine) 13%, var(--surface)); } .venn-b h4 { color: var(--pine); }
@media (max-width: 720px) { .venn-lists { grid-template-columns: 1fr; } }

/* Shema words */
.words { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; direction: rtl; }
.word { direction: ltr; display: grid; justify-items: center; gap: 4px; padding: 14px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-align: center; }
.word .w-heb { font-family: var(--font-hebrew); font-size: 2rem; line-height: 1.3; direction: rtl; color: var(--m-ink); font-weight: 500; }
.word .w-say { font-weight: 700; font-size: 1.05rem; }
.word .w-mean { font-size: .95rem; color: var(--ink-3); }
.word:last-child { background: var(--m); border-color: var(--m); }
.word:last-child .w-heb, .word:last-child .w-say, .word:last-child .w-mean { color: #FFFFFF; }
.words-note { font-size: .95rem; color: var(--ink-3); margin-top: 8px; }
@media (max-width: 720px) { .words { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Icon cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.cards.compact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.icard { display: grid; gap: 8px; align-content: start; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.icard .i-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--m-soft); color: var(--m-ink); }
.icard .i-ico .ico { width: 24px; height: 24px; }
.icard h4 { font-size: 1.15rem; }
.icard p { font-size: 1.05rem; line-height: 1.45; color: var(--ink-2); }
.icard cite { font-style: normal; font-size: .95rem; font-weight: 700; color: var(--m-ink); }
.icard .i-num { font-family: var(--font-display); color: var(--m-ink); font-size: 1.1rem; }

/* Checklist */
.checklist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.checklist-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 20px; background: var(--m-soft); border-bottom: 1px solid var(--m-line); }
.checklist-head h3 { font-size: 1.2rem; }
.checklist ol { list-style: none; margin: 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .box { width: 32px; height: 32px; border-radius: 8px; border: 3px solid var(--m); display: grid; place-items: center; }
.checklist .box .ico { width: 18px; height: 18px; color: var(--ink-3); opacity: .5; }
.checklist .ck-text { font-weight: 700; font-size: 1.1rem; line-height: 1.4; }
.checklist .ck-ref { display: block; font-weight: 400; font-size: .95rem; color: var(--ink-3); }
.checklist .ck-status { font-size: .85rem; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
@media (max-width: 560px) { .checklist li { grid-template-columns: 36px 1fr; } .checklist .ck-status { display: none; } }

/* Flow */
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: flow; }
.flow-step { position: relative; padding: 18px 16px 18px 18px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; align-content: start; }
.flow-step:first-child { border-radius: var(--r) 0 0 var(--r); }
.flow-step:last-child { border-radius: 0 var(--r) var(--r) 0; }
.flow-step + .flow-step { border-left: 0; }
.flow-step::after { content: ""; position: absolute; right: -13px; top: 50%; width: 24px; height: 24px; background: var(--surface); border-top: 1px solid var(--line); border-right: 1px solid var(--line); transform: translateY(-50%) rotate(45deg); z-index: 1; }
.flow-step:last-child::after { display: none; }
.flow-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--m); color: #FFFFFF; font-weight: 700; }
.flow-step h4 { font-size: 1.15rem; }
.flow-step p { font-size: 1rem; line-height: 1.45; color: var(--ink-2); }
@media (max-width: 720px) {
  .flow { grid-template-columns: 1fr; gap: 10px; }
  .flow-step, .flow-step:first-child, .flow-step:last-child { border-radius: var(--r); border-left: 1px solid var(--line); }
  .flow-step::after { right: 50%; top: auto; bottom: -13px; transform: translateX(50%) rotate(135deg); }
}

/* Principles (13) */
.principles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 8px; }
.principle { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 1rem; line-height: 1.35; }
.principle b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); font-size: .95rem; }
.principle.hl { background: var(--m-soft); border-color: var(--m); font-weight: 700; }
.principle.hl b { background: var(--m); color: #FFFFFF; }

/* Diagram: oneness */
.diagram svg:not(.ico) { max-width: 640px; margin-inline: auto; }

/* Glossary terms */
.term { all: unset; cursor: help; border-bottom: 2px dotted var(--m); font-weight: 700; color: var(--ink); position: relative; }
.term:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 3px; }
.term-pop {
  position: absolute; z-index: 70; width: min(340px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 14px;
  background: var(--ink); color: var(--bg); font-size: 1.02rem; line-height: 1.5; font-weight: 400; box-shadow: var(--shadow-2);
}
.term-pop strong { color: var(--bg); display: block; font-size: 1.1rem; }
.term-pop .he { font-size: 1.3rem; margin-left: 8px; }

/* Guide cues (inline) */
.cue { display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: start; padding: 18px 20px; border-radius: var(--r); background: var(--surface); border: 2px solid var(--m-line); box-shadow: var(--shadow-1); position: relative; }
.cue-avatar { width: 72px; height: 72px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--sun) 40%, var(--surface)), var(--m-soft)); overflow: hidden; border: 3px solid var(--m); }
.cue-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; transform: scale(1.25); transform-origin: 50% 20%; }
.cue-name { font-size: .85rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--m-ink); }
.cue-text { font-size: 1.25rem; line-height: 1.5; margin-top: 2px; }
.cue-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cue.is-speaking { border-color: var(--m); box-shadow: 0 0 0 4px color-mix(in srgb, var(--m) 20%, transparent), var(--shadow-1); }

/* Guide dock */
.guide-dock { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 45; display: flex; align-items: flex-end; gap: 12px; pointer-events: none; }
.gd-avatar {
  pointer-events: auto; position: relative; width: 104px; height: 104px; border-radius: 50%; padding: 0; cursor: pointer; overflow: hidden;
  border: 4px solid var(--surface); background: radial-gradient(circle at 50% 40%, #FFE3A8, #F4A15D 70%, #D9622C);
  box-shadow: var(--shadow-2); perspective: 600px;
}
.gd-avatar .netiva { position: absolute; left: -18%; top: -4%; width: 136%; height: auto; }
.gd-avatar::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid var(--m); opacity: 0; }
.guide-dock.has-news .gd-avatar::after { animation: pulse 1.8s ease-out infinite; opacity: 1; }
.gd-bubble {
  pointer-events: auto; position: relative; width: min(360px, calc(100vw - 150px)); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-2); padding: 16px 18px; margin-bottom: 16px;
}
.gd-bubble::after { content: ""; position: absolute; right: -9px; bottom: 26px; width: 16px; height: 16px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(-45deg); }
.gd-name { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--m-ink); }
.gd-text { font-size: 1.1rem; line-height: 1.5; margin-top: 2px; }
.gd-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gd-actions .btn { min-height: 40px; padding: 6px 14px; font-size: .95rem; }
@media (max-width: 560px) {
  .gd-avatar { width: 76px; height: 76px; }
  .gd-bubble { width: calc(100vw - 120px); padding: 12px 14px; }
  .gd-text { font-size: 1rem; }
}

/* Takeaways */
.takeaways { background: var(--dusk); color: var(--on-dusk); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 40px); display: grid; gap: 18px; }
.takeaways h2 { color: var(--on-dusk); font-size: clamp(1.7rem, 1.3rem + 1vw, 2.2rem); }
.takeaways ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: tk; }
.takeaways li { counter-increment: tk; display: grid; grid-template-columns: 38px 1fr; gap: 12px; color: var(--on-dusk); font-size: 1.2rem; line-height: 1.5; }
.takeaways li::before { content: counter(tk); width: 34px; height: 34px; border-radius: 50%; background: var(--sun); color: #2A1E05; display: grid; place-items: center; font-weight: 700; font-size: 1rem; }
.takeaways strong { color: #FFFFFF; }
.takeaways .cue { background: var(--dusk-2); border-color: rgba(255, 255, 255, .18); box-shadow: none; }
.takeaways .cue-text { color: var(--on-dusk); }
.takeaways .cue-name { color: var(--sun); }

/* Quiz */
.quiz { margin-top: clamp(36px, 5vw, 56px); background: var(--surface); border: 2px solid var(--m-line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.quiz-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 24px; background: var(--m-soft); border-bottom: 1px solid var(--m-line); }
.quiz-head h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); }
.quiz-pips { display: flex; gap: 6px; }
.quiz-pips i { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--m-line); }
.quiz-pips i.on { background: var(--m); border-color: var(--m); }
.quiz-pips i.ok { background: var(--pine); border-color: var(--pine); }
.quiz-pips i.no { background: var(--rose); border-color: var(--rose); }
.quiz-body { padding: clamp(20px, 4vw, 36px); display: grid; gap: 18px; }
.quiz-intro { display: grid; gap: 14px; justify-items: start; }
.quiz-intro p { color: var(--ink-2); font-size: 1.2rem; }
.quiz-q { font-size: clamp(1.35rem, 1.2rem + .5vw, 1.6rem); font-weight: 700; line-height: 1.4; }
.quiz-count { font-size: 1rem; color: var(--ink-3); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.choices { display: grid; gap: 10px; }
.choice {
  display: grid; grid-template-columns: 40px 1fr 28px; gap: 14px; align-items: center; width: 100%; text-align: left; cursor: pointer;
  padding: 14px 16px; min-height: 64px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); font-size: 1.2rem; line-height: 1.35; color: var(--ink);
  transition: border-color .15s, background .15s, transform .1s;
}
.choice:hover:not([disabled]) { border-color: var(--m); background: var(--m-soft); }
.choice .letter { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); font-weight: 700; }
.choice .mark { width: 28px; height: 28px; }
.choice[disabled] { cursor: default; }
.choice.correct { border-color: var(--pine); background: color-mix(in srgb, var(--pine) 12%, var(--surface)); }
.choice.correct .letter { background: var(--pine); border-color: var(--pine); color: #FFFFFF; }
.choice.wrong { border-color: var(--rose); background: color-mix(in srgb, var(--rose) 10%, var(--surface)); }
.choice.wrong .letter { background: var(--rose); border-color: var(--rose); color: #FFFFFF; }
.feedback { padding: 16px 18px; border-radius: 14px; font-size: 1.15rem; line-height: 1.5; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.feedback.ok { background: color-mix(in srgb, var(--pine) 12%, var(--surface)); }
.feedback.no { background: color-mix(in srgb, var(--rose) 10%, var(--surface)); }
.feedback .f-head { font-weight: 700; display: block; }
.feedback.ok .f-head, .feedback.ok .ico { color: var(--pine); }
.feedback.no .f-head, .feedback.no .ico { color: var(--rose); }
.quiz-nav { display: flex; justify-content: flex-end; gap: 10px; }
.quiz-result { display: grid; gap: 16px; justify-items: center; text-align: center; padding-block: 10px; }
.quiz-result .big-stars { display: flex; gap: 8px; color: var(--sun); }
.quiz-result .big-stars .ico { width: 56px; height: 56px; }
.quiz-result .big-stars .off { color: var(--line); }
.quiz-result .big-stars .ico.pop { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(0) rotate(-30deg); } to { transform: scale(1) rotate(0); } }
.quiz-result h3 { font-family: var(--font-display); font-weight: 400; font-size: 2.2rem; }
.quiz-result p { color: var(--ink-2); font-size: 1.2rem; max-width: 34rem; }
.score { font-variant-numeric: tabular-nums; }

/* Rewards / printables */
.rewards { margin-top: 28px; display: grid; gap: 16px; }
.rewards-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.rewards-head h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); }
.reward-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .reward-grid { grid-template-columns: minmax(0, 1fr); } }
.reward { position: relative; display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.reward-thumb { aspect-ratio: 17 / 22; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); max-height: 260px; width: 100%; }
.reward-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.reward-body { padding: 16px 18px 18px; display: grid; gap: 8px; align-content: start; }
.reward-body h3 { font-size: 1.2rem; }
.reward-body p { font-size: 1rem; color: var(--ink-2); line-height: 1.45; }
.reward-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.reward-lock {
  position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; padding: 20px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  font-weight: 700; color: var(--ink);
}
.reward-lock .lock-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); }
.reward-lock .lock-ico .ico { width: 28px; height: 28px; }
.reward-lock small { font-weight: 400; color: var(--ink-2); font-size: 1rem; }
.reward.unlocked .reward-lock { display: none; }
.reward:not(.unlocked) .reward-actions { visibility: hidden; }

/* Pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: clamp(36px, 5vw, 56px); }
.pager a { display: grid; gap: 4px; padding: 18px 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--ink-3); }
.pager small { font-size: .95rem; color: var(--ink-3); font-weight: 700; }
.pager span { font-weight: 700; font-size: 1.15rem; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: auto; } }

/* Printables library */
.lib-row { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; padding-block: 28px; border-bottom: 1px solid var(--line); }
.lib-row:last-child { border-bottom: 0; }
.lib-info { display: grid; gap: 8px; }
.lib-info h2 { font-size: 1.5rem; }
.lib-info .stars { font-size: 1.1rem; }
@media (max-width: 860px) { .lib-row { grid-template-columns: 1fr; } }
.badge-shelf { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 860px) { .badge-shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.badge { display: grid; justify-items: center; gap: 6px; text-align: center; font-size: .9rem; font-weight: 700; color: var(--ink-3); line-height: 1.3; }
.badge-disc { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; border: 3px dashed var(--line); color: var(--line); }
.badge-disc .ico { width: 30px; height: 30px; }
.badge.earned { color: var(--ink); }
.badge.earned .badge-disc { border: 4px solid color-mix(in srgb, var(--m) 50%, #FFFFFF); background: var(--m); color: #FFFFFF; box-shadow: 0 0 0 4px var(--m-soft); }

/* Glossary page */
.gloss-index { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.gloss-index a { display: grid; place-items: center; min-width: 44px; height: 44px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 700; color: var(--ink); }
.gloss-list { display: grid; gap: 12px; margin: 0; }
.gloss-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 22px; scroll-margin-top: 120px; }
.gloss-item dt { font-weight: 700; font-size: 1.3rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.gloss-item dt .he { font-size: 1.6rem; font-weight: 500; color: var(--m-ink); }
.gloss-item dd { margin: 6px 0 0; color: var(--ink-2); }

/* About page */
.prose { display: grid; gap: 18px; }
.prose h2 { font-size: clamp(1.7rem, 1.3rem + 1vw, 2.2rem); margin-top: 18px; }
.prose ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.about-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.about-art { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 12px; }
.about-art img { border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.about-art figcaption { font-size: 1rem; color: var(--ink-3); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } .about-art { position: static; max-width: 420px; } }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: grid; gap: 10px; }
.copy-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.copy-row code { font-family: var(--font-body); font-weight: 700; font-size: 1.1rem; padding: 8px 12px; background: var(--surface-2); border-radius: 10px; user-select: all; }

/* Studio page */
.studio-table { width: 100%; border-collapse: collapse; font-size: 1.02rem; background: var(--surface); border-radius: var(--r); overflow: hidden; }
.studio-table th, .studio-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.studio-table th { background: var(--surface-2); font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; }
.studio-table code { font-size: .95rem; white-space: nowrap; }
.studio-table .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.meter { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; min-width: 120px; }
.meter i { display: block; height: 100%; background: var(--pine); }

/* Toast */
.toast-zone { position: fixed; left: 50%; top: calc(var(--header-h) + 18px); transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2); animation: toast-in .35s ease both; font-size: 1.05rem; line-height: 1.4; }
.toast .t-ico { width: 48px; height: 48px; border-radius: 50%; background: var(--sun); color: #2A1E05; display: grid; place-items: center; }
.toast strong { color: var(--bg); display: block; }
.toast a { color: var(--sun); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* Reading ruler */
.ruler { position: fixed; left: 0; right: 0; height: 3.2em; pointer-events: none; z-index: 30; background: color-mix(in srgb, var(--sun) 16%, transparent); border-top: 2px solid color-mix(in srgb, var(--sun) 60%, transparent); border-bottom: 2px solid color-mix(in srgb, var(--sun) 60%, transparent); transform: translateY(-50%); display: none; }
html[data-ruler="on"] .ruler { display: block; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; width: 100vw; height: 100vh; }

/* ---------- Netiva character ---------- */
.netiva { overflow: visible; }
.netiva .nv-arm, .netiva .nv-eyes-happy, .netiva .nv-m1, .netiva .nv-m2, .netiva .nv-sparkles, .netiva .nv-question { display: none; }
.netiva[data-mood="wave"] .nv-arm-wave, .netiva[data-mood="point"] .nv-arm-wave { display: inline; }
.netiva[data-mood="think"] .nv-arm-think, .netiva[data-mood="think"] .nv-question { display: inline; }
.netiva[data-mood="happy"] .nv-eyes { display: none; }
.netiva[data-mood="happy"] .nv-eyes-happy, .netiva[data-mood="happy"] .nv-sparkles, .netiva[data-mood="wow"] .nv-sparkles { display: inline; }
.netiva[data-mouth="1"] .nv-m0, .netiva[data-mouth="2"] .nv-m0 { display: none; }
.netiva[data-mouth="1"] .nv-m1, .netiva[data-mouth="2"] .nv-m2 { display: inline; }
.netiva[data-mood="think"] .nv-brow-l { transform: translateY(-5px) rotate(-6deg); transform-box: fill-box; transform-origin: center; }
.netiva[data-mood="wow"] .nv-brows { transform: translateY(-6px); }
.netiva[data-mood="wow"] .nv-iris { transform: scale(1.08); transform-box: fill-box; transform-origin: center; }
.netiva .nv-p { transition: transform .25s ease-out; }
.netiva .nv-p-back { transform: translate(calc(var(--px, 0) * -5px), calc(var(--py, 0) * -3px)); }
.netiva .nv-p-head { transform: translate(calc(var(--px, 0) * 7px), calc(var(--py, 0) * 4px)); }
.netiva .nv-front { transform: translate(calc(var(--px, 0) * 3px), calc(var(--py, 0) * 2px)); transition: transform .25s ease-out; }
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="reduce"]) .netiva .nv-eye { animation: nv-blink 5.5s infinite; transform-box: fill-box; transform-origin: center; }
  html:not([data-motion="reduce"]) .netiva .nv-eye-r { animation-delay: .02s; }
  html:not([data-motion="reduce"]) .netiva .nv-body { animation: nv-breathe 4.2s ease-in-out infinite; transform-origin: 160px 400px; }
  html:not([data-motion="reduce"]) .netiva .nv-headgrp { animation: nv-sway 7s ease-in-out infinite; transform-origin: 160px 250px; }
  html:not([data-motion="reduce"]) .netiva .nv-hairback { animation: nv-sway 7s ease-in-out infinite reverse; transform-origin: 160px 120px; }
  html:not([data-motion="reduce"]) .netiva[data-talking="1"] .nv-headgrp { animation: nv-nod .9s ease-in-out infinite; }
  html:not([data-motion="reduce"]) .netiva[data-mood="wave"] .nv-arm-wave { animation: nv-wave 1.1s ease-in-out infinite; transform-origin: 236px 330px; }
  html:not([data-motion="reduce"]) .netiva .nv-sp { animation: twinkle 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  html:not([data-motion="reduce"]) .netiva .nv-sp:nth-child(2) { animation-delay: .4s; }
  html:not([data-motion="reduce"]) .netiva .nv-sp:nth-child(3) { animation-delay: .8s; }
  html:not([data-motion="reduce"]) .netiva .nv-question { animation: bob 2s ease-in-out infinite; }
}
@keyframes nv-blink { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.08); } }
@keyframes nv-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.012); } }
@keyframes nv-sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@keyframes nv-nod { 0%, 100% { transform: rotate(-1deg) translateY(0); } 50% { transform: rotate(1deg) translateY(2px); } }
@keyframes nv-wave { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(9deg); } }
@keyframes twinkle { 0%, 100% { transform: scale(.6); opacity: .5; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Scene animations ---------- */
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="reduce"]) .cp-needle { animation: cp-swing 6s ease-in-out infinite; transform-origin: 112px 118px; }
  html:not([data-motion="reduce"]) .cp-trail { animation: dash 1.6s linear infinite; }
  html:not([data-motion="reduce"]) .sh-l1 { animation: fade-in-out 6s ease-in-out infinite; }
  html:not([data-motion="reduce"]) .sh-l2 { animation: fade-in-out 6s ease-in-out .6s infinite; }
  html:not([data-motion="reduce"]) .sh-one { animation: bob 3s ease-in-out infinite; }
  html:not([data-motion="reduce"]) .sh-halo { animation: glow 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  html:not([data-motion="reduce"]) .sn-flames { animation: flicker .5s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
  html:not([data-motion="reduce"]) .sn-glow { animation: glow 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  html:not([data-motion="reduce"]) .sn-cloud-a { animation: drift 7s ease-in-out infinite; }
  html:not([data-motion="reduce"]) .sn-cloud-b { animation: drift 8s ease-in-out infinite reverse; }
  html:not([data-motion="reduce"]) .sn-bolt { animation: bolt 4s steps(1) infinite; }
  html:not([data-motion="reduce"]) .sn-tablets { animation: bob 3.5s ease-in-out infinite; }
  html:not([data-motion="reduce"]) .tp-rays { animation: spin 40s linear infinite; transform-origin: 120px 90px; }
  html:not([data-motion="reduce"]) .tp-dove { animation: fly 7s ease-in-out infinite; }
  html:not([data-motion="reduce"]) .tp-wing { animation: flap .45s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 20% 100%; }
  html:not([data-motion="reduce"]) .sf-wave { animation: wave-out 1.6s ease-out infinite; transform-box: fill-box; transform-origin: left center; }
  html:not([data-motion="reduce"]) .sf-w2 { animation-delay: .4s; }
  html:not([data-motion="reduce"]) .sf-horn { animation: horn 3.2s ease-in-out infinite; transform-origin: 40px 140px; }
  html:not([data-motion="reduce"]) .tr-text { stroke-dasharray: 480; animation: write 6s ease-in-out infinite; }
  html:not([data-motion="reduce"]) .tr-c2 { animation-delay: 1s; }
  html:not([data-motion="reduce"]) .tr-crown { animation: bob 3s ease-in-out infinite; }
  html:not([data-motion="reduce"]) .mn-flame { animation: light-up 7s ease-in-out infinite; animation-delay: calc(var(--i) * .35s); transform-box: fill-box; transform-origin: 50% 100%; }
  html:not([data-motion="reduce"]) .mn-halo { animation: glow 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  html:not([data-motion="reduce"]) .rb-band { animation: band-in 7s ease-in-out infinite; animation-delay: calc(var(--i) * .18s); }
  html:not([data-motion="reduce"]) .rb-ark { animation: rock 3.6s ease-in-out infinite; transform-origin: 120px 172px; }
}
@keyframes cp-swing { 0% { transform: rotate(-38deg); } 18% { transform: rotate(24deg); } 32% { transform: rotate(-12deg); } 44% { transform: rotate(6deg); } 54%, 100% { transform: rotate(0deg); } }
@keyframes dash { to { stroke-dashoffset: -28; } }
@keyframes fade-in-out { 0% { opacity: .15; } 20%, 80% { opacity: 1; } 100% { opacity: .15; } }
@keyframes glow { 0%, 100% { opacity: .65; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes flicker { from { transform: scale(1, 1) skewX(0deg); } to { transform: scale(.92, 1.08) skewX(3deg); } }
@keyframes drift { 0%, 100% { transform: translateX(-5px); } 50% { transform: translateX(6px); } }
@keyframes bolt { 0%, 88%, 92%, 100% { opacity: 0; } 89%, 91%, 93% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fly { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-14px, 8px); } }
@keyframes flap { from { transform: rotate(0deg); } to { transform: rotate(38deg) scaleY(.7); } }
@keyframes wave-out { 0% { opacity: 0; transform: scale(.6); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.25); } }
@keyframes horn { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-2.5deg); } }
@keyframes write { 0% { stroke-dashoffset: 480; } 55%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: .3; } }
@keyframes light-up { 0% { opacity: 0; transform: scale(.3); } 8% { opacity: 1; transform: scale(1.1); } 12%, 90% { opacity: 1; transform: scale(1); } 45% { transform: scale(.94, 1.06); } 100% { opacity: 0; transform: scale(.5); } }
@keyframes band-in { 0% { opacity: 0; } 10%, 88% { opacity: 1; } 100% { opacity: 0; } }
@keyframes rock { 0%, 100% { transform: rotate(-2deg) translateY(0); } 50% { transform: rotate(2deg) translateY(2px); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after { animation: none !important; transition: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .wp.is-next .wp-marker::after { animation: none; } }

/* ---------- Line-art (coloring) mode for scenes ---------- */
.lineart * { fill: #FFFFFF !important; stroke: #1A1A1A !important; stroke-width: 1.5px !important; animation: none !important; }
.lineart .fx { display: none !important; }
.lineart .ln, .lineart .ln * { fill: none !important; }
.lineart text { fill: #1A1A1A !important; stroke: none !important; }
.lineart .rb-band { opacity: 1 !important; }
.lineart .tr-text { stroke-dasharray: none !important; }
.lineart .outline-text { fill: #FFFFFF !important; stroke: #1A1A1A !important; stroke-width: 1.6px !important; }

/* ---------- Print (site pages) ---------- */
@media print {
  .site-header, .site-footer, .guide-dock, .elev, .listen, .quiz, .rewards, .pager, .ruler, .toast-zone { display: none !important; }
  body { background: #FFFFFF; color: #000000; font-size: 12pt; }
}

/* ---------- Additions: module scoping, charts, elevation ---------- */
[style*="--m:"] {
  --m-soft: color-mix(in srgb, var(--m) 13%, var(--surface));
  --m-ink: color-mix(in srgb, var(--m) 78%, var(--ink));
  --m-line: color-mix(in srgb, var(--m) 35%, var(--line));
}
img.hero-photo { width: 100%; height: 100%; object-fit: cover; object-position: 72% 42%; }

.elev-track { position: relative; flex: 1; min-width: 0; height: 34px; }
.elev-track .elev-svg { width: 100%; height: 100%; display: block; }
.elev-hiker { position: absolute; left: 0; top: 90%; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 3px solid var(--ink); transform: translate(-50%, -60%); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); transition: left .15s linear, top .15s linear; }
.elev-flag { position: absolute; right: -6px; top: -8px; color: var(--ember-ink); }
.elev-flag .ico { width: 20px; height: 20px; }
.elev .focus-btn { width: 40px; height: 40px; }
.elev .focus-btn .ico { width: 20px; height: 20px; }

/* Horizontal bars */
.hbars { display: grid; gap: 14px; }
.hbar { display: grid; gap: 4px; }
.hb-label { font-weight: 700; font-size: 1.05rem; }
.hb-track { position: relative; height: 34px; background: var(--surface-2); border-radius: 8px; }
.hb-fill { height: 100%; border-radius: 8px; }
.bg-j { background: var(--jud); } .bg-c { background: var(--chr); } .bg-m { background: var(--m); } .bg-b { background: var(--pine); }
.hb-val { position: absolute; top: 50%; transform: translateY(-50%); right: 10px; font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.hb-axis { position: relative; height: 22px; margin-top: 8px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.hb-axis span { position: absolute; top: 2px; transform: translateX(-50%); }
.hb-axis span:first-child { transform: none; }
.hb-axis span:last-child { transform: translateX(-100%); }

/* Donut */
.donut-wrap { display: grid; grid-template-columns: minmax(0, 220px) 1fr; gap: 24px; align-items: center; }
.donut { width: 100%; max-width: 220px; }
.c-track-stroke { stroke: var(--surface-2); }
.donut-num { font-family: var(--font-display); font-size: 40px; }
.donut-sub { font-size: 14px; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 1.15rem; }
.donut-legend li { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.donut-legend i { width: 16px; height: 16px; border-radius: 4px; flex: none; align-self: center; }
.donut-legend .l-j { background: var(--jud); } .donut-legend .l-m { background: var(--m); } .donut-legend .l-c { background: var(--chr); }
.donut-legend b { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.donut-legend .pct { color: var(--ink-3); font-size: 1rem; }
@media (max-width: 560px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 2px; background: var(--line); }
.tl-item { position: relative; display: grid; justify-items: center; text-align: center; gap: 4px; padding: 0 4px; }
.tl-dot { width: 26px; height: 26px; border-radius: 50%; border: 4px solid var(--surface); position: relative; z-index: 1; box-shadow: 0 0 0 2px var(--line); }
.tl-both .tl-dot { background: var(--pine); } .tl-j .tl-dot { background: var(--jud); } .tl-c .tl-dot { background: var(--chr); }
.tl-date { font-size: .9rem; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: 4px; }
.tl-label { font-size: 1rem; font-weight: 700; line-height: 1.3; }
@media (max-width: 860px) {
  .timeline { grid-template-columns: 1fr; gap: 14px; padding-left: 4px; }
  .timeline::before { left: 15px; right: auto; top: 6px; bottom: 6px; width: 4px; height: auto; }
  .tl-item { grid-template-columns: 26px auto 1fr; justify-items: start; text-align: left; align-items: center; gap: 12px; }
  .tl-date { margin: 0; min-width: 6.5em; }
}

/* Venn labels */
.venn-svg { max-width: 560px; margin-inline: auto; }
.venn-lbl { font-weight: 700; font-size: 17px; }
.venn-both { font-weight: 700; font-size: 18px; }
.venn-n { font-size: 14px; }

/* Servant chart */
.sv-axis { position: relative; height: 92px; margin: 10px 8px 6px; }
.sv-line { position: absolute; left: 0; right: 0; top: 46px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--jud-soft), var(--jud) 70%, var(--m)); }
.sv-mark { position: absolute; top: 0; transform: translateX(-50%); display: grid; justify-items: center; gap: 4px; }
.sv-mark:nth-of-type(even) b { margin-top: 50px; }
.sv-mark i { width: 18px; height: 18px; border-radius: 50%; background: var(--jud); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--jud); margin-top: 38px; }
.sv-mark b { font-size: .8rem; color: var(--jud); position: absolute; top: 0; white-space: nowrap; }
.sv-mark:nth-of-type(even) b { top: 64px; margin: 0; }
.sv-target i { width: 32px; height: 32px; margin-top: 31px; background: var(--m); box-shadow: 0 0 0 2px var(--m); color: #FFFFFF; font-style: normal; font-weight: 700; display: grid; place-items: center; font-size: 1.1rem; }
.sv-target b { color: var(--m-ink); top: 0 !important; }
.sv-ticks { position: absolute; left: 0; right: 0; bottom: -6px; height: 18px; font-size: .78rem; color: var(--ink-3); }
.sv-ticks span { position: absolute; transform: translateX(-50%); }
.sv-caption { font-size: 1rem; color: var(--ink-2); margin-top: 18px; }
.sv-quotes { margin: 12px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 8px; }
.sv-quotes li { background: var(--jud-soft); border-radius: 10px; padding: 10px 14px; font-size: 1.05rem; line-height: 1.45; font-style: italic; }
.sv-quotes cite { display: block; font-style: normal; font-weight: 700; color: var(--jud); font-size: .9rem; }

/* Oneness diagram */
.dg-grid { gap: 14px; }
.dg-panel { border-radius: 14px; padding: 14px; text-align: center; display: grid; gap: 6px; justify-items: center; }
.dg-panel svg:not(.ico) { max-width: 300px; width: 100%; }
.dg-j { background: var(--jud-soft); } .dg-c { background: var(--chr-soft); }
.dg-label { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .95rem; display: inline-flex; gap: 8px; align-items: center; }
.dg-j .dg-label { color: var(--jud); } .dg-c .dg-label { color: var(--chr); }
.dg-cap { font-size: 1rem; color: var(--ink-2); line-height: 1.45; }
.dg-big { font-family: var(--font-display); font-size: 30px; }
.dg-small { font-size: 16px; }
.dg-tiny { font-size: 13px; font-style: italic; }
.dg-node { font-size: 14px; font-weight: 700; }
.dg-onc { fill: #FFFFFF; }
.c-surface.c-stroke-c { fill: var(--surface); }

/* Candles flicker */
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="reduce"]) .cd-flame { animation: flicker .55s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
  html:not([data-motion="reduce"]) .cd-f2 { animation-delay: .25s; }
}

/* Overflow guards */
.word { min-width: 0; }
.word .w-heb { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2rem); }
@media (max-width: 480px) { .words { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.prose > *, .callout > div, .meet-copy > *, .hero-copy > * { min-width: 0; }
code { overflow-wrap: anywhere; }
.dg-panel { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 760px) {
  .hero::before { background: linear-gradient(180deg, rgba(20, 24, 54, .78) 0%, rgba(20, 24, 54, .88) 55%, rgba(20, 24, 54, .95) 100%); }
  .scene-wrap { max-width: 320px; }
}
.takeaways li > span { min-width: 0; }
