/* ════════════════════════════════════════════════════════════════
   HUD.CSS — the site-wide DriveHUD bottom strip.
   Loaded by BaseLayout on every page. Tokens come from styles.css
   (:root). Homepage-only experience styles stay in experience.css.
   ════════════════════════════════════════════════════════════════ */
.ac-hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: linear-gradient(180deg, rgba(11,14,18,0.86), rgba(7,9,12,0.96));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.08);
  font-family: var(--font-condensed);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.ac-hud-progress {
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,0.06);
}
.ac-hud-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 8px var(--accent);
}
.ac-hud-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 20px;
}

/* cluster */
.ac-hud-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 168px;
}
.ac-hud-gauge { width: 44px; height: 44px; display: block; }
.ac-hud-gauge-ring {
  fill: rgba(255,255,255,0.03);
  stroke: rgba(255,255,255,0.14);
  stroke-width: 1.5;
}
.ac-hud-tick { stroke: rgba(138,151,166,0.55); stroke-width: 1.5; }
.ac-hud-tick-red { stroke: #FF3D2E; }
.ac-hud-needle {
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px var(--accent));
}
.ac-hud-hub { fill: var(--accent); }
.ac-hud-readout { display: flex; flex-direction: column; line-height: 1; }
.ac-hud-speed {
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  min-width: 34px;
}
.ac-hud-unit { font-size: 9px; letter-spacing: 0.22em; color: var(--steel); }
.ac-hud-gear-block { display: flex; flex-direction: column; line-height: 1; align-items: center; }
.ac-hud-gear-label { font-size: 8px; letter-spacing: 0.24em; color: var(--steel); }
.ac-hud-gear { font-size: 21px; font-weight: 700; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.ac-hud-rpm {
  width: 44px;
  height: 4px;
  border-radius: 4px;
  background: var(--asphalt-3);
  overflow: hidden;
}
.ac-hud-rpm-fill {
  height: 100%;
  width: 20%;
  border-radius: 4px;
  background: linear-gradient(90deg, #FFB02E, var(--accent), #FF3D2E);
}

/* sector dots */
.ac-hud-sectors {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}
.ac-hud-sector {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--steel);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
}
.ac-hud-sector:hover { color: #fff; }
.ac-hud-sector.is-active {
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.ac-hud-sector-num { color: var(--accent); font-size: 10px; }
.ac-hud-sector.is-active .ac-hud-sector-num { text-shadow: 0 0 8px var(--accent); }

/* drive mode switch */
.ac-hud-modes {
  display: flex;
  align-items: center;
  gap: 5px;
}
.ac-hud-modes-label {
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--steel);
  margin-right: 4px;
}
.ac-hud-mode {
  font-family: var(--font-condensed);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
  color: var(--steel);
  cursor: pointer;
  transition: all 0.2s;
}
.ac-hud-mode:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
.ac-hud-mode.is-active { color: #0c0d10; }
.ac-hud-mode-eco.is-active { background: #FFB02E; border-color: #FFB02E; box-shadow: 0 0 14px rgba(255,176,46,0.5); }
.ac-hud-mode-sport.is-active { background: #FF6A2B; border-color: #FF6A2B; box-shadow: 0 0 14px rgba(255,106,43,0.5); }
.ac-hud-mode-track.is-active { background: #FF3D2E; border-color: #FF3D2E; box-shadow: 0 0 14px rgba(255,61,46,0.5); }
.ac-hud-mode-cycle { display: none; }

/* sound toggle — opt-in audio, muted by default */
.ac-hud-sound {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
  color: var(--steel);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.ac-hud-sound:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
.ac-hud-sound.is-on {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.ac-hud-sound svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ac-hud-sound svg path:first-child { fill: currentColor; stroke: none; }

/* page bottom breathing room so the HUD never covers content */
.has-hud footer { padding-bottom: 84px; }

/* sector-dot anchor jumps land below the fixed nav */
#main > section { scroll-margin-top: 72px; }

@media (max-width: 1280px) {
  /* Mid widths: number-only dots so six sectors never crowd the mode switch. */
  .ac-hud-sector-label { display: none; }
  .ac-hud-sector { padding: 6px 9px; }
}
@media (max-width: 900px) {
  .ac-hud-sectors { display: none; }
}
@media (max-width: 768px) {
  .ac-hud-inner { padding: 5px 14px; gap: 10px; }
  .ac-hud-gauge, .ac-hud-rpm { display: none; }
  .ac-hud-cluster { min-width: 0; }
  .ac-hud-modes { display: none; }
  .ac-hud-mode-cycle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
  }
  .has-hud footer { padding-bottom: 64px; }
}
