/* ==========================================================================
   Story: chapters, picture frames, the script text, widgets, finale, footer.
   Each chapter sets its own --c1 / --c2 accent pair inline from hooks/story.yml.
   ========================================================================== */

.chapter { position: relative; isolation: isolate; padding: clamp(64px, 8.5vw, 120px) var(--gutter); }
.chapter__inner { max-width: 1280px; margin-inline: auto; }

/* The giant outlined chapter number drifts slower than the page (scroll.js writes --p, 0 to 1). */
.chapter__num {
  position: absolute; z-index: -1; top: clamp(8px, 3vw, 48px); right: 1vw; pointer-events: none; user-select: none;
  font-size: clamp(9rem, 30vw, 27rem); font-weight: 800; line-height: 0.85; letter-spacing: -0.06em;
  color: transparent; -webkit-text-stroke: 2px color-mix(in srgb, var(--c1) 38%, transparent);
  translate: 0 calc((var(--p, 0.5) - 0.5) * -150px);
  opacity: 0.55; transition: opacity 1.2s;
}
.chapter.is-active .chapter__num { opacity: 1; }
.chapter.is-flip .chapter__num { right: auto; left: 1vw; }

.chapter__head { display: grid; gap: 18px; margin-bottom: clamp(28px, 4vw, 56px); }
.chapter__title {
  max-width: 18ch; padding-bottom: 0.06em; text-wrap: balance;
  font-size: clamp(2.5rem, 6.6vw, 5.6rem); font-weight: 800; line-height: 1.03; letter-spacing: -0.045em;
  background: linear-gradient(100deg, #fff 8%, var(--c1) 50%, var(--c2) 94%) calc(var(--p, 0.5) * 100%) 0 / 230% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.chapter__stage {
  display: grid; align-items: center; gap: clamp(28px, 4.5vw, 72px);
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
}
.chapter.is-flip .chapter__stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr); }
.chapter.is-flip .frame { order: 2; }
.chapter__text { display: grid; gap: 22px; align-content: center; }

/* ---------- The slide picture, framed ---------- */
.frame { position: relative; isolation: isolate; }
/* On wide screens the picture stays in view while the longer text column scrolls past it. */
@media (min-width: 1001px) {
  .frame { position: sticky; top: calc(var(--topbar) + 28px); }
}
/* Ambilight: a blurred copy of the picture glows around the frame. */
.frame__glow {
  position: absolute; inset: -8% -6%; z-index: -1; overflow: hidden; border-radius: 48px; opacity: 0.8;
  filter: blur(46px) saturate(1.9);
}
.frame__glow img { width: 100%; height: 100%; object-fit: cover; }
.frame__box {
  position: relative; overflow: hidden; aspect-ratio: 1600 / 895; border-radius: 28px; background: #0b1226;
  border: 1px solid rgb(255 255 255 / 0.16);
  box-shadow: 0 44px 90px -30px rgb(0 0 0 / 0.9);
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.3s ease-out;
}
/* A conic gradient border that turns slowly: --ang is a registered angle, so it animates smoothly. */
.frame__box::after {
  content: ""; position: absolute; inset: 0; padding: 2px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--ang), var(--c1), transparent 28%, var(--c2) 52%, transparent 78%, var(--c1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
html.fx .frame__box::after { animation: spin-ang 9s linear infinite; }
@keyframes spin-ang { to { --ang: 360deg; } }
.frame__img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(calc(1.03 + var(--p, 0.5) * 0.06)); /* slow zoom as the chapter scrolls by */
}
.frame__shine {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(460px circle at var(--gx, 50%) var(--gy, 0%), rgb(255 255 255 / 0.24), transparent 55%);
}
[data-tilt].is-hot .frame__shine { opacity: 1; }
.frame__zoom { position: absolute; right: 14px; top: 14px; }
.frame__cap { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 16px 6px 0; font-size: 0.9rem; }

/* ---------- Text column ---------- */
.pull { font-size: clamp(1.5rem, 2.7vw, 2.4rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.025em; }
.pull::before {
  content: "\201C"; display: block; margin-bottom: 0.1em; color: var(--c1);
  font-size: 3.4em; line-height: 0.55; font-weight: 800;
}
.pull p {
  background: linear-gradient(100deg, #fff, color-mix(in srgb, var(--c1) 55%, #fff));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* The script lights up word by word as you scroll (scroll.js toggles .on). The dim state keeps AA contrast. */
.script { font-size: clamp(1.02rem, 1.25vw, 1.16rem); line-height: 1.85; }
html.fx .script .w { opacity: 0.62; transition: opacity 0.4s, text-shadow 0.4s; }
html.fx .script .w.on { opacity: 1; text-shadow: 0 0 22px color-mix(in srgb, var(--c1) 70%, transparent); }

.crib { display: grid; gap: 16px; }
.crib dt { color: var(--c1); font-weight: 800; }
.crib dd { margin-top: 0.15em; color: var(--muted); font-size: 0.98rem; line-height: 1.6; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.facts--four { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* four cards read better as a 2 by 2 grid than 3 plus 1 */
/* Each card is a size container, so its value can be sized to fit the card (--len is the character count, set in the template). */
.fact { container-type: inline-size; padding: 18px 20px; border: 1px solid var(--line); border-radius: 20px; background: rgb(255 255 255 / 0.06); }
.fact__value {
  display: block; white-space: nowrap; line-height: 1.05; font-weight: 800; letter-spacing: -0.035em;
  font-size: clamp(1.6rem, 2.6vw, 2.4rem); /* fallback for browsers without container units */
  font-size: clamp(1.45rem, calc(185cqi / max(var(--len, 5), 4)), 2.9rem);
  font-variant-numeric: tabular-nums;
  background: linear-gradient(100deg, var(--c1), var(--c2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fact__label { display: block; margin-top: 0.5em; color: var(--muted); font-size: 0.86rem; line-height: 1.4; }

/* ---------- Widgets (shared) ---------- */
.widget { position: relative; margin-top: clamp(44px, 6vw, 96px); }
.widget__title {
  display: flex; align-items: center; gap: 0.8em; margin-bottom: 22px;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem); font-weight: 700; letter-spacing: 0.015em;
}
.widget__title::before { content: ""; flex: none; width: 30px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.widget__note { margin-top: 16px; color: var(--muted); font-size: 0.86rem; }

/* Tilt cards: scroll.js / widgets.js set --rx, --ry (tilt) and --gx, --gy (glare position). */
.move, .person { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.3s ease-out, border-color 0.3s; }
.move::before, .person::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 0%), color-mix(in srgb, var(--m, var(--c1)) 30%, transparent), transparent 58%);
}
.move.is-hot::before, .person.is-hot::before { opacity: 1; }

/* ---- Chapter 3: obvious fixes ---- */
.fixes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.fix {
  position: relative; padding: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 24px;
  background: rgb(255 255 255 / 0.06); transition: border-color 0.6s, background-color 0.6s, box-shadow 0.6s;
  transition-delay: calc(0.9s + var(--i) * 0.45s);
}
.fix__x { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 16px; border-radius: 50%; background: rgb(255 77 109 / 0.18); color: var(--coral); }
.fix__title { font-size: 1.3rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.015em; }
/* The strike-through is a background that grows across the text, one card after another. */
.fix__title span {
  background: linear-gradient(var(--coral), var(--coral)) 0 58% / 100% 3px no-repeat;
  transition: background-size 0.8s var(--ease); transition-delay: calc(0.5s + var(--i) * 0.45s);
}
.fix__why { margin-top: 0.7em; color: var(--muted); font-size: 0.98rem; }
html.fx .widget--fixes:not(.in-view) .fix__title span { background-size: 0 3px; }
html.fx .widget--fixes.in-view .fix { border-color: rgb(255 77 109 / 0.5); box-shadow: inset 0 0 60px -20px rgb(255 77 109 / 0.35); }
html.fx .widget--fixes:not(.in-view) .fix { border-color: var(--line); }

.insight {
  display: flex; align-items: center; gap: 18px; margin-top: 22px; padding: 24px 28px;
  border: 1px solid color-mix(in srgb, var(--teal) 65%, transparent); border-radius: 24px;
  background: linear-gradient(120deg, rgb(25 240 200 / 0.18), rgb(200 255 61 / 0.09));
  box-shadow: 0 0 70px -14px rgb(25 240 200 / 0.55);
  font-size: clamp(1.3rem, 2.5vw, 2.1rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.025em;
  transition: opacity 0.9s ease 2.6s, translate 0.9s var(--ease) 2.6s, scale 0.9s var(--ease) 2.6s;
}
.insight__icon { flex: none; width: 1.7em; height: 1.7em; color: var(--lime); filter: drop-shadow(0 0 10px var(--lime)); }
html.fx .insight__icon { animation: bob 3.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
html.fx .widget--fixes:not(.in-view) .insight { opacity: 0; translate: 0 26px; scale: 0.96; }

/* ---- Chapter 4: wells to living stone ---- */
.widget--flow { overflow: hidden; border: 1px solid var(--line); border-radius: 32px; background: #060b1d; }
.flow__art { position: absolute; inset: 0; overflow: hidden; }
.flow__art img {
  width: 100%; height: 130%; object-fit: cover; opacity: 0.6; filter: saturate(1.25);
  translate: 0 calc((var(--p, 0.5) - 0.5) * -90px);
}
.flow__art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgb(5 8 22 / 0.94), rgb(5 8 22 / 0.5) 55%, rgb(5 8 22 / 0.82)), linear-gradient(0deg, rgb(5 8 22 / 0.75), transparent 45%);
}
.flow__body { position: relative; padding: clamp(26px, 4vw, 56px); }
.flow { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 34px; }
/* The wire joining the four steps, with a bright pulse travelling along it. */
.flow::before {
  content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 40px; height: 4px; border-radius: 2px; transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--teal), var(--lime), var(--sky)); box-shadow: 0 0 18px rgb(25 240 200 / 0.6);
  transition: transform 1.8s var(--ease) 0.3s;
}
.flow::after {
  content: ""; position: absolute; top: 33px; left: 12.5%; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 22px 6px var(--teal);
}
html.fx .flow::after { animation: travel 4.2s linear infinite 2s; }
@keyframes travel { from { translate: 0 0; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } to { translate: calc(var(--wire, 62vw) * 1) 0; opacity: 0; } }
html.fx .widget--flow:not(.in-view) .flow::before { transform: scaleX(0); }
.flow__step { position: relative; display: grid; justify-items: center; gap: 14px; text-align: center; }
.flow__icon {
  display: grid; place-items: center; width: 82px; height: 82px; border-radius: 50%; color: var(--lime);
  background: radial-gradient(circle at 30% 25%, rgb(255 255 255 / 0.26), rgb(255 255 255 / 0.05)), #0a1330;
  border: 1px solid color-mix(in srgb, var(--teal) 70%, transparent);
  box-shadow: 0 0 0 8px rgb(255 255 255 / 0.035), 0 0 44px -6px var(--teal);
  transition: scale 0.7s var(--ease), opacity 0.7s; transition-delay: calc(0.3s + var(--i) * 0.45s);
}
.flow__icon .icon { width: 36px; height: 36px; }
.flow__n {
  position: absolute; top: -6px; left: calc(50% + 26px); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--lime); color: #04101c; font-size: 0.85rem; font-weight: 800;
}
.flow__label { max-width: 14ch; font-size: 1.08rem; font-weight: 700; line-height: 1.3; }
html.fx .widget--flow:not(.in-view) .flow__icon { scale: 0.3; opacity: 0; }
html.fx .flow__step:nth-child(3) .flow__icon { animation: zap 2.4s ease-in-out infinite; }
html.fx .flow__step:nth-child(4) .flow__icon { animation: zap 3.2s ease-in-out infinite 0.8s; }
@keyframes zap { 50% { box-shadow: 0 0 0 8px rgb(255 255 255 / 0.035), 0 0 70px 2px var(--lime); } }

/* ---- Chapter 5: Read, Root, Raise ---- */
.moves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.move {
  position: relative; display: grid; gap: 12px; align-content: start; padding: 30px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 28px;
  background: linear-gradient(160deg, rgb(255 255 255 / 0.1), rgb(255 255 255 / 0.025)), rgb(8 12 30 / 0.5);
}
.move:nth-child(1) { --m: var(--sky); }
.move:nth-child(2) { --m: var(--lime); }
.move:nth-child(3) { --m: var(--violet); }
.move__verb {
  display: block; width: fit-content; font-size: clamp(2.2rem, 4.4vw, 3.8rem); font-weight: 800; line-height: 1; letter-spacing: -0.045em; padding-bottom: 0.05em;
  background: linear-gradient(100deg, #fff, var(--m)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.move__icon {
  display: grid; place-items: center; width: 60px; height: 60px; border-radius: 20px; color: var(--m);
  background: color-mix(in srgb, var(--m) 16%, transparent); box-shadow: 0 0 40px -10px var(--m);
}
.move__icon .icon { width: 30px; height: 30px; }
html.fx .move__icon .icon { animation: bob 4s ease-in-out infinite; animation-delay: calc(var(--i) * -1.2s); }
.move__title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.move__text { color: var(--muted); }

.seeds { display: grid; gap: 14px; margin-top: 22px; padding: clamp(22px, 3vw, 34px); border: 1px solid var(--line); border-radius: 28px; background: rgb(255 255 255 / 0.05); }
.seeds .widget__title { margin: 0; }
.seeds li { display: flex; align-items: flex-start; gap: 12px; padding: 6px 0; font-size: 1.05rem; }
.seeds li .icon { margin-top: 0.2em; color: var(--lime); }
.leap {
  padding: 22px 26px; border-radius: 22px; font-size: clamp(1.15rem, 2vw, 1.6rem); font-weight: 800; line-height: 1.3; letter-spacing: -0.02em;
  background: linear-gradient(120deg, rgb(56 189 248 / 0.22), rgb(139 92 255 / 0.22)); border: 1px solid rgb(139 92 255 / 0.5);
}

/* ---- Chapter 6: cross-section of the ground ---- */
.layers { overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: rgb(5 8 22 / 0.7); }
.layers__svg { width: 100%; height: auto; }
.layers__water {
  fill: none; stroke: #8be9ff; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 0.018 0.034; opacity: 0.95;
  filter: drop-shadow(0 0 4px #38bdf8);
}
html.fx .layers__water { animation: water 3.2s linear infinite; }
html.fx .layers__water--b { animation-duration: 4.6s; animation-direction: reverse; }
@keyframes water { to { stroke-dashoffset: -0.052; } }
.layers__roots path { fill: none; stroke: var(--lime); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
html.fx .widget--layers:not(.in-view) .layers__roots path { stroke-dashoffset: 1; }
html.fx .widget--layers.in-view .layers__roots path { animation: grow 2.8s var(--ease) calc(var(--d) * 0.45s + 0.3s) backwards; }
@keyframes grow { from { stroke-dashoffset: 1; } }
html.fx .layers__well { animation: glow 3s ease-in-out infinite; }
@keyframes glow { 50% { filter: drop-shadow(0 0 10px var(--teal)); } }
.layers__legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 22px clamp(18px, 3vw, 32px) 28px; border-top: 1px solid var(--line); }
.layers__legend li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); font-size: 0.96rem; }
.layers__legend strong { color: var(--text); }
.swatch { flex: none; width: 16px; height: 16px; margin-top: 0.3em; border-radius: 5px; }
.swatch--clay { background: #7a56a3; }
.swatch--sand { background: #d9a441; }
.swatch--well { background: var(--teal); box-shadow: 0 0 12px var(--teal); }

/* ---- Chapter 7: lifelines rise first ---- */
.lifelines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: end; }
.lift { display: grid; align-content: end; }
.lift__card {
  padding: 26px; border: 1px solid var(--line); border-radius: 26px 26px 6px 6px;
  background: linear-gradient(160deg, rgb(255 255 255 / 0.11), rgb(255 255 255 / 0.03)), rgb(8 12 30 / 0.6);
}
.lift__icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 18px; color: #04101c; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 10px 30px -8px var(--c1); }
.lift__card h3 { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.lift__card p { margin-top: 0.4em; color: var(--muted); }
/* Each block of ground is taller than the last, so the cards form a staircase that grows upward. */
.lift__ground {
  display: block; height: calc(34px + var(--i) * 44px); border-top: 3px solid var(--lime); border-radius: 0 0 20px 20px;
  background: repeating-linear-gradient(180deg, #3a2a58 0 14px, #5a4280 14px 28px, #6b4f10 28px 40px);
  box-shadow: 0 -12px 34px -10px var(--lime); transition: height 1.4s var(--ease) calc(0.3s + var(--i) * 0.55s);
}
html.fx .widget--lifelines:not(.in-view) .lift__ground { height: 0; }

/* ---- Chapter 8: Penjaringan root map ---- */
.map { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: center; }
.map__stage { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: #06122b; }
.map__svg { width: 100%; height: auto; }
.m-sea { fill: #07224a; }
.m-wave { fill: none; stroke: rgb(140 210 255 / 0.28); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 18 26; }
html.fx .m-wave { animation: water-px 5s linear infinite; }
@keyframes water-px { to { stroke-dashoffset: -88; } }
.m-foam { fill: none; stroke: rgb(190 235 255 / 0.55); stroke-width: 2; stroke-linejoin: round; }
/* Every cell carries three colours (--then, --now, --next). The svg's data-state picks one, and --d delays
   each cell by its distance from the pump so a change spreads outward like a ripple. */
.cell { fill: var(--then); transition: fill 1.2s ease var(--d, 0s); }
.map__svg[data-state="now"] .cell { fill: var(--now); }
.map__svg[data-state="next"] .cell { fill: var(--next); }
.m-seed { fill: #fff; opacity: 0; scale: 0; transform-box: fill-box; transform-origin: center; transition: opacity 0.5s, scale 0.6s var(--ease); }
.map__svg[data-state="now"] .m-seed, .map__svg[data-state="next"] .m-seed { opacity: 0.95; scale: 1; }
.m-ps { fill: #fff; stroke: #050816; stroke-width: 3; }
.m-ring { fill: none; stroke: #fff; stroke-width: 2; transform-box: fill-box; transform-origin: center; }
html.fx .m-ring { animation: ring 2.4s ease-out infinite; }
@keyframes ring { from { scale: 0.6; opacity: 0.9; } to { scale: 3.2; opacity: 0; } }
.map__pin {
  position: absolute; left: 49.5%; top: 37%; translate: -50% -135%; padding: 6px 12px; border-radius: 999px;
  background: #fff; color: #050816; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.03em; pointer-events: none;
}
.map__side { display: grid; gap: 20px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; width: fit-content; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: rgb(255 255 255 / 0.07); }
.seg button {
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font-weight: 700; transition: background-color 0.3s, color 0.3s;
}
.seg button:hover { background: rgb(255 255 255 / 0.12); }
.seg button[aria-pressed="true"] { background: linear-gradient(110deg, var(--c1), var(--c2)); color: #04101c; }
.map__read { display: grid; gap: 4px; }
.map__rate {
  width: fit-content; padding-bottom: 0.05em; font-size: clamp(2.4rem, 5.4vw, 4rem); font-weight: 800; line-height: 1; letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums; background: linear-gradient(100deg, var(--c1), var(--c2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.map__note { color: var(--muted); }
.map__key { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 0.84rem; }
.k { display: inline-block; width: 12px; height: 12px; margin-right: 7px; border-radius: 3px; vertical-align: -1px; }
.k--hot { background: #ff4d6d; }
.k--warm { background: #ffb020; }
.k--root { background: #19f0c8; }
.k--rise { background: #c8ff3d; }

/* ---- Chapter 9: ten-year chart ---- */
.chart { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: center; }
.chart__plot { padding: clamp(10px, 2vw, 22px); border: 1px solid var(--line); border-radius: 28px; background: rgb(5 8 22 / 0.65); }
.chart__svg { width: 100%; height: auto; overflow: visible; }
.chart__svg text { fill: var(--muted); font-family: var(--font); font-size: 13px; }
.c-zone { fill: rgb(255 77 109 / 0.08); }
.c-grid { stroke: rgb(255 255 255 / 0.09); }
.c-zero { stroke: rgb(255 255 255 / 0.75); stroke-width: 1.6; stroke-dasharray: 7 6; }
.chart__svg .c-zero-label { fill: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.chart__svg .c-axis-title { font-size: 12px; letter-spacing: 0.04em; }
.c-line { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; transition: stroke-dashoffset 2.8s var(--ease) 0.3s; }
.c-line--sq { stroke: var(--amber); filter: drop-shadow(0 0 6px rgb(255 176 32 / 0.55)); }
.c-line--ak { stroke: var(--teal); filter: drop-shadow(0 0 8px rgb(25 240 200 / 0.75)); }
.c-area { transition: opacity 1.4s ease 2s; }
.chart__svg .c-end { font-size: 15px; font-weight: 800; }
.chart__svg .c-end--sq { fill: var(--amber); }
.chart__svg .c-end--ak { fill: var(--teal); }
.c-fade { transition: opacity 0.8s ease 2.6s; }
.c-cursor { stroke: rgb(255 255 255 / 0.55); stroke-width: 1.5; stroke-dasharray: 3 5; }
.c-dot { stroke: #050816; stroke-width: 3; }
.c-dot--sq { fill: var(--amber); }
.c-dot--ak { fill: var(--teal); }
html.fx .widget--chart:not(.in-view) .c-line { stroke-dashoffset: 1; }
html.fx .widget--chart:not(.in-view) :is(.c-area, .c-fade) { opacity: 0; }
.chart__side { display: grid; gap: 4px; }
.chart__legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-weight: 700; }
.key { display: inline-flex; align-items: center; gap: 9px; }
.key i { width: 30px; height: 5px; border-radius: 3px; }
.key--sq i { background: var(--amber); }
.key--akar i { background: var(--teal); }
.chart__read { display: grid; gap: 2px; margin: 16px 0 10px; }
.chart__year { color: var(--muted); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.chart__val { color: var(--muted); }
.chart__val b { margin-right: 0.3em; font-size: clamp(1.9rem, 3.6vw, 2.9rem); font-weight: 800; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.chart__val--akar b { color: var(--teal); }
.chart__val--sq b { color: var(--amber); }
.scrub { display: grid; gap: 6px; font-size: 0.92rem; font-weight: 600; }
.beats { display: grid; gap: 10px; margin-top: 18px; }
.beat { display: flex; align-items: baseline; gap: 12px; padding: 13px 16px; border-left: 4px solid var(--teal); border-radius: 14px; background: rgb(255 255 255 / 0.06); }
.beat--warn { border-color: var(--amber); }
.beat b { flex: none; font-weight: 800; }
.beat span { color: var(--muted); }
.datatable { margin-top: 22px; padding: 4px 20px; border: 1px solid var(--line); border-radius: 20px; background: rgb(255 255 255 / 0.04); }
.datatable summary { display: flex; align-items: center; gap: 0.6em; min-height: 48px; font-weight: 700; cursor: pointer; }
.datatable table { width: 100%; margin: 6px 0 16px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.datatable th, .datatable td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; font-weight: 500; }
.datatable th[scope="col"] { color: var(--muted); font-size: 0.85rem; }
.datatable th:first-child, .datatable td:first-child { text-align: left; }

/* ---- Chapter 10: people ---- */
.widget--people { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.7fr); gap: 20px; align-items: stretch; }
.people__art { position: relative; min-height: 340px; overflow: hidden; border: 1px solid var(--line); border-radius: 28px; }
.people__art img {
  position: absolute; left: 0; top: -6%; width: 100%; height: 112%; object-fit: cover;
  translate: 0 calc((var(--p, 0.5) - 0.5) * 50px);
}
.people__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgb(5 8 22 / 0.55), transparent 45%); }
.people { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.person {
  position: relative; padding: 28px; border: 1px solid var(--line); border-radius: 26px;
  background: linear-gradient(160deg, rgb(255 255 255 / 0.1), rgb(255 255 255 / 0.025)), rgb(8 12 30 / 0.5);
}
.person__icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 16px; border-radius: 18px; color: #04101c; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 12px 34px -8px var(--c1); }
.person h3 { margin-bottom: 0.4em; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.person p { color: var(--muted); }

/* ---- Chapter 11: roadmap ---- */
.roadmap { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding-top: 46px; }
/* The root line grows from left to right when the roadmap scrolls into view. */
.roadmap::before {
  content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 4px; border-radius: 2px; transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--teal), var(--lime) 45%, var(--violet)); box-shadow: 0 0 20px rgb(25 240 200 / 0.6);
  transition: transform 2.8s var(--ease) 0.2s;
}
html.fx .widget--roadmap:not(.in-view) .roadmap::before { transform: scaleX(0); }
.phase { position: relative; padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(160deg, rgb(255 255 255 / 0.09), rgb(255 255 255 / 0.025)), rgb(8 12 30 / 0.5); }
.phase__node {
  position: absolute; left: 26px; top: -41px; width: 22px; height: 22px; border: 4px solid var(--lime); border-radius: 50%;
  background: var(--ink); box-shadow: 0 0 22px var(--lime);
  transition: scale 0.6s var(--ease), opacity 0.6s; transition-delay: calc(0.4s + var(--i) * 0.7s);
}
html.fx .widget--roadmap:not(.in-view) .phase__node { scale: 0; opacity: 0; }
.phase__when { margin-bottom: 0.5em; color: var(--lime); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.phase__title { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.025em; }
.phase__text { margin-top: 0.5em; color: var(--muted); font-size: 0.98rem; }
.roadmap__foot { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; margin-top: 22px; }
.measures { padding: 24px 28px; border: 1px solid var(--line); border-radius: 24px; background: rgb(255 255 255 / 0.05); }
.measures .widget__title { margin-bottom: 10px; }
.measures li { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; }
.measures li .icon { margin-top: 0.22em; color: var(--lime); }

/* ---- Chapter 13: questions ---- */
.qa { display: grid; gap: 12px; }
.qa__item { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: rgb(255 255 255 / 0.05); transition: background-color 0.3s, border-color 0.3s; }
.qa__item[open] { border-color: color-mix(in srgb, var(--c1) 60%, transparent); background: rgb(255 255 255 / 0.09); }
.qa__item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; padding: 18px 24px;
  font-size: 1.15rem; font-weight: 700; cursor: pointer; list-style: none;
}
.qa__item summary::-webkit-details-marker { display: none; }
.qa__plus { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: rgb(255 255 255 / 0.12); transition: transform 0.4s var(--ease), background-color 0.3s; }
.qa__item[open] .qa__plus { transform: rotate(45deg); background: var(--c1); color: #04101c; }
.qa__a { max-width: 72ch; padding: 0 24px 24px; color: var(--muted); font-size: 1.05rem; }
html.fx .qa__item[open] .qa__a { animation: qa-in 0.45s var(--ease); }
@keyframes qa-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Finale ---------- */
.finale { position: relative; isolation: isolate; display: grid; place-items: center; min-height: 92svh; padding: 120px var(--gutter); overflow: clip; text-align: center; }
.finale__glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.finale__glow i { position: absolute; width: 64vmax; height: 64vmax; border-radius: 50%; }
.finale__glow i:nth-child(1) { left: -20vmax; top: -10vmax; background: radial-gradient(circle, rgb(25 240 200 / 0.4), transparent 66%); }
.finale__glow i:nth-child(2) { right: -22vmax; bottom: -18vmax; background: radial-gradient(circle, rgb(139 92 255 / 0.45), transparent 66%); }
html.fx .finale__glow i { animation: drift 24s ease-in-out infinite alternate; }
html.fx .finale__glow i:nth-child(2) { animation-duration: 30s; animation-delay: -10s; }
.finale__inner { display: grid; justify-items: center; gap: clamp(20px, 3vw, 36px); }
.finale__title { display: grid; font-size: clamp(3.4rem, 13.5vw, 11.5rem); font-weight: 800; line-height: 0.9; letter-spacing: -0.055em; }
.finale__line {
  display: block; padding-bottom: 0.06em;
  background: linear-gradient(100deg, #fff 10%, var(--lime) 58%, var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.finale__line--outline { background: none; color: transparent; -webkit-text-stroke: 2px rgb(255 255 255 / 0.75); }
.finale__thanks { max-width: 24ch; font-size: clamp(1.4rem, 3vw, 2.4rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.025em; }
.finale__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* ---------- Footer ---------- */
.footer { padding: 56px var(--gutter) calc(56px + 80px); border-top: 1px solid var(--line); background: rgb(5 8 22 / 0.75); }
.footer__inner { display: grid; gap: 22px; max-width: 1280px; margin-inline: auto; }
.footer__brand { display: flex; align-items: center; gap: 10px; color: var(--lime); font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; }
.footer__brand .icon { width: 30px; height: 30px; }
.footer__text { display: grid; gap: 10px; max-width: 78ch; color: var(--muted); font-size: 0.95rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: 10px 28px; }

/* ---------- Tablet and phone ---------- */
@media (max-width: 1000px) {
  .chapter__stage, .chapter.is-flip .chapter__stage { grid-template-columns: minmax(0, 1fr); }
  .chapter.is-flip .frame { order: 0; }
  .moves, .lifelines { grid-template-columns: minmax(0, 1fr); }
  .lift__ground { height: 0 !important; border: 0; box-shadow: none; }
  .lift__card { border-radius: 26px; }
  .map, .chart { grid-template-columns: minmax(0, 1fr); }
  .widget--people { grid-template-columns: minmax(0, 1fr); }
  .people__art { min-height: 280px; }
  .roadmap { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 0 0 0 38px; }
  .roadmap::before { left: 10px; right: auto; top: 0; bottom: 0; width: 4px; height: auto; transform-origin: 50% 0; background: linear-gradient(180deg, var(--teal), var(--lime) 45%, var(--violet)); }
  html.fx .widget--roadmap:not(.in-view) .roadmap::before { transform: scaleY(0); }
  .phase__node { left: -38px; top: 28px; }
  .roadmap__foot { grid-template-columns: minmax(0, 1fr); }
  .layers__legend { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-left: 4px; }
  .flow::before { left: 41px; right: auto; top: 40px; bottom: 40px; width: 4px; height: auto; transform-origin: 50% 0; }
  html.fx .widget--flow:not(.in-view) .flow::before { transform: scaleY(0); }
  .flow::after { display: none; }
  .flow__step { grid-template-columns: auto 1fr; justify-items: start; text-align: left; align-items: center; gap: 18px; }
  .flow__n { top: -6px; left: 54px; }
  .flow__label { max-width: none; }
}
@media (max-width: 600px) {
  .people { grid-template-columns: minmax(0, 1fr); }
  .fixes { grid-template-columns: minmax(0, 1fr); }
  .insight { flex-direction: column; align-items: flex-start; }
  .chapter__num { font-size: 9rem; }
}
