/* ============================================================
   KAIRO — カイロ ｜ wedelab showcase (fictional EV / mobility)
   Layout : horizontal chapter track (vertical scroll → translateX pin)
   Tech    : Canvas 2D electric energy-flow · spec odometer · SVG range arc
   Palette : graphite/near-black #0e1013 + ONE electric orange #ff5a1f + steel/ice
   Type    : Sora (EN display) · Zen Kaku Gothic New (JP) · Space Mono (spec)
   Self-contained. Default = readable vertical stack; JS opts into pin mode.
   ============================================================ */

:root{
  --bg:#0e1013;
  --bg-2:#121519;
  --bg-3:#171b20;
  --bg-4:#1e242b;
  --ice:#eef2f6;
  --steel:#9aa6b2;
  --steel-dim:#616d79;
  --amber:#ff5a1f;
  --amber-hi:#ff8654;
  --amber-deep:#d63f0c;
  --line:rgba(255,255,255,.09);
  --line-amber:rgba(255,90,31,.30);
  --en:"Sora", system-ui, sans-serif;
  --jp:"Zen Kaku Gothic New", sans-serif;
  --mono:"Space Mono", ui-monospace, monospace;
  --ease:cubic-bezier(.22,.75,.28,1);
  --smooth:cubic-bezier(.4,0,.15,1);
  --gut: clamp(22px, 5vw, 90px);
}

*{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
html:not(.hmode){ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--bg);
  color:var(--ice);
  font-family:var(--jp);
  font-weight:400;
  line-height:1.75;
  letter-spacing:.01em;
  overflow-x:hidden;
}
html.hmode body{ cursor:none; }
@media (max-width:820px){ html.hmode body{ cursor:auto; } }
img,canvas,svg{ display:block; max-width:100%; }
a{ color:inherit; text-decoration:none; }
em{ font-style:normal; }

/* ---------- persistent energy-flow canvas ---------- */
.flow-canvas{ position:fixed; inset:0; width:100%; height:100%; z-index:0; pointer-events:none; }
.flow-veil{
  position:fixed; inset:0; z-index:1; pointer-events:none;
  background:
    radial-gradient(120% 90% at 50% 46%, transparent 0%, rgba(14,16,19,.35) 62%, rgba(14,16,19,.9) 100%),
    linear-gradient(180deg, rgba(14,16,19,.5) 0%, transparent 22%, transparent 74%, rgba(14,16,19,.85) 100%);
}

/* ---------- journey progress ---------- */
.progress{ position:fixed; top:0; left:0; right:0; height:3px; z-index:120; background:rgba(255,255,255,.05); }
.progress i{
  display:block; height:100%; width:0%;
  background:linear-gradient(90deg,var(--amber-deep),var(--amber),var(--amber-hi));
  box-shadow:0 0 14px rgba(255,90,31,.6);
  transition:width .12s linear;
}

/* ---------- custom cursor (electric) ---------- */
.cursor,.cursor-dot{ position:fixed; top:0; left:0; z-index:130; pointer-events:none; will-change:transform; opacity:0; transition:opacity .3s; }
html.hmode .cursor,html.hmode .cursor-dot{ opacity:1; }
.cursor{
  width:30px; height:30px; margin:-15px 0 0 -15px; border-radius:50%;
  border:1.5px solid var(--amber);
  transition:width .22s var(--smooth), height .22s var(--smooth), margin .22s var(--smooth),
             background .25s, opacity .3s;
}
.cursor-dot{ width:5px; height:5px; margin:-2.5px 0 0 -2.5px; background:var(--amber); border-radius:50%; box-shadow:0 0 10px var(--amber); }
.cursor.hot{ width:54px; height:54px; margin:-27px 0 0 -27px; background:rgba(255,90,31,.10); border-color:var(--amber-hi); }
@media (max-width:820px){ .cursor,.cursor-dot{ display:none; } }

/* ---------- loader ---------- */
.loader{
  position:fixed; inset:0; z-index:200; display:grid; place-items:center; gap:18px;
  align-content:center; background:var(--bg);
  transition:opacity .55s var(--ease), visibility .55s;
}
.loader.done{ opacity:0; visibility:hidden; }
.loader-mark{ font-family:var(--en); font-weight:800; font-size:clamp(44px,10vw,104px); line-height:.9; letter-spacing:.14em; color:var(--ice); padding-left:.14em; }
.loader-bar{ width:min(240px,54vw); height:3px; background:rgba(255,255,255,.09); overflow:hidden; }
.loader-bar span{ display:block; height:100%; width:0%; background:linear-gradient(90deg,var(--amber),var(--amber-hi)); box-shadow:0 0 12px var(--amber); animation:load 1s var(--smooth) forwards; }
@keyframes load{ to{ width:100%; } }
.loader-sub{ font-family:var(--mono); font-size:10px; letter-spacing:.36em; color:var(--steel-dim); }

/* ---------- floating nav ---------- */
.nav{
  position:fixed; top:0; left:0; right:0; z-index:100;
  display:flex; align-items:center; justify-content:space-between; gap:24px;
  padding:16px var(--gut);
  transition:background .4s var(--ease), backdrop-filter .4s, padding .35s, border-color .4s;
  border-bottom:1px solid transparent;
}
.nav.scrolled{
  background:rgba(14,16,19,.72);
  backdrop-filter:blur(14px) saturate(1.1);
  -webkit-backdrop-filter:blur(14px) saturate(1.1);
  border-bottom:1px solid var(--line);
  padding-top:11px; padding-bottom:11px;
}
.brand{ display:flex; flex-direction:column; line-height:1; }
.brand-mark{ font-family:var(--en); font-weight:800; font-size:23px; letter-spacing:.2em; color:var(--ice); padding-left:.2em; }
.brand-sub{ font-family:var(--mono); font-size:9px; letter-spacing:.24em; color:var(--steel-dim); margin-top:6px; }
.nav-links{ display:flex; gap:30px; }
.nav-links a{ font-family:var(--jp); font-weight:700; font-size:13px; letter-spacing:.06em; color:var(--steel); position:relative; transition:color .25s; }
.nav-links a::after{ content:""; position:absolute; left:0; bottom:-6px; width:0; height:2px; background:var(--amber); transition:width .32s var(--ease); }
.nav-links a:hover,.nav-links a.on{ color:var(--ice); }
.nav-links a:hover::after,.nav-links a.on::after{ width:100%; }
.nav-cta{
  font-family:var(--mono); font-weight:700; font-size:11px; letter-spacing:.14em;
  padding:9px 18px; border:1.5px solid var(--amber); color:var(--amber);
  transition:background .25s, color .25s, box-shadow .25s;
}
.nav-cta b{ font-style:normal; transition:transform .25s var(--smooth); display:inline-block; }
.nav-cta:hover{ background:var(--amber); color:var(--bg); box-shadow:0 8px 26px -10px rgba(255,90,31,.75); }
.nav-cta:hover b{ transform:translateX(4px); }
@media (max-width:820px){ .nav-links{ display:none; } }

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:10px;
  font-family:var(--mono); font-weight:700; font-size:12px; letter-spacing:.12em; text-transform:uppercase;
  padding:15px 28px; position:relative;
  transition:transform .3s var(--smooth), color .25s, box-shadow .3s, background .25s, border-color .25s;
}
.btn b{ font-style:normal; transition:transform .3s var(--smooth); }
.btn:hover{ transform:translateY(-2px); }
.btn:hover b{ transform:translateX(5px); }
.btn-fill{ color:var(--bg); background:var(--amber); box-shadow:0 10px 30px -12px rgba(255,90,31,.8); }
.btn-fill:hover{ background:var(--amber-hi); box-shadow:0 18px 42px -14px rgba(255,90,31,.95); }
.btn-ghost{ color:var(--ice); border:1.5px solid var(--line); }
.btn-ghost:hover{ border-color:var(--amber); color:var(--amber); }

/* ============================================================
   HORIZONTAL TRACK — default (no-JS / mobile) = vertical stack
   ============================================================ */
.hscroll{ position:relative; z-index:2; }
.pin{ position:static; }
.rail{ display:block; }
.panel{
  position:relative; width:100%; overflow:hidden;
  min-height:auto; padding:clamp(96px,14vh,150px) var(--gut) clamp(64px,10vh,110px);
  display:flex; flex-direction:column; justify-content:center;
  border-top:1px solid var(--line);
}
.panel:first-child{ border-top:0; }
.panel-inner{ width:100%; max-width:1180px; margin:0 auto; }
.ch-anchor{ display:none; }

/* ---- pin mode (desktop, JS on) ---- */
html.hmode .hscroll{ height:calc(var(--panels) * 100vh); }
html.hmode .pin{ position:sticky; top:0; height:100vh; overflow:hidden; }
html.hmode .rail{ display:flex; height:100vh; width:max-content; will-change:transform; }
html.hmode .panel{
  flex:0 0 100vw; width:100vw; height:100vh; min-height:100vh;
  padding:clamp(96px,13vh,140px) var(--gut) clamp(56px,8vh,96px);
  border-top:0; overflow:hidden;
}
html.hmode .ch-anchor{ display:block; position:absolute; left:0; width:1px; height:1px; }

/* ---------- shared type ---------- */
.eyebrow{ font-family:var(--mono); font-weight:700; font-size:clamp(10px,1.05vw,12px); letter-spacing:.28em; color:var(--amber); margin:0 0 clamp(16px,2.6vh,28px); }
.kicker{ font-family:var(--mono); font-weight:700; font-size:11px; letter-spacing:.24em; text-transform:uppercase; color:var(--amber); margin:0 0 18px; }
.panel-title{ font-family:var(--jp); font-weight:900; line-height:1.16; font-size:clamp(28px,4.4vw,58px); margin:0 0 18px; letter-spacing:.005em; }
.panel-title em{ font-style:normal; color:var(--amber); }
.panel-body{ font-family:var(--jp); font-weight:500; color:var(--steel); font-size:clamp(14px,1.4vw,17px); max-width:38em; margin:0 0 clamp(22px,3.4vh,34px); line-height:1.95; }
.panel-body b{ color:var(--ice); font-weight:700; }

/* ---------- PANEL 00 · INTRO ---------- */
.intro-inner{ position:relative; z-index:2; max-width:1120px; }
.hero-title{ font-family:var(--en); font-weight:800; font-size:clamp(58px,12vw,180px); line-height:.9; letter-spacing:.005em; margin:0; text-transform:uppercase; }
.hero-title .line{ display:block; }
.hero-title em{ font-style:normal; color:var(--amber); text-shadow:0 0 60px rgba(255,90,31,.4); }
.hero-jp{ font-family:var(--jp); font-weight:900; font-size:clamp(22px,4vw,52px); letter-spacing:.02em; line-height:1.14; margin:clamp(16px,3vh,30px) 0 0; }
.hero-jp .hl{ color:var(--bg); background:var(--amber); padding:0 .16em; margin:0 .04em; box-decoration-break:clone; -webkit-box-decoration-break:clone; }
.hero-lede{ font-family:var(--jp); font-weight:500; font-size:clamp(14px,1.5vw,18px); color:var(--steel); max-width:34em; margin:clamp(18px,3vh,30px) 0 clamp(26px,4vh,36px); line-height:1.9; }
.hero-actions{ display:flex; gap:14px; flex-wrap:wrap; }
.hero-pills{ list-style:none; display:flex; flex-wrap:wrap; gap:clamp(20px,4vw,56px); margin:clamp(30px,5vh,48px) 0 0; padding:22px 0 0; border-top:1px solid var(--line); }
.hero-pills li{ display:flex; flex-direction:column; gap:5px; }
.hero-pills b{ font-family:var(--en); font-weight:800; font-size:clamp(30px,4vw,50px); line-height:.9; color:var(--ice); letter-spacing:.01em; }
.hero-pills span{ font-family:var(--mono); font-size:10px; letter-spacing:.14em; color:var(--steel-dim); }
.scroll-hint{ position:absolute; left:var(--gut); bottom:clamp(20px,4vh,42px); z-index:2; display:flex; align-items:center; gap:12px; font-family:var(--mono); font-weight:700; font-size:10px; letter-spacing:.22em; color:var(--steel-dim); }
.scroll-hint i{ width:46px; height:2px; background:linear-gradient(90deg,var(--amber),transparent); animation:zip 1.9s var(--ease) infinite; }
.scroll-hint .hint-jp{ font-family:var(--jp); font-weight:700; letter-spacing:.08em; color:var(--steel); }
@keyframes zip{ 0%{ transform:translateX(0); opacity:1; } 60%{ transform:translateX(20px); opacity:.15; } 100%{ transform:translateX(0); opacity:1; } }
@media (max-width:820px){ .scroll-hint{ position:static; margin-top:36px; } }
.car-ghost{
  position:absolute; right:clamp(-40px,-2vw,0px); bottom:clamp(10px,7vh,80px); z-index:1;
  width:min(52vw,640px); height:auto; opacity:.5; pointer-events:none;
}
.car-ghost .car-body,.car-ghost .car-glass{ fill:none; stroke:var(--steel-dim); stroke-width:1.6; vector-effect:non-scaling-stroke; }
.car-ghost .car-glass{ stroke:var(--amber); opacity:.7; }
.car-ghost .wheel{ fill:none; stroke:var(--steel); stroke-width:2; vector-effect:non-scaling-stroke; }
@media (max-width:820px){ .car-ghost{ position:static; width:100%; margin-top:30px; opacity:.4; } }

/* reveal-on-load (NOT scroll-gated) */
.reveal-now{ opacity:0; transform:translateY(28px); animation:riseIn .85s var(--ease) forwards; animation-delay:var(--d,0s); }
@keyframes riseIn{ to{ opacity:1; transform:none; } }

/* ---------- PANEL 01 · DRIVE ---------- */
.panel-drive .panel-inner{ position:relative; }
.drive-metrics{ display:flex; flex-wrap:wrap; gap:clamp(22px,4vw,60px); margin:6px 0 0; padding-top:26px; border-top:1px solid var(--line); }
.dm{ display:flex; flex-direction:column; gap:6px; }
.dm b{ font-family:var(--en); font-weight:800; font-size:clamp(34px,4.4vw,60px); line-height:.9; color:var(--ice); }
.dm span{ font-family:var(--mono); font-size:10.5px; letter-spacing:.08em; color:var(--steel-dim); }
.drive-wave{ position:absolute; left:0; right:0; bottom:-6vh; width:100%; height:clamp(80px,14vh,130px); opacity:.9; z-index:0; pointer-events:none; }
#drive-path{ filter:drop-shadow(0 0 7px rgba(255,90,31,.5)); stroke-dasharray:2400; stroke-dashoffset:2400; }
.panel-drive.lit #drive-path{ transition:stroke-dashoffset 1.7s var(--smooth); stroke-dashoffset:0; }
@media (max-width:820px){ .drive-wave{ position:static; margin-top:34px; bottom:auto; height:110px; } }

/* ---------- PANEL 02 · RANGE ---------- */
.range-inner{ display:grid; grid-template-columns:1.05fr .95fr; gap:clamp(30px,5vw,80px); align-items:center; }
.range-facts{ list-style:none; padding:0; margin:6px 0 0; }
.range-facts li{ display:flex; justify-content:space-between; gap:20px; padding:12px 0; border-bottom:1px solid var(--line); }
.rf-k{ font-family:var(--mono); font-size:10.5px; letter-spacing:.14em; color:var(--amber); }
.rf-v{ font-family:var(--jp); font-weight:500; font-size:14px; color:var(--ice); }
.range-viz{ display:flex; flex-direction:column; align-items:center; gap:26px; }
.range-arc{ width:min(78%,320px); height:auto; overflow:visible; }
.arc-track{ stroke:var(--bg-4); stroke-width:14; stroke-linecap:round; }
.arc-fill{ stroke:var(--amber); stroke-width:14; stroke-linecap:round; filter:drop-shadow(0 0 8px rgba(255,90,31,.5)); }
.arc-num{ font-family:var(--en); font-weight:800; font-size:56px; fill:var(--ice); }
.arc-unit{ font-family:var(--mono); font-size:11px; letter-spacing:.1em; fill:var(--steel-dim); }
.charge{ display:flex; align-items:center; gap:18px; }
.charge-ring{ width:96px; height:96px; overflow:visible; }
.cr-track{ stroke:var(--bg-4); stroke-width:9; }
.cr-fill{ stroke:var(--amber-hi); stroke-width:9; stroke-linecap:round; filter:drop-shadow(0 0 6px rgba(255,134,84,.5)); }
.cr-num{ font-family:var(--en); font-weight:700; font-size:24px; fill:var(--ice); }
.charge-cap{ font-family:var(--jp); font-weight:500; font-size:13.5px; color:var(--steel); margin:0; }
.charge-cap b{ color:var(--amber); font-weight:700; }
@media (max-width:900px){ .range-inner{ grid-template-columns:1fr; } .range-viz{ margin-top:20px; } }

/* ---------- PANEL 03 · SPEC ---------- */
.spec-lede{ margin-bottom:clamp(26px,4vh,40px); }
.spec-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:clamp(12px,1.8vw,24px); max-width:1120px; }
.spec{ position:relative; padding:clamp(22px,2.4vw,34px) clamp(18px,1.8vw,26px); border:1px solid var(--line); background:rgba(23,27,32,.6); transition:border-color .4s, transform .4s var(--ease), background .4s; }
.spec::before{ content:""; position:absolute; left:0; top:0; width:0; height:3px; background:var(--amber); transition:width .6s var(--smooth); }
html.hmode .panel-spec.lit .spec::before{ width:100%; }
.spec:hover{ border-color:var(--line-amber); transform:translateY(-4px); background:rgba(30,36,43,.7); }
.spec b.odo{ display:block; font-family:var(--en); font-weight:800; font-size:clamp(44px,5.4vw,80px); line-height:.86; color:var(--ice); letter-spacing:.005em; }
.spec-unit{ display:inline-block; font-family:var(--mono); font-weight:700; font-size:clamp(13px,1.3vw,16px); color:var(--amber); margin-top:6px; letter-spacing:.04em; }
.spec-label{ display:block; font-family:var(--jp); font-weight:500; font-size:12.5px; color:var(--steel-dim); margin-top:14px; line-height:1.6; }
@media (max-width:820px){ .spec-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:520px){ .spec-grid{ grid-template-columns:1fr; } }

/* ---------- PANEL 04 · RESERVE ---------- */
.reserve-inner{ max-width:880px; }
.reserve-form{ display:flex; flex-wrap:wrap; gap:14px; align-items:flex-end; margin:0 0 clamp(28px,4vh,40px); }
.fld{ display:flex; flex-direction:column; gap:8px; text-align:left; flex:1 1 200px; min-width:150px; }
.fld span{ font-family:var(--mono); font-weight:700; font-size:10px; letter-spacing:.14em; color:var(--amber); text-transform:uppercase; }
.fld input,.fld select{ font-family:var(--jp); font-weight:500; font-size:15px; color:var(--ice); background:var(--bg-3); border:1px solid var(--line); padding:14px 16px; transition:border-color .25s; }
html.hmode .fld input,html.hmode .fld select{ cursor:none; }
.fld input::placeholder{ color:var(--steel-dim); }
.fld input:focus,.fld select:focus{ outline:none; border-color:var(--amber); }
.reserve-form .btn-fill{ flex:0 0 auto; }
.form-note{ flex:1 1 100%; font-family:var(--mono); font-size:12px; letter-spacing:.05em; color:var(--amber-hi); min-height:1em; margin:2px 0 0; }
.access{ display:flex; flex-wrap:wrap; gap:clamp(22px,5vw,60px); border-top:1px solid var(--line); padding-top:28px; }
.access > div{ display:flex; flex-direction:column; gap:6px; }
.ac-k{ font-family:var(--mono); font-weight:700; font-size:10px; letter-spacing:.18em; color:var(--amber); }
.ac-v{ font-family:var(--jp); font-weight:500; color:var(--steel); font-size:14px; }
@media (max-width:820px){ html.hmode .fld input,html.hmode .fld select{ cursor:auto; } }

/* ---------- footer ---------- */
.foot{ position:relative; z-index:2; border-top:1px solid var(--line); padding:clamp(44px,7vh,76px) var(--gut); background:var(--bg-2); }
.foot-inner{ display:flex; flex-wrap:wrap; gap:28px; align-items:flex-start; justify-content:space-between; max-width:1320px; margin:0 auto; }
.foot-brand{ display:flex; flex-direction:column; }
.foot-links{ display:flex; gap:24px; flex-wrap:wrap; }
.foot-links a{ font-family:var(--jp); font-weight:700; font-size:13px; color:var(--steel); transition:color .25s; }
.foot-links a:hover{ color:var(--amber); }
.foot-note{ font-family:var(--mono); font-size:11px; letter-spacing:.04em; color:var(--steel-dim); line-height:2; margin:0; text-align:right; }
.foot-note b{ color:var(--amber); font-weight:700; }
@media (max-width:760px){ .foot-note{ text-align:left; } }

/* ---------- scroll reveal (vertical / mobile below-the-fold) ---------- */
.reveal{ opacity:0; transform:translateY(34px); transition:opacity .7s var(--ease), transform .8s var(--ease); }
.reveal.in{ opacity:1; transform:none; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  *{ animation:none !important; transition:none !important; scroll-behavior:auto !important; }
  .reveal,.reveal-now{ opacity:1 !important; transform:none !important; }
  .loader{ display:none !important; }
  .loader-bar span{ width:100%; }
  #drive-path{ stroke-dashoffset:0 !important; }
  .scroll-hint i{ background:var(--amber); }
}
