/* /learn: topics -> videos. Same palette and notebook paper as the home page (style.css), wider layout. */
/* graph paper like the videos, a warm glow behind the hero and a navy one low down */
body.learn {
  --grid: rgb(31 79 191 / .07);
  --grid5: rgb(31 79 191 / .12);
  background-color: var(--paper);
  background-image:
    radial-gradient(60% 45% at 78% 12%, rgb(246 184 41 / .20), transparent 70%),
    radial-gradient(50% 40% at 8% 95%, rgb(15 27 61 / .10), transparent 70%),
    linear-gradient(var(--grid5) 1px, transparent 1px), linear-gradient(90deg, var(--grid5) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, auto, 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-attachment: fixed;
}
@media (prefers-color-scheme: dark) {
  body.learn { --grid: rgb(143 177 255 / .06); --grid5: rgb(143 177 255 / .11);
    background-image:
      radial-gradient(60% 45% at 78% 12%, rgb(246 184 41 / .12), transparent 70%),
      radial-gradient(50% 40% at 8% 95%, rgb(143 177 255 / .10), transparent 70%),
      linear-gradient(var(--grid5) 1px, transparent 1px), linear-gradient(90deg, var(--grid5) 1px, transparent 1px),
      linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); }
}
.shell { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

.mono { font: 600 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* top bar */
.bar { position: sticky; top: 8px; z-index: 5; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 16px; padding: 8px; margin: 10px 0 18px; box-shadow: 0 6px 24px rgb(15 27 61 / .06); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 11px; font-size: 15px;
  text-decoration: none; color: var(--ink); border: 1px solid transparent; white-space: nowrap; }
.pill:hover { border-color: var(--border); }
.pill.dark, .pill[aria-current="page"] { background: var(--navy); color: #fff; }
.pill b { font-weight: 600; opacity: .7; font-size: 13px; }
.search { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--muted); }
.search input { flex: 1; border: 0; background: transparent; font: inherit; color: var(--ink); padding: 8px 0; outline: none; min-width: 0; }

/* hero */
.hero2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center; min-height: 420px; }
@media (max-width: 860px) { .hero2 { grid-template-columns: 1fr; min-height: 0; } }
.hero2 h1 { font-size: clamp(52px, 7.4vw, 92px); line-height: 1; letter-spacing: -0.01em; margin: 10px 0 14px; }
.hero2 p { font-size: 19px; max-width: 30em; margin: 0 0 18px; }
.hero2 p.mono { font-size: 11px; margin: 0; }
.hero2 .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.btn2 { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; min-height: 44px; border-radius: 999px; font-weight: 600; text-decoration: none;
  transition: transform .2s cubic-bezier(.4,0,.2,1), box-shadow .2s, background-color .2s;
  background: var(--navy); color: #fff; border: 0; cursor: pointer; font-size: 16px; }
.btn2.light { background: var(--card); color: var(--ink); border: 1px solid var(--border); }
.btn2.yellow { background: var(--yellow); color: var(--navy); }

/* floating stack of covers */
.stack { position: relative; height: 420px; perspective: 1400px; }
@media (max-width: 860px) { .stack { height: 340px; } }
.stack .c { position: absolute; left: 50%; top: 50%; width: 190px; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden;
  box-shadow: 0 10px 26px rgb(15 27 61 / .18); transition: transform .8s cubic-bezier(.22,1,.36,1), opacity .8s, filter .8s;
  background: var(--navy); cursor: pointer; }
@media (max-width: 860px) { .stack .c { width: 150px; } }
@media (max-width: 560px) { .stack { height: 300px; margin-bottom: 150px; } .stack .info { bottom: -150px; width: 100%; } }
.stack .c img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stack .info { position: absolute; right: 0; bottom: 6px; width: min(240px, 46%); background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px; box-shadow: 0 10px 30px rgb(15 27 61 / .12); z-index: 50; }
.stack .info h3 { font-size: 26px; margin: 2px 0 4px; }
.stack .info p { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .stack .c { transition: none; } }

/* strands: a horizontal strip that scrolls */
.strip-head { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-top: 26px; }
.strip-head h2 { margin: 0; }
.strip-nav { display: flex; gap: 14px; align-items: center; }
.strip-nav button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--ink); font-size: 18px; cursor: pointer; }
.modes { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.strip-nav .modes button { display: grid; place-items: center; border: 0; width: 38px; height: 38px; border-radius: 10px; background: transparent; color: var(--muted); }
.strip-nav .modes button:hover { color: var(--ink); background: color-mix(in srgb, var(--navy) 6%, transparent); }
.strip-nav .modes button[aria-pressed="true"] { background: var(--navy); color: #fff; }
@media (max-width: 560px) { .strip-nav .steps { display: none; } }
.flow-box { position: relative; }
.strip { position: relative; overflow: hidden; padding: 14px 0 22px; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.strip .track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 300px); gap: 16px; width: max-content; will-change: transform; }
/* soft edges: plain gradients on top (cheaper than a mask while things move) */
.flow-box.x::before, .flow-box.x::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40px; z-index: 2; pointer-events: none; }
.flow-box.x::before { left: 0; background: linear-gradient(90deg, var(--paper), transparent); }
.flow-box.x::after { right: 0; background: linear-gradient(-90deg, var(--paper), transparent); }
.strip.dragging { cursor: grabbing; }
.strip.dragging .strand { pointer-events: none; }
.strip img { -webkit-user-drag: none; }
.strand { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 18px;
  text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 8px; min-height: 360px; overflow: hidden;
  transition: transform .25s, box-shadow .25s; }

.strand h3 { font-size: 34px; margin: 0; }
.strand .fan { position: relative; height: 170px; margin: 4px 0 6px; flex-shrink: 0; }
.strand .fan img { position: absolute; bottom: 0; width: 96px; aspect-ratio: 9/16; object-fit: cover; border-radius: 10px; box-shadow: 0 8px 18px rgb(15 27 61 / .22); transition: transform .3s; }
.strand .fan img:nth-child(1) { left: 6px; transform: rotate(-9deg); }
.strand .fan img:nth-child(2) { left: 74px; transform: rotate(-1deg); z-index: 2; }
.strand .fan img:nth-child(3) { left: 142px; transform: rotate(8deg); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--yellow) 22%, var(--card)); color: var(--ink); border: 1px solid var(--border); }
.strand.soon h3 { color: var(--muted); }
.strand.soon .fan { display: grid; place-items: center; font-family: "Caveat", cursive; font-size: 30px; color: var(--muted); }

/* strand page and grids */
.crumbs { margin: 6px 0 0; }
.crumbs a { color: var(--muted); }
.topics { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 18px; }
.topics button { font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--ink); cursor: pointer; }
.topics button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.vcard { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
.vcard .img { aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--navy); box-shadow: 0 8px 20px rgb(15 27 61 / .12); transition: transform .25s, box-shadow .25s; }
.vcard .img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s cubic-bezier(.22,1,.36,1); }
.vcard .t { font-size: 14px; line-height: 1.35; }
.vcard .m { font-size: 12px; color: var(--muted); }

/* video page */
.watch { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 28px; align-items: start; margin-top: 8px; }
@media (max-width: 760px) { .watch { grid-template-columns: 1fr; } }
.player { position: relative; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: var(--navy); box-shadow: 0 16px 40px rgb(15 27 61 / .2); }
.player img, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.player button { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 78px; height: 78px; border-radius: 50%; border: 0;
  background: rgb(15 27 61 / .85); color: #fff; font-size: 30px; cursor: pointer; box-shadow: 0 8px 24px rgb(0 0 0 / .3); }
.player .note { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px; font-size: 12px; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / .6)); }
.side h1 { font-size: clamp(40px, 5vw, 64px); line-height: 1; margin: 6px 0 10px; }
.side .q { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin: 14px 0; }
.side .q { margin-left: 0; margin-right: 0; }
.side .q img { display: block; width: 100%; height: auto; border-radius: 8px; background: #fff; margin: 6px 0; }
.side .q figcaption { font-size: 12px; color: var(--muted); }
.pre { white-space: pre-line; }
.side .turn { background: color-mix(in srgb, var(--yellow) 18%, var(--card)); border: 1px dashed var(--yellow); border-radius: 14px; padding: 14px 16px; margin: 14px 0; }
.side .turn h3 { font-size: 28px; margin: 0 0 4px; }
.side .links2 { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }

/* exam papers */
.papers { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.paper { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 18px; }
.paper h3 { font-size: 30px; margin: 0 0 2px; }
.qs { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; margin-top: 12px; }
.qs a { display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--border); text-decoration: none; color: var(--ink); font-weight: 600; }
.qs a:hover { background: var(--navy); color: #fff; }
.empty { color: var(--muted); padding: 30px 0; }

/* topic flow layouts: across (default), diagonal (tilted deep plane), up and down */
.flow-box.diag { position: relative; height: 700px; overflow: hidden; margin: 0 -16px; }
.flow-box.diag .strip { position: absolute; inset: 0; display: block; overflow: visible; padding: 0; height: auto; touch-action: pan-y; }
.flow-box.diag .strand { position: absolute; left: 0; top: 0; width: 240px; min-height: 0; padding: 14px; will-change: transform, opacity;
  box-shadow: 0 24px 44px rgb(15 27 61 / .16); transition: none; }
.flow-box.diag .strand .chips { display: none; }
.path-info { position: absolute; left: 24px; bottom: 28px; width: min(250px, 30%); z-index: 200; background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: 20px; padding: 18px; box-shadow: 0 16px 40px rgb(15 27 61 / .12); }
.path-info h3 { font-size: 32px; line-height: 1; margin: 6px 0 4px; }
.path-info .chips { margin: 10px 0 14px; }
@media (max-width: 700px) {
  .flow-box.diag { height: 640px; }
  .flow-box.diag .strand { width: 190px; padding: 14px; }
  .flow-box.diag .strand h3 { font-size: 28px; }
  .flow-box.diag .strand .fan { height: 130px; transform: scale(.72); transform-origin: left bottom; margin-bottom: -10px; }
  .path-info { left: 16px; right: 16px; top: auto; bottom: 12px; width: auto; padding: 12px 14px; }
  .path-info h3 { font-size: 30px; }
  .path-info .chips { display: none; }
}
.flow-box.y .strip { height: 640px; touch-action: none; padding: 8px 0; }
.flow-box.y .track { grid-auto-flow: row; grid-auto-columns: auto; grid-auto-rows: max-content; grid-template-columns: repeat(3, 1fr); width: auto; }
.flow-box.y::before, .flow-box.y::after { content: ""; position: absolute; left: 0; right: 0; height: 40px; z-index: 2; pointer-events: none; }
.flow-box.y::before { top: 0; background: linear-gradient(180deg, var(--paper), transparent); }
.flow-box.y::after { bottom: 0; background: linear-gradient(0deg, var(--paper), transparent); }
@media (max-width: 900px) { .flow-box.y .track { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .flow-box.y .track { grid-template-columns: 1fr; } .flow-box.y .strip { height: 480px; } }

/* Paper.js background drawing: under everything, never catches the mouse */
#bg-maths { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }

/* bottom dock: area + kind filter and count (like the reference's bottom bar) */
body.has-dock { padding-bottom: 96px; }
.dock { position: fixed; left: 50%; bottom: 14px; translate: -50% 0; z-index: 300; width: min(1128px, calc(100% - 24px));
  display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: 18px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: blur(12px); box-shadow: 0 14px 40px rgb(15 27 61 / .16); }
.dock[hidden] { display: none; }
.dock-areas { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.dock-areas::-webkit-scrollbar { display: none; }
.dock-areas button { flex: 0 0 auto; font: inherit; font-size: 14px; padding: 9px 14px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.dock-areas button:hover:not(:disabled) { color: var(--ink); background: color-mix(in srgb, var(--navy) 6%, transparent); }
.dock-areas button[aria-pressed="true"], .dock-areas button[aria-pressed="true"]:hover { background: var(--navy); color: #fff; }
.dock-areas button:disabled { opacity: .4; cursor: default; }
.dock-kind select { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--ink); }
.dock-count { white-space: nowrap; padding: 0 8px; display: inline-flex; align-items: center; gap: 6px; }
.dock-count i { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); display: inline-block; }
@media (max-width: 700px) { .dock { gap: 6px; padding: 6px; bottom: 10px; } .dock-count { display: none; } .dock-kind select { max-width: 112px; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Matter.js dice on the Probability card */
.strand .fan.dice { display: block; height: 170px; }
.dice-box { width: 100%; height: 170px; display: block; touch-action: none; cursor: grab; border-radius: 12px;
  background: color-mix(in srgb, var(--yellow) 10%, transparent); }
.dice-box:active { cursor: grabbing; }
.flow-box.diag .strand .fan.dice { transform: none; }

/* exam papers: bike combination lock */
.lock-wrap { display: grid; grid-template-columns: minmax(320px, 520px) 1fr; gap: 34px; align-items: start; margin: 150px 0 30px; }
@media (max-width: 900px) { .lock-wrap { grid-template-columns: 1fr; } }
.bikelock { position: relative; padding-top: 10px; }
.shackle { position: absolute; left: 50%; top: -86px; width: 56%; height: 150px; translate: -50% 0; border: 24px solid #c9ced8; border-bottom: 0;
  border-radius: 200px 200px 0 0; box-shadow: inset 0 6px 10px rgb(0 0 0 / .12); transform-origin: 12% 100%; z-index: 0; }
.shackle.open { transform: translateY(-30px) rotate(-12deg); }
.pop { position: absolute; right: 8%; top: -70px; font-family: "Caveat", cursive; font-size: 34px; color: var(--navy); opacity: 0; z-index: 3;
  background: var(--yellow); padding: 0 12px; border-radius: 12px; box-shadow: 0 6px 14px rgb(0 0 0 / .18); }
.lock-body { position: relative; z-index: 1; background: linear-gradient(180deg, #1a2a5c, #0f1b3d 60%, #0a1230); border-radius: 26px; padding: 18px 16px 16px;
  box-shadow: 0 22px 44px rgb(15 27 61 / .35), inset 0 2px 0 rgb(255 255 255 / .12); }
.lock-labels, .lock-wheels { display: grid; grid-template-columns: 1fr 1.35fr 1.25fr .6fr .8fr; gap: 7px; }
.lock-labels span { color: #c9d3f0; text-align: center; font: 700 10px ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
.lock-wheels { position: relative; }
.wheel { position: relative; height: 210px; border-radius: 12px; overflow: hidden; perspective: 500px; cursor: grab; touch-action: none; user-select: none; outline: none;
  background: linear-gradient(180deg, #3b4668 0%, #e9ecf4 24%, #fff 50%, #e9ecf4 76%, #3b4668 100%); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .25); }
.wheel:active { cursor: grabbing; }
.wheel:focus-visible { box-shadow: inset 0 0 0 3px var(--yellow); }
.wheel span { position: absolute; left: 0; right: 0; top: 50%; height: 44px; margin-top: -22px; line-height: 44px; text-align: center;
  font-weight: 800; font-size: 14px; color: var(--navy); white-space: nowrap; backface-visibility: hidden; }
.wheel span.sel { font-size: 16px; }
.wheel span.soon { font-style: italic; font-weight: 600; }
.lock-window { position: absolute; left: -4px; right: -4px; top: 50%; height: 46px; margin-top: -23px; border: 3px solid var(--yellow); border-radius: 10px;
  pointer-events: none; box-shadow: 0 0 18px rgb(246 184 41 / .45); }
.lock-hint { text-align: center; margin-top: 10px; font-size: 13px; color: var(--muted); }
@media (max-width: 520px) { .wheel span { font-size: 12px; } .wheel span.sel { font-size: 13px; } .lock-wheels, .lock-labels { gap: 4px; } .lock-body { padding: 14px 10px 12px; } }
.lock-result { display: grid; grid-template-columns: 140px 1fr; gap: 18px; align-items: start; min-height: 200px; }
.lock-result:empty { display: none; }
.lock-cover img { width: 140px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; box-shadow: 0 12px 26px rgb(15 27 61 / .2); display: block; }
.lock-result h3 { font-size: 34px; margin: 4px 0; }
.lock-q { width: 100%; max-height: 260px; object-fit: contain; object-position: left top; background: #fff; border: 1px solid var(--border); border-radius: 10px; margin: 10px 0 4px; }
@media (max-width: 520px) { .lock-result { grid-template-columns: 96px 1fr; } .lock-cover img { width: 96px; } .lock-result h3 { font-size: 26px; } }

/* phones: no frosted glass over moving content (costly to repaint) */
@media (max-width: 700px) {
  .bar, .dock, .path-info { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--card); }
}
.strand { contain: layout paint; }

/* craft pass (rules adapted from the MotionSites craft notes, MIT; no CDN, fonts or media taken) */
html { overflow-x: clip; }
body.learn { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: rgb(246 184 41 / .35); color: inherit; }
.dock-count, .pill b, .strand .mono { font-variant-numeric: tabular-nums; }
.btn2:active, .pill:active, .dock-areas button:active, .modes button:active { transform: scale(.97); }
/* header links: underline grows from the left */
body.learn header.site nav a { text-decoration: none; position: relative; color: var(--ink); }
body.learn header.site nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; background: var(--yellow);
  transform: scaleX(0); transform-origin: left; transition: transform .3s cubic-bezier(.22,1,.36,1); }
/* hover effects only on devices that really hover (no sticky hover on phones) */
@media (hover: hover) {
  body.learn header.site nav a:hover::after { transform: scaleX(1); }
  .btn2:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgb(15 27 61 / .16); }
  .vcard:hover .img { transform: translateY(-3px); box-shadow: 0 10px 24px rgb(15 27 61 / .16); }
  .vcard:hover .img img { transform: scale(1.05); }
  .strip .strand:hover { box-shadow: 0 12px 28px rgb(15 27 61 / .14); }
  .strip .strand:hover .fan img:nth-child(1) { transform: rotate(-14deg) translateX(-8px); }
  .strip .strand:hover .fan img:nth-child(3) { transform: rotate(13deg) translateX(8px); }
}
/* tap targets of at least 44px on touch screens */
@media (pointer: coarse) {
  .strip-nav .modes button { width: 44px; height: 44px; }
  .strip-nav button { width: 44px; height: 44px; }
  .dock-areas button { min-height: 44px; }
  .topics button { min-height: 44px; }
}
/* phones: the hero info card goes under the stack instead of covering it */
@media (max-width: 560px) {
  .stack { height: 300px; margin-bottom: 170px; }
  .stack .info { left: 0; right: 0; bottom: -165px; width: auto; }
}

/* section rhythm and numbered eyebrows ("01 Topics") */
.strip-head.section, .section { margin-top: clamp(64px, 9vw, 128px); }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.eyebrow b { font-weight: 700; color: var(--ink); }
.eyebrow b::after { content: ""; display: inline-block; width: 32px; height: 1.5px; background: currentColor; margin-left: 10px; vertical-align: middle; opacity: .5; }
.strip-head h2, .section + h2 { font-size: clamp(36px, 4.6vw, 56px); line-height: 1; margin: 6px 0 4px; }
.lede { font-size: 17px; color: var(--muted); max-width: 34rem; margin: 0 0 14px; }

/* diagonal flow: compact cards and panel */
.flow-box.diag .strand h3 { font-size: 28px; line-height: 1; margin: 2px 0 4px; }
.flow-box.diag .strand .fan { height: 140px; transform: scale(.82); transform-origin: left bottom; margin-bottom: -6px; }
.flow-box.diag .strand .fan.dice { height: 140px; transform: none; }
.flow-box.diag .strand .dice-box { height: 140px; }
.path-info { padding: 14px 16px; }
.path-info .chips { margin: 8px 0 10px; }
.path-info .chip:nth-child(n+4) { display: none; }
/* keep the panel's Open button clear of the fixed filter dock */
body.has-dock .flow-box.diag .path-info { bottom: 84px; }
@media (max-width: 700px) { body.has-dock .flow-box.diag .path-info { bottom: 12px; } }

/* video page v2: 1 try it -> 2 watch it -> 3 your turn */
.v-title { font-size: clamp(40px, 5vw, 64px); line-height: 1; margin: 6px 0 14px; }
.watch.v2 { grid-template-columns: 1.25fr minmax(260px, 340px); align-items: start; }
.watch.v2 .v-step.turn { grid-column: 1 / -1; }
@media (max-width: 760px) { .watch.v2 { grid-template-columns: 1fr; } }
.v-num { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-weight: 700; }
.v-num b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 15px; }
.v-step .q { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin: 0 0 6px; }
.v-step .q img { display: block; width: 100%; height: auto; border-radius: 8px; background: #fff; margin: 6px 0; }
.v-step .q figcaption { font-size: 12px; color: var(--muted); }
.v-step.turn { background: color-mix(in srgb, var(--yellow) 18%, var(--card)); border: 1px dashed var(--yellow); border-radius: 16px; padding: 16px 18px; }
.player button span { display: inline-block; }
.answer summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.v-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 26px 0 0; padding: 10px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border); }
.v-pager a { padding: 10px 16px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
@media (hover: hover) { .v-pager a:hover { background: var(--navy); color: #fff; } }
.crumbs a { color: var(--muted); }

.answer summary { list-style: none; display: inline-flex; gap: 8px; padding: 10px 18px; border-radius: 999px; background: var(--navy); color: #fff; }
.answer summary::-webkit-details-marker { display: none; }
.answer summary::before { content: "▸"; transition: transform .2s; }
.answer[open] summary::before { transform: rotate(90deg); }
.answer > p { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); }
