/* Kinetic. Bold colour blocks, oversized type, a floating pill nav, big numeric readouts.
   The shapes are physics: red and blue magnets, a sine squiggle, formulas on a ticker. */
:root {
  --ink: #0d0e12;
  --ink-2: #181a22;
  --paper: #f7f5ef;
  --white: #ffffff;
  --yellow: #ffd02e;
  --blue: #3347ff;
  --red: #ef4a52;
  --mint: #6fe3cf;
  --lilac: #b4bdff;

  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Section themes: a section picks one and everything inside reads these. */
.s-paper  { --bg: var(--paper);  --fg: var(--ink);   --muted: #4b4d57; --rule: rgba(13, 14, 18, 0.16); }
.s-yellow { --bg: var(--yellow); --fg: var(--ink);   --muted: #3a3520; --rule: rgba(13, 14, 18, 0.25); }
.s-blue   { --bg: var(--blue);   --fg: #ffffff;      --muted: #e3e6ff; --rule: rgba(255, 255, 255, 0.35); }
.s-ink    { --bg: var(--ink);    --fg: #ffffff;      --muted: #b9bcc8; --rule: rgba(255, 255, 255, 0.2); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(96px + var(--banner-height, 0px)); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 19px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
::selection { background: var(--ink); color: var(--yellow); }
img, video, canvas, svg { max-width: 100%; display: block; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.s-ink :focus-visible, .s-blue :focus-visible, .nightpage :focus-visible { outline-color: var(--yellow); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.section { background: var(--bg); color: var(--fg); padding: clamp(72px, 10vw, 140px) 0; position: relative; }
.wrap { width: min(1280px, 100% - 2 * var(--gutter)); margin-inline: auto; position: relative; }

h1, h2, h3, h4 { font-family: var(--display); margin: 0; font-weight: 700; font-stretch: 88%; letter-spacing: -0.035em; line-height: 0.95; }
h2 { font-size: clamp(2.8rem, 7vw, 6rem); }
h3 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); line-height: 1.02; letter-spacing: -0.025em; }
.lede { font-size: clamp(1.15rem, 1.5vw, 1.35rem); line-height: 1.5; color: var(--muted); margin: 0; max-width: 32em; }
.small { font-size: 0.9375rem; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; padding: 0 30px;
  border-radius: 999px; border: 2px solid var(--ink); background: var(--ink); color: #fff;
  font-weight: 700; font-size: 1.0625rem; text-decoration: none; cursor: pointer;
  transition: transform 200ms var(--ease), background-color 200ms, color 200ms, box-shadow 200ms;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 0 -4px rgba(13, 14, 18, 0.25); }
.btn:active { transform: translateY(0) scale(0.98); box-shadow: none; }
.btn svg { width: 20px; height: 20px; flex: none; transition: transform 240ms var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn-y { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.btn-w { background: #fff; color: var(--ink); border-color: #fff; }
.btn-line { background: transparent; color: var(--fg); border-color: var(--rule); }
.btn-line:hover { border-color: var(--fg); box-shadow: none; }
.btn-sm { min-height: 46px; padding: 0 22px; font-size: 1rem; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.tlink { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 700; color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; min-height: 44px; display: inline-flex; align-items: center; }

/* Floating pill nav */
.pillnav { position: fixed; top: calc(14px + var(--banner-height, 0px)); left: 0; right: 0; z-index: 50; display: flex; justify-content: center; padding: 0 14px; pointer-events: none; }
.pill { pointer-events: auto; width: min(1120px, 100%); height: 64px; padding: 0 10px 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-radius: 999px; background: rgba(255, 255, 255, 0.72); border: 1px solid rgba(13, 14, 18, 0.08); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 10px 30px -14px rgba(13, 14, 18, 0.35); color: var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 1.55rem/1 var(--display); font-stretch: 85%; letter-spacing: -0.04em; text-decoration: none; color: inherit; }
.brand svg { width: 28px; height: 28px; }
.pill-links { display: flex; gap: 6px; }
.pill-links a { text-decoration: none; font-weight: 600; font-size: 0.9375rem; padding: 9px 16px; border-radius: 999px; transition: background-color 160ms; }
.pill-links a:hover { background: rgba(13, 14, 18, 0.08); }
.topic-open { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid rgba(13,14,18,.25); border-radius: 999px; color: inherit; background: transparent; font: 700 0.9375rem var(--sans); cursor: pointer; }
.topic-open:hover { background: rgba(13,14,18,.08); }
.topic-open span { font-size: 1.4rem; }
@media (max-width: 560px) { .pill { gap: 8px; padding-left: 14px; } .pill .btn-sm { padding: 0 14px; font-size: .875rem; white-space: nowrap; } .pill .btn-sm svg { display: none; } .topic-open { padding: 0 10px; white-space: nowrap; } .pill .brand { font-size: 1.3rem; gap: 6px; white-space: nowrap; } .pill .brand svg { width: 23px; } }
@media (max-width: 360px) { .pill { gap: 6px; padding-left: 10px; } .pill .btn-sm { padding: 0 10px; } .topic-open { padding: 0 8px; } .topic-open span { display: none; } }
@media (max-width: 860px) { .pill-links { display: none; } }

/* Hero */
.hero { padding: clamp(116px, 16vw, 168px) 0 clamp(64px, 9vw, 120px); overflow: hidden; }
.hero h1 { font-size: clamp(2.9rem, 6.6vw, 6.9rem); font-weight: 800; font-stretch: 80%; line-height: 0.92; letter-spacing: -0.035em; }
.hero h1 .blue { color: var(--blue); }
.hero-row { display: grid; gap: 28px; margin-top: clamp(24px, 3.4vw, 40px); }
.hero .lede { color: #2a2818; max-width: 30em; font-size: clamp(1.2rem, 1.7vw, 1.5rem); font-weight: 500; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.squig { width: 100%; height: clamp(40px, 6vw, 84px); margin-top: clamp(40px, 6vw, 72px); overflow: visible; pointer-events: none; }
.squig path { fill: none; stroke: var(--ink); stroke-width: 6; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s 0.4s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.stage { margin-top: clamp(40px, 6vw, 72px); position: relative; }
.magnet { position: absolute; z-index: 0; display: grid; place-items: start center; padding-top: 14px; width: clamp(86px, 13vw, 190px); aspect-ratio: 0.62; border-radius: clamp(14px, 2vw, 26px); color: #fff; font: 800 clamp(1.8rem, 4vw, 3.6rem)/1 var(--display); }
.magnet.n { background: var(--red); left: clamp(-14px, -1vw, 0px); top: clamp(-70px, -7vw, -36px); transform: rotate(-9deg); }
.magnet.s { background: var(--blue); right: clamp(-14px, -1vw, 0px); bottom: clamp(-60px, -6vw, -30px); transform: rotate(7deg); place-items: end center; padding: 0 0 14px; z-index: 0; }
.device { position: relative; z-index: 1; border: clamp(6px, 0.9vw, 12px) solid var(--ink); border-radius: clamp(20px, 3vw, 36px); background: #000; overflow: hidden; aspect-ratio: 16 / 9; box-shadow: 0 40px 70px -30px rgba(13, 14, 18, 0.6); }
.device video { width: 100%; height: 100%; object-fit: cover; }
.sound-btn { position: absolute; left: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 10px; background: var(--yellow); color: var(--ink); border: 0; border-radius: 999px; min-height: 48px; padding: 0 22px 0 16px; font-weight: 700; font-size: 1rem; cursor: pointer; transition: transform 200ms var(--ease); }
.sound-btn:hover { transform: scale(1.04); }
.sound-btn svg { width: 22px; height: 22px; }
.stage-bar { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 28px; margin-top: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 2px solid rgba(13, 14, 18, 0.85); background: transparent; font-weight: 700; font-size: 0.9375rem; cursor: pointer; transition: background-color 160ms, color 160ms; }
.chips button:hover { background: rgba(13, 14, 18, 0.1); }
.chips button[aria-pressed="true"], .chips button[aria-selected="true"] { background: var(--ink); color: var(--yellow); }
.stage-note { margin: 0; font-size: 0.9375rem; font-weight: 600; color: #2a2818; }

/* Typeset maths (KaTeX). Sized to sit comfortably next to the sans-serif body text. */
.tex .katex { font-size: 1.12em; }
.tex { white-space: nowrap; }
.katex-display { margin: 0; }

/* Formula ticker */
.ticker { background: var(--ink); color: #fff; overflow: hidden; padding: 22px 0; border-block: 2px solid var(--ink); }
.ticker-track { display: flex; width: max-content; animation: tick 48s linear infinite; }
.ticker-track > span { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.2; white-space: nowrap; padding-right: 44px; display: inline-flex; align-items: center; gap: 44px; }
.ticker .tex .katex { font-size: 1.15em; }
.ticker-track > span::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--yellow); flex: none; }
.ticker-track > span:nth-child(3n+2)::after { background: var(--red); }
.ticker-track > span:nth-child(3n)::after { background: var(--mint); }
@keyframes tick { to { transform: translateX(-50%); } }

/* Glance */
.glance .big { font: 600 clamp(2rem, 4.4vw, 3.9rem)/1.08 var(--display); font-stretch: 90%; letter-spacing: -0.035em; margin: 0; max-width: 21em; }
.glance .big mark { background: var(--yellow); color: var(--ink); padding: 0 0.12em; border-radius: 0.12em; }
.nums { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(56px, 8vw, 104px); border-top: 2px solid var(--ink); }
@media (max-width: 860px) { .nums { grid-template-columns: repeat(2, 1fr); } }
.num { padding: 26px 20px 34px 0; border-bottom: 1px solid var(--rule); }
.num b { display: block; font: 800 clamp(3.6rem, 8.4vw, 7.6rem)/0.9 var(--display); font-stretch: 75%; letter-spacing: -0.05em; }
.num span { display: block; margin-top: 12px; font-weight: 600; font-size: 1rem; color: var(--muted); }

/* How it helps */
.helps h2 { max-width: 9em; }
.helps-list { margin-top: clamp(40px, 6vw, 80px); }
.help { display: grid; grid-template-columns: clamp(80px, 14vw, 200px) 1fr 1.2fr; gap: 12px clamp(20px, 4vw, 64px); padding: clamp(26px, 3.6vw, 44px) 0; border-top: 2px solid var(--rule); align-items: baseline; }
@media (max-width: 800px) { .help { grid-template-columns: 70px 1fr; } .help p { grid-column: 2; } }
.help .no { font: 800 clamp(2.6rem, 6vw, 5rem)/0.9 var(--display); font-stretch: 75%; color: var(--yellow); letter-spacing: -0.04em; }
.help h3 { font-size: clamp(1.9rem, 3.4vw, 3rem); }
.help p { margin: 0; color: var(--muted); font-size: 1.1875rem; }

/* Demo */
.demo-copy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); align-items: end; gap: 32px 80px; margin-bottom: 40px; }
.demo-copy h2 { max-width: 12em; font-size: clamp(2.3rem, 5vw, 4rem); }
.demo-preview > summary { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border: 1px solid #596174; border-radius: 16px; font: 700 1.0625rem var(--sans); cursor: pointer; list-style: none; }
.demo-preview > summary::-webkit-details-marker { display: none; }
.demo-preview > summary > span { display: flex; align-items: center; gap: 16px; color: var(--yellow); font-size: .8125rem; white-space: nowrap; }
.demo-preview > summary b { font-size: 1.5rem; transition: transform 180ms ease-out; }
.demo-preview[open] > summary b { transform: rotate(45deg); }
.demo-preview[open] .demo-card { margin-top: 24px; animation: rise 180ms var(--ease); }
.demo-intro-note { color: #a9aebc; font-size: 1rem; }
@media (max-width: 800px) { .demo-copy { grid-template-columns: 1fr; gap: 0; } }
.demo-copy h2 .y { color: var(--yellow); }
.demo-copy .lede { margin-top: 24px; }
.demo-copy ol { margin: 30px 0 0; padding: 0; list-style: none; counter-reset: d; }
.demo-copy li { counter-increment: d; display: grid; grid-template-columns: 2.6em 1fr; padding: 16px 0; border-top: 1px solid var(--rule); color: var(--muted); font-size: 1.0625rem; }
.demo-copy li::before { content: counter(d, decimal-leading-zero); font: 700 1.2rem/1.4 var(--display); color: var(--yellow); }
.demo-copy li b { color: #fff; }
.demo-card { background: #11141c; border-radius: 28px; padding: clamp(16px, 3vw, 28px); border: 1px solid #3a3f4b; }
.demo-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.demo-live-label { font-size: .875rem; color: #c3c6d2; }
.demo-panels { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; }
.demo-machine, .demo-output { min-width: 0; background: #090c12; border: 1px solid #303642; border-radius: 18px; padding: 16px 12px; }
.demo-panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 0 6px; font-size: .6875rem; letter-spacing: .06em; color: #c1c7d3; }
.demo-panel-head span { letter-spacing: 0; font-size: .75rem; color: #9ca4b5; }
.demo-canvas { display: block; width: 100%; max-width: 620px; margin: auto; min-height: 340px; height: auto; aspect-ratio: 540 / 350; cursor: grab; }
.demo-graph { display: block; width: 100%; height: 240px; margin-top: 16px; }
.demo-caption { margin: 8px 6px 0; font-size: .875rem; line-height: 1.45; color: #c1c7d3; min-height: 2.9em; }
.demo-stats { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 8px; padding: 16px 4px 0; border-top: 1px solid #303642; }
.demo-stats span { display: block; font-size: .75rem; color: #a9aebc; }
.demo-stats b { display: block; margin-top: 6px; font: 600 clamp(1rem, 2vw, 1.4rem) var(--sans); color: var(--yellow); font-variant-numeric: tabular-nums; }
.demo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; padding: 24px 0 18px; }
.demo-controls .btn-line { margin-left: 0; }
.demo-angle { display: flex; align-items: center; flex: 1; gap: 12px; color: #d5d7e0; font-size: .9375rem; font-weight: 600; }
.demo-angle input { flex: 1; min-width: 100px; accent-color: var(--yellow); height: 32px; }
.demo-keyframes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 0; border-top: 1px solid #303642; }
.demo-keyframes > span { font-size: .8125rem; color: #a9aebc; margin-right: 8px; }
.demo-keyframes button { min-height: 44px; border: 1px solid #596174; background: transparent; border-radius: 10px; padding: 8px 12px; color: #eee; font: 600 .8125rem var(--sans); cursor: pointer; transition: background-color 150ms, border-color 150ms; }
.demo-keyframes button:hover, .demo-keyframes button[aria-pressed="true"] { background: #272c37; border-color: var(--yellow); color: var(--yellow); }
.demo-takeaways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 28px; font-size: 1rem; color: #a9aebc; }
.demo-takeaways b { display: block; color: #fff; margin-bottom: 8px; }
.demo-controls .btn-line { margin-left: 0 !important; }
@media (max-width: 900px) { .demo-panels { grid-template-columns: 1fr; } .demo-graph { height: 220px; } .demo-takeaways { grid-template-columns: 1fr; gap: 4px; } }
@media (max-width: 560px) { .demo-card { border-radius: 20px; } .demo-panels { gap: 14px; } .demo-machine, .demo-output { padding: 14px 6px; } .demo-controls { gap: 16px; } .demo-angle { flex-basis: 100%; } .demo-keyframes > span { flex-basis: 100%; } .demo-toolbar .tog { width: 100%; } .demo-toolbar .tog button { flex: 1; padding: 0 12px; } .demo-stats b { font-size: 1rem; } }
.tog { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); gap: 2px; }
.tog button { min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; font-size: 0.9375rem; color: #d5d7e0; cursor: pointer; transition: background-color 160ms, color 160ms; }
.tog button[aria-pressed="true"] { background: var(--yellow); color: var(--ink); }
.speed { display: flex; align-items: center; gap: 12px; color: #d5d7e0; font-size: 0.9375rem; font-weight: 600; }
.speed input { width: 120px; accent-color: var(--yellow); height: 28px; }
.demo-controls .btn-line { --fg: #fff; --rule: rgba(255, 255, 255, 0.3); margin-left: auto; }
.readout { margin: 6px 8px 8px; font-size: 1rem; color: #c3c6d2; min-height: 3.3em; }
.readout b { color: #fff; font-variant-numeric: tabular-nums; }

/* Videos */
.videos .head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px 48px; margin-bottom: clamp(40px, 6vw, 72px); }
.videos .head h2 { max-width: 8em; }
.vcards { display: grid; gap: clamp(20px, 3vw, 36px); }
.vcard { background: var(--tint); color: var(--ink); border-radius: clamp(24px, 3.4vw, 44px); padding: clamp(20px, 3.4vw, 48px); border: 2px solid var(--ink); }
.vc-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px clamp(28px, 5vw, 72px); align-items: center; }
@media (max-width: 900px) { .vc-top { grid-template-columns: 1fr; } }
.vc-media { margin: 0; }
.vc-frame { position: relative; border: 6px solid var(--ink); border-radius: clamp(16px, 2.4vw, 28px); overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.vc-frame img { width: 100%; height: 100%; object-fit: cover; }
.vc-media figcaption { margin-top: 14px; font-size: 0.9375rem; font-weight: 600; min-height: 1.6em; }
.vc-info > p.vc-tag { color: #fff; margin: 0 0 18px; display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 6px 16px 6px 6px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 0.9375rem; }
.vc-tag b { background: var(--tint); color: var(--ink); border-radius: 999px; padding: 2px 12px; font-variant-numeric: tabular-nums; }
.vc-info h3 { font-size: clamp(2.6rem, 5.2vw, 4.6rem); font-weight: 800; font-stretch: 82%; line-height: 0.9; letter-spacing: -0.045em; }
.vc-info > p { margin: 18px 0 0; font-size: 1.125rem; color: #26261f; font-weight: 500; }
.specs { display: flex; flex-wrap: wrap; gap: 14px 34px; margin: 26px 0 0; padding: 20px 0; border-block: 2px solid var(--ink); }
.specs div { display: flex; flex-direction: column-reverse; }
.specs dt { font-size: 0.875rem; font-weight: 600; }
.specs dd { margin: 0; font: 800 2.6rem/1 var(--display); font-stretch: 78%; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.vc-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 26px; }
.price { font: 800 clamp(3rem, 5vw, 4.4rem)/0.9 var(--display); font-stretch: 80%; letter-spacing: -0.05em; }
.vc-more { margin-top: clamp(24px, 3vw, 40px); border-top: 2px solid var(--ink); }
.vc-more summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; font: 700 1.25rem/1.2 var(--display); font-stretch: 90%; }
.vc-more summary::-webkit-details-marker { display: none; }
.vc-more summary i { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--tint); display: grid; place-items: center; font: 400 1.7rem/1 var(--sans); font-style: normal; transition: transform 220ms var(--ease); }
.vc-more[open] summary i { transform: rotate(45deg); }
.vc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px clamp(28px, 5vw, 72px); padding: 8px 0 8px; }
@media (max-width: 800px) { .vc-cols { grid-template-columns: 1fr; } }
.vc-cols h4 { font-size: 1.05rem; font-stretch: 100%; letter-spacing: -0.01em; margin-bottom: 8px; }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding: 11px 0 11px 34px; border-bottom: 1px solid rgba(13, 14, 18, 0.25); font-size: 1.0625rem; line-height: 1.42; font-weight: 500; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 14px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6 11.5l3.2 3.2L16 7.8' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.toc { list-style: none; margin: 0; padding: 0; }
.toc button { width: 100%; display: grid; grid-template-columns: 2.5em 1fr auto; gap: 8px; text-align: left; background: none; border: 0; border-bottom: 1px solid rgba(13, 14, 18, 0.25); padding: 11px 6px; min-height: 48px; cursor: pointer; font-size: 1.0625rem; font-weight: 500; border-radius: 0; transition: background-color 140ms, padding 200ms var(--ease); }
.toc button:hover { background: rgba(13, 14, 18, 0.07); padding-left: 12px; }
.toc button[aria-current="true"] { background: var(--ink); color: #fff; padding-left: 12px; border-radius: 10px; border-color: transparent; }
.toc .n, .toc .t { font-variant-numeric: tabular-nums; font-size: 0.9375rem; font-weight: 700; }

.fullset { margin-top: clamp(20px, 3vw, 36px); position: relative; overflow: hidden; background: var(--ink); color: #fff; border-radius: clamp(24px, 3.4vw, 44px); padding: clamp(28px, 5vw, 64px); display: grid; grid-template-columns: 1fr auto; gap: 28px 48px; align-items: end; }
@media (max-width: 800px) { .fullset { grid-template-columns: 1fr; } }
.fullset h3 { font-size: clamp(2.8rem, 6.4vw, 5.6rem); font-weight: 800; font-stretch: 80%; line-height: 0.88; letter-spacing: -0.05em; }
.fullset h3 em { font-style: normal; color: var(--yellow); }
.fullset p { margin: 18px 0 0; color: #c9ccd8; max-width: 30em; }
.fullset .right { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; position: relative; z-index: 1; }
.fullset .price { color: var(--yellow); font-size: clamp(4rem, 7vw, 6rem); }
.fullset .save { margin: 0; font-weight: 700; color: var(--mint); }
.fullset .mg { position: absolute; width: 150px; aspect-ratio: .62; border-radius: 22px; opacity: 1; }
.fullset .mg.a { background: var(--red); right: 24%; top: -60px; transform: rotate(14deg); }
.fullset .mg.b { background: var(--blue); right: 10%; top: -80px; transform: rotate(-8deg); }
@media (max-width: 800px) { .fullset .mg { display: none; } }
.more { margin: 0; font-weight: 700; font-size: 1.125rem; color: var(--fg); }
.fullset .ticks { margin-top: 22px; max-width: 34em; }
.fullset .ticks li { border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.fullset .ticks li::before { background-color: var(--yellow); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6 11.5l3.2 3.2L16 7.8' fill='none' stroke='%230d0e12' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* Exam checklists */
.checks h2 { max-width: 9em; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 26px); margin-top: clamp(40px, 6vw, 72px); }
@media (max-width: 960px) { .check-grid { grid-template-columns: minmax(0, 1fr); } }
.check { min-width: 0; background: #fff; border: 2px solid var(--ink); border-radius: clamp(20px, 2.6vw, 32px); padding: clamp(22px, 3vw, 34px); }
.check h3 { font-size: 1.1rem; font-stretch: 100%; letter-spacing: 0; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.check h3::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--c, var(--ink)); }
.check ul { list-style: none; margin: 14px 0 0; padding: 0; }
.check li { font: 600 1.5rem/1.2 var(--display); font-stretch: 90%; letter-spacing: -0.02em; padding: 18px 0; border-top: 1px solid rgba(13, 14, 18, 0.2); }
@media (max-width: 560px) { .check li { font-size: 1.125rem; line-height: 1.4; } }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 4vw, 56px); margin-top: clamp(40px, 6vw, 72px); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step .badge { width: clamp(84px, 9vw, 120px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font: 800 clamp(2.6rem, 4.6vw, 4rem)/1 var(--display); color: var(--ink); margin-bottom: 26px; }
.step:nth-child(1) .badge { background: var(--yellow); }
.step:nth-child(2) .badge { background: var(--mint); border-radius: 30%; }
.step:nth-child(3) .badge { background: var(--lilac); border-radius: 50% 50% 50% 8%; }
.step h3 { margin-bottom: 10px; }
.step p { margin: 0; color: var(--muted); font-size: 1.125rem; }
.safe { margin: clamp(40px, 6vw, 72px) 0 0; padding: 26px 30px; border-radius: 24px; background: var(--ink); color: #c9ccd8; max-width: 52em; font-size: 1.0625rem; }
.safe b { color: #fff; }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.4fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
@media (max-width: 900px) { .faq-grid { grid-template-columns: 1fr; } }
.faq-grid .side { position: sticky; top: 110px; }
@media (max-width: 900px) { .faq-grid .side { position: static; } }
.faq-grid .side p { margin: 20px 0 0; color: var(--muted); }
details.q { border-top: 2px solid var(--ink); }
details.q:last-child { border-bottom: 2px solid var(--ink); }
details.q summary { list-style: none; cursor: pointer; padding: 24px 56px 24px 0; font: 700 clamp(1.3rem, 2vw, 1.7rem)/1.15 var(--display); font-stretch: 92%; letter-spacing: -0.025em; position: relative; }
details.q summary::-webkit-details-marker { display: none; }
details.q summary::after { content: "+"; position: absolute; right: 0; top: 50%; margin-top: -20px; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--yellow); display: grid; place-items: center; font: 400 1.6rem/1 var(--sans); transition: transform 220ms var(--ease); }
details.q[open] summary::after { transform: rotate(45deg); }
details.q p { margin: 0 0 26px; color: var(--muted); max-width: 40em; font-size: 1.0625rem; }
details.q p a, details.q p .tlink { color: var(--fg); }

/* Footer */
footer { background: var(--ink); color: #b9bcc8; padding: clamp(56px, 8vw, 100px) 0 44px; overflow: hidden; }
footer .mark { font: 800 clamp(5rem, 22vw, 20rem)/0.8 var(--display); font-stretch: 78%; letter-spacing: -0.06em; color: var(--yellow); margin: 0 0 clamp(36px, 5vw, 64px); }
footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 48px; border-top: 1px solid rgba(255, 255, 255, 0.2); padding-top: 28px; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 28px; align-items: center; }
footer nav a, footer nav button { color: #fff; font-weight: 600; font-size: 1rem; }
footer small { display: block; max-width: 40em; font-size: 0.9375rem; line-height: 1.6; }

/* Dialogs */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: min(560px, 100% - 24px); width: 100%; margin: auto; overflow: visible; }
dialog::backdrop { background: rgba(13, 14, 18, 0.72); backdrop-filter: blur(5px); }
dialog[open] { animation: rise 280ms var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
.sheet { background: var(--yellow); border: 2px solid var(--ink); border-radius: 32px; padding: clamp(26px, 5vw, 44px); position: relative; }
.sheet h2 { font-size: 3.2rem; }
.sheet .close { position: absolute; right: 16px; top: 16px; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; font-size: 1.6rem; line-height: 1; cursor: pointer; transition: background-color 160ms; }
.sheet .close:hover { background: var(--ink); color: var(--yellow); }
.order-line { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; margin: 22px 0; border-block: 2px solid var(--ink); }
.order-line b { font: 700 1.5rem/1.1 var(--display); font-stretch: 90%; letter-spacing: -0.02em; }
.order-line .price { font-size: 2.8rem; }
.field { display: block; margin: 0 0 18px; }
.field span { display: block; font-weight: 700; margin-bottom: 8px; }
.field input[type="email"], .field input[type="text"] { width: 100%; min-height: 58px; padding: 0 20px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; font-size: 1.0625rem; }
.field input:focus { outline: 3px solid var(--blue); outline-offset: 2px; }
.field small { display: block; margin: 8px 0 0 6px; font-size: 0.9375rem; color: #3a3520; }
.hp { position: absolute; left: -9999px; }
.err { color: #a0121b; font-weight: 700; margin: 0 0 14px; }
.fine { color: #3a3520; font-size: 0.9375rem; margin: 16px 0 0; line-height: 1.55; }
.fine a { color: var(--ink); }
.sheet .btn { width: 100%; }
.banner { position: relative; background: var(--ink); color: var(--yellow); font-weight: 700; text-align: center; padding: 13px 56px; }
#banner a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.banner-x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.banner-x:hover { background: rgba(255, 255, 255, 0.14); }
@media (max-width: 560px) { .banner { font-size: .875rem; line-height: 1.45; padding: 10px 16px; } }

/* Reveal. Content stays visible unless a working script is about to animate it in. */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .squig path { stroke-dashoffset: 0; }
}

/* Plain pages: success, watch, legal */
.nightpage { background: var(--ink); color: #fff; min-height: 100vh; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px var(--gutter); }
.bar .brand { color: #fff; }
.bar .brand svg { width: 30px; height: 30px; }
.center-card { width: min(640px, 100% - 2 * var(--gutter)); margin: clamp(48px, 12vh, 120px) auto; }
.center-card h1 { font-size: clamp(3.4rem, 10vw, 6.4rem); font-weight: 800; font-stretch: 80%; margin: 24px 0 18px; line-height: 0.88; letter-spacing: -0.05em; }
.center-card p { color: #b9bcc8; font-size: 1.1875rem; margin: 0 0 14px; }
.center-card b { color: #fff; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.18); border-top-color: var(--yellow); animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tick-big { width: 68px; height: 68px; border-radius: 50%; background: var(--yellow); display: grid; place-items: center; }
.tick-big svg { width: 34px; height: 34px; color: var(--ink); }

/* The hidden attribute must win over component display rules (buttons, chips, etc.). */
[hidden] { display: none !important; }

/* Syllabus map */
.syl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px 48px; margin-bottom: clamp(36px, 5vw, 64px); }
.syl-head h2 { max-width: 9em; }
.syl-head .lede { max-width: 26em; }
.syl-note { max-width: 76ch; margin: -12px 0 28px; color: #c3c6d2; font-size: 1rem; line-height: 1.6; }
.syl-note a { color: var(--yellow); text-underline-offset: 4px; }
.syl-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.syl-find { margin-bottom: 24px; }
.syl-list li { scroll-margin-top: 20px; }
.syl-list li:target { border-radius: 8px; background: rgba(255,208,46,.12); outline: 2px solid var(--yellow); outline-offset: 4px; }
.syl-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 9px 16px; border: 1px solid #737787; border-radius: 999px; font-size: 0.9375rem; text-decoration: none; }
.syl-nav a:hover { color: var(--yellow); border-color: var(--yellow); }
.syl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2.4vw, 28px); align-items: start; }
@media (max-width: 960px) { .syl-grid { grid-template-columns: 1fr; } }
.syl-card { min-width: 0; scroll-margin-top: 20px; background: var(--ink-2); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: clamp(22px, 3vw, 34px); padding: clamp(22px, 3.2vw, 40px); }
.syl-no { margin: 0 0 8px; color: var(--yellow); font-weight: 700; font-size: 0.9375rem; }
.syl-card h3 { font-size: clamp(2rem, 3.2vw, 2.75rem); font-weight: 800; font-stretch: 82%; letter-spacing: -0.04em; line-height: 1.05; }
.syl-scope { font-size: 0.9375rem; line-height: 1.5; color: #c3c6d2; margin: 0 0 18px; }
.syl-count { margin: 12px 0 14px; color: var(--muted); font-size: 1rem; }
.syl-count b { color: #fff; }
.meter { display: flex; gap: 4px; margin-bottom: 18px; }
.meter i { flex: 1; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.16); }
.meter i.on { background: var(--tint); }
.syl-list { list-style: none; margin: 0; padding: 0; }
.syl-list li { display: grid; grid-template-columns: 18px 1fr auto; gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: 1.0625rem; line-height: 1.4; }
.syl-list .dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; border: 2px dashed rgba(255, 255, 255, 0.45); }
.syl-list .ready .dot { background: var(--tint); border: 2px solid var(--tint); }
.syl-list .soon .t { color: #c3c6d2; }
.syl-list .tag { font-size: 0.8125rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; white-space: nowrap; text-decoration: none; }
.syl-list .soon .tag { border: 1.5px dashed rgba(255, 255, 255, 0.4); color: #c3c6d2; }
.syl-list .ready { grid-template-columns: 18px 1fr; }
.syl-lessons { margin-top: 18px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.14); }
.syl-lessons h4 { margin: 0 0 12px; color: #c3c6d2; font: 600 .875rem var(--sans); }
.syl-lesson { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 48px; padding: 12px 18px; margin-top: 8px; border-radius: 14px; background: var(--tint); color: var(--ink); font-size: 1rem; font-weight: 700; line-height: 1.4; text-decoration: none; transition: filter 160ms ease-out; }
.syl-lesson:hover { filter: brightness(1.08); }
.syl-lesson span { flex: none; }
@media (max-width: 560px) { .syl-list li { grid-template-columns: 18px 1fr; } .syl-list .tag { grid-column: 2; justify-self: start; } }
.syl-skills { margin-top: 32px; padding: 28px; border: 1px solid #737787; border-radius: 24px; }
.syl-skills h3 { font-size: 1.5rem; margin-bottom: 16px; }
.syl-skills ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; padding-left: 20px; color: #c3c6d2; }
@media (max-width: 560px) { .syl-skills ul { grid-template-columns: 1fr; } }

/* Topic selector: native modal focus management, with a scrollable result list. */
.topic-picker { max-width: min(660px, calc(100% - 24px)); overflow: hidden; border-radius: 28px; background: var(--paper); color: var(--ink); }
.topic-picker[open] { animation: rise 200ms var(--ease); }
.topic-sheet { padding: clamp(20px, 4vw, 32px); height: min(740px, 90dvh); display: flex; flex-direction: column; }
.topic-picker-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 22px; }
.topic-eyebrow { font-size: .75rem; letter-spacing: .12em; font-weight: 800; margin: 0 0 6px; }
.topic-picker h2 { font-size: clamp(2rem, 5vw, 3rem); }
.topic-close { width: 44px; height: 44px; flex: none; border: 1px solid #8c8b84; border-radius: 50%; background: transparent; font-size: 1.8rem; cursor: pointer; }
.topic-search { display: flex; align-items: center; gap: 12px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 16px; background: #fff; }
.topic-search > span:not(.sr) { font-size: 2rem; }
.topic-search:focus-within { outline: 3px solid var(--blue); outline-offset: 3px; }
.topic-search input { min-width: 0; width: 100%; height: 56px; border: 0; background: transparent; font: 400 1rem var(--sans); color: var(--ink); outline: none; }
.topic-section-label { display: flex; align-items: center; gap: 12px; font-size: .875rem; font-weight: 700; margin-top: 16px; }
.topic-section-label select { flex: 1; min-width: 0; max-width: 100%; min-height: 44px; border: 1px solid #9c9b93; border-radius: 10px; padding: 8px 12px; background: transparent; color: var(--ink); font: 500 .9375rem var(--sans); }
.topic-result-count { font-size: .8125rem; color: #53534f; margin: 14px 0 8px; }
.topic-results { flex: 1; list-style: none; padding: 0; margin: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.topic-results a { display: flex; align-items: center; gap: 16px; justify-content: space-between; min-height: 72px; padding: 12px; border-radius: 12px; text-decoration: none; transition: background-color 140ms ease-out; }
.topic-results a:hover, .topic-results a:focus-visible { background: #e7e5dc; outline-offset: -2px; }
.topic-result-text { min-width: 0; }
.topic-result-text b { display: block; font-size: 1rem; line-height: 1.35; }
.topic-result-text small { display: block; margin-top: 3px; color: #60605a; font-size: .8125rem; }
.topic-result-badge { flex: none; white-space: nowrap; font-size: .75rem; color: #5e5e58; }
.topic-result-badge.available { background: var(--yellow); border-radius: 999px; padding: 5px 10px; color: var(--ink); font-weight: 700; }
.topic-empty { padding: 24px 12px; font-size: 1rem; }
.topic-picker-foot { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid #cfcec5; color: #60605a; font-size: .75rem; }
@media (hover: none) { .topic-picker-foot { display: none; } }
@media (max-width: 560px) {
  .topic-picker { position: fixed; inset: 0; margin: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .topic-sheet { height: 100%; padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); }
  .topic-picker-head { margin-bottom: 24px; }
  .topic-search { flex-shrink: 0; }
  .topic-search input { height: 58px; }
  .topic-results a { padding: 16px 10px; gap: 12px; }
  .demo-canvas { height: 340px; aspect-ratio: auto; }
  .demo-card { margin-inline: -8px; padding: 12px; border-radius: 16px; }
  .demo-machine, .demo-output { padding: 12px 0; }
  .demo-panel-head { display: block; font-size: .8125rem; padding: 2px 10px 8px; }
  .demo-panel-head span { display: block; margin-top: 6px; font-size: .8125rem; }
  .demo-caption { font-size: .9375rem; margin: 8px 10px; }
}

/* Video switcher inside a multi-video section pack */
.vc-cols .vtabs { margin: 4px 0 12px; gap: 6px; }
.vc-cols .vtabs button { border-color: var(--ink); }
.vc-cols .vtabs button[aria-pressed="true"] { background: var(--ink); color: var(--tint); }

/* Header: copy on the left, the live Newton's cradle on the right */
.hero-top { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(8px, 3vw, 48px); align-items: center; }
.hero-top.no-sculpture { grid-template-columns: 1fr; }
@media (max-width: 900px) { .hero-top { grid-template-columns: 1fr; } }
.sculpture { position: relative; aspect-ratio: 6 / 5; min-height: 300px; margin: 0 -7%; }
.sculpture canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline-offset: -6px; }
.sculpture-hint { position: absolute; left: 0; right: 0; bottom: 2%; margin: 0; text-align: center; font-size: 0.875rem; font-weight: 700; color: #2a2818; pointer-events: none; }
@media (max-width: 900px) { .sculpture { aspect-ratio: 5 / 4; min-height: 0; margin: 8px -6% 0; } }
