/* Venom IK explainer. Look: warm light industrial dashboard, safety orange on hairline line art. */
:root {
  --bg-top: #e8ecee; --bg-bottom: #ede3d0;
  --bg: #ece8e0; --fg: #111111; --muted: #8a8a86; --card: #ffffff; --border: rgba(0,0,0,.07);
  --grid: #efece6; --axis: #c4c0b8;
  --a: #ff6a22;      /* solution 0: the one the robot uses (solid line, circle markers) */
  --b: #3d3d3b;      /* solution 1: the other branch (dashed line, square markers) */
  --amber: #f5b642;
  --bad: #ff1a1a; --ok: #1f9d55; --warn: #c27c0e;
  --code-bg: #f4f1ea; --link: #e04a05;
  --shadow: 0 20px 60px rgba(0,0,0,.06);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Outfit", "Urbanist", "Avenir Next", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; color: var(--fg); font: 300 17px/1.65 var(--sans); background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom)) fixed; min-height: 100vh; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
b, strong { font-weight: 500; }
h1, h2, h3 { line-height: 1.1; font-weight: 300; }
h1 { font-size: clamp(2.6rem, 9vw, 5.6rem); margin: .6rem 0 1rem; letter-spacing: -.035em; }
h2 { font-size: clamp(1.9rem, 5vw, 2.9rem); margin: 0 0 1rem; letter-spacing: -.025em; }
h2 .n { color: var(--a); font-weight: 400; margin-right: .35em; font-variant-numeric: tabular-nums; }
h3 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; font-weight: 500; }
code, pre, .mono { font-family: var(--mono); font-size: .86em; }
code { background: var(--code-bg); padding: .08em .35em; border-radius: 6px; }
.wrap { max-width: none; margin: 0 auto; padding: 0 clamp(20px, 4vw, 72px); }
header.top { padding: 3.2rem 0 1.2rem; }
.eyebrow { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; color: var(--muted); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.pill { display: inline-flex; align-items: center; gap: .45rem; padding: .22rem .8rem; border-radius: 999px; background: var(--card); box-shadow: 0 0 0 1px var(--border); font-size: .8rem; letter-spacing: 0; text-transform: none; color: var(--fg); }
.pill.on { background: var(--a); color: #fff; box-shadow: none; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
header.top .links { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.2rem 0 0; }
header.top .links a { text-decoration: none; background: var(--fg); color: var(--bg-top); padding: .5rem 1.1rem; border-radius: 999px; font-size: .9rem; font-weight: 400; }
header.top .links a:nth-child(n+2) { background: var(--card); color: var(--fg); box-shadow: 0 0 0 1px var(--border); }
.credit { font-size: .92rem; color: var(--muted); max-width: 70ch; margin: 1.2rem 0 0; }
.credit b { color: var(--fg); }
nav.sticky { position: sticky; top: 12px; z-index: 20; margin: 1rem 0 0; pointer-events: none; }
nav.sticky .wrap { display: flex; margin-left: clamp(20px, 4vw, 72px); padding-left: .35rem; padding-right: .35rem; gap: .2rem; overflow-x: auto; pointer-events: auto; width: fit-content; max-width: calc(100% - 24px); padding: .35rem; border-radius: 999px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow), 0 0 0 1px var(--border); scrollbar-width: none; }
nav.sticky a { white-space: nowrap; padding: .35rem .85rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .85rem; font-weight: 400; }
nav.sticky a:hover { color: var(--fg); }
nav.sticky a.on { background: var(--a); color: #fff; }
section { padding: 3.2rem 0 .8rem; }
.lede { color: var(--muted); max-width: 62ch; font-size: 1.15rem; }
p { max-width: 75ch; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
@media (max-width: 760px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--card); border-radius: 26px; padding: 1rem; box-shadow: var(--shadow), 0 0 0 1px var(--border); }
canvas.plane { width: 100%; height: clamp(470px, 64vh, 720px); display: block; border-radius: 22px; background: var(--card); touch-action: auto; cursor: grab; box-shadow: var(--shadow), 0 0 0 1px var(--border); }
canvas.plane:focus-visible, .stage canvas:focus-visible { outline: 2px solid var(--a); outline-offset: 3px; }
canvas.plot { width: 100%; height: 170px; display: block; }
.stage { position: relative; width: 100%; height: clamp(440px, 62vh, 760px); border-radius: 26px; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, var(--card), color-mix(in srgb, var(--card) 70%, var(--bg-bottom))); box-shadow: var(--shadow), 0 0 0 1px var(--border); }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.stage .msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .95rem; text-align: center; padding: 1rem; }
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .6rem 1.4rem; margin: 1rem 0; padding: 1rem 1.3rem; background: var(--card); border-radius: 26px; box-shadow: var(--shadow), 0 0 0 1px var(--border); }
.controls label { display: grid; grid-template-columns: 1fr auto; gap: 0 .5rem; font-size: .85rem; color: var(--muted); }
.controls label output { font-family: var(--mono); color: var(--fg); font-variant-numeric: tabular-nums; }
.controls input[type=range] { grid-column: 1 / -1; width: 100%; min-height: 28px; accent-color: var(--a); }
.controls label.sel { display: flex; align-items: center; gap: .5rem; }
.controls select, button, .btn { font: inherit; font-size: .88rem; font-weight: 400; padding: .4rem 1rem; border-radius: 999px; border: 0; box-shadow: 0 0 0 1px var(--border); background: var(--card); color: var(--fg); cursor: pointer; }
button:hover { box-shadow: 0 0 0 1px var(--fg); }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }
#s5-play, #s5-restart { background: var(--fg); color: var(--bg-top); box-shadow: none; }
fieldset { border: 0; border-radius: 999px; padding: .3rem .8rem; margin: 0; box-shadow: 0 0 0 1px var(--border); }
legend { font-size: .8rem; color: var(--muted); padding: 0 .3rem; }
fieldset label { display: inline-flex; gap: .35rem; margin-right: 1rem; font-size: .88rem; align-items: center; }
fieldset input[type=radio] { accent-color: var(--a); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-size: .82rem; color: var(--muted); margin: .6rem .3rem; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend svg { width: 34px; height: 14px; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { text-align: right; padding: .3rem .5rem; border-bottom: 1px solid var(--border); font-family: var(--mono); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child, th.l, td.l { text-align: left; }
th { font-weight: 400; color: var(--muted); font-family: var(--sans); }
tr.sep td { border-top: 1px solid var(--axis); }
.badge { display: inline-block; padding: 0 .55em; border-radius: 999px; font-size: .78rem; font-family: var(--sans); box-shadow: inset 0 0 0 1px currentColor; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.status { font-size: .92rem; padding: .7rem 1.1rem; border-radius: 20px; background: var(--card); box-shadow: 0 0 0 1px var(--border); margin: .6rem 0; min-height: 3em; }
.status::before { font-weight: 500; margin-right: .6em; padding: .1em .65em; border-radius: 999px; font-size: .72rem; letter-spacing: .04em; color: #fff; }
.status.ok::before { content: "OK"; background: var(--a); }
.status.bad::before { content: "NOT REACHABLE"; background: var(--bad); }
.status.warn::before { content: "JOINT LIMIT"; background: var(--fg); color: var(--bg-top); }
.note { font-size: .85rem; color: var(--muted); }
.callout { background: var(--card); padding: .9rem 1.2rem; border-radius: 22px; margin: 1rem 0; box-shadow: 0 0 0 1px var(--border); border-left: 0; position: relative; }
.callout::before { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 3px; background: var(--a); }
.callout b:first-child { color: var(--a); font-weight: 500; }
ul.tight { margin: .3rem 0; padding-left: 1.2rem; } ul.tight li { margin: .3rem 0; max-width: 68ch; }
footer { padding: 3rem 0 4rem; color: var(--muted); font-size: .9rem; }
.eq { font-family: var(--mono); font-size: .86rem; background: var(--code-bg); padding: .6rem 1rem; border-radius: 16px; overflow-x: auto; white-space: pre; margin: .5rem 0; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tablewrap { overflow-x: auto; }
.controls fieldset label { display: inline-flex; grid-template-columns: none; color: var(--fg); margin-right: .9rem; }
.controls fieldset { grid-column: 1 / -1; }
@media (max-width: 520px) { body { font-size: 16px; } section { padding-top: 2.4rem; } .stage { height: 380px; } canvas.plane { height: 420px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- Modern full-width layout (desktop first; collapses to one column on small screens) ---- */
header.top { min-height: min(62vh, 640px); display: flex; align-items: flex-end; padding: clamp(3rem, 9vh, 6rem) 0 2rem; }
header.top .wrap { width: 100%; }
header.top h1 { font-size: clamp(3rem, 10vw, 9rem); letter-spacing: -.05em; max-width: 12ch; }
header.top .lede { font-size: clamp(1.1rem, 1.6vw, 1.5rem); max-width: 48ch; }
nav.sticky .wrap { margin-left: auto; margin-right: auto; }
main.wrap { padding-bottom: 2rem; }
section { padding: clamp(3rem, 8vh, 6rem) 0 1rem; }
h2 { max-width: 16ch; }

@media (min-width: 1000px) {
  /* 3D sections: copy and controls on the left, the model fills the right and stays in view */
  #s3, #s4, #s5 { display: grid; grid-template-columns: minmax(320px, 30rem) minmax(0, 1fr); column-gap: clamp(2rem, 4vw, 5rem); align-items: start; }
  #s3 > *, #s4 > *, #s5 > * { grid-column: 1; min-width: 0; }
  #s3 .stage, #s4 .stage, #s5 .stage { grid-column: 2; grid-row: 1 / span 12; position: sticky; top: 84px; height: calc(100vh - 108px); min-height: 520px; margin: 0; }
  #s4 h3, #s4 .tablewrap, #s4 > .status { grid-column: 1 / -1; }
  #s4 > p:has(#s4-reset) { grid-column: 1; }
  #s3 .controls, #s4 .controls, #s5 .controls { grid-template-columns: 1fr; margin-top: .4rem; }
  #s4 .controls { grid-template-columns: 1fr 1fr; }
  #s4 .controls fieldset { grid-column: 1 / -1; }
  /* plane sections: wide chart, narrow readout */
  .grid2 { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: clamp(1.5rem, 3vw, 3rem); }
  canvas.plane { height: clamp(520px, 72vh, 820px); }
  #s1 > h2, #s1 > p, #s2 > h2, #s2 > p { max-width: 62ch; }
}
@media (min-width: 1000px) and (min-height: 700px) { #s3 .stage, #s4 .stage, #s5 .stage { top: 96px; } }
@media (min-width: 1600px) { body { font-size: 18px; } }
@media (max-width: 999px) { header.top { min-height: 0; } h2 { max-width: none; } }

/* ---- Centred column (LinkedIn-style): content capped, page background shows on both sides ---- */
.wrap { max-width: 1180px; margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }
nav.sticky .wrap { max-width: calc(100% - 24px); margin-left: auto; margin-right: auto; padding-left: .35rem; padding-right: .35rem; }
header.top h1 { font-size: clamp(2.8rem, 8vw, 6.5rem); }
@media (min-width: 1000px) {
  #s3, #s4, #s5 { grid-template-columns: minmax(300px, 26rem) minmax(0, 1fr); column-gap: 2.5rem; }
  .grid2 { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 2rem; }
  canvas.plane { height: clamp(500px, 68vh, 720px); }
}
@media (min-width: 1600px) { body { font-size: 17px; } }
[hidden]{display:none!important}.modes{margin:.6rem 0}
.duo { display: grid; gap: .8rem; margin: 1rem 0; }
.duo .controls { margin: 0; grid-template-columns: 1fr; }
.grouptitle { margin: 0 0 .2rem; font-size: .9rem; max-width: none; }
.grouptitle b { color: var(--a); font-weight: 500; }
@media (min-width: 640px) and (max-width: 999px) { .duo { grid-template-columns: 1fr 1fr; } }

/* ---- Dark theme (the page's only theme) ---- */
:root {
  --bg-top: #0c0c0d; --bg-bottom: #1a1613;
  --bg: #111; --fg: #f1efea; --muted: #9a9892; --card: #1b1a19; --border: rgba(255,255,255,.08);
  --grid: #262422; --axis: #4b4741;
  --a: #ff6a22; --b: #d8d5ce; --amber: #f5b642;
  --bad: #ff5c5c; --ok: #5fd38d; --warn: #f5b642;
  --code-bg: #232120; --link: #ff8a4c;
  --shadow: 0 20px 60px rgba(0,0,0,.45);
  color-scheme: dark;
}
/* section 4: the 3D view spans only the first rows, so the full-width table below never sits under it */
@media (min-width: 1000px) { #s4 .stage { grid-row: 1 / span 4; } }

/* ---- Sliders: thin track with an orange fill and a glowing round thumb ---- */
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; height: 28px; cursor: pointer; --p: 50%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--a) var(--p), color-mix(in srgb, var(--fg) 16%, transparent) var(--p)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--fg) 16%, transparent); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--a); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; border: 4px solid var(--a); box-shadow: 0 2px 8px rgba(0,0,0,.45); transition: box-shadow .15s, transform .15s; }
input[type=range]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 4px solid var(--a); box-shadow: 0 2px 8px rgba(0,0,0,.45); }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:active::-webkit-slider-thumb { box-shadow: 0 0 0 7px color-mix(in srgb, var(--a) 28%, transparent), 0 2px 8px rgba(0,0,0,.45); transform: scale(1.08); }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 7px color-mix(in srgb, var(--a) 40%, transparent); }

/* ---- Radios: segmented pills; the native input stays in place (hidden visually) for keyboard and screen readers ---- */
fieldset { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .35rem .45rem; border-radius: 999px; }
fieldset legend { padding: 0 .5rem; }
fieldset label, .controls fieldset label { position: relative; display: inline-flex; margin: 0; padding: .3rem .95rem; border-radius: 999px; font-size: .86rem; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; box-shadow: inset 0 0 0 1px var(--border); }
fieldset label:hover { color: var(--fg); }
fieldset label input[type=radio] { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
fieldset label:has(input:checked) { background: var(--a); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--a) 40%, transparent); }
fieldset label:has(input:focus-visible) { outline: 2px solid var(--fg); outline-offset: 2px; }
.stage.mini { height: 340px; margin-bottom: .2rem; }
ol.steps { counter-reset: st; list-style: none; padding: 0; margin: 1rem 0; max-width: 75ch; }
ol.steps li { counter-increment: st; position: relative; padding: 0 0 1rem 3rem; }
ol.steps li::before { content: counter(st); position: absolute; left: 0; top: .1rem; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 500; color: #fff; background: var(--a); }
.eq { font-size: .92rem; }

/* ---- matrix derivation ---- */
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1rem 0 .4rem; }
.mcard { margin: 0; padding: .6rem .8rem; border-radius: 20px; background: var(--card); box-shadow: 0 0 0 1px var(--border); }
.mcard figcaption { font-size: .72rem; color: var(--muted); line-height: 1.3; margin-bottom: .35rem; max-width: 11rem; }
.mcard figcaption b { color: var(--fg); font-weight: 500; font-size: .8rem; }
.mdot { color: var(--a); font-size: 1.4rem; }
table.mx { border-collapse: separate; border-spacing: 0; font-family: var(--mono); font-size: .72rem; border-left: 2px solid var(--axis); border-right: 2px solid var(--axis); border-radius: 6px; }
table.mx td { border: 0; padding: .08rem .35rem; text-align: right; }
.foot { font-size: 1.05rem; }
.hot { color: var(--a); font-weight: 500; }
.revbox { margin: .8rem 0; padding: 1.1rem 1.4rem; }
.revbox p { max-width: 70ch; }
.eqs { display: grid; gap: .4rem; margin: .5rem 0; }
.eqs .eq { margin: 0; white-space: normal; }
table.sols td, table.sols th { padding: .35rem .7rem; }
table.sols tr.mine td { color: var(--a); font-weight: 500; }
td.ang, b.ang { color: var(--a); font-style: italic; }
td.len, b.len { color: var(--amber); }
td.z, td.o { color: var(--muted); }
table.mx td { white-space: nowrap; }
.chain { align-items: stretch; }

/* ---- equations ---- */
.eqblock { display: grid; gap: .35rem; margin: .6rem 0; }
.eqblock .eq { margin: 0; white-space: normal; overflow-x: auto; font-size: .95rem; padding: .6rem 1rem; }
.eqblock .eq.soft { background: transparent; color: var(--muted); padding-top: 0; font-family: var(--sans); font-size: .85rem; }
ol.steps li .eqblock { margin-top: .5rem; }

/* diagrams sized so canvas + legend + sliders fit on one screen */
canvas.plane { height: clamp(340px, 46vh, 500px) !important; }
@media (max-width: 520px) { canvas.plane { height: 380px !important; } }

/* section 4: the sticky 3D view lives inside .split so it can never slide over the table below */
@media (min-width: 1000px) {
  #s5 { display: block; }
  #s5 .split { display: grid; grid-template-columns: minmax(300px, 26rem) minmax(0, 1fr); column-gap: 2.5rem; align-items: start; }
  #s5 .split > * { grid-column: 1; min-width: 0; }
  #s5 .split > .stage { grid-column: 2; grid-row: 1 / span 8; position: sticky; top: 96px; height: calc(100vh - 108px); min-height: 520px; margin: 0; }
}
details.algebra { margin: .6rem 0; }
details.algebra summary { cursor: pointer; display: inline-block; padding: .3rem 1rem; border-radius: 999px; box-shadow: 0 0 0 1px var(--border); background: var(--card); font-size: .85rem; color: var(--muted); }
details.algebra[open] summary { color: var(--fg); }
details.algebra .eqblock { margin-top: .6rem; }

/* ---- typeset maths (MathML) ---- */
math { font-family: "STIX Two Math", "Latin Modern Math", "Cambria Math", "Times New Roman", serif; font-size: 1.2em; color: var(--fg); }
.eqblock .eq { font-family: var(--sans); background: transparent; padding: .1rem 0; overflow-x: auto; overflow-y: hidden; }
.eqblock { gap: .1rem; }
.eqblock .eq math[display="block"] { text-align: left; margin: .35rem 0; }
.eqblock .eq.soft { font-size: .85rem; color: var(--muted); padding: 0; }
.eqblock .eq.soft math { font-size: 1.05em; color: var(--muted); }
.eqblock .eq.defs { line-height: 2.2; }
math.mx { font-size: .95em; }
math.mx mtd.ang { color: var(--a); }
math.mx mtd.len { color: var(--amber); }
math.mx mtd.z, math.mx mtd.o { color: var(--muted); }
.mcard math.mx { display: block; }

/* =====================================================================
   Look v27: blueprint line art + solid orange, frosted glass, dot matrix
   ===================================================================== */
:root {
  --bg-top: #0d0c0b; --bg-bottom: #1c1612;
  --glass: rgba(255,255,255,.045); --glass-edge: rgba(255,255,255,.10);
}
body {
  background:
    radial-gradient(70% 45% at 82% -5%, rgba(255,106,34,.22), transparent 70%),
    radial-gradient(50% 40% at 0% 30%, rgba(255,150,80,.07), transparent 70%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom)) fixed;
  font-weight: 200;
}
b, strong { font-weight: 400; }

/* hero: big thin headline over a dot-matrix field with a soft orange bloom */
header.top { position: relative; padding: clamp(3rem, 9vh, 6rem) 0 1.5rem; isolation: isolate; }
header.top::before {
  content: ""; position: absolute; z-index: -1; right: 0; top: 6%; width: min(46vw, 560px); aspect-ratio: 1;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,106,34,.55), transparent 60%) ,
    radial-gradient(circle, rgba(255,255,255,.55) 1.4px, transparent 1.8px) 0 0 / 16px 16px;
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 68%); mask: radial-gradient(circle, #000 0%, transparent 68%);
  opacity: .8; filter: saturate(1.1);
}
header.top h1 { font-weight: 200; letter-spacing: -.055em; line-height: .95; max-width: 11ch; }
.lede { font-size: 1.15rem; color: color-mix(in srgb, var(--fg) 72%, transparent); max-width: 52ch; }
.pill { background: var(--glass); box-shadow: 0 0 0 1px var(--glass-edge); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pill.on { background: var(--a); box-shadow: 0 8px 24px rgba(255,106,34,.35); }
header.top .links a:first-child { box-shadow: 0 10px 30px rgba(255,255,255,.12); }

/* floating glass nav */
nav.sticky .wrap { background: rgba(24,21,19,.6) !important; backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 0 0 1px var(--glass-edge), 0 14px 40px rgba(0,0,0,.35) !important; }
nav.sticky a.on { box-shadow: 0 6px 18px rgba(255,106,34,.4); }

/* glass cards */
.card, .controls, .status, .mcard, details.algebra, .eqblock {
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px var(--glass-edge), 0 24px 60px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.06);
}
.controls label { font-weight: 300; letter-spacing: .01em; }
.controls label output { color: var(--a); }

/* 3D stages: dark studio, dot-matrix floor glow, orange rim light */
.stage {
  background:
    radial-gradient(circle, rgba(255,255,255,.16) 1px, transparent 1.4px) 0 0 / 22px 22px,
    radial-gradient(90% 70% at 50% 100%, rgba(255,106,34,.22), transparent 70%),
    radial-gradient(120% 90% at 50% 0%, #26211d, #14110f);
  box-shadow: 0 0 0 1px var(--glass-edge), 0 30px 80px rgba(0,0,0,.5);
}
.stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 120px rgba(0,0,0,.45); }
.stage .msg { z-index: 1; }

/* status: orange-tinted glass for ok, red badge for problems, like the reference chips */
.status.ok { background: linear-gradient(135deg, rgba(255,106,34,.22), rgba(255,106,34,.06)); }
.status.bad::before { background: #ff1a1a; box-shadow: 0 4px 14px rgba(255,26,26,.45); }
.status.ok::before { box-shadow: 0 4px 14px rgba(255,106,34,.45); }

/* section headings: oversized numeral as a faint outline */
h2 { font-weight: 200; }
h2 .n { font-weight: 200; color: transparent; -webkit-text-stroke: 1px var(--a); font-size: 1.25em; margin-right: .3em; }
section + section { border-top: 1px solid rgba(255,255,255,.05); }

/* =====================================================================
   Motion: drifting light, breathing hero glow, soft scroll reveals
   ===================================================================== */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; will-change: transform; }
.bg i:nth-child(1) { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: radial-gradient(circle, rgba(255,106,34,.55), transparent 65%); animation: drift1 26s ease-in-out infinite alternate; }
.bg i:nth-child(2) { width: 38vmax; height: 38vmax; right: -10vmax; top: 30vh; background: radial-gradient(circle, rgba(255,150,80,.32), transparent 65%); animation: drift2 32s ease-in-out infinite alternate; }
.bg i:nth-child(3) { width: 34vmax; height: 34vmax; left: 25vw; bottom: -18vmax; background: radial-gradient(circle, rgba(255,70,20,.30), transparent 65%); animation: drift3 38s ease-in-out infinite alternate; }
.bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255,255,255,.07) 1px, transparent 1.4px) 0 0 / 28px 28px; animation: dots 60s linear infinite; -webkit-mask: linear-gradient(180deg, #000, transparent 85%); mask: linear-gradient(180deg, #000, transparent 85%); }
@keyframes drift1 { to { transform: translate(18vw, 14vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-22vw, -12vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(-16vw, -10vh) scale(1.2); } }
@keyframes dots { to { background-position: 28px 56px; } }
header.top::before { animation: breathe 7s ease-in-out infinite; transform: translate(var(--mx, 0px), var(--my, 0px)); transition: transform .6s ease-out; }
@keyframes breathe { 50% { opacity: 1; filter: saturate(1.4) brightness(1.15); } }

.rv { opacity: 0; transform: translateY(22px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }
.pill.on { animation: glow 3.5s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 8px 34px rgba(255,106,34,.65); } }
.status { transition: background .5s, box-shadow .5s; }
nav.sticky a { transition: background .3s, color .3s, box-shadow .3s; }
@media (prefers-reduced-motion: reduce) {
  .bg i, .bg::after, header.top::before, .pill.on { animation: none !important; }
  .rv { opacity: 1; transform: none; transition: none; }
}

/* legibility: thin display type, but readable body and labels */
:root { --muted: #b4b1a9; }
body { font-weight: 300; }
.controls label, .legend, .note, .status, fieldset legend, .mcard figcaption { font-weight: 300; color: color-mix(in srgb, var(--fg) 78%, transparent); }
.legend span, .note { color: var(--muted); }
h2, h1, h3.thin { font-weight: 200; }

/* subtle background: content first, light only as a faint warm tint */
body { background:
    radial-gradient(70% 45% at 82% -5%, rgba(255,106,34,.07), transparent 70%),
    linear-gradient(180deg, #0c0b0a, #131110) fixed; }
.bg i { opacity: .16; filter: blur(90px); }
.bg::after { opacity: .35; }
header.top::before { opacity: .35; animation: breathe 9s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .5; } }
.stage { background:
    radial-gradient(circle, rgba(255,255,255,.07) 1px, transparent 1.4px) 0 0 / 22px 22px,
    radial-gradient(90% 70% at 50% 100%, rgba(255,106,34,.08), transparent 70%),
    radial-gradient(120% 90% at 50% 0%, #1c1917, #100e0d); }
.status.ok { background: linear-gradient(135deg, rgba(255,106,34,.10), rgba(255,106,34,.03)); }

/* equation panels: padded rounded glass, left-aligned, one panel per group */
.eqblock { padding: 1.1rem 1.6rem; border-radius: 24px; gap: .2rem; margin: .8rem 0 1rem; overflow-x: auto; }
.eqblock .eq math, .eqblock .eq math[display="block"] { display: inline math; math-style: normal; margin: .35rem 0; }
.eqblock .eq.soft { margin: .3rem 0 .1rem; line-height: 2.1; }
.eqblock .eq.soft math { display: inline math; math-style: compact; margin: 0; }
.eqblock .eq { display: block; text-align: left; }
details.algebra { padding: .5rem; border-radius: 24px; }
details.algebra summary { background: rgba(255,255,255,.06); }
details.algebra summary:hover { color: var(--fg); }
details.algebra .eqblock { background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: .6rem 1.1rem; margin: .4rem 0 0; }
.eqblock .eq.soft:not(.defs) { font-size: 1rem; color: var(--fg); }
.eqblock .eq.soft:not(.defs) math { color: var(--fg); font-size: 1.05rem; math-style: normal; }

/* =====================================================================
   Performance pass: compositor-only motion, no blur filters, no per-frame repaints
   ===================================================================== */
body { background: #0c0b0a; }
.bg { background:
    radial-gradient(70% 45% at 82% -5%, rgba(255,106,34,.07), transparent 70%),
    linear-gradient(180deg, #0c0b0a, #131110);
  contain: strict; transform: translateZ(0); }
.bg i { filter: none; opacity: .5; will-change: transform; backface-visibility: hidden; }
.bg i:nth-child(1) { background: radial-gradient(circle closest-side, rgba(255,106,34,.20), rgba(255,106,34,.07) 55%, transparent); }
.bg i:nth-child(2) { background: radial-gradient(circle closest-side, rgba(255,150,80,.13), rgba(255,150,80,.04) 55%, transparent); }
.bg i:nth-child(3) { background: radial-gradient(circle closest-side, rgba(255,70,20,.12), rgba(255,70,20,.04) 55%, transparent); }
.bg::after { animation: none; opacity: .3; }                  /* static dot grid: animating background-position repaints every frame */
header.top::before { will-change: transform, opacity; transition: transform .9s cubic-bezier(.2,.7,.2,1); }
header.top { --mx: 0px; --my: 0px; }
/* glass without backdrop blur (cheap); only the floating nav keeps a blur */
.card, .controls, .status, .mcard, details.algebra, .eqblock, .pill { backdrop-filter: none; -webkit-backdrop-filter: none; background-color: rgba(30,27,25,.62); }
.status.ok { background-color: rgba(60,34,22,.7); }
/* smooth, GPU-friendly interactions */
.rv { will-change: opacity, transform; }
.rv.in { will-change: auto; }
.controls, .status, .mcard, .pill, nav.sticky a, button, .btn, header.top .links a { transition: transform .25s cubic-bezier(.2,.7,.2,1), background-color .3s, box-shadow .3s, color .3s; }
header.top .links a:hover, button:hover, .btn:hover { transform: translateY(-2px); }
button:active, .btn:active { transform: translateY(0) scale(.98); }
input[type=range]::-webkit-slider-thumb { transition: transform .2s cubic-bezier(.2,.7,.2,1), box-shadow .2s; }
.stage canvas { transform: translateZ(0); }
.stage { contain: layout paint; }
details.algebra > .eqblock { animation: openIn .35s cubic-bezier(.2,.7,.2,1); }
@keyframes openIn { from { opacity: 0; transform: translateY(-6px); } }
/* no content-visibility on sections: its paint containment hard-clipped card shadows and hover glows at the section edge */
               /* sections with sticky 3D stages stay fully rendered */

/* visible-but-calm ambient motion */
.bg i { opacity: 1; }
.bg i:nth-child(1) { width: 60vmax; height: 60vmax; background: radial-gradient(circle closest-side, rgba(255,106,34,.30), rgba(255,106,34,.10) 55%, transparent); animation: drift1 15s ease-in-out infinite alternate; }
.bg i:nth-child(2) { width: 52vmax; height: 52vmax; background: radial-gradient(circle closest-side, rgba(255,150,80,.20), rgba(255,150,80,.06) 55%, transparent); animation: drift2 19s ease-in-out infinite alternate; }
.bg i:nth-child(3) { width: 48vmax; height: 48vmax; background: radial-gradient(circle closest-side, rgba(255,70,20,.20), rgba(255,70,20,.06) 55%, transparent); animation: drift3 23s ease-in-out infinite alternate; }
@keyframes drift1 { 0% { transform: translate3d(0,0,0) scale(1); } 100% { transform: translate3d(48vw, 38vh, 0) scale(1.25); } }
@keyframes drift2 { 0% { transform: translate3d(0,0,0) scale(1); } 100% { transform: translate3d(-52vw, -34vh, 0) scale(.85); } }
@keyframes drift3 { 0% { transform: translate3d(0,0,0) scale(1); } 100% { transform: translate3d(-40vw, -42vh, 0) scale(1.3); } }

/* glows live in the side margins only, never behind copy; they drift vertically along the edges */
.bg i { width: 44vmax; height: 44vmax; top: 0; bottom: auto; }
.bg i:nth-child(1) { left: -30vmax; right: auto; top: -5vh; background: radial-gradient(circle closest-side, rgba(255,106,34,.38), rgba(255,106,34,.12) 55%, transparent); animation: edgeA 14s ease-in-out infinite alternate; }
.bg i:nth-child(2) { right: -30vmax; left: auto; top: 10vh; background: radial-gradient(circle closest-side, rgba(255,150,80,.30), rgba(255,150,80,.09) 55%, transparent); animation: edgeB 18s ease-in-out infinite alternate; }
.bg i:nth-child(3) { right: -32vmax; left: auto; top: 60vh; background: radial-gradient(circle closest-side, rgba(255,70,20,.28), rgba(255,70,20,.08) 55%, transparent); animation: edgeC 22s ease-in-out infinite alternate; }
@keyframes edgeA { 0% { transform: translate3d(0,0,0) scale(1); } 100% { transform: translate3d(2vw, 70vh, 0) scale(1.2); } }
@keyframes edgeB { 0% { transform: translate3d(0,0,0) scale(1); } 100% { transform: translate3d(-2vw, 55vh, 0) scale(.9); } }
@keyframes edgeC { 0% { transform: translate3d(0,0,0) scale(1.1); } 100% { transform: translate3d(0, -60vh, 0) scale(.9); } }
.bg { -webkit-mask-image: linear-gradient(90deg, #000 0, transparent 7%, transparent 91%, #000 100%); mask-image: linear-gradient(90deg, #000 0, transparent 7%, transparent 91%, #000 100%); }
.bg::after { display: none; }
header.top::before { opacity: .22; animation: none; }

/* =====================================================================
   v42: 3D hero, dot-matrix pad, ring gauges, tick meter
   ===================================================================== */
/* hero: the robot fills the right side and fades under the headline */
header.top { min-height: min(78vh, 760px); }
.hero-stage { position: absolute; z-index: -1; top: 0; bottom: 0; right: 0; width: min(62vw, 940px); opacity: 0; transition: opacity 1.2s ease;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28%, #000 88%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 28%, #000 88%, transparent 100%); }
.hero-stage.ready { opacity: 1; }
.hero-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.hero-stage canvas:active { cursor: grabbing; }
header.top::before { right: 8%; top: 18%; opacity: .5; }          /* glow sits under the robot */
header.top h1, header.top .lede, header.top .eyebrow, header.top .links { position: relative; z-index: 1; }
@media (max-width: 999px) { .hero-stage { width: 100%; opacity: 0; } .hero-stage.ready { opacity: .55; } .hero-stage canvas { pointer-events: none; } }

/* dot-matrix pad */
.padwrap { grid-column: 1 / -1; position: relative; width: 100%; max-width: 380px; aspect-ratio: 1; margin: .2rem auto .6rem; border-radius: 26px; overflow: hidden;
  background: radial-gradient(120% 100% at 30% 0%, #ff8a3d, #f2540c 70%); box-shadow: 0 24px 60px rgba(242,84,12,.28), inset 0 1px 0 rgba(255,255,255,.35); }
.padwrap canvas.padcv { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; outline: none; }
.padwrap canvas.padcv:focus-visible { box-shadow: inset 0 0 0 2px #fff; border-radius: inherit; }
.pl { position: absolute; font-size: .72rem; font-weight: 400; letter-spacing: .08em; color: rgba(255,255,255,.92); pointer-events: none; }
.pl.t { top: 10px; left: 50%; transform: translateX(-50%); } .pl.l { left: 12px; top: 50%; transform: translateY(-50%); } .pl.r { right: 12px; top: 50%; transform: translateY(-50%); }
#s3-inv-controls .padwrap { max-width: none; }

/* ring gauges */
.rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: .8rem 0; }
.ring { position: relative; display: grid; justify-items: center; padding: .4rem .2rem .2rem; border-radius: 22px; background: rgba(30,27,25,.62); box-shadow: 0 0 0 1px var(--glass-edge); }
.ring svg { width: min(100%, 118px); height: auto; overflow: visible; }
.ring circle { fill: none; stroke-linecap: round; }
.ring .trk { stroke: rgba(255,255,255,.12); stroke-width: 6; }
.ring .val { stroke: var(--a); stroke-width: 6; transition: stroke-dasharray .35s cubic-bezier(.2,.7,.2,1); filter: drop-shadow(0 0 5px rgba(255,106,34,.55)); }
.ring .knob { fill: #fff; stroke: none; filter: drop-shadow(0 0 4px rgba(255,255,255,.6)); transition: cx .35s cubic-bezier(.2,.7,.2,1), cy .35s cubic-bezier(.2,.7,.2,1); }
.ring .num { position: absolute; top: 34%; left: 0; right: 0; text-align: center; line-height: 1.15; }
.ring .num b { display: block; font-size: 1.15rem; font-weight: 300; font-variant-numeric: tabular-nums; }
.ring .num span { font-size: .68rem; color: var(--muted); letter-spacing: .04em; }
.ring .lim { visibility: hidden; font-style: normal; font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--bad); margin: -.1rem 0 .3rem; }
.ring.hit .val { stroke: var(--bad); filter: drop-shadow(0 0 5px rgba(255,26,26,.6)); }
.ring.hit .lim { visibility: visible; }
.rnote { font-size: .8rem; color: var(--muted); margin: .2rem .4rem .4rem; min-height: 1.4em; } .rnote.bad { color: var(--bad); }
#s1 .card .rings { margin: .2rem 0 0; }

/* tick meter, as in the reference's "Max limit" chart */
.tickmeter { grid-column: 1 / -1; margin: .8rem 0; padding: 1rem 1.3rem 1rem; }
.tk-head { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); } .tk-head b { color: var(--fg); font-weight: 400; }
.tk-plot { position: relative; height: 128px; margin-top: .6rem; }
.tk-line { position: absolute; left: 0; right: 0; top: 4px; border-top: 1px dashed rgba(255,255,255,.35); }
.tk-line span { position: absolute; top: -1.35em; left: 0; font-size: .68rem; letter-spacing: .04em; color: var(--muted); }
.tk-groups { position: absolute; left: 0; right: 0; top: 10px; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.tk-leg { display: grid; grid-template-rows: 1fr auto; justify-items: center; } .tk-leg > span { font-size: .68rem; color: var(--muted); margin-top: 4px; }
.tk-bars { display: flex; align-items: flex-end; gap: 12px; height: 92px; }
.tk-joint { display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.tk-joint i { width: 2px; border-radius: 2px; background: rgba(255,255,255,.28); height: 16%; transition: height .4s cubic-bezier(.2,.7,.2,1), background-color .3s; }
.tk-joint i.hot { background: var(--a); } .tk-joint i.hit { background: var(--bad); }
@media (max-width: 520px) { .rings { gap: .4rem; } .ring .num b { font-size: .95rem; } .tk-bars { gap: 6px; } }

/* pad: flat orange so the two dot states read clearly */
.padwrap { background: linear-gradient(160deg, #f96a1c, #ee5410); }
.padwrap canvas.padcv:focus { outline: none; }
.padwrap canvas.padcv:focus-visible { box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.pleg { position: absolute; left: 0; right: 0; bottom: 9px; display: flex; justify-content: center; align-items: center; gap: .45rem; font-size: .68rem; letter-spacing: .04em; color: rgba(255,255,255,.92); pointer-events: none; }
.pleg i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: .7rem; } .pleg i:first-child { margin-left: 0; }
.pleg i.on { background: #fff; } .pleg i.off { background: #7d2300; width: 5px; height: 5px; opacity: .8; }

/* quieter pad: deeper, less saturated orange; the legend and labels recede */
.padwrap { background: linear-gradient(160deg, #e5601a, #cf4a0e); box-shadow: 0 18px 44px rgba(207,74,14,.18), inset 0 1px 0 rgba(255,255,255,.2); }
.pl { color: rgba(255,255,255,.7); } .pleg { color: rgba(255,255,255,.7); }
.pleg i.on { background: rgba(255,255,255,.85); }

.pz { position: absolute; top: 10px; right: 14px; font-size: .68rem; letter-spacing: .04em; color: rgba(255,255,255,.75); pointer-events: none; font-variant-numeric: tabular-nums; }

/* gauges floating over the 3D view */
.stage .rings.overlay { position: absolute; z-index: 2; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: .5rem; margin: 0; pointer-events: none; }
.stage .rings.overlay .ring { width: 104px; padding: .35rem .2rem .1rem; border-radius: 20px; background: rgba(14,12,11,.5); box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 10px 30px rgba(0,0,0,.35); }
.stage .rings.overlay .ring svg { width: 76px; }
.stage .rings.overlay .ring .num { top: 28%; } .stage .rings.overlay .ring .num b { font-size: .95rem; } .stage .rings.overlay .ring .num span { font-size: .6rem; }
.stage .rings.overlay .ring .lim { font-size: .58rem; margin: -.2rem 0 .25rem; visibility: hidden; }
@media (max-width: 520px) { .stage .rings.overlay { gap: .3rem; bottom: 8px; } .stage .rings.overlay .ring { width: 84px; } .stage .rings.overlay .ring svg { width: 60px; } }

/* tunable gauges */
#s3 .duo { display: block; }
.stage .rings.overlay .ring.tunable { pointer-events: auto; cursor: grab; touch-action: none; outline: none; transition: box-shadow .25s, background-color .25s, transform .25s cubic-bezier(.2,.7,.2,1); }
.stage .rings.overlay .ring.tunable:hover { background: rgba(24,20,18,.72); box-shadow: 0 0 0 1px rgba(255,106,34,.55), 0 10px 30px rgba(0,0,0,.4); transform: translateY(-2px); }
.stage .rings.overlay .ring.tunable:active { cursor: grabbing; }
.stage .rings.overlay .ring.tunable:focus-visible { box-shadow: 0 0 0 2px var(--a); }
.ring.tunable:hover .knob { r: 6; }
.ring .knob { transition: r .2s, cx .12s linear, cy .12s linear; }

/* COM stability margin, floating over the gait view */
.comgauge { position: absolute; z-index: 2; left: 50%; bottom: 14px; transform: translateX(-50%); display: grid; grid-template-columns: auto 190px auto; align-items: center; gap: .8rem; padding: .55rem 1rem; border-radius: 999px; background: rgba(14,12,11,.55); box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 10px 30px rgba(0,0,0,.35); font-size: .78rem; pointer-events: none; white-space: nowrap; }
.comgauge .mt { color: var(--muted); letter-spacing: .04em; } .comgauge .mv { min-width: 8.5em; font-variant-numeric: tabular-nums; color: #fff; }
.comgauge .trk { position: relative; height: 6px; border-radius: 999px; background: rgba(255,255,255,.14); }
.comgauge .trk b { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--a); box-shadow: 0 0 10px rgba(255,106,34,.6); transition: left .2s, width .2s, background-color .2s; }
.comgauge .trk .zero { position: absolute; left: 37.5%; top: -4px; bottom: -4px; width: 1px; background: rgba(255,255,255,.6); }
.comgauge.bad .trk b { background: var(--bad); box-shadow: 0 0 10px rgba(255,26,26,.6); } .comgauge.bad .mv { color: #ff8b8b; }
.comgauge.na .trk b { background: transparent; box-shadow: none; }
@media (max-width: 520px) { .comgauge { grid-template-columns: auto 90px auto; gap: .5rem; padding: .45rem .8rem; font-size: .7rem; } }

/* ---- section 5: joint-angle panels ---- */
.angcard { margin: .8rem 0; padding: 1rem 1.3rem 1.1rem; }
.angkey { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: .1rem 0 .8rem; font-size: .8rem; color: var(--muted, #9a9a9a); }
.angkey span { display: inline-flex; align-items: center; gap: .45rem; }
.angkey i { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.angkey .sw i { height: 10px; width: 14px; border-radius: 3px; background: rgba(255,106,34,.25); }
.angs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .9rem; }
.ap { border-radius: 14px; padding: .55rem .7rem .6rem; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.06); transition: border-color .2s, background .2s; min-width: 0; }
.ap .ph { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .35rem; font-size: .85rem; }
.ap .av { display: inline-flex; gap: .55rem; font-variant-numeric: tabular-nums; font-size: .78rem; }
.ap .av em { font-style: normal; }
.ap .pc { position: relative; height: 84px; overflow: hidden; }
.ap .pc canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }

/* section 5: the 3D view and the angle plots share one sticky column so both fit on screen */
@media (min-width: 1000px) {
  #s5 .split > .vis { grid-column: 2; grid-row: 1 / span 8; position: sticky; top: 92px; align-self: start; min-width: 0; }
  #s5 .vis .stage { grid-column: auto; grid-row: auto; position: relative; top: auto; height: clamp(300px, calc(100vh - 330px), 720px); min-height: 0; margin: 0; }
  #s5 .vis .angcard { margin: .7rem 0 0; padding: .7rem .9rem .8rem; }
  #s5 .vis .angcard .tk-head { margin-bottom: .2rem; }
  #s5 .vis .angkey { margin-bottom: .5rem; }
  #s5 .vis .angs { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
  #s5 .vis .ap { padding: .4rem .5rem .45rem; }
  #s5 .vis .ap .pc { height: 52px; }
  #s5 .vis .ap .av { gap: .35rem; font-size: .72rem; }
}
.ap .ph b { white-space: nowrap; }
.ap .ph { gap: .4rem; flex-wrap: wrap; }

/* =====================================================================
   Site-wide navigation bar & engineering design document modules
   ===================================================================== */
.site-nav { position: relative; z-index: 30; padding: 16px 0 0; }
.site-nav .wrap { display: flex; justify-content: space-between; align-items: center; gap: .8rem; }
.site-nav .nav-pill { min-width: 0; flex: 0 1 auto; }
.site-nav .tabs { min-width: 0; }
.site-nav .nav-play { flex-shrink: 0; white-space: nowrap; text-decoration: none; padding: .55rem 1.05rem; border-radius: 999px; background: var(--a); color: #fff; font-size: .84rem; box-shadow: 0 8px 24px rgba(255,106,34,.4); transition: transform .2s, box-shadow .2s; }
.site-nav .nav-play:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(255,106,34,.55); }
@media (max-width: 760px) { .site-nav .wrap { flex-wrap: wrap; } }
.nav-pill {
  display: flex; align-items: center; gap: .6rem; max-width: 100%; padding: .35rem .45rem .35rem 1rem;
  border-radius: 999px;
  background: rgba(24,21,19,.68); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 0 0 1px var(--glass-edge), 0 14px 40px rgba(0,0,0,.38);
}
.site-nav .brand {
  display: inline-flex; align-items: center; gap: .5rem; text-decoration: none;
  color: var(--fg); font-weight: 400; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; white-space: nowrap;
}
.site-nav .brand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--a); box-shadow: 0 0 10px rgba(255,106,34,.85); }
.nav-sep { width: 1px; height: 16px; background: rgba(255,255,255,.12); flex-shrink: 0; }
.site-nav .tabs { display: flex; align-items: center; gap: .15rem; overflow-x: auto; scrollbar-width: none; }
.site-nav .tabs a {
  white-space: nowrap; padding: .34rem .85rem; border-radius: 999px; text-decoration: none;
  color: var(--muted); font-size: .84rem; font-weight: 400;
  transition: background .25s, color .25s, box-shadow .25s;
}
.site-nav .tabs a:hover { color: var(--fg); }
.site-nav .tabs a.on { background: var(--a); color: #fff; box-shadow: 0 6px 18px rgba(255,106,34,.4); }

nav.site-nav + header.top { padding-top: clamp(2rem, 5vh, 3.6rem); min-height: min(70vh, 660px); }

/* Section 1: Real vs Simulation photo showcase */
.compare-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem; margin: 1.2rem 0 .8rem; }
.compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 780px) { .compare-grid { grid-template-columns: 1fr; } }
.photo-frame {
  position: relative; margin: 0; border-radius: 24px; overflow: hidden;
  background: #141210; box-shadow: 0 0 0 1px var(--glass-edge), 0 24px 60px rgba(0,0,0,.38);
}
.photo-frame img {
  display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  filter: contrast(1.04) brightness(1.22) saturate(1.06);
  transition: transform .5s cubic-bezier(.2,.7,.2,1), filter .4s;
}
.photo-frame:hover img { transform: scale(1.015); filter: contrast(1.05) brightness(1.3) saturate(1.08); }
.photo-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 40px rgba(10,9,8,.3), inset 0 -56px 60px -24px rgba(10,9,8,.7);
}
.photo-cap {
  position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 13px;
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  font-size: .8rem; color: var(--fg); pointer-events: none;
}
.photo-cap span { color: var(--muted); font-size: .75rem; }
.photo-tag {
  padding: .18rem .65rem; border-radius: 999px; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(16,14,13,.75); box-shadow: 0 0 0 1px rgba(255,255,255,.14); color: var(--fg);
}
.photo-tag.sim { background: rgba(255,106,34,.22); box-shadow: 0 0 0 1px rgba(255,106,34,.45); color: #ffd4bd; }

/* Section 2: Modelling concepts + sticky 3D CAD model */
.split-home { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 1000px) {
  .split-home { grid-template-columns: minmax(310px, 27rem) minmax(0, 1fr); column-gap: 2.5rem; }
  .split-home .col-left { grid-column: 1; min-width: 0; }
  .split-home .stage { grid-column: 2; position: sticky; top: 96px; height: clamp(440px, 60vh, 600px); min-height: 440px; margin: 0; }
  .split-home .controls { grid-template-columns: 1fr; }
}
.split-home fieldset, #morph fieldset, #calculator fieldset { border-radius: 20px; padding: .45rem .6rem; }
.concept-list { display: grid; gap: .75rem; margin: 1rem 0; }
.concept-card { padding: .95rem 1.15rem; border-radius: 22px; }
.concept-card h3 { margin: .1rem 0 .3rem; font-size: .98rem; font-weight: 400; color: var(--fg); }
.concept-card p { margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.5; }
.step-tag { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--a); font-weight: 400; }

.stage-hud {
  position: absolute; z-index: 2; left: 50%; bottom: 14px; transform: translateX(-50%);
  padding: .45rem 1rem; border-radius: 999px; background: rgba(14,12,11,.6);
  box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 10px 30px rgba(0,0,0,.35);
  font-size: .78rem; color: var(--fg); pointer-events: none; white-space: nowrap;
}
.stage-hud b { color: var(--a); font-weight: 500; }

/* Section 3: morphology & side chain */
.side-cv { height: 220px !important; }
#m-canvas { cursor: pointer; }

/* Section 4: MuJoCo simulation pipeline & terrain evidence */
.pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 1.1rem 0 1.3rem; }
@media (max-width: 900px) { .pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pipe { grid-template-columns: 1fr; } }
.pipe-node {
  display: flex; flex-direction: column; gap: .3rem;
  padding: .9rem 1rem; border-radius: 22px;
  background: rgba(30,27,25,.62); box-shadow: 0 0 0 1px var(--glass-edge);
}
.pipe-node.hot { background: linear-gradient(135deg, rgba(255,106,34,.14), rgba(30,27,25,.72)); box-shadow: 0 0 0 1px rgba(255,106,34,.35); }
.pipe-node b { font-family: var(--mono); font-size: .74rem; color: var(--a); font-weight: 500; }
.pipe-node strong { font-size: .94rem; font-weight: 400; color: var(--fg); line-height: 1.25; }
.pipe-node span { font-size: .8rem; color: var(--muted); line-height: 1.45; }

.sim-gallery { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 52rem; gap: .9rem; margin-top: 1rem; }
.compact-section { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.compact-section .links { display: flex; flex-wrap: wrap; gap: 1rem; }
.philosophy-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin-top: 1rem; }
@media (max-width: 700px) { .philosophy-strip { grid-template-columns: 1fr; } }
.philosophy-strip div { display: grid; gap: .2rem; padding: .8rem .95rem; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.06); }
.philosophy-strip b { color: var(--a); font-size: .82rem; font-weight: 400; }
.philosophy-strip span { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.explore-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; margin-top: .9rem; }
@media (max-width: 860px) { .explore-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .explore-links { grid-template-columns: 1fr; } }
.explore-link { position: relative; display: grid; gap: .22rem; padding: .85rem 2rem .85rem .95rem; border-radius: 16px; background: rgba(30,27,25,.62); box-shadow: 0 0 0 1px var(--glass-edge); text-decoration: none; transition: transform .2s, background .2s; }
.explore-link:hover { transform: translateY(-2px); background: rgba(255,106,34,.1); }
.explore-link span { color: var(--fg); font-size: .86rem; }
.explore-link small { color: var(--muted); font-size: .74rem; }
.explore-link b { position: absolute; right: .8rem; top: .8rem; color: var(--a); font-weight: 400; }

/* Section 5: Payload & Servo Calculator */
.payload-ref { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: .9rem; margin: 1rem 0 .6rem; }
.payload-ref .photo-frame img { aspect-ratio: 4 / 3; height: 100%; }
.payload-ref .photo-cap { flex-direction: column; align-items: flex-start; gap: .25rem; }
.payload-note { color: var(--muted); font-size: .8rem; margin: 0 0 1rem; }
@media (max-width: 860px) { .payload-ref { grid-template-columns: 1fr; } }
.calc-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; margin-top: 1rem; }
@media (max-width: 880px) { .calc-grid { grid-template-columns: 1fr; } }
.calc-out { display: grid; gap: .9rem; padding: 1.25rem 1.35rem; }
.calc-hero { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.calc-stat { padding: .8rem .95rem; border-radius: 18px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.06); }
.calc-stat span { display: block; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.calc-stat b { display: block; margin-top: .2rem; font-size: 1.65rem; font-weight: 200; letter-spacing: -.02em; color: var(--fg); font-variant-numeric: tabular-nums; }
.calc-stat b.hot { color: var(--a); }
.calc-stat b.bad { color: var(--bad); }
.calc-stat em { display: block; margin-top: .1rem; font-style: normal; font-size: .76rem; color: var(--muted); font-family: var(--mono); }

.bar-meter { display: grid; gap: .38rem; }
.bar-meter-head { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }
.bar-meter-head b { color: var(--fg); font-family: var(--mono); font-weight: 400; }
.bar-trk { position: relative; height: 10px; border-radius: 999px; background: rgba(255,255,255,.09); overflow: hidden; }
.bar-trk i { display: block; height: 100%; border-radius: 999px; background: var(--a); transition: width .2s, background-color .2s; }
.bar-trk.bad i { background: var(--bad); }
.bar-trk.warn i { background: var(--amber); }

.mass-stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; background: rgba(255,255,255,.06); }
.mass-stack i { display: block; height: 100%; transition: width .2s; }
.mass-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .76rem; color: var(--muted); }
.mass-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.mass-legend span i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* Engineering content pages used by the secondary tabs */
.tab-page { padding-bottom: 5rem; }
.tab-hero { padding: clamp(3rem, 9vh, 6rem) 0 2.5rem; max-width: 54rem; }
.tab-hero h1 { font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 200; letter-spacing: -.05em; margin: .8rem 0 .75rem; }
.page-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 760px) { .page-grid { grid-template-columns: 1fr; } }
.page-card { padding: 1.25rem 1.35rem; border-radius: 24px; background: rgba(30,27,25,.62); box-shadow: 0 0 0 1px var(--glass-edge); }
.page-card-wide { margin-top: 1rem; }
.page-card h2 { margin: .25rem 0 .45rem; font-size: 1.18rem; font-weight: 400; color: var(--fg); }
.page-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.flowline { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: .75rem; margin: 1.25rem 0; }
@media (max-width: 760px) { .flowline { grid-template-columns: 1fr; } .flowline i { transform: rotate(90deg); justify-self: center; } }
.flowline div { display: grid; gap: .25rem; padding: .8rem .9rem; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.06); }
.flowline b { font-size: .86rem; color: var(--fg); font-weight: 400; }
.flowline span { font: .72rem var(--mono); color: var(--muted); }
.flowline i { color: var(--a); font-style: normal; font-size: 1.2rem; }

/* ---- simulation tab ---- */
.sim-block { margin-top: 2.6rem; }
.sim-head { max-width: 46rem; margin-bottom: 1rem; }
.sim-head h2 { margin: .3rem 0 .5rem; font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 300; letter-spacing: -.02em; }
.sim-head p { margin: 0; color: var(--muted); line-height: 1.6; }
.sim-lab { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 860px) { .sim-lab { grid-template-columns: 1fr; } }
.sim-lab .card { padding: .9rem 1rem; margin: 0; }
.sim-lab .controls { grid-template-columns: 1fr; }
.lab-cv { display: block; width: 100%; height: 260px; }
.sim-lab .angkey { margin: .5rem 0 0; }
.flowline .hotnode { background: linear-gradient(135deg, rgba(255,106,34,.14), rgba(30,27,25,.72)); border-color: rgba(255,106,34,.35); }
.evidence { display: grid; gap: 1rem; }
.photo-frame.wide img { aspect-ratio: 1920 / 540; }
.photo-frame.wide .photo-cap { flex-wrap: wrap; }
.code-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 860px) { .code-grid { grid-template-columns: 1fr; } }
.codeblock { margin: 0; padding: 1rem 1.2rem; border-radius: 22px; background: rgba(30,27,25,.62); box-shadow: 0 0 0 1px var(--glass-edge); overflow-x: auto; font: .8rem/1.65 var(--mono); color: var(--fg); }
.codeblock code { background: none; padding: 0; }
.stat-col { display: grid; gap: .7rem; }
.controls label.inline { display: flex; align-items: center; gap: .6rem; }

/* physics view */
.phys-lab { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.phys-lab .stage { height: clamp(380px, 56vh, 560px); min-height: 0; margin: 0; }
.massbox { padding: .9rem 1rem; border-radius: 22px; background: rgba(30,27,25,.62); box-shadow: 0 0 0 1px var(--glass-edge); display: grid; gap: .7rem; }
.mass-head { display: flex; align-items: baseline; gap: .6rem; }
.mass-head b { font-size: 1.7rem; font-weight: 200; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mass-head span { color: var(--muted); font-size: .8rem; }
.mass-stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; background: rgba(255,255,255,.06); }
.mass-stack i { display: block; height: 100%; transition: opacity .2s; }
.mass-rows { display: grid; gap: .1rem; }
.mass-row { display: grid; grid-template-columns: 12px 1fr auto auto; gap: .55rem; align-items: center; padding: .28rem .35rem; border-radius: 10px; font-size: .82rem; cursor: default; transition: background .15s; }
.mass-row:hover, .mass-row.hot { background: rgba(255,255,255,.06); }
.mass-row i { width: 10px; height: 10px; border-radius: 3px; }
.mass-row span { color: var(--fg); }
.mass-row em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .78rem; }
.mass-row b { font-weight: 400; font-variant-numeric: tabular-nums; min-width: 3.4em; text-align: right; }
.mass-row .tag { font-size: .62rem; letter-spacing: .05em; text-transform: uppercase; padding: .05rem .4rem; border-radius: 999px; background: rgba(255,210,63,.18); color: #ffd23f; box-shadow: 0 0 0 1px rgba(255,210,63,.4); margin-left: .4rem; }
.sim-part { margin-top: 3.2rem; scroll-margin-top: 90px; }
.part-head { max-width: 46rem; margin-bottom: 1.2rem; }
.part-head p { color: var(--muted); line-height: 1.6; margin: .3rem 0 0; }
.sim-part .sim-block:first-of-type { margin-top: 1.6rem; }
header.tab-head { padding-bottom: 0; }

/* simulation clips */
.clip-set { margin-top: 1.6rem; }
.clip-set > h3 { margin: 0 0 .15rem; font-size: 1.05rem; font-weight: 400; color: var(--fg); }
.clip-set > p { margin: 0 0 .8rem; color: var(--muted); font-size: .9rem; line-height: 1.55; max-width: 46rem; }
.clip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.clip-grid.one { grid-template-columns: minmax(0, 1fr); max-width: 52rem; }
@media (max-width: 780px) { .clip-grid { grid-template-columns: 1fr; } }
.clip-grid .photo-frame img { aspect-ratio: 16 / 9; background: #141210; }
.photo-tag.dim { background: rgba(16,14,13,.75); }
.clip-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .6rem; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.clip-meta b { color: var(--fg); font-weight: 400; }

/* Section 6: Results by scenario */
.results-wrap { overflow-x: auto; margin-top: 1rem; border-radius: 22px; background: rgba(30,27,25,.62); box-shadow: 0 0 0 1px var(--glass-edge); }
.results-tbl { min-width: 46rem; }
.results-tbl th, .results-tbl td { padding: .65rem .9rem; text-align: left; border-bottom: 1px solid rgba(255,255,255,.06); }
.results-tbl thead th { font-size: .72rem; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.results-tbl tbody th { font-weight: 400; color: var(--fg); }
.results-tbl tbody td { color: var(--muted); font-variant-numeric: tabular-nums; }
.results-tbl tbody tr:last-child > * { border-bottom: 0; }
.results-tbl td.tbd { color: rgba(255,255,255,.28); }
.tbd-tag { padding: .12rem .55rem; border-radius: 999px; font-size: .68rem; letter-spacing: .05em; text-transform: uppercase; background: rgba(255,106,34,.22); box-shadow: 0 0 0 1px rgba(255,106,34,.45); color: #ffd4bd; }
.results-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin-top: 1rem; }
@media (max-width: 700px) { .results-notes { grid-template-columns: 1fr; } }
.results-notes div { display: grid; gap: .2rem; padding: .8rem .95rem; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.06); }
.results-notes b { color: var(--a); font-size: .82rem; font-weight: 400; }
.results-notes span { color: var(--muted); font-size: .76rem; line-height: 1.4; }

/* Gait page */
.g-stage { height: clamp(340px, 52vh, 520px); margin: 1rem 0 .3rem; }
.gstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; margin: 1rem 0; }
.gstats .calc-stat b { font-size: 1.4rem; }
.gstats .calc-stat em { font-size: .72rem; line-height: 1.35; }
.results-tbl .rng { color: rgba(255,255,255,.4); font-size: .85em; }
.results-tbl td.bad { color: var(--bad); }

/* ---- play page ---- */
.hero-cta { margin: 1.3rem 0 0; }
.play-btn { display: inline-flex; align-items: center; gap: .55rem; padding: .62rem 1.5rem; border-radius: 999px; background: var(--a); color: #fff; text-decoration: none; font-size: 1rem; box-shadow: 0 10px 30px rgba(255,106,34,.4); }
.play-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(255,106,34,.5); }
.play .stage { height: clamp(460px, 68vh, 780px); margin-top: 1.4rem; outline: none; }
.play-hud { position: absolute; z-index: 2; top: 14px; left: 14px; display: flex; flex-wrap: wrap; gap: .45rem; max-width: calc(100% - 28px); pointer-events: none; }
.play-hud > div { display: flex; align-items: baseline; gap: .35rem; padding: .3rem .75rem; border-radius: 14px; background: rgba(14,12,11,.55); box-shadow: 0 0 0 1px rgba(255,255,255,.1); font-size: .75rem; color: var(--muted); }
.play-hud b { font-family: var(--mono); font-weight: 400; font-size: .95rem; color: var(--fg); font-variant-numeric: tabular-nums; min-width: 2ch; }
.play-hud em { font-style: normal; font-size: .68rem; opacity: .7; }
.play-diag { position: absolute; z-index: 2; left: 14px; bottom: 14px; width: 190px; height: 74px; padding: 4px; border-radius: 14px; background: rgba(14,12,11,.55); box-shadow: 0 0 0 1px rgba(255,255,255,.1); pointer-events: none; }
.play-hint { position: absolute; z-index: 2; left: 50%; bottom: 16px; transform: translateX(-50%); padding: .45rem 1rem; border-radius: 999px; background: rgba(14,12,11,.65); box-shadow: 0 0 0 1px rgba(255,106,34,.5); font-size: .85rem; pointer-events: none; transition: opacity .5s; }
.play-hint.gone { opacity: 0; }
.play-warn { position: absolute; z-index: 2; right: 14px; top: 14px; padding: .3rem .8rem; border-radius: 999px; background: rgba(255,59,59,.2); box-shadow: 0 0 0 1px rgba(255,59,59,.6); color: #ffb4b4; font-size: .78rem; pointer-events: none; }
kbd { font-family: var(--mono); font-size: .8em; padding: .05rem .4rem; border-radius: 6px; background: rgba(255,255,255,.08); box-shadow: 0 0 0 1px rgba(255,255,255,.18); }
.play-ctl { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: stretch; margin: 1rem 0; }
.play-ctl .controls { margin: 0; }
.drive { display: grid; grid-template-columns: repeat(3, 62px); grid-auto-rows: 62px; gap: .45rem; padding: 1rem; border-radius: 26px; background: rgba(30,27,25,.62); box-shadow: 0 0 0 1px var(--border); align-content: center; }
.drive button { position: relative; padding: 0; font-size: 1.25rem; border-radius: 18px; touch-action: none; user-select: none; -webkit-user-select: none; display: grid; place-items: center; }
.drive button small { position: absolute; right: 7px; bottom: 4px; font-size: .55rem; font-family: var(--mono); opacity: .5; }
.drive button.on { background: var(--a); color: #fff; box-shadow: 0 6px 20px rgba(255,106,34,.45); transform: scale(.96); }
.drive [data-key=s] { grid-column: 2; }
.controls fieldset.tog { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.controls fieldset.tog label { margin-right: 0; }
@media (max-width: 760px) { .play-ctl { grid-template-columns: 1fr; } .drive { justify-self: center; } .play-diag { display: none; } }
.stage canvas.play-diag { position: absolute; width: 190px; height: 74px; left: 14px; bottom: 14px; top: auto; }
.gpair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; align-items: start; }
.gpair canvas.plane, .gpair .g-stage { height: clamp(260px, 40vh, 420px) !important; margin: 0; }
@media (max-width: 860px) { .gpair { grid-template-columns: 1fr; } .gpair canvas.plane, .gpair .g-stage { height: 340px !important; } }
.controls.gctl { padding: .7rem 1.1rem; margin: .8rem 0; gap: .4rem 1.2rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.gplots { display: grid; gap: .8rem 1.2rem; padding: .8rem 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: .8rem; }
.gplots canvas.plot { height: 150px; }
header.top .links a.play-link { background: var(--a); color: #fff; box-shadow: 0 10px 30px rgba(255,106,34,.4); }
.play-note { margin: .8rem 0 0; max-width: 52ch; font-size: .82rem; color: var(--muted); }
.play-note a { color: var(--a); }
.play-warning { margin: 1.2rem 0 0; padding: .8rem 1.1rem; border-radius: 18px; background: rgba(245,182,66,.1); box-shadow: 0 0 0 1px rgba(245,182,66,.45); font-size: .9rem; color: color-mix(in srgb, var(--fg) 85%, transparent); }
.play-warning b { color: #f5b642; font-weight: 400; }
.play-warning a { color: var(--a); }
.play .stage { margin-top: .8rem; }
h2 .hl { color: var(--a); font-weight: 400; }
.proto-brief { margin: 1rem 0 1.2rem; }
.proto-brief span { font-size: .85rem; line-height: 1.5; }

/* ---- terrain page ---- */
.terr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; margin: 1rem 0 1.4rem; }
.terr { display: grid; gap: .35rem; padding: 1rem 1.15rem; border-radius: 22px; background: rgba(30,27,25,.62); box-shadow: 0 0 0 1px var(--border); }
.terr b { font-weight: 400; font-size: 1.05rem; }
.terr span { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.terr code { font-size: .74rem; color: var(--a); }
.results-wrap.narrow { max-width: 40rem; }
.results-tbl .bar { display: block; position: relative; height: 1.5rem; min-width: 9rem; border-radius: 8px; background: rgba(255,255,255,.05); overflow: hidden; }
.results-tbl .bar i { position: absolute; inset: 0 auto 0 0; width: var(--w); background: rgba(255,106,34,.75); border-radius: 8px; }
.results-tbl .bar.lv i { background: rgba(255,255,255,.7); }
.results-tbl .bar b { position: absolute; left: .55rem; top: 0; line-height: 1.5rem; font-weight: 400; font-size: .8rem; color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.9), 0 0 6px rgba(0,0,0,.6); }
.results-tbl .bar.lv b { color: #111; text-shadow: none; }
.sim-head h2 { max-width: none; }
.results-tbl td.ok { color: #7fd8a0; } .results-tbl td.no { color: #ff8a8a; }
.dots { display: inline-flex; gap: .25rem; margin-right: .4rem; vertical-align: middle; }
.dots i { width: .6rem; height: .6rem; border-radius: 50%; background: #7fd8a0; } .dots i.no { background: #ff6b6b; }
.limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; margin-top: 1rem; }
.lim { display: grid; gap: .3rem; padding: 1rem 1.15rem; border-radius: 22px; background: rgba(30,27,25,.62); box-shadow: 0 0 0 1px var(--border); }
.lim b { font-weight: 400; color: var(--a); font-size: .95rem; } .lim span { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.sim-head p code, .results-notes code { font-size: .85em; }
.results-wrap.narrow .results-tbl { min-width: 0; }
.clip-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .clip-grid.three { grid-template-columns: 1fr; } }
.warn-strip { margin: .4rem 0 .8rem; padding: .6rem 1rem; border-radius: 16px; background: rgba(245,182,66,.1); box-shadow: 0 0 0 1px rgba(245,182,66,.4); font-size: .85rem; color: color-mix(in srgb, var(--fg) 85%, transparent); }
.warn-strip b { color: #f5b642; font-weight: 400; }
#watch .stage { height: clamp(360px, 52vh, 560px); margin-bottom: 1rem; }
#watch .grid2 { margin-bottom: 0; }
.clip-grid .photo-frame img.pair { aspect-ratio: auto; height: auto; object-fit: contain; }

/* terrain page: stage and controls side by side, sized to the screen */
#watch .watch-grid { display: grid; gap: 1rem; }
#watch .watch-side { display: grid; gap: .7rem; align-content: start; min-width: 0; }
#watch .watch-side .controls { margin: 0; padding: .7rem 1rem; gap: .35rem .9rem; border-radius: 22px; }
#watch .watch-side .controls fieldset { padding: .3rem .5rem .45rem; margin: 0; }
#watch .watch-side .controls fieldset label { padding: .2rem .7rem; font-size: .8rem; }
#watch .watch-side .controls input[type=range] { min-height: 20px; }
#watch .watch-side .gstats { margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
#watch .watch-side .calc-stat { padding: .55rem .7rem; min-width: 0; }
#watch .watch-side .calc-stat b { font-size: 1.05rem; }
#watch .watch-side .calc-stat em { font-size: .66rem; }
#watch .tw-plots { display: grid; gap: .5rem; }
#watch .tw-plots .card { padding: .5rem .7rem; }
#watch .status { margin: 0; padding: .6rem .9rem; font-size: .82rem; }
@media (min-width: 1000px) {
  #watch .watch-grid { grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); align-items: start; }
  #watch .watch-grid .stage { height: calc(100vh - 150px); min-height: 460px; max-height: 760px; margin: 0; position: sticky; top: 84px; }
}
@media (min-width: 1000px) { #watch .tw-plots { grid-template-columns: 1fr 1fr; } }
#watch .watch-side .controls { grid-template-columns: 1fr 1fr; }
#watch .watch-side .controls fieldset { grid-column: auto; }
#watch .watch-side .controls fieldset:first-child { grid-column: 1 / -1; }
#watch .watch-side .controls fieldset.tog { grid-column: 1 / -1; }
#watch .watch-side .controls button { padding: .25rem .8rem; font-size: .8rem; }
#watch .controls label output { white-space: nowrap; }
.photo-frame video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #141210; filter: contrast(1.04) brightness(1.22) saturate(1.06); }
.photo-frame video.pair { aspect-ratio: 1280 / 360; object-fit: contain; }
.sim-block .clip-grid.one { max-width: none; }
.clip-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.clip-grid.three .photo-frame:last-child { grid-column: 1 / -1; }
@media (max-width: 900px) { .clip-grid.three { grid-template-columns: 1fr; } }

/* Hint pointing at the Play button in the top-right of the nav */
.go-play { display: inline-flex; align-items: center; gap: .45rem; color: var(--a); text-decoration: none; font-size: 1rem; }
.go-play svg { width: 1.25em; height: 1.25em; flex-shrink: 0; animation: hint-nudge 1.6s ease-in-out infinite; }
.go-play:hover { text-decoration: underline; text-underline-offset: 4px; }
@keyframes hint-nudge { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(4px, -4px); } }
@media (prefers-reduced-motion: reduce) { .go-play svg { animation: none; } }

.site-nav .nav-play.on { box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 8px 24px rgba(255,106,34,.5); }

/* Journey page: vertical timeline */
.tl { position: relative; display: grid; gap: 3.2rem; padding-left: 1.4rem; }
.tl::before { content: ""; position: absolute; left: 0; top: .6rem; bottom: 0; width: 2px; background: linear-gradient(var(--a), rgba(255,106,34,.08)); }
.tl-item { position: relative; display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1.6rem; }
.tl-item::before { content: ""; position: absolute; left: calc(-1.4rem - 4px); top: .55rem; width: 10px; height: 10px; border-radius: 50%; background: var(--a); box-shadow: 0 0 12px rgba(255,106,34,.8); }
.tl-date { display: grid; align-content: start; gap: .2rem; padding-top: .1rem; }
.tl-date span { color: var(--a); font-size: .9rem; letter-spacing: .02em; }
.tl-date b { color: var(--muted); font-weight: 400; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; }
.tl-body h2 { margin: 0 0 .5rem; font-size: 1.5rem; font-weight: 300; letter-spacing: -.02em; }
.tl-body > p { max-width: 44rem; margin: 0 0 1.1rem; color: var(--muted); }
.tl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .7rem; margin-bottom: .7rem; }
.tl-grid .photo-frame img, .tl-grid .photo-frame video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.tl-vids { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tl-vids .photo-frame video { aspect-ratio: 16 / 9; }
.tl-links { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: .6rem; }
.tl-links a { color: var(--a); text-decoration: none; }
@media (max-width: 700px) { .tl-item { grid-template-columns: 1fr; gap: .5rem; } .tl-date { display: flex; gap: .7rem; align-items: baseline; } }

/* ---- Journey: cinematic scroll hero, film strip, before/after ---- */
.jy-title { text-align: center; padding: 2.2rem 1rem 1.6rem; }
.jy-title .eyebrow { justify-content: center; } .jy-title .lede { margin-inline: auto; }
.jy-h { text-align: center; margin: 4.5rem auto .5rem; max-width: none; }
.jy-sub { text-align: center; opacity: .7; margin: 0 auto 2rem; }
.film { display: grid; gap: 1.2rem; }
.film-frame { margin: 0; border-radius: 22px; overflow: hidden; background: #141210; box-shadow: 0 30px 80px -30px rgba(0,0,0,.7); position: relative; }
.film-frame video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; filter: contrast(1.04) brightness(1.15); }
.film-frame:first-child { grid-column: 1 / -1; }
.film-frame figcaption { position: absolute; z-index: 2; left: 16px; bottom: 13px; padding: .18rem .65rem; border-radius: 999px; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; background: rgba(16,14,13,.75); box-shadow: 0 0 0 1px rgba(255,255,255,.14); color: var(--fg); pointer-events: none; }
@media (min-width: 800px) { .film { grid-template-columns: repeat(3, 1fr); } .film-frame:first-child { grid-column: 1 / -1; } }
.ba-grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.ba { --x: 50%; position: relative; margin: 0; border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 3; background: #141210; box-shadow: 0 30px 80px -30px rgba(0,0,0,.7); }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba .ba-top { clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.ba::before { content: ""; position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: #fff; z-index: 2; pointer-events: none; }
.ba::after { content: "↔"; position: absolute; top: 50%; left: var(--x); transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: #ff7a2e; color: #fff; display: grid; place-items: center; font-size: 1.2rem; z-index: 2; pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.ba input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; z-index: 3; margin: 0; }
.ba input:focus-visible { opacity: .01; outline: 2px solid #ff7a2e; }
.ba figcaption { position: absolute; left: 1rem; bottom: .8rem; z-index: 2; font-size: .8rem; color: #fff; background: rgba(0,0,0,.45); padding: .2rem .6rem; border-radius: 99px; pointer-events: none; }

/* pet: a tiny Venom that follows the pointer (home page) */
canvas.pet { position: fixed; left: 0; top: 0; width: 210px; height: 210px; z-index: 40; pointer-events: none; opacity: 0; transition: opacity .3s ease; will-change: transform; }
.pet-toggle { position: fixed; left: 16px; bottom: 16px; z-index: 41; padding: .3rem .8rem; border: 0; border-radius: 999px; font: 400 .75rem/1.4 var(--sans); color: var(--muted); background: color-mix(in srgb, var(--card) 80%, transparent); backdrop-filter: blur(8px); box-shadow: 0 0 0 1px var(--border); cursor: pointer; transition: color .2s, box-shadow .2s; }
.pet-toggle:hover, .pet-toggle:focus-visible { color: var(--fg); box-shadow: 0 0 0 1px rgba(255,106,34,.6); }
@media print { canvas.pet, .pet-toggle { display: none; } }

/* ---- Reality check: real footage vs the simulation ---- */
.rc-bar { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; justify-content: space-between; align-items: center; margin: 1.2rem 0 1rem; }
.rc-tabs, .rc-modes { display: inline-flex; gap: .2rem; padding: .25rem; border-radius: 999px; background: rgba(255,255,255,.05); box-shadow: 0 0 0 1px var(--border); }
.rc-tabs button, .rc-modes button { font: inherit; font-size: .85rem; color: var(--muted); background: none; border: 0; padding: .4rem 1rem; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.rc-tabs button:hover, .rc-modes button:hover { color: var(--fg); }
.rc-tabs button[aria-selected="true"], .rc-modes button[aria-pressed="true"] { background: var(--a); color: #fff; }
.rc-meta { color: var(--muted); font-size: .85rem; margin: 0 0 .8rem; } .rc-meta b { color: var(--fg); font-weight: 600; }
.rc-stage { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.rc-fig { margin: 0; } .rc-fig video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #141210; filter: contrast(1.04) brightness(1.12); }
.rc-fig.real { box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 24px 60px -30px rgba(0,0,0,.8); }
.rc-fig.sim { box-shadow: 0 0 0 1px rgba(255,106,34,.35), 0 24px 60px -30px rgba(255,106,34,.25); }
.rc-wipe, .rc-wipe-in { display: none; }
.rc-stage[data-mode="wipe"] { display: block; max-width: 52rem; margin-inline: auto; border-radius: 22px; overflow: hidden; --x: 50%; }
.rc-stage[data-mode="wipe"] .rc-fig { border-radius: 0; box-shadow: none; }
.rc-stage[data-mode="wipe"] .rc-fig.sim { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--x)); }
.rc-stage[data-mode="wipe"] .rc-wipe { display: block; position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: #fff; z-index: 3; pointer-events: none; }
.rc-stage[data-mode="wipe"] .rc-wipe::after { content: "↔"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: var(--a); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.rc-stage[data-mode="wipe"] .rc-wipe-in { display: block; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; z-index: 4; margin: 0; }
.rc-stage[data-mode="wipe"] .photo-cap { z-index: 2; }
.rc-stage[data-mode="wipe"] .rc-fig.sim .photo-cap { left: auto; right: 0; flex-direction: row-reverse; }
.rc-takerow { display: flex; flex-wrap: wrap; gap: .6rem 2rem; margin-top: .8rem; }
.rc-takes { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; } .rc-takes em { font-style: normal; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rc-take { width: 4.6rem; aspect-ratio: 16 / 9; border-radius: 10px; border: 0; padding: 0; cursor: pointer; background-size: cover; background-position: center; position: relative; opacity: .55; transition: opacity .2s, transform .2s; box-shadow: 0 0 0 1px var(--border); }
.rc-take span { position: absolute; right: 5px; bottom: 3px; font-size: .7rem; color: #fff; text-shadow: 0 0 4px #000; }
.rc-take:hover { opacity: .9; transform: translateY(-2px); } .rc-take[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--a); }
.wall { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); margin-top: 1rem; }
.wall-item { margin: 0; } .wall-item[hidden] { display: none; }
.wall-item video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #141210; filter: contrast(1.04) brightness(1.12); transition: transform .5s; }
.wall-item:hover video { transform: scale(1.04); }
.hw-tbl td.chip-q { color: #ffd4bd; } .hw-tbl td.chip-n { color: rgba(255,255,255,.4); }
@media (max-width: 560px) { .rc-stage[data-mode="side"] { grid-template-columns: minmax(0, 1fr); } }
.film.duo { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 1.2rem; } .film.duo .film-frame:first-child { grid-column: auto; }
@media (max-width: 700px) { .film.duo { grid-template-columns: minmax(0, 1fr); } }
.so-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.so-card { margin: 0; border-radius: 20px; overflow: hidden; background: var(--card); box-shadow: 0 0 0 1px var(--border); display: flex; flex-direction: column; }
.so-card video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #141210; }
.so-card figcaption { padding: .8rem 1rem 1rem; display: grid; gap: .35rem; }
.so-card figcaption b { font-weight: 600; font-size: 1rem; color: var(--fg); }
.so-card figcaption span { font-size: .8rem; color: var(--muted); display: flex; gap: .5rem; align-items: baseline; font-variant-numeric: tabular-nums; }
.so-card figcaption i { font-style: normal; font-size: .68rem; letter-spacing: .05em; text-transform: uppercase; color: var(--a); min-width: 6.4rem; }

/* mascot: the big Venom behind every page header, doing what the page is about */
.mascot-band { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: min(54vh, 500px); }
.mascot-band > header { width: 100%; position: relative; z-index: 1; }
.mascot-band::before { content: ""; position: absolute; z-index: -1; right: 6%; top: 10%; width: min(42vw, 520px); aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255,106,34,.4), transparent 62%), radial-gradient(circle, rgba(255,255,255,.4) 1.4px, transparent 1.8px) 0 0 / 16px 16px;
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 68%); mask: radial-gradient(circle, #000 0%, transparent 68%); opacity: .7; pointer-events: none; }
.mascot-chip { display: none !important; position: absolute; z-index: 2; right: max(1.2rem, 5vw); bottom: 1.1rem; display: flex; align-items: center; gap: .65rem; padding: .4rem .95rem; border-radius: 999px;
  background: rgba(14,12,11,.62); backdrop-filter: blur(8px); box-shadow: 0 0 0 1px rgba(255,255,255,.1); color: #f1efea; font-size: .78rem; pointer-events: none; white-space: nowrap; max-width: calc(100vw - 2.4rem); }
.mascot-chip b { font-weight: 500; color: #ff8a4a; }
.mascot-chip span { color: #cfcac2; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.mascot-chip .feet { display: inline-flex; gap: .25rem; }
.mascot-chip .feet i { width: 1.15rem; height: 1.15rem; display: grid; place-items: center; border-radius: 50%; font-style: normal; font-size: .62rem; background: rgba(255,255,255,.1); color: #9a9892; transition: background .15s, color .15s; }
.mascot-chip .feet i.on { background: #ff6a22; color: #fff; }
@media (max-width: 999px) { .mascot-band { min-height: 0; } .mascot-chip { display: none; } }
.hero-stage.mascot { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28%, #000 88%, transparent 100%), linear-gradient(180deg, transparent 0, #000 26%, #000 74%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 28%, #000 88%, transparent 100%), linear-gradient(180deg, transparent 0, #000 26%, #000 74%, transparent 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
/* nav: tabs shrink fluidly so the whole bar fits at any desktop width */
.site-nav .wrap { padding-left: clamp(10px, 2vw, 72px); padding-right: clamp(10px, 2vw, 72px); }
.site-nav .tabs a { padding: .34rem clamp(.4rem, .85vw, .85rem); font-size: clamp(.72rem, .95vw, .84rem); }
.site-nav .nav-pill { padding-left: clamp(.6rem, 1vw, 1rem); gap: clamp(.3rem, .6vw, .6rem); }
.site-nav .nav-play { padding: .5rem clamp(.7rem, 1vw, 1.05rem); font-size: clamp(.74rem, .95vw, .84rem); }
@media (max-width: 1180px) { .site-nav .nav-play .pl-long { display: none; } }
/* the pill's glow spills outside the eyebrow box; give the box room so the compositing layer never crops it */
.eyebrow { padding: 44px 20px; margin: -44px -20px; pointer-events: none; }
.eyebrow > * { pointer-events: auto; }

/* speech bubble over the mascot */
.mascot-bubble { position: absolute; z-index: 3; transform: translate(-50%, -100%); margin-top: -14px; padding: .4rem .9rem; border-radius: 16px; background: #fff; color: #17120e; font: 600 .82rem/1.2 var(--sans); white-space: nowrap; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); transform-origin: 50% 100%; animation: bubble-pop .32s cubic-bezier(.3,1.6,.5,1) both; }
.mascot-bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 0 0 4px 0; }
.mascot-bubble.ok { background: #ff6a22; color: #fff; }
.mascot-bubble.bad { background: #ff3b3b; color: #fff; }
.mascot-bubble.big { font-size: 1.5rem; padding: .25rem .85rem; }
@keyframes bubble-pop { from { opacity: 0; transform: translate(-50%, -100%) scale(.4); } to { opacity: 1; transform: translate(-50%, -100%) scale(1); } }
@media (prefers-reduced-motion: reduce) { .mascot-bubble { animation: none; } }
/* nav: short labels, never scrolls; wraps onto a second row on narrow screens */
.site-nav .tabs { overflow: visible; flex-wrap: wrap; }
.site-nav .nav-pill { flex-wrap: wrap; border-radius: 26px; }
@media (min-width: 761px) { .site-nav .tabs { flex-wrap: nowrap; } .site-nav .nav-pill { flex-wrap: nowrap; border-radius: 999px; } }

.joint-cv { height: 150px; margin-bottom: .4rem; }

/* ---- overview: at-a-glance stats and "where to go next" tiles ---- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin: .4rem 0 1.2rem; }
.stats > div { padding: 1rem 1.1rem; border-radius: 20px; background: rgba(30,27,25,.62); box-shadow: 0 0 0 1px var(--border); }
.stats b { display: block; font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 200; line-height: 1; color: #ff8a4a; letter-spacing: -.02em; }
.stats span { display: block; margin-top: .45rem; font-size: .85rem; font-weight: 300; color: var(--muted); }
.what-text { max-width: 46rem; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin-top: 1rem; }
.tile { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 22px; background: #14110f; box-shadow: 0 0 0 1px var(--border); text-decoration: none; color: inherit; transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(255,106,34,.6), 0 16px 40px rgba(0,0,0,.4); }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .3s, transform .6s; }
.tile:hover video { opacity: 1; transform: scale(1.04); }
.tile-t { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.4rem 1.1rem 1rem; background: linear-gradient(transparent, rgba(8,7,6,.88)); }
.tile-t b { display: block; font-size: 1.15rem; font-weight: 400; }
.tile-t small { display: block; margin-top: .15rem; font-size: .82rem; font-weight: 300; color: #cfcac2; }
.tile-play { display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, rgba(255,106,34,.5), rgba(255,106,34,.12) 70%); }
.tile-play .tile-t { position: static; padding: 0; background: none; text-align: center; }
.tile-play .tile-t b { font-size: 1.6rem; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr; } }

/* ---- gait page: a leaner layout. Controls and charts that only confuse are hidden; the page scripts still run against them ---- */
.philosophy-strip.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .philosophy-strip.two { grid-template-columns: 1fr; } }
.tab-page label:has(> #g1-t), .tab-page label:has(> #g1-speed), .tab-page label:has(> #g2-speed), .tab-page label:has(> #g3-speed), .tab-page label:has(> #g3-t),
.tab-page label:has(> #g5-speed), .tab-page label:has(> #g6-speed), .tab-page label:has(> #g4-t), .tab-page label:has(> #g4-n), .tab-page label:has(> #g4-dc),
.tab-page label:has(> #g4-stroke), .tab-page label:has(> #g4-ht), .tab-page label:has(> #g4-T),
.tab-page .calc-stat:has(#g1-s-adv), .tab-page .calc-stat:has(#g1-s-min), .tab-page .calc-stat:has(#g1-s-margin) { display: none !important; }
#g1-margin, #g5-margin, #g2-bars, #g6-pitch, #g4-y, #g4-z { display: none !important; }
.tab-page .calc-stat:has(#g5-s-margin), .tab-page .calc-stat:has(#g5-s-feet), .tab-page .calc-stat:has(#g4-s-err), .tab-page .calc-stat:has(#g4-s-spd), .tab-page .calc-stat:has(#g4-s-lag),
.tab-page .calc-stat:has(#g6-s-pitch-dyn), .tab-page .calc-stat:has(#g6-s-h) { display: none !important; }
/* ---- terrain page: lean controls ---- */
.tab-page label:has(> #tw-rate), #tw-tilt, .tab-page .calc-stat:has(#tw-s-hits), .tab-page .calc-stat:has(#tw-s-down) { display: none !important; }
#tw-tilt { display: none !important; }
/* ---- simulation page: lean controls ---- */
.tab-page label:has(> #fr-mu), .tab-page label:has(> #imu-l), .tab-page label:has(> #imu-b),
.tab-page .calc-hero:has(.calc-stat > b:not([id])) { display: none !important; }

/* ---- simulation page: purpose tiles, trust numbers, measured-vs-estimated ---- */
.sim-intro { margin-top: 1.6rem; }
.uses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin: .9rem 0 1.6rem; }
.use { display: grid; align-content: start; gap: .35rem; padding: 1.1rem 1.15rem; border-radius: 20px; background: rgba(30,27,25,.62); box-shadow: 0 0 0 1px var(--border); text-decoration: none; color: inherit; transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s; }
.use:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(255,106,34,.6), 0 14px 34px rgba(0,0,0,.35); }
.use b { font-size: 1.15rem; font-weight: 400; color: #ff8a4a; }
.use span { font-size: .9rem; font-weight: 300; color: #d8d3cb; line-height: 1.4; }
.use em { margin-top: .4rem; font-style: normal; font-size: .8rem; color: var(--muted); }
.proof-head { margin-top: 1.4rem; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: .9rem; }
.known { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: .9rem; }
.known-card { padding: 1.1rem 1.2rem; border-radius: 20px; background: rgba(30,27,25,.62); box-shadow: 0 0 0 1px var(--border); }
.known-card.est { box-shadow: 0 0 0 1px rgba(245,182,66,.35); }
.known-card b { display: block; margin-bottom: .5rem; font-weight: 400; }
.known-card.ok b { color: #7fd99a; } .known-card.est b { color: #f5b642; }
.known-card ul { margin: 0; padding-left: 1.1rem; font-size: .92rem; font-weight: 300; color: #d8d3cb; line-height: 1.7; }
@media (max-width: 860px) { .uses { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats.three { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .uses, .known { grid-template-columns: 1fr; } }

/* ---- overview tiles: drawn line animations instead of video ---- */
.tile { background: radial-gradient(circle at 78% 18%, rgba(255,106,34,.16), transparent 55%), radial-gradient(circle, rgba(255,255,255,.07) 1px, transparent 1.4px) 0 0 / 18px 18px, #12100e; }
.tile-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: .95; }
.tile-play { background: radial-gradient(circle at 50% 38%, rgba(255,106,34,.34), transparent 62%), radial-gradient(circle, rgba(255,255,255,.07) 1px, transparent 1.4px) 0 0 / 18px 18px, #12100e; }
.tile-play .tile-t { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.4rem 1.1rem 1rem; background: linear-gradient(transparent, rgba(8,7,6,.88)); text-align: left; }
.tile-play .tile-t b { font-size: 1.15rem; }

/* ---- sim 2 real: verdict scorecard, calibration bars, robustness grid ---- */
.score { display: grid; gap: .5rem; margin-top: .9rem; }
.sc-row { display: grid; grid-template-columns: 1.1rem minmax(0, 1.2fr) minmax(0, 2.2fr) auto; align-items: center; gap: .8rem; padding: .7rem 1rem; border-radius: 16px; background: rgba(30,27,25,.62); box-shadow: 0 0 0 1px var(--border); }
.sc-row i { width: .8rem; height: .8rem; border-radius: 50%; background: #7fd8a0; box-shadow: 0 0 0 4px rgba(127,216,160,.15); }
.sc-row i.a { background: #f5b642; box-shadow: 0 0 0 4px rgba(245,182,66,.15); } .sc-row i.r { background: #ff6b6b; box-shadow: 0 0 0 4px rgba(255,107,107,.15); }
.sc-row b { font-weight: 400; } .sc-row span { font-size: .88rem; font-weight: 300; color: #cfcac2; } .sc-row em { font-style: normal; font-variant-numeric: tabular-nums; color: #ff8a4a; white-space: nowrap; }
.sc-row small { color: var(--muted); }
@media (max-width: 700px) { .sc-row { grid-template-columns: 1rem 1fr auto; } .sc-row span { grid-column: 2 / 4; } }
.verdict { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-top: 1rem; }
.verdict > div { padding: 1rem 1.15rem; border-radius: 20px; background: rgba(30,27,25,.62); box-shadow: 0 0 0 1px var(--border); }
.verdict b { display: block; margin-bottom: .35rem; font-weight: 400; } .verdict span { font-size: .9rem; font-weight: 300; color: #d8d3cb; line-height: 1.5; }
.verdict .v-ok b { color: #7fd8a0; } .verdict .v-no b { color: #f5b642; } .verdict .v-next b { color: #6fb1ff; }
@media (max-width: 800px) { .verdict { grid-template-columns: 1fr; } }
.cal { display: grid; gap: .5rem; margin-top: .9rem; }
.cal-row { display: grid; grid-template-columns: minmax(7rem, 1fr) 3fr; align-items: center; gap: .9rem; font-size: .88rem; font-weight: 300; color: #cfcac2; }
.cal-bars { display: grid; gap: .25rem; }
.cal-bar { position: relative; height: 1.15rem; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.cal-bar i { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 999px; background: rgba(255,255,255,.28); } .cal-bar.after i { background: #ff6a22; } .cal-bar.real i { background: #7fd8a0; }
.cal-bar b { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); font-weight: 400; font-size: .72rem; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.cal-key { display: flex; gap: 1rem; margin-top: .6rem; font-size: .78rem; color: var(--muted); } .cal-key span::before { content: ""; display: inline-block; width: .7rem; height: .7rem; margin-right: .4rem; border-radius: 50%; vertical-align: -1px; background: rgba(255,255,255,.28); } .cal-key .k-a::before { background: #ff6a22; } .cal-key .k-r::before { background: #7fd8a0; }
.rob { width: 100%; border-collapse: separate; border-spacing: 0 .35rem; margin-top: .8rem; font-size: .9rem; }
.rob th, .rob td { padding: .55rem .8rem; text-align: center; } .rob th:first-child, .rob td:first-child { text-align: left; }
.rob thead th { font-weight: 400; font-size: .78rem; color: var(--muted); }
.rob tbody th { font-weight: 400; background: rgba(30,27,25,.62); border-radius: 14px 0 0 14px; } .rob tbody td { background: rgba(30,27,25,.62); font-variant-numeric: tabular-nums; } .rob tbody td:last-child { border-radius: 0 14px 14px 0; }
.rob td.ok { color: #7fd8a0; } .rob td.part { color: #f5b642; } .rob td.no { color: #ff8a8a; }
.rob-note { margin-top: .5rem; font-size: .8rem; color: var(--muted); }

.tile-play { grid-column: 1 / -1; aspect-ratio: 16 / 4; }
@media (max-width: 520px) { .tile-play { aspect-ratio: 4 / 3; } }


.site-nav .nav-right { display: flex; align-items: center; gap: .55rem; flex-shrink: 0; }
.site-nav .nav-gh { white-space: nowrap; text-decoration: none; padding: .5rem .95rem; border-radius: 999px; font-size: .85rem; color: var(--muted); background: rgba(30,27,25,.7); box-shadow: 0 0 0 1px var(--border); transition: color .2s, box-shadow .2s; }
.site-nav .nav-gh:hover, .site-nav .nav-gh:focus-visible { color: var(--fg); box-shadow: 0 0 0 1px rgba(255,106,34,.6); }
@media (max-width: 520px) { .site-nav .nav-gh { display: none; } }

header.top .links a .gh-ico { vertical-align: -2px; margin-right: .45rem; }

.limits ~ .links a + a { margin-left: 1.4rem; }
.only-sim { display: inline-block; margin-left: .5rem; padding: .12rem .65rem; border-radius: 999px; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; vertical-align: .08em; background: rgba(255,106,34,.22); box-shadow: 0 0 0 1px rgba(255,106,34,.45); color: #ffd4bd; }

/* Play: on wide screens the controls sit beside the 3D view, so the stage and the settings are on screen together */
@media (min-width: 900px) {
  .play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
  .play-layout .stage { margin-top: 0; height: clamp(480px, calc(100vh - 140px), 820px); }
  .play-layout .play-ctl { grid-template-columns: 1fr; margin: 0; position: sticky; top: 84px; }
  .play-layout .drive { justify-self: center; }
}
@media (min-width: 900px) {
  .play-page .tab-hero { padding-top: .8rem; padding-bottom: .4rem; }
  .play-page .tab-hero h1 { font-size: clamp(2.2rem, 3.6vw, 3rem); margin: .3rem 0 .2rem; }
  .play-page .tab-hero .lede { font-size: .95rem; max-width: 72ch; margin: .2rem 0 0; }
  .play-layout .stage { height: clamp(480px, calc(100vh - 230px), 800px); }
}

/* narrow screens: nothing may push the page sideways */
.jy-title .eyebrow { padding-inline: 1rem; margin-inline: -1rem; }
@media (max-width: 600px) {
  .rc-tabs, .rc-modes { flex-wrap: wrap; justify-content: center; max-width: 100%; border-radius: 22px; }
  .rc-tabs button, .rc-modes button { padding: .4rem .8rem; }
  .rob th, .rob td { padding: .5rem .35rem; font-size: .8rem; }
}

/* section headings use the full column width (the global 16ch cap made them wrap early) */
main h2 { max-width: none; }

/* play: colourway picker (dots only) and the dark backdrop that goes with a colourway */
fieldset.venoms { gap: .15rem; }
fieldset.venoms label.vn, .controls fieldset.venoms label.vn { padding: .28rem; margin: 0; }
fieldset.venoms label.vn i { display: block; width: 20px; height: 20px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(255,255,255,.28), 0 0 0 1px var(--border); transition: transform .2s, box-shadow .2s; }
fieldset.venoms label.vn:hover i { transform: scale(1.14); }
fieldset.venoms label.vn:has(input:checked) { background: none; box-shadow: none; }
fieldset.venoms label.vn:has(input:checked) i { box-shadow: inset 0 0 0 1px rgba(255,255,255,.28), 0 0 0 2px var(--bg, #fff), 0 0 0 4px var(--a); }
#play-stage { transition: background .4s; }
#play-stage.skinned { background: radial-gradient(120% 90% at 50% 28%, color-mix(in srgb, var(--skin-bg) 62%, #39445a), var(--skin-bg) 78%); }
#play-stage.loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--fg) 18%, transparent); border-top-color: var(--a); animation: venom-spin .8s linear infinite; pointer-events: none; z-index: 5; }
@keyframes venom-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #play-stage.loading::after { animation-duration: 2.4s; } }
/* play controls: group labels sit inside each group, above its buttons (not on the outline), and the groups are rounded boxes rather than stretched pills */
.play-ctl .controls fieldset { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; border-radius: 20px; padding: .1rem .7rem .7rem; }
.play-ctl .controls fieldset legend { float: left; width: 100%; box-sizing: border-box; margin: 0; padding: .55rem .15rem .3rem; font-size: .8rem; color: var(--muted); }
.play-warn-note { margin: -.2rem 0 .9rem; font-size: .8rem; color: var(--muted); }
.play-warn-note span { color: var(--a); font-size: .85rem; margin-right: .3rem; }
.play-warn-note a { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, var(--fg) 30%, transparent); }

html.pet-hover, html.pet-hover * { cursor: pointer !important; }

/* the nav Play pill: inverted so it stands apart from the orange active tab; pulses until Play has been visited once */
.site-nav .nav-play:not(.on) { background: var(--fg); color: var(--bg); box-shadow: 0 8px 24px rgba(0,0,0,.28); }
.site-nav .nav-play:not(.on):hover { box-shadow: 0 10px 30px rgba(0,0,0,.36); }
.site-nav .nav-play.nudge:not(.on) { animation: play-pulse 2.6s ease-out infinite; }
@keyframes play-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,106,34,.6), 0 8px 24px rgba(0,0,0,.28); } 65%, 100% { box-shadow: 0 0 0 13px rgba(255,106,34,0), 0 8px 24px rgba(0,0,0,.28); } }
@media (prefers-reduced-motion: reduce) { .site-nav .nav-play.nudge:not(.on) { animation: none; box-shadow: 0 0 0 3px rgba(255,106,34,.55), 0 8px 24px rgba(0,0,0,.28); } }


/* Play: the obstacle course bar, the finish card, and the wider view */
.course { position: absolute; z-index: 3; top: 14px; right: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; max-width: calc(100% - 28px); pointer-events: none; }
.course[hidden], .course-win[hidden], .c-msg[hidden] { display: none; }
.c-goal { padding: .25rem .8rem; border-radius: 999px; background: rgba(14,12,11,.6); box-shadow: 0 0 0 1px rgba(255,106,34,.5); font-size: .74rem; color: #ff9a5c; }
.c-row { display: flex; align-items: center; gap: .9rem; padding: .35rem .5rem .35rem .9rem; border-radius: 999px; background: rgba(14,12,11,.62); box-shadow: 0 0 0 1px rgba(255,255,255,.12); pointer-events: auto; }
.c-stat { display: inline-flex; align-items: baseline; gap: .3rem; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.c-stat small { font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; }
.c-stat b { font-family: var(--mono); font-weight: 400; color: var(--fg); font-size: .95rem; }
.c-dot { align-self: center; width: .8rem; height: .8rem; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffd2b0, #ff6a22 55%, #b83d00); box-shadow: 0 0 8px rgba(255,106,34,.6); margin-right: .15rem; }
.c-row button { font: inherit; width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: var(--fg); cursor: pointer; line-height: 1; }
.c-row button:hover { background: rgba(255,255,255,.18); }
.c-row button.off { color: var(--muted); text-decoration: line-through; }
.course.done .c-dot { box-shadow: 0 0 12px #ffc21a; }
.c-msg { padding: .3rem .8rem; border-radius: 999px; background: rgba(255,106,34,.16); box-shadow: 0 0 0 1px rgba(255,106,34,.55); color: #ffb98a; font-size: .78rem; }
.course-win { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(8,7,6,.45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.cw-card { text-align: center; padding: 1.4rem 2.2rem; border-radius: 22px; background: rgba(20,17,15,.88); box-shadow: 0 0 0 1px rgba(255,106,34,.6), 0 20px 60px rgba(0,0,0,.5); animation: cw-in .35s cubic-bezier(.2,1.3,.4,1); }
.cw-card h2 { margin: 0; font-weight: 300; font-size: 1.5rem; color: #ff9a5c; }
.cw-t { margin: .3rem 0 0; font-family: var(--mono); font-size: 2.4rem; }
.cw-b { margin: 0 0 1rem; color: var(--muted); font-size: .85rem; }
.cw-b.rec { color: #7be08a; }
.cw-card button { font: inherit; padding: .5rem 1.3rem; border-radius: 999px; border: 0; background: var(--a, #ff6a22); color: #fff; cursor: pointer; }
@keyframes cw-in { from { transform: scale(.85); opacity: 0; } }
.play-warn { top: auto; right: auto; left: 50%; bottom: 58px; transform: translateX(-50%); }
.wide-btn { display: none; position: absolute; z-index: 3; right: 14px; bottom: 14px; padding: .35rem .6rem; border-radius: 12px; border: 0; background: rgba(14,12,11,.6); box-shadow: 0 0 0 1px rgba(255,255,255,.14); color: var(--fg); cursor: pointer; opacity: .85; }
.wide-btn:hover { opacity: 1; background: rgba(40,34,30,.8); }
.wide-btn .w-in { transition: all .2s; }
.wide-btn[aria-pressed="true"] .w-in { x: 2px; width: 20px; }
@media (min-width: 900px) {
  .wide-btn { display: block; }
  .play-layout.wide { grid-template-columns: minmax(0, 1fr); margin-inline: calc(50% - min(50vw - 14px, 880px)); }
  .play-layout.wide .stage { height: clamp(520px, calc(100vh - 110px), 960px); }
  .play-layout.wide .play-ctl { grid-template-columns: auto 1fr; position: static; margin-top: 0; align-items: center; }
}
@media (max-width: 760px) { .c-goal { display: none; } }

#play-stage { container-type: inline-size; }

/* the course bar shares the top row with the stats on wide stages; on narrower ones it moves to the bottom-right corner, clear of the robot */
@container (max-width: 1300px) { .course { top: auto; bottom: 58px; right: 14px; flex-direction: column-reverse; } }
@container (max-width: 640px) { .c-row { gap: .55rem; padding-left: .7rem; } .c-stat small { display: none; } .c-goal { display: none; } }

