/* ============================================================
   The Mysteries of Life — Interactive Lesson
   Design system
   ============================================================ */

:root {
  /* Warm paper neutrals */
  --paper:        oklch(0.975 0.008 85);
  --paper-2:      oklch(0.955 0.010 84);
  --card:         oklch(0.995 0.004 90);
  --ink:          oklch(0.26 0.025 265);
  --ink-soft:     oklch(0.42 0.025 265);
  --ink-faint:    oklch(0.58 0.020 265);
  --hair:         oklch(0.90 0.012 80);
  --hair-strong:  oklch(0.82 0.015 80);

  /* Cool primary — honors the original deep-blue identity */
  --blue:         oklch(0.45 0.115 258);
  --blue-deep:    oklch(0.33 0.095 262);
  --blue-tint:    oklch(0.93 0.030 250);
  --blue-tint-2:  oklch(0.88 0.045 250);

  /* Warm accent */
  --amber:        oklch(0.70 0.130 62);
  --terra:        oklch(0.62 0.135 42);
  --terra-tint:   oklch(0.93 0.035 50);

  /* Semantic */
  --good:         oklch(0.58 0.115 152);
  --good-tint:    oklch(0.93 0.040 152);
  --warn:         oklch(0.62 0.150 38);
  --warn-tint:    oklch(0.93 0.045 40);

  --maxw: 720px;
  --wide: 1080px;

  --serif: "Spectral", Georgia, serif;
  --sans:  "Hanken Grotesk", system-ui, sans-serif;

  --shadow-sm: 0 1px 2px oklch(0.4 0.03 265 / 0.06), 0 2px 8px oklch(0.4 0.03 265 / 0.05);
  --shadow-md: 0 4px 14px oklch(0.4 0.03 265 / 0.08), 0 12px 30px oklch(0.4 0.03 265 / 0.07);
  --shadow-lg: 0 10px 40px oklch(0.35 0.04 265 / 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Progress bar ---------- */
#progress {
  position: fixed; top: 0; left: 0; height: 4px; width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--terra));
  z-index: 100; transition: width 0.15s linear;
}

/* ---------- Top chapter rail ---------- */
.toprail {
  position: fixed; top: 0; right: 0; left: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  pointer-events: none;
}

/* ---------- Contents button ---------- */
.toc-btn {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 13.5px; letter-spacing: 0.02em;
  color: var(--blue-deep); background: oklch(0.99 0.004 90 / 0.82);
  border: 1px solid var(--hair); border-radius: 999px; padding: 9px 16px 9px 13px;
  cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm); transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}
.toc-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.toc-btn svg { width: 18px; height: 18px; }
@media (max-width: 520px){ .toc-btn span { display: none; } .toc-btn { padding: 9px 11px; } }

/* ---------- Contents overlay panel ---------- */
.toc-scrim {
  position: fixed; inset: 0; z-index: 110; background: oklch(0.2 0.03 265 / 0.32);
  backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.toc-scrim.show { opacity: 1; pointer-events: auto; }
.toc-panel {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 120; width: min(340px, 86vw);
  background: var(--paper); box-shadow: var(--shadow-lg); padding: 22px 22px 30px;
  transform: translateX(-104%); transition: transform 0.34s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; display: flex; flex-direction: column;
}
.toc-panel.show { transform: none; }
.toc-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--serif); font-size: 14px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); padding-bottom: 16px; margin-bottom: 8px;
  border-bottom: 1px solid var(--hair);
}
.toc-close {
  background: none; border: 0; cursor: pointer; color: var(--ink-soft); padding: 6px;
  border-radius: 8px; display: grid; place-items: center; transition: background 0.15s;
}
.toc-close:hover { background: var(--paper-2); }
.toc-close svg { width: 20px; height: 20px; }
.toc-list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc-list li { margin: 0; }
.toc-list button {
  width: 100%; text-align: left; font: inherit; background: none; border: 0; cursor: pointer;
  display: flex; align-items: baseline; gap: 14px; padding: 11px 12px; border-radius: 10px;
  color: var(--ink-soft); transition: background 0.15s, color 0.15s;
}
.toc-list button:hover { background: var(--paper-2); color: var(--ink); }
.toc-list button .tnum {
  font-family: var(--serif); font-size: 13px; font-weight: 600; color: var(--terra);
  font-variant-numeric: tabular-nums; flex: none; width: 22px;
}
.toc-list button .tlbl { font-size: 16px; font-weight: 600; }
.toc-list li.active button { background: var(--blue-tint); color: var(--blue-deep); }
.toc-list li.active button .tnum { color: var(--blue); }

/* ---------- Desktop dot rail ---------- */
.dotnav {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 80;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
}
.dotnav button {
  display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer;
  padding: 5px 2px; font: inherit; color: var(--ink-faint);
}
.dotnav .lab {
  font-size: 12.5px; font-weight: 700; white-space: nowrap; opacity: 0; transform: translateX(6px);
  transition: opacity 0.2s, transform 0.2s; background: var(--blue-deep); color: oklch(0.96 0.01 250);
  padding: 4px 10px; border-radius: 6px; box-shadow: var(--shadow-sm); pointer-events: none;
}
.dotnav button:hover .lab { opacity: 1; transform: none; }
.dotnav .pip {
  width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--hair-strong);
  transition: background 0.2s, transform 0.2s; box-shadow: 0 0 0 0 transparent;
}
.dotnav button:hover .pip { background: var(--blue); }
.dotnav button.active .pip { background: var(--blue); transform: scale(1.5); }
.dotnav button.active .lab { opacity: 1; transform: none; }
@media (max-width: 1180px){ .dotnav { display: none; } }
.toprail .brand {
  font-family: var(--sans); font-weight: 700; font-size: 13px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue-deep);
  opacity: 0; transition: opacity 0.4s; pointer-events: auto;
}
.toprail.show .brand { opacity: 0.85; }
@media (max-width: 760px){ .toprail .brand { display: none; } }
.toprail .miniglass {
  width: 22px; height: 22px; opacity: 0; transition: opacity 0.4s;
}
.toprail.show .miniglass { opacity: 0.7; }

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: var(--wide); margin: 0 auto; padding: 0 24px; }

section.block { padding: clamp(56px, 9vh, 110px) 0; position: relative; }
section.block.alt { background: var(--paper-2); }
section.block.deep {
  background: var(--blue-deep);
  color: oklch(0.95 0.02 250);
}
section.block.deep .eyebrow { color: var(--amber); }
section.block.deep h2, section.block.deep h3 { color: oklch(0.97 0.015 250); }
section.block.deep .lead, section.block.deep p { color: oklch(0.88 0.02 250); }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--sans); font-weight: 700;
  font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--terra); display: flex; align-items: center; gap: 10px;
  margin: 0 0 18px;
}
.eyebrow .num {
  font-variant-numeric: tabular-nums; color: var(--blue);
}
.eyebrow::before {
  content: ""; width: 26px; height: 1.5px; background: var(--terra); display: inline-block;
}

h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(38px, 6.2vw, 68px); line-height: 1.04;
  letter-spacing: -0.015em; margin: 0 0 22px;
}
h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(28px, 4.4vw, 44px); line-height: 1.1;
  letter-spacing: -0.01em; margin: 0 0 20px; text-wrap: balance;
}
h3 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(21px, 2.6vw, 27px); line-height: 1.2; margin: 0 0 12px;
}
.lead {
  font-size: clamp(20px, 2.4vw, 24px); line-height: 1.55; color: var(--ink-soft);
  font-family: var(--serif); font-weight: 400;
}
p { margin: 0 0 18px; }
p .key {
  font-weight: 700; color: var(--blue-deep);
}
section.block.deep p .key { color: var(--amber); }

.muted { color: var(--ink-faint); }
.cite {
  font-size: 13.5px; color: var(--ink-faint); font-style: italic;
  border-left: 2px solid var(--hair-strong); padding-left: 12px; margin-top: 8px;
}

/* ---------- Glossary term ---------- */
.term {
  border-bottom: 1.5px dotted var(--terra);
  cursor: help; color: inherit; font-weight: 600;
  position: relative; white-space: nowrap;
}
.term:focus { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

#tip {
  position: fixed; z-index: 200; max-width: 300px;
  background: var(--blue-deep); color: oklch(0.96 0.01 250);
  padding: 14px 16px; border-radius: 12px;
  font-size: 14.5px; line-height: 1.5; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(4px); pointer-events: none;
  transition: opacity 0.16s, transform 0.16s;
}
#tip.show { opacity: 1; transform: translateY(0); }
#tip .tt {
  display: block; font-family: var(--serif); font-weight: 600; font-size: 16px;
  color: var(--amber); margin-bottom: 4px;
}
#tip .pali { font-style: italic; opacity: 0.85; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 90% at 80% -10%, var(--blue-tint) 0%, transparent 55%),
    var(--paper);
}
.hero .wrap { width: 100%; }
.hero .kicker {
  font-family: var(--sans); font-weight: 700; font-size: 14px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--terra);
  margin-bottom: 26px; display: flex; align-items: center; gap: 14px;
}
.hero h1 { max-width: 14ch; }
.hero h1 em { font-style: italic; color: var(--blue); }
.hero .sub {
  font-family: var(--serif); font-size: clamp(19px, 2.3vw, 23px);
  color: var(--ink-soft); max-width: 40ch; margin-bottom: 40px; line-height: 1.5;
}
.glass-mark {
  position: absolute; right: -60px; top: 50%; transform: translateY(-50%);
  width: min(46vw, 460px); height: auto; opacity: 0.10; color: var(--blue-deep);
  pointer-events: none;
}
.scroll-cue {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 14px; letter-spacing: 0.08em; color: var(--ink-faint);
  font-weight: 600;
}
.scroll-cue .dot {
  width: 30px; height: 48px; border: 1.5px solid var(--hair-strong);
  border-radius: 16px; position: relative;
}
.scroll-cue .dot::after {
  content: ""; position: absolute; left: 50%; top: 9px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--blue); transform: translateX(-50%);
  animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue { 0%,100%{ transform: translate(-50%,0); opacity:1 } 50%{ transform: translate(-50%,14px); opacity:0.3 } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

/* ---------- Pull quote ---------- */
.pull {
  font-family: var(--serif); font-weight: 500; font-style: italic;
  font-size: clamp(26px, 4vw, 40px); line-height: 1.28; letter-spacing: -0.01em;
  text-wrap: balance; margin: 0;
}
.pull .mark { color: var(--terra); font-style: normal; }

/* ============================================================
   Components
   ============================================================ */

/* ---- Life diagram (tappable) ---- */
.life-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 8px;
}
@media (max-width: 620px){ .life-grid { grid-template-columns: 1fr; } }
.life-card {
  background: var(--card); border: 1px solid var(--hair); border-radius: 16px;
  padding: 22px 22px 20px; cursor: pointer; text-align: left;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative; box-shadow: var(--shadow-sm); font: inherit; color: inherit;
}
.life-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue-tint-2); }
.life-card .ic {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--blue-tint); color: var(--blue-deep); margin-bottom: 14px;
}
.life-card .ic svg { width: 24px; height: 24px; }
.life-card .en { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.life-card .th { font-size: 13.5px; color: var(--terra); font-weight: 700; letter-spacing: 0.03em; margin-top: 2px; }
.life-card .body { font-size: 15px; color: var(--ink-soft); margin-top: 12px; max-height: 0; overflow: hidden; transition: max-height 0.4s ease, margin-top 0.3s; }
.life-card.open .body { max-height: 220px; margin-top: 14px; }
.life-card .more { font-size: 13px; font-weight: 700; color: var(--blue); margin-top: 12px; display: inline-flex; gap: 6px; align-items: center; }
.life-card.open .more .lbl::after { content: " less"; }
.life-card .more .lbl::after { content: " more"; }
.life-card .more svg { transition: transform 0.3s; }
.life-card.open .more svg { transform: rotate(180deg); }

.life-eq {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  font-family: var(--serif); font-size: clamp(18px, 2.4vw, 24px); font-weight: 600;
  color: var(--blue-deep); margin: 8px 0 30px; padding: 18px;
  background: var(--card); border: 1px dashed var(--hair-strong); border-radius: 14px;
}
.life-eq .plus { color: var(--terra); font-weight: 400; }

/* ---- Flip cards (roots of pressure) ---- */
.flip-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px){ .flip-row { grid-template-columns: 1fr; } }
.flip {
  perspective: 1200px; height: 290px; cursor: pointer; font: inherit; color: inherit;
  background: none; border: 0; padding: 0; text-align: left;
}
.flip-inner {
  position: relative; width: 100%; height: 100%; transition: transform 0.6s cubic-bezier(.4,.1,.2,1);
  transform-style: preserve-3d;
}
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 18px; padding: 24px; display: flex; flex-direction: column;
  box-shadow: var(--shadow-md);
}
.flip-front { background: var(--card); border: 1px solid var(--hair); }
.flip-front .pnum { font-family: var(--serif); font-size: 15px; color: var(--terra); font-weight: 600; }
.flip-front .ttl { font-family: var(--serif); font-size: 25px; font-weight: 600; margin-top: auto; line-height: 1.15; }
.flip-front .pali { font-size: 13.5px; color: var(--blue); font-weight: 700; margin-top: 6px; letter-spacing: 0.02em; }
.flip-front .hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 16px; display: flex; align-items: center; gap: 7px; }
.flip-back { background: var(--blue-deep); color: oklch(0.95 0.015 250); transform: rotateY(180deg); }
.flip-back .ttl { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--amber); margin-bottom: 10px; }
.flip-back ul { margin: 0; padding-left: 18px; font-size: 15px; line-height: 1.5; }
.flip-back li { margin-bottom: 7px; }
.flip-back p { font-size: 15px; line-height: 1.5; margin: 0; }

/* ---- Matching (afflictions -> requisites) ---- */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 760px){ .match { grid-template-columns: 1fr; gap: 18px; } }
.match h4 { font-family: var(--sans); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 14px; font-weight: 700; }
.chip {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 10px;
  background: var(--card); border: 1.5px solid var(--hair); border-radius: 12px;
  cursor: grab; transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s, opacity 0.3s;
  font-weight: 600; box-shadow: var(--shadow-sm); touch-action: none;
}
.chip:active { cursor: grabbing; }
.chip.dragging { opacity: 0.4; }
.chip.placed { opacity: 0.45; pointer-events: none; }
.chip .ic { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--warn-tint); color: var(--warn); }
.chip .ic svg { width: 17px; height: 17px; }
.drop {
  border: 1.5px dashed var(--hair-strong); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
  background: var(--paper); transition: border-color 0.2s, background 0.2s;
  min-height: 70px;
}
.drop.over { border-color: var(--blue); background: var(--blue-tint); }
.drop.correct { border-style: solid; border-color: var(--good); background: var(--good-tint); }
.drop .req-h { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.drop .req-h .ic { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--good-tint); color: var(--good); border: 1px solid var(--good); }
.drop .req-h .ic svg { width: 17px; height: 17px; }
.drop .req-sub { font-size: 13px; color: var(--ink-faint); margin-top: 2px; margin-left: 40px; }
.drop .landed { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.drop .landed .mini { font-size: 13px; font-weight: 700; background: var(--good); color: white; padding: 4px 10px; border-radius: 20px; }
.match-status { margin-top: 18px; font-weight: 700; color: var(--good); min-height: 24px; }

/* ---- Body scan exercise ---- */
.scan {
  background: var(--card); border: 1px solid var(--hair); border-radius: 20px;
  padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow-md);
}
.scan .intro { color: var(--ink-soft); font-size: 16px; margin-bottom: 22px; }
.scan-list { display: grid; gap: 10px; }
.scan-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1.5px solid var(--hair); border-radius: 12px; cursor: pointer;
  transition: background 0.25s, border-color 0.25s; background: var(--paper);
  font: inherit; color: inherit; text-align: left; width: 100%;
}
.scan-item:hover { border-color: var(--blue-tint-2); }
.scan-item .box {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--hair-strong);
  flex: none; display: grid; place-items: center; transition: background 0.25s, border-color 0.25s;
}
.scan-item .box svg { width: 16px; height: 16px; color: white; opacity: 0; transform: scale(0.5); transition: 0.25s; }
.scan-item.checked { background: var(--good-tint); border-color: var(--good); }
.scan-item.checked .box { background: var(--good); border-color: var(--good); }
.scan-item.checked .box svg { opacity: 1; transform: none; }
.scan-item .lab { font-weight: 600; }
.scan-item .q { color: var(--ink-faint); font-size: 14px; font-weight: 400; margin-left: auto; }
.scan-done {
  margin-top: 22px; padding: 18px 20px; border-radius: 14px; background: var(--blue-tint);
  color: var(--blue-deep); font-size: 16px; line-height: 1.5; opacity: 0; max-height: 0;
  overflow: hidden; transition: opacity 0.4s, max-height 0.5s, padding 0.4s;
  padding-top: 0; padding-bottom: 0;
}
.scan-done.show { opacity: 1; max-height: 220px; padding-top: 18px; padding-bottom: 18px; }
.scan-done strong { color: var(--terra); }

/* ---- 4 Works ---- */
.works { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
@media (max-width: 700px){ .works { grid-template-columns: 1fr; } }
.work {
  background: var(--card); border: 1px solid var(--hair); border-radius: 18px;
  padding: 26px; box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.work::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c, var(--blue)); }
.work:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.work .wn { font-family: var(--serif); font-size: 14px; color: var(--c, var(--blue)); font-weight: 600; }
.work h3 { margin: 8px 0 2px; }
.work .care { font-size: 13.5px; color: var(--terra); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.work p { font-size: 15.5px; color: var(--ink-soft); margin: 14px 0 0; }

/* ---- Habit flow ---- */
.flow {
  display: flex; align-items: stretch; gap: 0; flex-wrap: nowrap; overflow-x: auto;
  padding: 6px 2px 16px; scroll-snap-type: x mandatory;
}
.flow .stage {
  flex: 1 0 auto; min-width: 130px; scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
}
.flow .puck {
  width: 100%; background: var(--card); border: 1px solid var(--hair); border-radius: 14px;
  padding: 16px 12px; box-shadow: var(--shadow-sm); min-height: 96px; display: flex;
  flex-direction: column; justify-content: center; gap: 4px;
}
.flow .puck.lit { background: var(--blue-deep); border-color: var(--blue-deep); }
.flow .puck.lit .pt { color: white; }
.flow .puck.lit .ps { color: oklch(0.85 0.02 250); }
.flow .pt { font-family: var(--serif); font-weight: 600; font-size: 17px; }
.flow .ps { font-size: 12.5px; color: var(--ink-faint); }
.flow .arrow { display: grid; place-items: center; padding: 0 6px; color: var(--terra); flex: none; align-self: center; }
.flow .arrow svg { width: 22px; height: 22px; }
@media (max-width: 720px){ .flow .arrow { transform: none; } }

/* ---- Simple vs Careless toggle ---- */
.sc-toggle { display: inline-flex; background: var(--paper-2); border: 1px solid var(--hair-strong); border-radius: 999px; padding: 4px; margin-bottom: 24px; }
.sc-toggle button {
  font: inherit; font-weight: 700; font-size: 15px; border: 0; background: none; cursor: pointer;
  padding: 9px 22px; border-radius: 999px; color: var(--ink-faint); transition: 0.2s;
}
.sc-toggle button.on { color: white; }
.sc-toggle button.on[data-k="simple"] { background: var(--blue); }
.sc-toggle button.on[data-k="careless"] { background: var(--terra); }
.sc-panel { display: none; }
.sc-panel.on { display: block; animation: fade 0.4s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px);} to { opacity:1; transform:none;} }
.sc-card { background: var(--card); border: 1px solid var(--hair); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.sc-card .row { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--hair); }
.sc-card .row:last-child { border-bottom: 0; }
.sc-card .row .k { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); font-weight: 700; }
.sc-card .row .v { font-size: 16px; }
@media (max-width: 540px){ .sc-card .row { grid-template-columns: 1fr; gap: 4px; } }

/* ---- Cascade ---- */
.cascade { display: grid; gap: 14px; }
.casc-step {
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start;
  padding: 18px 20px; border-radius: 14px; background: var(--card); border: 1px solid var(--hair);
  box-shadow: var(--shadow-sm); position: relative;
}
.casc-step .stepn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--blue-tint); color: var(--blue-deep);
  display: grid; place-items: center; font-weight: 800; font-family: var(--serif); flex: none;
  transition: background 0.3s, color 0.3s;
}
.casc-step:nth-child(n+4) .stepn { background: var(--warn-tint); color: var(--warn); }
.casc-step h4 { margin: 2px 0 4px; font-family: var(--serif); font-size: 19px; }
.casc-step p { margin: 0; font-size: 15px; color: var(--ink-soft); }
.casc-rail { width: 2px; background: var(--hair-strong); height: 14px; margin-left: 39px; }

/* ---- Nested circles (zoom out) ---- */
.zoom { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; }
@media (max-width: 800px){ .zoom { grid-template-columns: 1fr; } }
.circles { position: relative; width: 100%; max-width: 420px; aspect-ratio: 1; margin: 0 auto; }
.ring {
  position: absolute; border-radius: 50%; display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14px; font-weight: 700; font-size: 13px; color: white; letter-spacing: 0.04em;
  left: 50%; top: 50%; transform: translate(-50%,-50%);
}
.ring span { display: inline-flex; align-items: center; gap: 6px; }
.ring svg { width: 15px; height: 15px; }
.ring.r5 { width: 100%; height: 100%; background: oklch(0.40 0.11 268); }
.ring.r4 { width: 80%; height: 80%; background: oklch(0.50 0.12 290); }
.ring.r3 { width: 60%; height: 60%; background: oklch(0.62 0.14 45); }
.ring.r2 { width: 41%; height: 41%; background: oklch(0.60 0.13 152); }
.ring.r1 { width: 22%; height: 22%; background: oklch(0.55 0.16 25); align-items: center; padding-top: 0; }
.bignum { font-family: var(--serif); font-weight: 600; font-size: clamp(40px, 7vw, 64px); color: var(--blue); line-height: 1; }

/* ---- Quiz ---- */
.quiz { display: grid; gap: 28px; }
.qcard { background: var(--card); border: 1px solid var(--hair); border-radius: 18px; padding: 26px clamp(20px,3vw,30px); box-shadow: var(--shadow-sm); }
.qcard .qn { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--terra); margin-bottom: 10px; }
.qcard .qq { font-family: var(--serif); font-size: 21px; font-weight: 600; margin-bottom: 18px; line-height: 1.3; }
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px;
  border: 1.5px solid var(--hair); background: var(--paper); cursor: pointer; font: inherit;
  text-align: left; color: inherit; transition: border-color 0.2s, background 0.2s; width: 100%;
}
.opt:hover:not(.locked) { border-color: var(--blue-tint-2); }
.opt .mk { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--hair-strong); flex: none; display: grid; place-items: center; }
.opt .mk svg { width: 14px; height: 14px; opacity: 0; }
.opt.correct { border-color: var(--good); background: var(--good-tint); }
.opt.correct .mk { background: var(--good); border-color: var(--good); color: white; }
.opt.correct .mk svg { opacity: 1; }
.opt.wrong { border-color: var(--warn); background: var(--warn-tint); }
.opt.wrong .mk { background: var(--warn); border-color: var(--warn); color: white; }
.opt.wrong .mk svg { opacity: 1; }
.qfb { margin-top: 14px; font-size: 15px; padding: 12px 14px; border-radius: 10px; background: var(--blue-tint); color: var(--blue-deep); opacity: 0; max-height: 0; overflow: hidden; transition: 0.35s; }
.qfb.show { opacity: 1; max-height: 160px; }

/* ---- Reflection journal ---- */
.journal { display: grid; gap: 20px; }
.jentry { background: var(--card); border: 1px solid var(--hair); border-radius: 16px; padding: 22px 24px; box-shadow: var(--shadow-sm); }
.jentry label { display: block; font-family: var(--serif); font-size: 19px; font-weight: 600; margin-bottom: 12px; }
.jentry textarea {
  width: 100%; border: 1.5px solid var(--hair); border-radius: 12px; padding: 14px;
  font: inherit; font-size: 16px; resize: vertical; min-height: 84px; background: var(--paper); color: var(--ink);
  transition: border-color 0.2s;
}
.jentry textarea:focus { outline: none; border-color: var(--blue); }
.jsaved { font-size: 13px; color: var(--good); font-weight: 700; opacity: 0; transition: 0.3s; margin-top: 8px; }
.jsaved.show { opacity: 1; }

/* ---- Glossary section ---- */
.gloss { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
@media (max-width: 700px){ .gloss { grid-template-columns: 1fr; } }
.gitem { background: var(--card); border: 1px solid var(--hair); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow-sm); }
.gitem .gt { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.gitem .gp { font-size: 13.5px; color: var(--blue); font-weight: 700; font-style: italic; margin-bottom: 6px; }
.gitem .gd { font-size: 15px; color: var(--ink-soft); }

/* ---- Completion ---- */
.complete { text-align: center; }
.complete .seal {
  width: 78px; height: 78px; margin: 0 auto 24px; border-radius: 50%;
  background: var(--blue-tint); display: grid; place-items: center; color: var(--blue-deep);
  border: 2px solid var(--blue); transform: scale(0.8); opacity: 0; transition: 0.5s cubic-bezier(.2,1.4,.4,1);
}
.complete.in .seal { transform: none; opacity: 1; }
.complete .seal svg { width: 38px; height: 38px; }

/* ---- Teaser ---- */
.teaser {
  background: var(--blue-deep); border-radius: 22px; padding: clamp(30px,5vw,52px);
  color: oklch(0.95 0.015 250); position: relative; overflow: hidden;
}
.teaser .ch { font-family: var(--sans); font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--amber); font-weight: 700; }
.teaser h2 { color: white; margin: 12px 0 16px; }
.teaser p { color: oklch(0.85 0.02 250); max-width: 50ch; }
.teaser .glass-bg { position: absolute; right: -40px; bottom: -50px; width: 240px; opacity: 0.12; color: white; }

/* ---- Footer ---- */
.foot { padding: 40px 0 60px; text-align: center; color: var(--ink-faint); font-size: 13.5px; }
.foot a { color: var(--blue); }

/* utility */
.center { text-align: center; }
.mt-s { margin-top: 14px; } .mt-m { margin-top: 28px; } .mt-l { margin-top: 44px; }
.divider { width: 40px; height: 3px; background: var(--terra); border-radius: 2px; margin: 0 0 26px; }
section.block.deep .divider { background: var(--amber); }
.btn-reset { font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-faint); background: none; border: 0; cursor: pointer; text-decoration: underline; }
