/* YOU ARE THE CURRENT — carbon #0A0A0C, sapphire #0B4FFF, tangerine #FF6A00, silver #C9CDD4 */

:root {
  --carbon: #0a0a0c;
  --sapphire: #0b4fff;
  --tangerine: #ff6a00;
  --silver: #c9cdd4;
  --silver-dim: rgba(201, 205, 212, 0.55);
  --line: rgba(201, 205, 212, 0.14);
  --disp: "Chakra Petch", sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: auto; }
body {
  background: var(--carbon);
  color: var(--silver);
  font-family: var(--mono);
  overflow-x: hidden;
}
::selection { background: var(--tangerine); color: var(--carbon); }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
#track { height: 700vh; }
body.static #track { display: none; }
body.static #gl { display: none; }

/* ---------------- ECU boot preloader ---------------- */

#boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--carbon);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .8s ease, visibility .8s;
}
#boot.off { opacity: 0; visibility: hidden; }
#boot-log {
  font-family: var(--mono);
  font-size: clamp(11px, 1.4vw, 14px);
  line-height: 1.9;
  color: var(--silver-dim);
  white-space: pre-wrap;
  min-width: min(560px, 84vw);
}
#boot-log .ok { color: var(--sapphire); }
#boot-log .armed { color: var(--tangerine); font-weight: 600; }

/* ---------------- silkscreen copy ---------------- */

#hud { position: relative; z-index: 2; pointer-events: none; }

.sk {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 7vw;
  max-width: 720px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(36px);
}
.sk.on { opacity: 1; visibility: visible; transform: none; }
.sk {
  transition: opacity .7s cubic-bezier(.22,1,.36,1),
              transform .7s cubic-bezier(.22,1,.36,1),
              visibility .7s;
}
.sk.right { margin-left: auto; text-align: right; align-items: flex-end; }
.sk.center { margin: 0 auto; text-align: center; align-items: center; max-width: 900px; }
.sk > * { pointer-events: auto; }

.ref {
  font-size: 11px;
  letter-spacing: .34em;
  color: var(--silver-dim);
  margin-bottom: 18px;
}

h1, h2 {
  font-family: var(--disp);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1.02;
  color: var(--silver);
  /* silkscreen: leggero alone come serigrafia su soldermask */
  text-shadow: 0 0 18px rgba(201,205,212,.12);
}
h1 { font-size: clamp(40px, 7vw, 96px); }
h2 { font-size: clamp(30px, 4.8vw, 64px); }
.sk.center h2 { font-size: clamp(70px, 14vw, 200px); color: var(--tangerine); }

/* copper trace underline: conduce luce in hover */
.u {
  display: block;
  height: 3px;
  margin-top: 16px;
  background:
    linear-gradient(90deg, transparent 0 8%, #b87333 8% 92%, transparent 92%);
  position: relative;
  overflow: hidden;
}
.sk.right .u { margin-left: auto; }
.u::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--tangerine), transparent);
  transform: translateX(-110%);
}
h1:hover .u::after, h2:hover .u::after {
  animation: conduct 1s cubic-bezier(.22,1,.36,1);
}
@keyframes conduct { to { transform: translateX(110%); } }

.body {
  margin-top: 22px;
  font-size: clamp(13px, 1.4vw, 16px);
  line-height: 1.8;
  color: var(--silver-dim);
  max-width: 34em;
}

.cta-row { margin-top: 40px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.cta {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .18em;
  text-decoration: none;
  color: var(--carbon);
  background: var(--tangerine);
  padding: 16px 30px;
  border: 1px solid var(--tangerine);
  box-shadow: 0 0 22px rgba(255,106,0,.35);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease;
}
.cta:hover { transform: translateY(-3px); box-shadow: 0 0 40px rgba(255,106,0,.6); }
.cta.ghost {
  color: var(--silver);
  background: transparent;
  border-color: var(--line);
  box-shadow: none;
}
.cta.ghost:hover { border-color: var(--sapphire); box-shadow: 0 0 22px rgba(11,79,255,.35); }

/* ---------------- oscilloscope timeline ---------------- */

#scope-wrap {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  height: 84px;
  background: rgba(10,10,12,.78);
  border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: crosshair;
}
#scope { width: 100%; height: 100%; display: block; }
#scope-labels {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  padding: 6px 12px 0;
  pointer-events: none;
  font-size: 9px;
  letter-spacing: .3em;
  color: var(--silver-dim);
}
body.static #scope-wrap { display: none; }

/* ---------------- probe cursor ---------------- */

#probe { display: none; }
@media (pointer: fine) {
  body.live { cursor: none; }
  body.live a, body.live button { cursor: none; }
  body.live #probe {
    display: block;
    position: fixed;
    left: 0; top: 0;
    z-index: 90;
    pointer-events: none;
  }
  #probe .cross {
    position: absolute;
    width: 26px; height: 26px;
    transform: translate(-50%, -50%);
  }
  #probe .cross::before, #probe .cross::after {
    content: "";
    position: absolute;
    background: var(--sapphire);
  }
  #probe .cross::before { left: 50%; top: 0; bottom: 0; width: 1px; }
  #probe .cross::after { top: 50%; left: 0; right: 0; height: 1px; }
  #probe.hot .cross::before, #probe.hot .cross::after { background: var(--tangerine); }
  #probe .readout {
    position: absolute;
    left: 18px; top: 14px;
    font-size: 10px;
    letter-spacing: .12em;
    white-space: nowrap;
    color: var(--sapphire);
    background: rgba(10,10,12,.85);
    border: 1px solid var(--line);
    padding: 4px 8px;
  }
  #probe.hot .readout { color: var(--tangerine); border-color: rgba(255,106,0,.5); }
}

/* ---------------- hum toggle ---------------- */

#hum {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 6;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--silver-dim);
  background: rgba(10,10,12,.6);
  border: 1px solid var(--line);
  padding: 8px 12px;
  cursor: pointer;
}
#hum[aria-pressed="true"] { color: var(--tangerine); border-color: rgba(255,106,0,.5); }

/* ---------------- static fallback ---------------- */

body.static .sk {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  min-height: 70vh;
  border-bottom: 1px solid var(--line);
  margin: 0 auto;
  max-width: 860px;
}
body.static .sk.right { margin: 0 auto; }
body.static #probe, body.static #hum { display: none; }

@media (prefers-reduced-motion: reduce) {
  .sk, .u::after, .cta { transition: none; animation: none !important; }
}
