@font-face{font-family:"Libertine Display";src:url(fonts/display.otf);font-display:block}
@font-face{font-family:"Libertine Display";src:url(fonts/display-italic.otf);font-style:italic;font-display:block}
@font-face{font-family:"Biolinum";src:url(fonts/text.otf);font-weight:400;font-display:block}
@font-face{font-family:"Biolinum";src:url(fonts/text-bold.otf);font-weight:700;font-display:block}
:root{
  --ease-camera:cubic-bezier(.65,0,.35,1); --ease-enter:cubic-bezier(.16,1,.3,1); --ease-tactile:cubic-bezier(.34,1.56,.64,1);
  --dur-copy:260ms; --dur-spot:450ms; --dur-tactile:380ms;
  --ground:#E9E2D2; --sheet:#F7F2E4; --ink:#2B2F36; --muted:#5A5F66; --accent:#9A5B14; --copper:#C97B2D; --copper-hi:#E8A75C; --copper-dk:#8F5518;
  --steel:#4A5A6A; --steel-hi:#93A7B8; --steel-lo:#2E3A45; --charge:#3E8E5A; --charge-hi:#67C587; --heat-hi:#E4572E; --heat-lo:#7A1F0B;
  --paper:#E9E2D2; --paper-hi:#F2ECDD; --sky:#DDE4E4; --sky-hi:#EDF1EE; --road:#C9C2B0; --batt-hi:#7FA8C9; --batt-lo:#3F6685;
  --chip:rgba(247,242,228,.93);
  font-family:"Biolinum",system-ui,sans-serif;
}
:root[data-theme=dark]{
  --ground:#161A1F; --sheet:#1E242B; --ink:#ECE4D0; --muted:#B0ACA0; --accent:#E8A75C; --copper:#D98B3D; --copper-hi:#F0BC7A; --copper-dk:#9A6020;
  --steel:#7E96AA; --steel-hi:#B8CCDC; --steel-lo:#42525F; --charge:#58B87A; --charge-hi:#86DCAA; --heat-hi:#F06A40; --heat-lo:#8F2C12;
  --paper:#161A1F; --paper-hi:#1B2026; --sky:#1B2229; --sky-hi:#222B33; --road:#23292F; --batt-hi:#5E89AC; --batt-lo:#2F4E66;
  --chip:rgba(30,36,43,.93);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:var(--ground);color:var(--ink);overscroll-behavior:none}
#app{position:fixed;inset:0}
#stage{position:absolute;inset:0;width:100%;height:100%;touch-action:none;display:block;user-select:none;-webkit-user-select:none}
#world,#wall,#near{will-change:transform}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
/* backdrop */
.grid-dot{fill:var(--ink);opacity:.10}
.gridfill{opacity:.5}
.skyband{opacity:.8}
.roadside{fill:var(--road)}
.kerb{fill:var(--ink);opacity:.22}
.near-road{fill:var(--road);opacity:.9}
.walldoodle{opacity:.5}
.doodle-card{fill:var(--sheet);stroke:var(--ink);stroke-width:2;stroke-opacity:.25}
.doodle-line{stroke:var(--copper);stroke-width:5;stroke-linecap:round}
.doodle-tick{stroke:var(--ink);stroke-width:3;stroke-opacity:.4}
.doodle-cap{font-family:"Libertine Display",serif;font-style:italic;font-size:34px;fill:var(--muted)}
.car-shadow{fill:rgba(30,24,16,.28)}
/* the car */
.body-sketch{stroke:var(--ink);stroke-width:7;stroke-linecap:round;stroke-linejoin:round;opacity:.8}
.body-cut{stroke:var(--ink);stroke-width:4;stroke-linecap:round;opacity:.35}
.glass{stroke:var(--ink);stroke-width:5;opacity:.3;fill:var(--sky)}
/* battery */
.batt-case{fill:var(--steel-lo);stroke:var(--ink);stroke-width:3;stroke-opacity:.4}
.batt-core{opacity:.95}
.cell{fill:var(--sheet);stroke:var(--batt-lo);stroke-width:2;opacity:.55}
.batt-charge{fill:var(--charge);opacity:.75}
.batt-glow{fill:none;stroke:var(--charge-hi);stroke-width:5;opacity:0;transition:opacity .3s}
/* inverter */
.inv-case{fill:var(--steel);stroke:var(--ink);stroke-width:3;stroke-opacity:.45}
.inv-face{fill:var(--sheet)}
.inv-wave{stroke:var(--copper);stroke-width:5;stroke-linecap:round}
.inv-dc,.inv-dc2{stroke:var(--charge);stroke-width:5;stroke-linecap:round}
.inv-led{fill:var(--charge-hi)}
/* HV cable + flow */
.hv-cable{stroke:var(--copper);stroke-width:16;stroke-linecap:round;opacity:.9}
.hv-cable-hi{stroke:var(--copper-hi);stroke-width:5;stroke-linecap:round;opacity:.7}
.hv-flow{stroke:var(--copper-hi);stroke-width:7;stroke-linecap:round;stroke-dasharray:6 34;opacity:0}
.hv-flow.charging{stroke:var(--charge-hi)}
.hv-none{stroke:none}
/* wheels */
.tyre{fill:#22262B;stroke:#101316;stroke-width:6}
.rim{fill:var(--steel-hi)} .rim.thin{opacity:.92}
.rim-edge{stroke:var(--steel-lo);stroke-width:5}
.spoke{fill:var(--steel-lo)} .spoke.thin{opacity:.9}
/* motor */
.stator{fill:var(--steel-lo);stroke:var(--copper-dk);stroke-width:4}
.tooth{fill:var(--copper)}
.rotor-core{fill:var(--steel);stroke:var(--steel-lo);stroke-width:3}
.magnet{fill:var(--copper-hi);stroke:var(--copper-dk);stroke-width:2}
.axle{fill:var(--ink)}
.drag-aura{fill:none;stroke:var(--charge-hi);stroke-width:7;stroke-dasharray:4 14;opacity:0}
/* brake disc */
.disc{fill:#6A7076}
.disc-ring{stroke:#43484D;stroke-width:4}
.disc-hole{fill:#43484D}
.disc-heat{opacity:0}
.caliper{fill:var(--heat-lo);stroke:var(--ink);stroke-width:2;stroke-opacity:.4}
/* pedal */
.pedal-arm{stroke:var(--steel-lo);stroke-width:10;stroke-linecap:round}
.pad{fill:var(--steel-lo);stroke:var(--ink);stroke-width:2;stroke-opacity:.5}
.pad-ribs{stroke:var(--steel-hi);stroke-width:4;stroke-linecap:round}
#stage *{pointer-events:none}
#stage .hit{pointer-events:all}
.hit{fill:transparent;stroke:none;pointer-events:all;cursor:grab}
/* chain navigation: the cable path with terminal posts */
.cable-seg{fill:none;stroke:var(--copper);stroke-width:5;opacity:.4;transition:opacity .25s, stroke .25s}
.link.lit .cable-seg{stroke:var(--charge-hi);opacity:1}
.marker .mhead{fill:var(--copper)} .marker .medge{stroke:var(--copper-hi);stroke-width:2} .marker .mshadow{fill:rgba(30,24,16,.34)}
.marker .mslot{stroke:#14181C;stroke-width:4;stroke-linecap:round;transition:transform .5s var(--ease-tactile);transform-box:view-box;transform-origin:0 0}
.marker.reached .mhead{fill:var(--charge)} .marker.here .mhead{fill:var(--charge-hi)}
.marker .hit{cursor:pointer}
.cue{fill:none;stroke:var(--copper-hi);stroke-width:5;opacity:0;transform-box:fill-box;transform-origin:center}
.cue.go{animation:cue 1.1s var(--ease-enter) 2}
@keyframes cue{0%{opacity:.95;transform:scale(.45)}100%{opacity:0;transform:scale(1.6)}}
.marker.pulse .mhead{animation:mpulse 2s var(--ease-enter)}
@keyframes mpulse{0%,100%{transform:scale(1)}50%{transform:scale(1.18)}}
/* spotlight veil */
#veil{position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity var(--dur-spot) var(--ease-enter);
  background:radial-gradient(ellipse var(--rx) var(--ry) at var(--cx) var(--cy),transparent 58%,var(--ground) 130%);}
#veil.on{opacity:.62}
body.explore #veil{opacity:0}
/* labels + leaders */
#lead{position:absolute;inset:0;pointer-events:none}
.leader{fill:none;stroke:var(--ink);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset 380ms var(--ease-enter)}
.leader.on{stroke-dashoffset:0}
#labels{position:absolute;inset:0;pointer-events:none}
.lab{position:absolute;left:0;top:0;padding:3px 9px 4px;background:var(--chip);color:var(--ink);font-size:16px;line-height:1.25;border-radius:3px;white-space:nowrap;opacity:0;transition:opacity 260ms ease;border-bottom:2px solid var(--copper)}
.lab.on{opacity:1}
/* top bar */
#topbar{position:absolute;top:calc(6px + env(safe-area-inset-top));left:8px;right:8px;display:flex;justify-content:space-between;pointer-events:none}
.tiny{pointer-events:auto;width:48px;height:44px;border:0;background:transparent;color:var(--muted);display:grid;place-items:center;cursor:pointer;border-radius:12px}
.tiny:focus-visible,button:focus-visible,input:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.th-track{fill:var(--sheet);stroke:var(--muted);stroke-width:1.5} .th-knob{fill:var(--copper)} .th-bolt{fill:var(--sheet)}
#th-knob{transition:transform var(--dur-tactile) var(--ease-tactile)}
/* sheet */
#sheet{position:absolute;background:var(--sheet);color:var(--ink);display:flex;flex-direction:column;box-shadow:0 -8px 30px rgba(0,0,0,.18)}
#copy{transition:opacity var(--dur-copy) var(--ease-enter),transform var(--dur-copy) var(--ease-enter)}
#sheet.hide #copy,#sheet.hide #touchrow{opacity:0;transform:translateY(8px)}
#sheet.hide #copy{display:none}
#touchrow{transition:opacity var(--dur-copy) var(--ease-enter)}
h1{font-family:"Libertine Display",serif;font-weight:400;margin:0;line-height:1.08;letter-spacing:-.005em}
#a{margin:0;line-height:1.38;font-size:16px} #nextq{margin:0;font-style:italic;color:var(--accent);font-size:16px;line-height:1.3;font-weight:700}
#simp{margin:0;font-size:14px;line-height:1.3;color:var(--muted)}
#hint{margin:0;font-size:16px;color:var(--muted);transition:opacity .5s} #sheet.lit #hint{opacity:0}
#touchrow{display:flex;align-items:center;gap:12px;justify-content:space-between}
#deepbtn{border:0;background:none;color:var(--accent);font:inherit;font-size:16px;min-height:44px;padding:0 4px;text-decoration:underline dotted;text-underline-offset:4px;cursor:pointer;margin-left:auto;white-space:nowrap;flex:none}
#slidewrap{flex:1;display:block}
#slide{width:100%;height:44px;background:none;-webkit-appearance:none;appearance:none}
#slide::-webkit-slider-runnable-track{height:8px;border-radius:4px;background:repeating-linear-gradient(90deg,var(--copper) 0 4px,transparent 4px 8px),linear-gradient(var(--muted),var(--muted));background-blend-mode:normal;opacity:.9}
#slide::-webkit-slider-thumb{-webkit-appearance:none;width:34px;height:34px;margin-top:-13px;border-radius:50%;background:var(--copper);border:3px solid var(--copper-dk);box-shadow:0 2px 5px rgba(0,0,0,.35)}
#slide::-moz-range-track{height:8px;border-radius:4px;background:var(--muted)} #slide::-moz-range-thumb{width:30px;height:30px;border-radius:50%;background:var(--copper);border:3px solid var(--copper-dk)}
#controls{display:flex;gap:10px;align-items:stretch}
#back{width:52px;height:56px;border-radius:14px;border:2px solid var(--muted);background:transparent;color:var(--ink);display:grid;place-items:center;cursor:pointer}
#back:disabled{opacity:.3;cursor:default}
#next{flex:1;height:56px;border-radius:16px;border:0;background:var(--steel);color:#fff;font:700 20px "Biolinum";display:flex;align-items:center;justify-content:center;gap:12px;cursor:pointer;
  box-shadow:0 5px 0 rgba(0,0,0,.35);transition:transform var(--dur-tactile) var(--ease-tactile),box-shadow var(--dur-tactile) var(--ease-tactile),background .3s;position:relative}
#next:active{transform:translateY(4px);box-shadow:0 1px 0 rgba(0,0,0,.35)}
:root[data-theme=dark] #next{color:#0d1218}
#next.lit{background:var(--charge);color:#0d1a10}
#next:not(.lit){visibility:hidden;opacity:0;transition:opacity .3s,visibility 0s .3s} #next.lit{transition:opacity var(--dur-copy) var(--ease-enter)}
/* the pedal that is the Next control */
.np-arm{stroke:currentColor;stroke-width:7;stroke-linecap:round;opacity:.85}
.np-pad{fill:currentColor}
.np-ribs{stroke:var(--steel);stroke-width:4;stroke-linecap:round}
#next.lit .np-ribs{stroke:var(--charge-hi)}
#npedal-arm{transform-origin:0 -34px;transform-box:view-box}
#npedal.flick #npedal-arm{animation:press .42s var(--ease-tactile)}
@keyframes press{0%{transform:rotate(0)}35%{transform:rotate(14deg)}100%{transform:rotate(0)}}
#next.lit #npedal #npedal-arm{animation:invite 2.6s ease-in-out 1s infinite}
@keyframes invite{0%,88%,100%{transform:rotate(0)}94%{transform:rotate(6deg)}}
#leave{flex:1;height:56px;border-radius:16px;border:2px solid var(--accent);background:transparent;color:var(--accent);font:700 18px "Biolinum";cursor:pointer}
body.explore #next,body.explore #back{display:none} body.explore #leave{display:block}
body.explore #touchrow{visibility:hidden}
#kbd{position:absolute;right:20px;bottom:18px;margin:0;font-size:14px;color:var(--muted);opacity:0;transition:opacity .6s;display:none}
#kbd.show{opacity:1} body:not(.phone) #kbd{display:block}
/* phone portrait */
body.phone:not(.land) #sheet{left:0;right:0;bottom:0;padding:14px 18px calc(12px + env(safe-area-inset-bottom));border-radius:22px 22px 0 0;gap:10px}
body.phone:not(.land) #sheet::before{content:"";position:absolute;top:6px;left:50%;width:44px;height:4px;border-radius:2px;background:var(--muted);opacity:.4}
body:not(.phone) #copy{display:flex;flex-direction:column;gap:14px}
body:not(.phone) h1{font-size:46px} body:not(.phone) #a{font-size:19px} body:not(.phone) #nextq{font-size:18px}
body:not(.phone) #topbar{right:calc(min(440px,34vw) + 8px)}
#nextq{opacity:0} #sheet.lit #nextq{opacity:1} #sheet.lit #hint{opacity:0}
#slidewrap{display:block} #slidewrap[hidden]{display:none!important}
#touchrow{align-items:center}
body.phone #touchrow{gap:6px}
/* landscape phone */
body.land #sheet{top:0;right:0;bottom:0;left:auto;width:min(50vw,420px);padding:12px 16px calc(10px + env(safe-area-inset-bottom));border-radius:22px 0 0 22px;gap:6px;overflow:hidden}
body.land h1{font-size:19px;line-height:1.08} body.land #a{font-size:16px;line-height:1.3} body.land #nextq{font-size:16px}
body.land #copy{gap:10px} body.land #next{height:44px} body.land #back{height:44px}
body.land #topbar{right:calc(min(50vw,420px) + 8px)}
body.land #prompt{min-height:36px}
body:not(.phone) #prompt{flex:1;min-width:0;min-height:60px}
/* desktop: full-bleed hero, copy in a card at the lower left */
body:not(.phone) #sheet{top:auto;right:auto;left:clamp(16px,2.4vw,40px);bottom:clamp(16px,3vh,36px);width:min(460px,36vw);max-height:calc(100dvh - 2*clamp(16px,3vh,36px));overflow-y:auto;padding:26px 30px 22px;gap:14px;justify-content:flex-start;border-radius:20px;border:1px solid color-mix(in srgb,var(--ink) 16%,transparent);box-shadow:0 18px 50px rgba(0,0,0,.28),0 2px 0 color-mix(in srgb,var(--ink) 10%,transparent);background:color-mix(in srgb,var(--sheet) 93%,transparent)}
body:not(.phone) #sheet::before{display:none}
body:not(.phone) h1{font-size:52px} body:not(.phone) #a{font-size:22px;line-height:1.4} body:not(.phone) #nextq{font-size:20px}
body:not(.phone) #sheet{width:min(500px,36vw)}
body:not(.phone) #topbar{right:calc(min(500px,36vw) + 8px)}
#peek{position:absolute;pointer-events:none;background:var(--chip);color:var(--ink);padding:5px 10px;border-radius:4px;border-bottom:2px solid var(--copper);font-size:16px;max-width:260px;opacity:0;transition:opacity .2s;z-index:5}
#peek.on{opacity:1}
body.phone:not(.land) h1{font-size:21px;line-height:1.08} body.phone:not(.land) #a{line-height:1.3} body.phone:not(.land) #next,body.phone:not(.land) #back{height:46px} body.phone:not(.land) #copy{gap:4px}
[hidden]{display:none!important}
#back.gone{display:none}
@media (min-width:900px) and (max-height:880px){
body:not(.phone) #sheet{padding:18px 22px 16px;gap:9px}
body:not(.phone) h1{font-size:clamp(22px,2.6vw,30px)}
body:not(.phone) #a{font-size:clamp(14px,1.3vw,16px);line-height:1.42}
body:not(.phone) #hint{font-size:13px} body:not(.phone) #nextq{font-size:15px}
}
@media (prefers-reduced-motion:reduce){.cue.go{animation-duration:.01s}#next.lit #npedal #npedal-arm{animation:none}}
