/* Jimmy's Ride — head-up display, designed on a 2560 × 1000 (2.56:1) canvas.
   Projected layer only: speed, next manoeuvre and driver assistance. */

.hud {
  color: var(--text-value);
  background: #02050a;
}

/* ---------- Night road scene ---------- */

.hud-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 52% at 50% 100%, rgba(16, 62, 108, 0.35), transparent 70%),
    linear-gradient(180deg, #010309 0%, #04101f 48%, #071a2a 58%, #02050a 100%);
}

.hud-sky {
  position: absolute;
  inset: 0 0 42%;
  background:
    radial-gradient(50% 44% at 50% 100%, rgba(56, 189, 248, 0.3), transparent 72%),
    linear-gradient(180deg, #020409 0%, #04101c 46%, #0b2233 100%);
}

.hud-city {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

.hud-horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: 44%;
  height: 20%;
  background: radial-gradient(56% 44% at 50% 72%, rgba(56, 189, 248, 0.38), transparent 70%);
  filter: blur(0.5cqw);
}

.hud-road {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 46%;
  background:
    linear-gradient(180deg, rgba(26, 50, 70, 0.95) 0%, rgba(12, 24, 35, 0.96) 38%, #04070b 100%),
    radial-gradient(52% 34% at 50% 0%, rgba(56, 189, 248, 0.22), transparent 70%);
  clip-path: polygon(37.5% 0, 62.5% 0, 100% 100%, 0 100%);
}

.hud-road::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(125, 220, 255, 0.06) 50%, transparent 70%);
}

.hud-markings,
.hud-traffic {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hud-hood {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -8%;
  height: 30%;
  border-radius: 50% 50% 0 0 / 26% 26% 0 0;
  background:
    radial-gradient(56% 100% at 50% 0%, rgba(120, 180, 240, 0.22), transparent 58%),
    radial-gradient(60% 110% at 50% 12%, #121c26 0%, #060a10 58%, #010204 100%);
  box-shadow:
    0 -1px 0 rgba(125, 220, 255, 0.26),
    0 -1.4cqw 4cqw rgba(0, 0, 0, 0.92),
    inset 0 0.3cqw 2cqw rgba(125, 220, 255, 0.05);
}

.hud-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 46%, transparent 30%, rgba(0, 0, 0, 0.52) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 18%, transparent 78%, rgba(0, 0, 0, 0.4) 100%);
}

/* ---------- Projected interface ---------- */

.hud-grid {
  position: absolute;
  left: 6%;
  right: 6%;
  /* Design-space base (16 px on the 2560 canvas). Set here rather than on
     .hud so the unit resolves against the screen, and every inherited line
     box scales identically in the band and on the standalone page. */
  font-size: 0.625cqw;
  /* Balance on the shorter 2560 × 562 canvas: the speed glyph's ink box
     reaches above its line box, so the block sits slightly higher than 24 %
     to keep equal clear space above and below. Shared by band and page. */
  top: 21.9%;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  text-shadow:
    0 0 1.4cqw rgba(2, 10, 20, 0.9),
    0 0 0.3cqw rgba(2, 10, 20, 0.9),
    0 0 1.6cqw rgba(125, 220, 255, 0.18);
}

.hud-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* The speed and its unit share one text baseline, the same rule as every
   other inline value + unit reading on the five surfaces. */
.hud-speed {
  display: flex;
  align-items: baseline;
  gap: 0.8cqw;
}

.hud-speed strong {
  font-size: 7.2cqw;
  font-weight: 200;
  line-height: 0.8;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.hud-speed span {
  font: 500 1cqw/1 var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--text-unit);
}

.hud-subline {
  /* Clears the descent of the 62 km/h hero above it; the reading-row rule
     requires the caption and value boxes never to intersect. */
  margin: 1.8cqw 0 0;
  font: 500 0.8cqw/1 var(--font);
  letter-spacing: 0.08em;
  color: var(--text-label);
}

/* Inline value + unit tokens inside HUD readings use the same two tokens as
   the screens: ink for the number, the one neutral unit ink for its unit. */
.hud-subline b,
.hud-then b {
  font-weight: 500;
  color: var(--text-value);
}

.hud-subline em,
.hud-then em {
  font: 500 0.7cqw/1 var(--font);
  font-variant-numeric: tabular-nums;
  font-style: normal;
  color: var(--text-unit);
}

/* Navigation cluster */

.hud-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 0.4cqw;
}

.hud-turn {
  color: var(--cyan-bright);
  filter: drop-shadow(0 0 1cqw rgba(56, 189, 248, 0.6));
}

.hud-turn svg {
  width: 4.5cqw;
  height: 4.5cqw;
}

.hud-distance {
  margin-top: 0.35cqw;
  font-size: 2.9cqw;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.hud-distance em {
  margin-left: 0.22cqw;
  font: 500 1.1cqw/1 var(--font);
  font-variant-numeric: tabular-nums;
  font-style: normal;
  color: var(--text-unit);
  letter-spacing: 0.02em;
}

.hud-road-name {
  margin-top: 0.45cqw;
  font: 600 0.92cqw/1 var(--font);
  letter-spacing: 0.16em;
  color: var(--text-value);
  white-space: nowrap;
}

.hud-lanes {
  display: flex;
  align-items: flex-end;
  gap: 0.5cqw;
  height: 1.8cqw;
  margin-top: 0.85cqw;
}

.hud-lanes span {
  display: block;
  width: 0.9cqw;
  height: 100%;
  background: rgba(232, 245, 255, 0.28);
  clip-path: polygon(50% 0, 100% 40%, 62% 40%, 62% 100%, 38% 100%, 38% 40%, 0 40%);
}

.hud-lanes span.is-active {
  background: linear-gradient(180deg, #dff7ff, #38bdf8);
  filter: drop-shadow(0 0 0.6cqw rgba(56, 189, 248, 0.7));
}

.hud-then {
  margin: 0.75cqw 0 0;
  font: 500 0.72cqw/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--text-prose);
}

/* Status cluster */

.hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hud-limit {
  display: grid;
  place-items: center;
  width: 4.8cqw;
  height: 4.8cqw;
  border: 0.2cqw solid rgba(255, 107, 90, 0.92);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  box-shadow:
    inset 0 0 0 0.1cqw rgba(255, 255, 255, 0.45),
    0 0 1.4cqw -0.2cqw rgba(255, 107, 90, 0.4);
}

.hud-limit span {
  font-size: 2.4cqw;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hud-adas {
  display: flex;
  align-items: center;
  gap: 0.45cqw;
  margin-top: 0.9cqw;
  color: var(--text-live);
}

.hud-adas svg {
  width: 1.15cqw;
  height: 1.15cqw;
}

.hud-adas span {
  font: 500 0.72cqw/1 var(--font);
  letter-spacing: 0.06em;
  color: var(--text-label);
}

/* ---------- Review guides ---------- */

.hud-guides {
  position: absolute;
  inset: 12% 5%;
  z-index: 3;
  border: 1px dashed rgba(125, 220, 255, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease);
}

.hud-guides::before {
  content: "";
  position: absolute;
  left: 33.33%;
  right: 33.33%;
  top: 0;
  bottom: 0;
  border-left: 1px dashed rgba(125, 220, 255, 0.16);
  border-right: 1px dashed rgba(125, 220, 255, 0.16);
}

.hud-guide-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(125, 220, 255, 0.1);
}

.hud-guide-label {
  position: absolute;
  left: -1px;
  top: -2.6cqw;
  font: 500 0.56cqw/1 var(--font);
  letter-spacing: 0.02em;
  color: rgba(125, 220, 255, 0.62);
  white-space: nowrap;
}

body:has(#guidesToggle:checked) .hud-guides {
  opacity: 1;
}

/* ---------- Guides toggle ---------- */

.guide-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  cursor: pointer;
  color: var(--muted);
  font-size: inherit;
  letter-spacing: inherit;
  transition: color 0.2s var(--ease);
}

.guide-toggle:hover {
  color: var(--ink-dim);
}

.guide-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.guide-toggle i {
  position: relative;
  display: block;
  width: 22px;
  height: 12px;
  border: 1px solid var(--hair-strong);
  border-radius: 999px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.guide-toggle i::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--muted);
  transition: left 0.2s var(--ease), background 0.2s var(--ease);
}

.guide-toggle input:checked + i {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.14);
}

.guide-toggle input:checked + i::after {
  left: 12px;
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.9);
}

.guide-toggle input:focus-visible + i {
  outline: 1px solid var(--cyan);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .guide-toggle span {
    display: none;
  }
}
