:root {
    --bg: #f7f7f8; --card: #ededef; --text: #1d1d1f; --body: #424245; --muted: #6e6e73; --faint: #86868b;
    --line: rgba(0, 0, 0, 0.08); --link: #0066cc; --accent: #0071e3; --warm: #bf4800;
    --stage-a: #38383c; --stage-b: #0c0c0d;     /* graphite stage in both modes (Apple Pro product look) */
    --glass: rgba(255, 255, 255, 0.72); --glass-line: rgba(0, 0, 0, 0.06); --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --ease: cubic-bezier(.16, 1, .3, 1);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
    --bg: #000000; --card: #1c1c1e; --text: #f5f5f7; --body: #d2d2d7; --muted: #a1a1a6; --faint: #86868b;
    --line: rgba(255, 255, 255, 0.12); --link: #2997ff; --accent: #0a84ff; --warm: #ff9f0a;
    --stage-a: #38383c; --stage-b: #0c0c0d;
    --glass: rgba(40, 40, 44, 0.66); --glass-line: rgba(255, 255, 255, 0.08); --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 22px;
    background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px);
    border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.bar a { text-decoration: none; color: var(--text); }
.bar a:hover { color: var(--link); }
.bar strong { font-weight: 600; }
/* over the graphite stage the bar turns to dark glass (in light mode too) */
.bar { transition: background-color 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease); }
.bar.on-stage { --bg: #161617; --text: #f5f5f7; --line: rgba(255, 255, 255, 0.1); --link: #2997ff; color: var(--text); }

main { max-width: 1180px; margin: 0 auto; padding: 0 22px 120px; }
header.hero { padding: 88px 0 56px; max-width: 860px; }
.cue { display: flex; align-items: center; gap: 10px; margin: 34px 0 0; color: var(--faint); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; }
.cue i { position: relative; width: 1.5px; height: 34px; background: var(--line); overflow: hidden; border-radius: 2px; }
.cue i::after { content: ''; position: absolute; left: 0; right: 0; top: -40%; height: 40%; background: var(--text); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { to { top: 100%; } }
.eyebrow { margin: 0 0 10px; color: var(--warm); font-weight: 600; font-size: 1rem; }
h1 { margin: 0; font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 1.04; letter-spacing: -0.045em; font-weight: 700; }
.sub { margin: 18px 0 0; max-width: 34em; color: var(--muted); font-size: clamp(1.1rem, 2vw, 1.3rem); line-height: 1.4; letter-spacing: -0.01em; font-weight: 500; }

/* ---------- model switcher (parts list) and chapter nav: segmented pills ---------- */
.models { display: flex; gap: 8px; margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.models::-webkit-scrollbar { display: none; }
.models button { flex: none; border: 0; cursor: pointer; padding: 9px 18px; border-radius: 980px; background: var(--card); color: var(--text);
    font-size: 0.92rem; font-weight: 500; letter-spacing: -0.01em; transition: background 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease); }
.models button:hover { background: color-mix(in srgb, var(--card) 70%, var(--text) 8%); }
.models button[aria-selected="true"] { background: var(--text); color: var(--bg); }
.models button:active { transform: scale(0.97); }

/* ---------- scroll story: full-bleed pinned stage, one tall chapter per model ---------- */
.scrolly { position: relative; width: 100vw; margin-left: calc(50% - 50vw); }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate;
    background: radial-gradient(120% 90% at 50% 38%, var(--stage-a) 0%, var(--stage-b) 100%); }
.chapters > div { height: var(--chapter, 340vh); }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; outline: none; transition: opacity 0.15s linear; }
#view.grabbing { cursor: grabbing; }
#view.over { cursor: pointer; }
/* keyboard: a ring around the stage when the model has focus, and on the part labels */
.stage:has(#view:focus-visible)::after { content: ''; position: absolute; inset: 6px; z-index: 8; border-radius: 18px; pointer-events: none; box-shadow: inset 0 0 0 3px var(--accent); }
.lbl:focus-visible { outline: none; }
.lbl:focus-visible span { background: var(--accent); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.tool:focus-visible, .chapters-nav button:focus-visible, .models button:focus-visible, .pill-btn:focus-visible, .sys-back:focus-visible, .info .x:focus-visible, .ar-pop .x:focus-visible,
.parts .part:focus-visible, .parts .sys-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }

.chapters-nav { position: absolute; left: 50%; top: 68px; transform: translateX(-50%); z-index: 6; display: flex; gap: 4px; padding: 4px; border-radius: 980px;
    background: var(--glass); backdrop-filter: saturate(1.8) blur(24px); -webkit-backdrop-filter: saturate(1.8) blur(24px); border: 1px solid var(--glass-line); box-shadow: var(--shadow); }
.chapters-nav button { position: relative; overflow: hidden; border: 0; cursor: pointer; padding: 7px 16px; border-radius: 980px; background: transparent;
    font-size: 0.8rem; font-weight: 600; color: var(--muted); white-space: nowrap; transition: color 0.3s var(--ease), background 0.3s var(--ease); }
.chapters-nav button:hover { color: var(--text); }
.chapters-nav button[aria-selected="true"] { color: var(--text); background: var(--line); }
.chapters-nav button i { position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); opacity: 0; transition: opacity 0.3s; }
.chapters-nav button[aria-selected="true"] i { opacity: 1; }

.caption { position: absolute; left: max(28px, 5vw); top: 128px; max-width: min(520px, 70%); pointer-events: none; z-index: 2; will-change: opacity, transform; }
.caption .c-eyebrow { margin: 0 0 8px; color: var(--warm); font-size: 0.9rem; font-weight: 600; }
.caption h2 { margin: 0; font-size: clamp(2rem, 4.6vw, 3.6rem); letter-spacing: -0.045em; font-weight: 700; line-height: 1.04; }
.caption p { margin: 12px 0 0; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.2rem); line-height: 1.4; font-weight: 500; letter-spacing: -0.01em; }
.caption.small h2 { font-size: 1.4rem; }
.caption.story { top: 50%; opacity: 0; transform: translateY(calc(-50% + var(--ty, 0px))); max-width: min(380px, 34%); }
.caption.story h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.caption.story p:last-child { font-size: 1.05rem; color: var(--body); }
/* phones and tablets: the story is a glass card above the dock, the model is lifted above it */
@media (max-width: 899px) {
    .caption.story { top: auto; bottom: 78px; left: 12px; right: 12px; max-width: none; transform: translateY(var(--ty, 0px)); padding: 14px 18px 15px; border-radius: 22px;
        background: var(--glass); backdrop-filter: saturate(1.8) blur(24px); -webkit-backdrop-filter: saturate(1.8) blur(24px); border: 1px solid var(--glass-line); box-shadow: var(--shadow); }
    .caption.story .c-eyebrow { margin-bottom: 2px; font-size: 0.78rem; }
    .caption.story h2 { font-size: 1.3rem; letter-spacing: -0.025em; line-height: 1.15; }
    .caption.story p:last-child { margin-top: 5px; font-size: 0.9rem; line-height: 1.4; }
}
.caption.small p { margin-top: 2px; font-size: 0.95rem; }
.caption.small .c-eyebrow { margin-bottom: 2px; }

.loading { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; justify-items: center; color: var(--muted); font-size: 0.9rem;
    transition: opacity 0.5s var(--ease); z-index: 3; pointer-events: none; font-variant-numeric: tabular-nums; }
.loading.done { opacity: 0; }
/* blurred still of the model while its mesh downloads; the live model fades in over it */
.poster { position: absolute; left: 50%; top: 50%; height: 100%; width: auto; max-width: none; aspect-ratio: 1; z-index: 1; pointer-events: none;
    transform: translate(-50%, -50%) scale(1.02); filter: blur(14px) saturate(1.1); opacity: 0; transition: opacity 0.6s var(--ease); }
.poster.on { opacity: 0.85; }
@media (min-width: 900px) { .poster { transform: translate(calc(-50% + 16vw), -50%) scale(1.02); } }
@media (max-width: 899px) { .poster { height: auto; width: 100%; } }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--muted); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tip { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; padding: 5px 11px; border-radius: 10px; font-size: 0.8rem; font-weight: 600;
    color: var(--bg); background: var(--text); white-space: nowrap; opacity: 0; transform: translate(-50%, -140%) scale(0.96); transition: opacity 0.18s var(--ease), transform 0.18s var(--ease); }
.tip.on { opacity: 1; transform: translate(-50%, -150%) scale(1); }
.tip small { font-weight: 500; opacity: 0.6; margin-left: 6px; }

/* part labels on the exploded view: callout columns, leader lines drawn in SVG */
.labels { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity 0.4s var(--ease); }
.labels.on { opacity: var(--vis, 1); }
.leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.leaders path { fill: none; stroke: var(--text); stroke-width: 1; transition: opacity 0.25s var(--ease); }
.leaders path.hot { stroke: var(--accent); stroke-width: 1.5; }
.leaders circle { fill: #fff; stroke: var(--text); stroke-width: 1.5; transition: opacity 0.25s var(--ease); }
.lbl { position: absolute; left: 0; top: 0; padding: 0; border: 0; background: none; cursor: pointer; white-space: nowrap; will-change: transform;
    opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease); }
.labels.on .lbl.vis { opacity: 1; pointer-events: auto; }
.labels.on .lbl.vis.dim { opacity: 0.3; }
.lbl span { display: block; padding: 3px 10px; border-radius: 980px; font-size: 0.74rem; font-weight: 600; letter-spacing: -0.005em; line-height: 18px; color: var(--text);
    background: var(--glass); backdrop-filter: saturate(1.8) blur(16px); -webkit-backdrop-filter: saturate(1.8) blur(16px);
    border: 1px solid var(--glass-line); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); transition: background 0.25s var(--ease), color 0.25s var(--ease); }
.lbl:hover span { background: var(--accent); color: #fff; }
.lbl.sys span { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; font-size: 0.86rem; letter-spacing: -0.01em; line-height: 20px; }
.lbl.sys em { font-style: normal; font-size: 0.7rem; font-weight: 600; min-width: 22px; padding: 1px 6px; border-radius: 980px; text-align: center; background: var(--line); color: var(--muted); }
.lbl.sys:hover em { background: rgba(255, 255, 255, 0.25); color: #fff; }

.sys-back { position: absolute; left: 50%; top: 122px; transform: translateX(-50%); z-index: 6; border: 0; cursor: pointer; padding: 8px 16px; border-radius: 980px;
    font-size: 0.82rem; font-weight: 600; color: var(--text); background: var(--glass); backdrop-filter: saturate(1.8) blur(24px); -webkit-backdrop-filter: saturate(1.8) blur(24px);
    border: 1px solid var(--glass-line); box-shadow: var(--shadow); animation: pop 0.4s var(--ease); transition: background 0.25s var(--ease), color 0.25s var(--ease); }
.sys-back:hover { background: var(--accent); color: #fff; }
.sys-back[hidden] { display: none; }

/* Penning trap chapter: a dark event-display stage */
.stage::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 0.9s var(--ease);
    background: radial-gradient(120% 90% at 50% 38%, #1d1f27 0%, #050507 100%); }
.stage.night::before { opacity: 1; }
/* the stage is always dark (graphite; the Penning trap adds its blue-black event-display tint), so everything on it uses dark tokens */
.stage { --bg: #000000; --card: #1c1c1e; --text: #f5f5f7; --body: #d2d2d7; --muted: #a1a1a6; --faint: #86868b; --line: rgba(255, 255, 255, 0.12);
    --link: #2997ff; --accent: #0a84ff; --warm: #ff9f0a;
    --glass: rgba(36, 37, 42, 0.68); --glass-line: rgba(255, 255, 255, 0.09); --shadow: 0 10px 40px rgba(0, 0, 0, 0.5); color: var(--text); }
.stage .leaders circle { fill: #1c1c1e; }

/* detector plots (desktop): a slim strip along the bottom left, clear of the trap */
.plots { position: absolute; left: 20px; bottom: 88px; z-index: 5; width: min(820px, calc(100% - 40px)); padding: 14px 18px 12px; border-radius: 20px;
    display: grid; grid-template-columns: 170px repeat(3, minmax(0, 1fr)); gap: 18px; align-items: end;
    background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: saturate(1.8) blur(24px); -webkit-backdrop-filter: saturate(1.8) blur(24px);
    box-shadow: var(--shadow); color: var(--text); animation: pop 0.45s var(--ease); }
.plots[hidden] { display: none; }
.pl-head { align-self: start; }
.pl-eyebrow { margin: 0; font-size: 0.7rem; font-weight: 600; color: #30d158; }
.plots h3 { margin: 2px 0 0; font-size: 1.1rem; letter-spacing: -0.02em; }
.pl-sub { margin: 4px 0 0; font-size: 0.74rem; color: var(--muted); line-height: 1.35; }
.pl-t { margin: 0 0 6px; font-size: 0.7rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.pl-t span { font-weight: 500; opacity: 0.7; }
.plots canvas { display: block; width: 100%; height: 84px; }
#pl-hits { cursor: pointer; }
@media (max-width: 899px) { .plots { display: none; } }

/* Penning trap: which stage the antiproton bunch is in */
.phase { position: absolute; left: 50%; top: 116px; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 12px;
    border-radius: 980px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; color: var(--text); background: var(--glass); border: 1px solid var(--glass-line);
    backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px); box-shadow: var(--shadow); }
.phase[hidden] { display: none; }
.phase i { width: 7px; height: 7px; border-radius: 50%; background: #dbe4ff; box-shadow: 0 0 10px #9fb4ff; }
.phase.tick span { animation: phase-in 0.5s var(--ease); }
@keyframes phase-in { from { opacity: 0; transform: translateY(4px); } }
@media (max-width: 640px) { .phase { top: 100px; font-size: 0.72rem; } }

/* lab photo compare: the photo is clipped from the divider to the right */
.compare { position: absolute; inset: 0; z-index: 3; pointer-events: none; --x: 50%; }
.compare[hidden] { display: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; clip-path: inset(0 0 0 var(--x)); }
.compare img.bg { object-fit: cover; filter: blur(40px) brightness(0.55) saturate(1.2); transform: scale(1.15); clip-path: inset(0 0 0 calc(var(--x) / 1.15 + 6.52%)); background: #111; }
.cmp-bar { position: absolute; top: 0; bottom: 0; left: var(--x); width: 44px; margin-left: -22px; cursor: ew-resize; pointer-events: auto; touch-action: none; outline: none; }
.cmp-bar::before { content: ''; position: absolute; left: 21px; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 12px rgba(0, 0, 0, 0.35); }
.cmp-bar i { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3); }
.cmp-bar i::before, .cmp-bar i::after { content: ''; position: absolute; top: 15px; border: 5px solid transparent; }
.cmp-bar i::before { left: 6px; border-right: 6px solid #1d1d1f; }
.cmp-bar i::after { right: 6px; border-left: 6px solid #1d1d1f; }
.cmp-bar:focus-visible i { box-shadow: 0 0 0 3px var(--accent), 0 4px 18px rgba(0, 0, 0, 0.3); }
.cmp-tag { position: absolute; bottom: 92px; padding: 4px 11px; border-radius: 980px; font-size: 0.74rem; font-weight: 600; color: #fff; background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.cmp-tag.l { left: calc(var(--x) - 96px); }
.cmp-tag.r { left: calc(var(--x) + 14px); }

/* field-line legend */
.legend { position: absolute; left: max(28px, 5vw); bottom: 96px; z-index: 4; display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 980px;
    font-size: 0.78rem; font-weight: 600; color: var(--text); background: var(--glass); border: 1px solid var(--glass-line);
    backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px); box-shadow: var(--shadow); animation: pop 0.4s var(--ease); }
.legend[hidden] { display: none; }
.legend { align-items: flex-start; gap: 12px; padding: 9px 16px 8px; border-radius: 16px; }
.lg-t { font-size: 0.78rem; font-weight: 700; padding-top: 1px; }
.lg-scale { display: flex; flex-direction: column; gap: 3px; }
.lg-bar { width: 150px; height: 5px; border-radius: 4px; background: linear-gradient(90deg, #5e5ce6 0%, #bf5af2 40%, #ff375f 72%, #ffd60a 100%); }
.lg-bar.t { background: linear-gradient(90deg, #0a0530 0%, #4a0f8c 20%, #b5247a 40%, #f0592a 60%, #fab51c 80%, #fff7cc 100%); }
.lg-bar.w { background: linear-gradient(90deg, #0a84ff 0%, #64d2ff 30%, #ff9f0a 75%, #ff6b2c 100%); }
.lg-ticks { display: flex; justify-content: space-between; width: 150px; font-size: 0.66rem; font-weight: 600; color: var(--muted); }
.lg-ticks i { font-style: normal; }
.lg-note { max-width: 150px; font-size: 0.68rem; font-weight: 500; color: var(--muted); line-height: 1.3; }

/* AR on a computer: scan to open on a phone */
.ar-pop { position: absolute; right: 20px; bottom: 86px; z-index: 7; width: 250px; padding: 18px 18px 16px; border-radius: 22px; text-align: center;
    background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: saturate(1.8) blur(24px); -webkit-backdrop-filter: saturate(1.8) blur(24px);
    box-shadow: var(--shadow); animation: pop 0.4s var(--ease); }
.ar-pop[hidden] { display: none; }
.ar-pop .x { position: absolute; right: 10px; top: 10px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--line); cursor: pointer; font-size: 0.7rem; color: var(--muted); }
.ar-pop .qr { width: 156px; height: 156px; margin: 6px auto 12px; padding: 10px; border-radius: 14px; background: #fff; }
.ar-pop .qr svg, .ar-pop .qr img { display: block; width: 100%; height: 100%; }
.ar-pop p { margin: 0; font-size: 0.82rem; line-height: 1.4; color: var(--body); }
.ar-pop b { color: var(--text); }

/* glass panels */
.info, .dock { background: var(--glass); backdrop-filter: saturate(1.8) blur(24px); -webkit-backdrop-filter: saturate(1.8) blur(24px);
    border: 1px solid var(--glass-line); box-shadow: var(--shadow); }

.info { position: absolute; right: 20px; top: 122px; width: min(320px, calc(100% - 40px)); padding: 20px 22px 18px; border-radius: 22px; z-index: 5;
    transform-origin: top right; animation: pop 0.45s var(--ease); }
.info[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: scale(0.94) translateY(-6px); } }
.info .x { position: absolute; right: 12px; top: 12px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--line); cursor: pointer; font-size: 0.72rem; color: var(--muted); }
.info .x:hover { color: var(--text); }
.i-mat { margin: 0; color: var(--warm); font-size: 0.8rem; font-weight: 600; min-height: 1em; }
.info h3 { margin: 2px 28px 0 0; font-size: 1.3rem; letter-spacing: -0.025em; line-height: 1.15; }
.i-blurb { margin: 8px 0 0; color: var(--body); font-size: 0.92rem; line-height: 1.45; }
.i-blurb:empty { display: none; }
.info dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.info dt { font-size: 0.72rem; color: var(--faint); font-weight: 500; }
.info dd { margin: 1px 0 0; font-size: 0.92rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.i-act { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pill-btn { border: 0; cursor: pointer; padding: 7px 14px; border-radius: 980px; background: var(--line); font-size: 0.82rem; font-weight: 500; transition: background 0.3s var(--ease); }
.pill-btn:hover, .pill-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }

.dock { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 6px;
    padding: 8px 10px 8px 18px; border-radius: 980px; max-width: calc(100% - 24px); }
.d-hint { font-size: 0.8rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.tool { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; padding: 8px 12px; border-radius: 980px; background: transparent;
    font-size: 0.82rem; font-weight: 500; color: var(--text); transition: background 0.3s var(--ease), color 0.3s var(--ease); }
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover { background: var(--line); }
.tool[aria-pressed="true"] { background: var(--accent); color: #fff; }
.tool[hidden] { display: none; }
.ar-link img { display: block; width: 18px; height: 18px; }
:root[data-theme="dark"] .ar-link img { filter: invert(1); }
@media (max-width: 1100px) { .d-hint, .d-hint + .sep { display: none; } }


/* ---------- parts list ---------- */
.box { margin-top: 96px; }
.box .models { margin-bottom: 22px; }
.box h2 { margin: 0 0 18px; font-size: clamp(1.6rem, 3.4vw, 2.2rem); letter-spacing: -0.035em; }
.parts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.parts .sys-h { grid-column: 1 / -1; margin-top: 18px; }
.parts .sys-h:first-child { margin-top: 0; }
.parts .sys-btn { display: block; width: 100%; text-align: left; border: 0; cursor: pointer; padding: 6px 2px 4px; background: none; border-radius: 10px; transition: color 0.3s var(--ease); }
.parts .sys-btn b { display: block; font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; }
.parts .sys-btn b::after { content: ' ›'; color: var(--faint); font-weight: 500; }
.parts .sys-btn span { display: block; margin-top: 2px; font-size: 0.86rem; color: var(--muted); line-height: 1.4; max-width: 46em; }
.parts .sys-btn:hover b, .parts .sys-btn[aria-pressed="true"] b { color: var(--link); }
.parts .part { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; text-align: left; border: 0; cursor: pointer;
    padding: 12px 16px 12px 12px; border-radius: 16px; background: var(--card); transition: background 0.35s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease); }
.parts .part:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.parts .part[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.sw { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.18), inset 0 2px 4px rgba(255, 255, 255, 0.6), 0 0 0 0.5px var(--line); }
.p-name { font-size: 0.92rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.p-mat { display: block; font-size: 0.76rem; color: var(--muted); font-weight: 500; }
.p-qty { font-size: 0.82rem; color: var(--faint); font-variant-numeric: tabular-nums; }

.end { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 26px; color: var(--muted); font-size: 0.9rem; }
.end a { color: var(--link); text-decoration: none; }
.end a:hover { text-decoration: underline; }
.copy { margin: 10px 0 0; color: var(--faint); font-size: 0.78rem; }

@media (max-width: 640px) {
    main { padding: 0 16px 90px; }
    header.hero { padding: 56px 0 40px; }
    .chapters > div { height: var(--chapter-m, 300vh); }
    .chapters-nav { top: 62px; max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; }
    .chapters-nav::-webkit-scrollbar { display: none; }
    .chapters-nav button { flex-shrink: 0; padding: 6px 11px; font-size: 0.72rem; white-space: nowrap; }
    .caption { left: 18px; top: 112px; max-width: calc(100% - 36px); }
    .caption h2 { font-size: 2rem; }
    .caption p { font-size: 0.95rem; }
    .sys-back { top: 108px; left: 18px; transform: none; padding: 6px 12px; font-size: 0.76rem; }
    .info { left: 12px; right: 12px; top: auto; bottom: 74px; width: auto; padding: 14px 16px 12px; }
    .info dl, .i-act { display: none; }
    .info h3 { font-size: 1.05rem; }
    .i-blurb { font-size: 0.82rem; margin-top: 4px; }
    .lbl.sys span { font-size: 0.74rem; padding: 3px 6px 3px 10px; line-height: 16px; }
    .lbl span { font-size: 0.62rem; padding: 1px 7px; line-height: 16px; }
    .dock { bottom: 12px; padding: 6px 6px 6px 14px; gap: 2px; }
    .d-hint { font-size: 0.72rem; }
    .tool span { display: none; }
    .cmp-tag { bottom: 80px; }
    .legend { left: 16px; bottom: 76px; }
    .tool { padding: 9px; }
    .sep { margin: 0 4px; }
}
@media (prefers-reduced-motion: reduce) {
    .info, .ar-pop, .legend, .plots, .sys-back, .phase.tick span { animation: none; }
    .cue i::after { animation: none; top: 30%; }
    .spin { animation-duration: 2.4s; }
    .parts .part:hover { transform: none; }
    .caption, .labels, .lbl, .poster, #view { transition: none; }
}

/* ---------- typography pass: balanced headings, no lone last words, kerning, aligned numbers ---------- */
h1, h2, h3, h4 { text-wrap: balance; font-kerning: normal; }
p, li, dd, figcaption, blockquote { text-wrap: pretty; hanging-punctuation: first; }
body { text-rendering: optimizeLegibility; font-feature-settings: "kern" 1; }
table, time, .num, [data-num] { font-variant-numeric: tabular-nums; }
