/* =====================================================================
   FINFLIX — the episode tile board (episode.html, full width).
   Every element of an episode is one tile. Tiles swipe sideways inside a
   deck; sections stack downwards in the order of the structural sketch:
   trailer → episode section → academic layer → bonus.
   Tile colours carry the sketch's colour code, so the page and the sketch
   can be read side by side.
   ===================================================================== */

:root {
  --t-dirk:   #8fd3c7;   /* sketch: teal — Dirk maps the content / intent   */
  --t-story:  #7cc0ff;   /* sketch: blue — storytelling, audiobook          */
  --t-q:      #fcfcfc;   /* sketch: white half-round — personal questions   */
  --t-acad:   #b8f28a;   /* sketch: green — standing points, graphs, bonus  */
  --t-red:    #ff5a52;   /* sketch: red bar — "Episode section"             */
  --t-fixed:  var(--pink);
  --t-switch: var(--yellow);
  --t-gold:   var(--gold);
  --t-sky:    var(--sky);

  /* chart series (validated: dark, surface #0b1238, all checks pass) */
  --c-nl:   #d95926;
  --c-us:   #3987e5;
  --c-home: #3987e5;
  --c-biz:  #d95926;
  --c-list: #199e70;
  --c-cash: #c98500;

  --paper:  #fbfaf6;
  --paper-ink: #1a1c26;
}

/* ---------------------------------------------------------------- *
   Section scaffolding
 * ---------------------------------------------------------------- */
.bsec { padding: 46px 0 8px; scroll-margin-top: 76px; }
.bsec-k {
  font-family: var(--mono); font-size: 12px; letter-spacing: 3.5px; text-transform: uppercase;
  color: var(--k, var(--pink)); margin: 0 0 8px;
}
.bsec h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; margin: 0 0 6px; }
.bsec .sec-lede { margin-bottom: 18px; }

.redbar {
  display: flex; align-items: center; gap: 14px; margin: 0 0 18px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 4px; text-transform: uppercase; color: #fff;
}
.redbar::before, .redbar::after { content: ""; height: 3px; flex: 1; border-radius: 3px; background: var(--t-red); }
.redbar::before { flex: 0 0 26px; }

.doublerule { border: 0; border-top: 3px double var(--border); margin: 56px 0 0; }

/* ---------------------------------------------------------------- *
   Status chips
 * ---------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; line-height: 1; padding: 6px 9px; border-radius: 99px;
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
  background: rgba(255,255,255,.03);
}
.chip b { color: var(--white); font-weight: 600; }
.chip--later::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); }
.chip--ready::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #7ef07a; }
.chip--draft::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pink); }
a.chip, button.chip { cursor: pointer; font: inherit; font-size: 11.5px; transition: border-color .2s, color .2s; }
a.chip:hover, button.chip:hover { border-color: var(--sky); color: var(--white); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------------------------------- *
   Trailer band
 * ---------------------------------------------------------------- */
.trailer {
  display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center;
  border: 1px solid rgba(255,255,255,.22); border-radius: 26px;
  padding: 22px 26px; background: linear-gradient(120deg, var(--navy-2), var(--navy-3));
}
.trailer-play {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid rgba(255,255,255,.4); color: #fff; font-size: 22px; padding-left: 4px;
}
.trailer h3 { font-size: 19px; font-weight: 800; margin: 0 0 4px; }
.trailer p { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 62ch; }
@media (max-width: 700px) {
  .trailer { grid-template-columns: 1fr; padding: 20px; gap: 14px; }
  .trailer-play { width: 52px; height: 52px; }
}

/* ---------------------------------------------------------------- *
   Deck = horizontal swipe row of tiles
 * ---------------------------------------------------------------- */
.deck { position: relative; }
.deck-track {
  display: flex; gap: 18px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 8px var(--gutter) 18px; margin-inline: calc(var(--gutter) * -1);
  scroll-padding-inline: var(--gutter);
}
.deck-track:focus-visible { outline: 2px solid var(--pink); outline-offset: -2px; border-radius: 8px; }
.deck-track > * { flex: 0 0 clamp(290px, 30%, 370px); scroll-snap-align: start; }
.deck-track--wide > * { flex-basis: clamp(300px, 46%, 560px); }
.deck-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 2px; min-height: 40px;
}
.deck-pos { font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px; color: var(--muted-2); }
.deck-pos b { color: var(--white); font-weight: 600; letter-spacing: 0; font-family: var(--font); font-size: 13.5px; margin-left: 8px; }
.deck-ctl { display: flex; gap: 8px; align-items: center; }
.dots { display: flex; gap: 6px; margin-right: 6px; }
.dot {
  width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--border); transition: background .2s, transform .2s; }
.dot[aria-current="true"]::before { background: var(--t, var(--pink)); transform: scale(1.35); }
.arrow {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--navy-2); color: #fff; font-size: 18px; cursor: pointer;
  display: grid; place-items: center; transition: border-color .2s, color .2s, opacity .2s;
}
.arrow:hover { border-color: var(--pink); color: var(--pink); }
.arrow[disabled] { opacity: .5; pointer-events: none; }
@media (max-width: 700px) {
  .deck-track > * { flex-basis: 84%; }
  .deck-track--wide > * { flex-basis: 90%; }
  .dots { display: none; }
}

/* ---------------------------------------------------------------- *
   Tile — the atom of the board
 * ---------------------------------------------------------------- */
.tile {
  --t: var(--t-dirk);
  position: relative; display: flex; flex-direction: column; gap: 12px;
  min-height: 450px; padding: 20px 20px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  border: 1px solid var(--hair); border-top: 3px solid var(--t);
  border-radius: 18px; overflow: hidden;
}
.tile-k {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11px; letter-spacing: 2.2px; text-transform: uppercase;
  color: var(--t); margin: 0;
}
.tile-k > span:not(.ai-mark) {
  flex-basis: 100%; color: var(--muted-2);
  font-family: var(--font); font-size: 12.5px; letter-spacing: .2px; text-transform: none;
}
.tile h3 { font-size: 21px; font-weight: 800; line-height: 1.2; margin: 0; }
.tile p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--sky-soft); }
.tile-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding-top: 6px; }

.tbtn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink-blue);
  background: var(--t); border: 0; border-radius: 10px; padding: 9px 14px;
  transition: transform .2s var(--ease), filter .2s;
}
.tbtn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.tbtn--ghost { background: transparent; color: var(--white); border: 1px solid var(--border); font-weight: 600; }
.tbtn--ghost:hover { border-color: var(--t); color: #fff; }
.tbtn[disabled] { opacity: .55; cursor: not-allowed; transform: none; filter: none; }

/* intent tile: map concepts with Switch roles */
.roles { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.roles li { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: baseline; font-size: 14px; }
.role { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted-2); }
.hbeat {
  border: 1px dashed color-mix(in srgb, var(--t) 60%, transparent); border-radius: 12px;
  padding: 10px 12px; font-size: 13.5px; color: var(--white);
}
.hbeat::before { content: "♥ Heartbeat · "; font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.5px; color: var(--t); text-transform: uppercase; }

/* questions — numbered list (the big variant lives with the viewer) */
.qs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: q; }
.qs li { counter-increment: q; display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 15px; line-height: 1.45; color: var(--white); }
.qs li::before {
  content: counter(q); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--t); color: var(--navy); font-weight: 800; font-size: 12.5px; margin-top: 1px;
}
.qs small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted-2); margin-bottom: 2px; }
.ai-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, #f58ab0, #8a7cf0); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0; }

/* quote tile */
.quote { margin: 0; }
.quote p { font-size: 19px; line-height: 1.4; font-weight: 700; color: var(--white); }
.quote p::before { content: "“"; color: var(--t); }
.quote p::after { content: "”"; color: var(--t); }
.quote cite { display: block; margin-top: 6px; font-style: normal; font-size: 12.5px; color: var(--muted-2); }

/* remedy — Rider / Elephant / Path */
.remedy { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.remedy li { border-left: 2px solid var(--t); padding: 2px 0 2px 11px; font-size: 13.5px; color: var(--sky-soft); line-height: 1.45; }
.remedy b { display: block; color: var(--white); font-size: 14px; }

/* dialogue — chat bubbles */
.chat { display: flex; flex-direction: column; gap: 8px; }
.say { max-width: 88%; padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.4; background: var(--panel-2); color: var(--white); }
.say b { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted-2); font-weight: 400; margin-bottom: 1px; }
.say.b { align-self: flex-end; background: color-mix(in srgb, var(--t) 22%, transparent); }

/* ---------------------------------------------------------------- *
   Academic layer
 * ---------------------------------------------------------------- */
.points { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .points { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .points { grid-template-columns: 1fr; } }
.point {
  --t: var(--t-acad);
  display: flex; flex-direction: column; gap: 10px; text-align: left; cursor: pointer;
  font: inherit; color: inherit; padding: 18px; border-radius: 16px;
  background: color-mix(in srgb, var(--t) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--t) 30%, transparent);
  transition: background .2s, border-color .2s, transform .2s var(--ease);
}
.point:hover { transform: translateY(-3px); border-color: var(--t); }
.point[aria-pressed="true"] { background: color-mix(in srgb, var(--t) 16%, transparent); border-color: var(--t); box-shadow: inset 0 -3px 0 var(--t); }
.point .eq { font-size: 23px; font-weight: 800; line-height: 1.15; color: var(--white); }
.point .eq em { font-style: normal; color: var(--t); }
.point p { margin: 0; font-size: 14px; color: var(--sky-soft); line-height: 1.5; }
.point small { margin-top: auto; font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted-2); }

.filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 26px 0 10px; }
.filterbar .bsec-k { margin: 0; }

/* paper tile — academic graphs keep their printed look */
.tile--paper { --t: var(--t-acad); background: var(--paper); color: var(--paper-ink); border-color: transparent; border-top-color: var(--t); min-height: 0; }
.tile--paper .tile-k { color: #3e6b12; }
.tile--paper .tile-k span { color: #6a6d78; }
.tile--paper h3 { color: var(--paper-ink); font-size: 18px; }
.tile--paper p { color: #3b3e4a; font-size: 14px; }
.tile--paper .chart-btn {
  display: block; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; overflow: hidden;
  aspect-ratio: 1200 / 680;
}
.tile--paper .chart-btn img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tile--paper .tbtn--ghost { color: var(--paper-ink); border-color: #c9cbd3; }
.tile--paper .chip { color: #3b3e4a; border-color: #d4d6dd; background: #fff; }
.tile--paper .chip b { color: var(--paper-ink); }
.tile--paper a.chip:hover, .tile--paper button.chip:hover { border-color: #3e6b12; color: #111; }
.graphline { font-size: 13px; color: #4b4f5c; }
.graphline b { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: #3e6b12; font-weight: 400; display: block; margin-bottom: 4px; }

/* infographics (built in HTML from the chart data card) */
.ig { display: grid; gap: 8px; }
.ig-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.ig-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.rung { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--hair); position: relative; }
.rung:first-of-type { border-top: 0; }
.rung-l { font-size: 13px; line-height: 1.25; }
.rung-l b { display: block; color: var(--white); }
.rung-l span { color: var(--muted-2); font-size: 12px; }
.bars { display: grid; gap: 4px; }
.bar { display: grid; grid-template-columns: 1fr 44px; gap: 8px; align-items: center; font-size: 12px; color: var(--sky-soft); }
.bar-track { height: 12px; position: relative; }
.bar-fill { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.rung-meta { grid-column: 2; font-size: 12px; color: var(--muted-2); }
.rung:hover .bar-fill, .rung:focus-within .bar-fill { filter: brightness(1.15); }

.stack-row { display: grid; grid-template-columns: 58px 1fr 42px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); padding: 1px 0; }
.stack-row b { color: var(--white); font-weight: 600; font-size: 12.5px; }
.stack { display: flex; height: 16px; gap: 2px; }
.stack span { display: block; height: 100%; min-width: 0; }
.stack span:first-child { border-radius: 4px 0 0 4px; }
.stack span:last-child  { border-radius: 0 4px 4px 0; }
.stack-row:hover .stack, .stack-row:focus-visible .stack { outline: 1px solid rgba(255,255,255,.45); outline-offset: 2px; border-radius: 4px; }
.stack-row:focus-visible { outline: none; }

.vtip {
  position: fixed; z-index: 80; pointer-events: none; max-width: 240px;
  background: #0e1c55; color: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 11px; font-size: 12.5px; line-height: 1.45; box-shadow: var(--sh-card);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.vtip.on { opacity: 1; transform: none; }
.vtip b { display: block; margin-bottom: 2px; }


/* ---------------------------------------------------------------- *
   Bonus grid (2 × 2, as in the sketch)
 * ---------------------------------------------------------------- */
.bonus { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bonus .tile { min-height: 330px; --t: var(--t-acad); }
@media (max-width: 760px) { .bonus { grid-template-columns: 1fr; } .bonus .tile { min-height: 0; } }
.scratch { font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", var(--font); font-size: 14.5px; line-height: 1.55; color: var(--sky-soft); min-height: 7.5em; }
.fire-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.fire-grid div { padding: 9px 11px; border-radius: 10px; background: var(--panel); font-size: 13px; line-height: 1.35; color: var(--muted); }
.fire-grid b { display: block; color: var(--white); font-size: 13.5px; }

/* ---------------------------------------------------------------- *
   Reader — full text on demand (native <dialog>)
 * ---------------------------------------------------------------- */
.reader {
  --t: var(--pink);
  width: min(760px, calc(100% - 24px)); max-height: min(88vh, 900px);
  padding: 0; border: 1px solid var(--border); border-top: 3px solid var(--t); border-radius: 20px;
  background: var(--navy-1); color: var(--white); box-shadow: var(--sh-hero);
}
.reader::backdrop { background: rgba(0,3,20,.72); backdrop-filter: blur(4px); }
.reader-in { display: flex; flex-direction: column; max-height: inherit; }
.reader-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid var(--hair); }
.reader-head h2 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; line-height: 1.2; }
.reader-x { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: none; color: #fff; font-size: 20px; cursor: pointer; }
.reader-x:hover { border-color: var(--pink); color: var(--pink); }
.reader-body { overflow-y: auto; padding: 16px 24px 26px; font-size: 16px; line-height: 1.7; color: var(--sky-soft); }
.reader-body p { margin: 0 0 14px; max-width: 66ch; }
.reader-body h4 { font-family: var(--mono); font-size: 11.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--t); margin: 20px 0 8px; font-weight: 400; }
.reader-body ul, .reader-body ol { padding-left: 20px; margin: 0 0 14px; }
.reader-body li { margin-bottom: 6px; }
.reader-body .paper { background: var(--paper); border-radius: 12px; padding: 10px; margin: 0 0 14px; }
.reader-body .paper img { width: 100%; display: block; }
.reader-body table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 0 0 14px; }
.reader-body th, .reader-body td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--hair); }
.reader-body th { color: var(--muted-2); font-weight: 600; }
.reader-body td.n, .reader-body th.n { text-align: right; font-variant-numeric: tabular-nums; }
.reader-body blockquote { margin: 0 0 14px; padding: 4px 0 4px 14px; border-left: 3px solid var(--t); color: var(--white); }
@media (max-width: 600px) {
  .reader-head { padding: 16px 16px 10px; }
  .reader-body { padding: 14px 16px 22px; font-size: 15.5px; }
}

/* `hidden` must win over component display rules (.chip is inline-flex) */
.bsec [hidden] { display: none !important; }
.tile:not(.tile--paper) .graphline { color: var(--muted); }
.tile:not(.tile--paper) .graphline b { color: var(--t-acad); }

/* ---------------------------------------------------------------- *
   Episode-page placement
 * ---------------------------------------------------------------- */
.board { padding: 6px 0 30px; }
.board > .redbar { margin-top: 0; }
.board .trailer { margin-bottom: 26px; }
.trailer-act { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
@media (max-width: 700px) { .trailer-act { align-items: flex-start; } }
.tbtn--white { background: #fcfcfc; color: var(--ink-blue); }
.tile .sub { font-size: 13px; color: var(--muted); font-style: italic; }
.src { font-size: 13.5px; color: var(--muted-2); }
.tile--paper .src { color: #5a5e6b; }
.bonus--one { grid-template-columns: minmax(0, 1fr); }
.tscroll { overflow-x: auto; margin: 0 0 14px; background:
  linear-gradient(90deg, var(--navy-1) 30%, transparent) left / 24px 100% no-repeat local,
  linear-gradient(270deg, var(--navy-1) 30%, transparent) right / 24px 100% no-repeat local,
  radial-gradient(farthest-side at 0 50%, rgba(255,255,255,.18), transparent) left / 10px 100% no-repeat scroll,
  radial-gradient(farthest-side at 100% 50%, rgba(255,255,255,.18), transparent) right / 10px 100% no-repeat scroll; }
.tscroll table { margin: 0; min-width: 520px; }
.tile--paper :focus-visible { outline-color: #3e6b12; }

/* ---------------------------------------------------------------- *
   Viewer — one episode element per view, full text on screen.
   Full-bleed: the viewer breaks out of .wrap to the whole page width,
   and each element fills (at least) the screen below the menu bar.
   A sticky menu + arrows switch elements; swipe on touch screens.
 * ---------------------------------------------------------------- */
.viewer {
  --sbw: 0px;
  --bleed: calc(100vw - var(--sbw));
  width: var(--bleed); margin-left: calc(50% - var(--bleed) / 2);
  scroll-margin-top: var(--navh, 68px); margin-top: 10px;
}
.vbar {
  position: sticky; top: var(--navh, 68px); z-index: 30;
  display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 10px; align-items: center;
  padding: 14px clamp(12px, 2vw, 32px);
  background: linear-gradient(180deg, rgba(0,5,31,.97) 78%, rgba(0,5,31,.85));
  border-bottom: 1px solid var(--hair);
  backdrop-filter: blur(10px);
}
.vmenu {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 8px 6px 10px; justify-content: safe center;
}
.vmenu::-webkit-scrollbar { display: none; }

/* ---- the "realism" button: gradient ring · cyan blob · dark inner face ---- */
.rbtn {
  position: relative; flex: none; cursor: pointer;
  padding: 2px; border: 0; border-radius: 16px;
  font: inherit; color: #fff;
  background: radial-gradient(circle 80px at 80% -10%, #ffffff, #181b1b);
  transition: transform .2s var(--ease), filter .2s;
}
.rbtn::after {                       /* soft white halo behind the top-right */
  content: ""; position: absolute; top: 0; right: 0; z-index: -1;
  width: 65%; height: 60%; border-radius: 120px;
  box-shadow: 0 0 20px #ffffff38;
}
.rbtn .blob {                        /* cyan → blue glow, bottom-left */
  position: absolute; left: 0; bottom: 0;
  width: 70px; height: 100%; border-radius: 16px;
  background: radial-gradient(circle 60px at 0% 100%, #3fe9ff, #0000ff80, transparent);
  box-shadow: -10px 10px 30px #0051ff2d;
}
.rbtn .inner {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 14px; color: #fff;
  background: radial-gradient(circle 80px at 80% -50%, #777777, #0f1111);
}
.rbtn .inner::before {
  content: ""; position: absolute; inset: 0; border-radius: 14px; pointer-events: none;
  background: radial-gradient(circle 60px at 0% 100%, #00e1ff1a, #0000ff11, transparent);
}
.rbtn:hover { transform: translateY(-2px); filter: brightness(1.12); }
.rbtn:active { transform: translateY(0); }
.rbtn:focus-visible { outline: 2px solid var(--pink); outline-offset: 4px; }
.rbtn[disabled] { opacity: .5; cursor: default; transform: none; filter: none; }

.rbtn--round { width: 48px; height: 48px; border-radius: 50%; }
.rbtn--round .blob { width: 100%; border-radius: 50%; }
.rbtn--round .inner { width: 100%; height: 100%; padding: 0; justify-content: center; border-radius: 50%; font-size: 22px; line-height: 1; }
.rbtn--round .inner::before { border-radius: 50%; }
.vbar .arrow.rbtn { display: block; border: 0; background: radial-gradient(circle 80px at 80% -10%, #ffffff, #181b1b); }

/* menu tabs: the realism button, tinted by the element's sketch colour */
.vtab .inner { padding: 10px 12px; gap: 6px; font-size: 13.5px; font-weight: 600; line-height: 1.2; color: rgba(255,255,255,.82); white-space: nowrap; }
.vtab i { width: 8px; height: 8px; border-radius: 50%; background: var(--t); flex: none; box-shadow: 0 0 8px var(--t); }
.vtab .num { font-family: var(--mono); font-size: 11px; font-weight: 400; color: rgba(255,255,255,.5); }
.vtab .blob { opacity: .55; transition: opacity .2s; }
.vtab:hover .blob { opacity: .9; }
.vtab[aria-selected="true"] {
  background: radial-gradient(circle 90px at 80% -10%, var(--t), #181b1b);
  box-shadow: 0 0 22px color-mix(in srgb, var(--t) 45%, transparent);
}
.vtab[aria-selected="true"] .blob { opacity: 1; }
.vtab[aria-selected="true"] .inner {
  color: #fff;
  background: radial-gradient(circle 90px at 80% -50%, color-mix(in srgb, var(--t) 55%, #777777), #0f1111);
}
.vtab[aria-selected="true"] .num { color: var(--t); }

/* ---- the element panel: full page width, at least one screen tall ---- */
.vpanel {
  position: relative; min-height: calc(100dvh - var(--navh, 68px) - 78px);
  border-top: 3px solid var(--t); border-bottom: 1px solid var(--hair);
  background:
    radial-gradient(1100px 520px at 8% 0%, color-mix(in srgb, var(--t) 11%, transparent), transparent 70%),
    radial-gradient(900px 600px at 100% 100%, rgba(63,233,255,.05), transparent 70%),
    linear-gradient(180deg, rgba(8,16,56,.94), rgba(0,5,33,.97));
}
.vstage { overflow-x: clip; }   /* the slide-in never pushes past the page edge */
.vpanel[hidden] { display: none; }
.vpanel.from-r { animation: slideInR .4s var(--ease) both; }
.vpanel.from-l { animation: slideInL .4s var(--ease) both; }
.vframe {
  display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 110px);
  max-width: 1560px; margin: 0 auto;
  padding: clamp(32px, 4.5vw, 72px) clamp(20px, 5vw, 96px) clamp(40px, 5vw, 84px);
}
.vmeta { position: sticky; top: calc(var(--navh, 68px) + 110px); align-self: start; display: flex; flex-direction: column; gap: 16px; }
.vtitle { font-size: clamp(30px, 3.4vw, 48px); font-weight: 800; line-height: 1.05; }
.vsub  { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); font-style: italic; }
.vnote { margin: 0; font-size: 16px; line-height: 1.6; color: var(--muted); }
.vmq   { margin: 0; font-size: 17px; line-height: 1.5; color: var(--white); font-style: italic; }
.vmq span {
  display: block; margin-bottom: 4px; font-style: normal; font-family: var(--mono);
  font-size: 10.5px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--t);
}
.vcover { width: 100%; max-width: 320px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 18px; box-shadow: var(--sh-card); display: block; }
.vbook  { width: 140px; height: 198px; object-fit: cover; border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.55); display: block; }

.vtext { min-width: 0; max-width: 82ch; font-size: clamp(17px, .35vw + 13px, 20px); line-height: 1.8; color: var(--sky-soft); }
.vtext p { margin: 0 0 18px; }
.vtext h4 {
  margin: 30px 0 12px; font-family: var(--mono); font-size: 12px; font-weight: 400;
  letter-spacing: 2.4px; text-transform: uppercase; color: var(--t);
}
.vtext > h4:first-child { margin-top: 0; }
.vtext blockquote { margin: 8px 0 18px; padding: 6px 0 6px 18px; border-left: 3px solid var(--t); color: var(--white); }
.vlead { font-size: clamp(21px, 1.4vw + 8px, 28px); line-height: 1.45; color: var(--white); font-weight: 600; }
.vhook p { margin-bottom: 10px; font-size: clamp(19px, .9vw + 9px, 24px); color: var(--white); }
.vhook p:last-child { color: var(--t); font-weight: 700; }
.roles--big { margin-bottom: 10px; }
.roles--big li { grid-template-columns: 100px 1fr; font-size: 18px; }
.vcards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 4px 0 18px; }
.vcard {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--hair); border-left: 3px solid var(--t);
}
.vcard b { color: var(--white); font-size: 16.5px; line-height: 1.3; }
.vcard small { font-size: 13.5px; color: var(--t); }
.vcard p { margin: 0; font-size: 16px; line-height: 1.65; }
.vcard .chip { align-self: flex-start; margin-top: 4px; }

/* the half-round questions shape from the sketch, as the inner frame */
.vpanel--q .vframe {
  margin: clamp(20px, 3vw, 44px) auto; max-width: 1480px;
  border-radius: 28px 300px 300px 28px; padding-right: clamp(40px, 9vw, 200px);
  background: linear-gradient(135deg, rgba(252,252,252,.09), rgba(252,252,252,.03));
  border: 1px solid rgba(255,255,255,.12);
}
.qs--big { gap: 32px; }
.qs--big li { grid-template-columns: 42px 1fr; gap: 16px; font-size: clamp(22px, 1.1vw + 10px, 30px); line-height: 1.35; }
.qs--big li::before { width: 38px; height: 38px; font-size: 17px; }
.qs--big small { font-size: 11.5px; }
.qs--big em { display: block; margin-top: 8px; font-size: 15px; font-style: normal; color: var(--muted-2); }
.quote--big { margin: 0 0 36px; }
.quote--big p { font-size: clamp(28px, 2.8vw, 46px); line-height: 1.25; }
.quote--big cite { margin-top: 12px; font-size: 15px; }
.remedy--big { gap: 16px; margin: 0 0 18px; }
.remedy--big li { padding-left: 16px; font-size: 18px; line-height: 1.6; }
.remedy--big b { margin-bottom: 2px; font-size: 19px; }
.chat--big { gap: 12px; max-width: 860px; }
.chat--big .say { max-width: 78%; padding: 12px 16px; font-size: 18px; line-height: 1.5; }
.vvalue p:first-child { font-size: clamp(21px, 1.4vw + 8px, 28px); line-height: 1.45; color: var(--white); font-weight: 600; }
.vrefs { margin-top: 22px; font-size: 15px; color: var(--muted-2); }
.vrefs summary { cursor: pointer; font-family: var(--mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--t); }
.vrefs ul { margin: 10px 0 0; padding-left: 18px; }

/* ---- previous / next under the element ---- */
.vfoot {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center;
  max-width: 1560px; margin: 0 auto; padding: 22px clamp(20px, 5vw, 96px) 6px;
}
.vnav.prev { justify-self: start; }
.vnav.next { justify-self: end; }
.vnav .inner { flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 20px; text-align: left; }
.vnav.next .inner { align-items: flex-end; text-align: right; }
.vnav .inner > span { font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.55); }
.vnav b { font-size: 16px; }
.vnav[disabled] { visibility: hidden; }
.vpos { font-family: var(--mono); font-size: 13px; letter-spacing: 1.5px; color: var(--muted-2); }

@media (max-width: 860px) {
  .vbar { grid-template-columns: 38px minmax(0, 1fr) 38px; gap: 8px; padding: 10px 10px; }
  .rbtn--round { width: 38px; height: 38px; }
  .rbtn--round .inner { font-size: 18px; }
  .vmenu { gap: 8px; justify-content: flex-start; }
  .vtab .inner { padding: 9px 13px; font-size: 13px; }
  .vpanel { min-height: 0; }
  .vframe { grid-template-columns: 1fr; gap: 22px; padding: 24px 18px 30px; }
  .vpanel--q .vframe { margin: 14px 10px; border-radius: 22px 90px 90px 22px; padding-right: 44px; }
  .vmeta { position: static; }
  .vcover { max-width: 160px; }
  .vbook { width: 84px; height: 119px; }
  .vtext { font-size: 16.5px; }
  .qs--big li { font-size: 19px; grid-template-columns: 34px 1fr; }
  .qs--big li::before { width: 30px; height: 30px; font-size: 14px; }
  .chat--big .say { max-width: 92%; font-size: 16px; }
  .vfoot { padding: 16px 12px 4px; }
  .vnav .inner { padding: 10px 14px; }
  .vnav b { font-size: 14px; }
}

/* ---- season → episode links (the lessons are episodes now) ---------- */
a.vcard { color: inherit; text-decoration: none; transition: background .2s, transform .2s var(--ease); }
a.vcard:hover { background: var(--panel-2); transform: translateY(-2px); }
.point--eps { cursor: default; }
.point--eps:hover { transform: none; }
.point--eps small { line-height: 1.9; }
.point--eps small a { color: var(--t-dirk); text-decoration: none; }
.point--eps small a:hover { color: var(--white); text-decoration: underline; }

/* ---- episode page: Dirk's lesson + its standing point ---------------- */
.ep-lesson { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.ep-lesson .point { cursor: pointer; }
.ep-take { margin: 18px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--t-dirk); font-size: 19px; line-height: 1.5; color: var(--white); }
.ep-src { margin: 8px 0 14px; padding-left: 18px; color: var(--sky-soft); line-height: 1.7; }
.ep-lesson h4, .ep-maph { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted-2); margin: 18px 0 8px; font-weight: 400; }
@media (max-width: 820px) { .ep-lesson { grid-template-columns: 1fr; } }

/* ---- season page: Dirk's sketchbook section, below the story -------- */
.dirk { margin-top: 56px; }
.redbar--dirk::before, .redbar--dirk::after { background: var(--t-dirk); }
.redbar--dirk { color: var(--t-dirk); }
.vpanel--static { min-height: 0; margin: 0 calc(50% - 50vw) 34px; }
.vpanel--static .vmeta { position: static; }
.dirk .season-eps { padding: 6px 0 10px; }

/* ---------------------------------------------------------------- *
   Story layer (episode.html, above Dirk's lesson) — js/story-layer.js
 * ---------------------------------------------------------------- */
.redbar--story::before, .redbar--story::after { background: var(--t-story); }
.redbar--story { color: var(--t-story); margin-top: 26px; }
.bsec.story { padding-top: 6px; }
.story-lede { max-width: 70ch; font-size: 17px; line-height: 1.6; color: var(--sky-soft); }
.story-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 20px; }
.story-facts div { border: 1px solid var(--hair); border-radius: 12px; padding: 12px 14px; background: rgba(255,255,255,.03); }
.story-facts dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--t-story); margin: 0 0 6px; }
.story-facts dd { margin: 0; font-size: 14px; line-height: 1.45; color: var(--white); }
.story-dir { max-width: 78ch; margin: 0 0 26px; font-size: 15px; line-height: 1.65; color: var(--sky-soft); }
.story-dir b { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; font-weight: 400; color: var(--muted-2); margin-bottom: 6px; }
.story-beats { list-style: none; margin: 0 0 26px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; counter-reset: beat; }
.story-beats li {
  display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 14px;
  border: 1px solid var(--hair); border-top: 3px solid var(--t-story); border-radius: 16px;
  background: linear-gradient(180deg, rgba(124,192,255,.07), rgba(255,255,255,.02));
}
.story-beats .n { font-family: var(--mono); font-size: 22px; font-weight: 600; color: color-mix(in srgb, var(--t-story) 70%, transparent); line-height: 1; }
.story-beats h3 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.25; }
.story-beats p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--sky-soft); }
.story-beats small { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--hair); font-size: 12.5px; line-height: 1.45; color: var(--muted-2); font-style: italic; }
.story-close {
  margin: 0 0 26px; padding: 6px 0 6px 20px; border-left: 3px solid var(--t-story);
  font-size: clamp(20px, 1.2vw + 12px, 27px); line-height: 1.4; font-weight: 700; color: var(--white); max-width: 46ch;
}
.story-close span { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 400; color: var(--t-story); margin-bottom: 8px; }
.story-tiles .tile { --t: var(--t-story); min-height: 300px; }
.story-tiles .tile h3 { font-size: 18px; }
.story-hb { background: linear-gradient(160deg, rgba(124,192,255,.16), rgba(255,255,255,.03)); }
.story-hb-t { font-size: 17px !important; line-height: 1.55 !important; color: var(--white) !important; font-weight: 600; }
@media (max-width: 900px) { .story-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .story-facts { grid-template-columns: 1fr; } }
