/* DRIFT.EG.JE — Shared design tokens */

:root {
  /* Type */
  --font-head: 'Bebas Neue', 'Oswald', 'Impact', sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;

  /* Dark gasoline palette */
  --bg: oklch(0.13 0.012 250);
  --bg-2: oklch(0.17 0.014 250);
  --surface: oklch(0.20 0.016 250);
  --surface-2: oklch(0.24 0.018 250);
  --line: oklch(0.32 0.015 250);
  --line-strong: oklch(0.45 0.018 250);
  --fg: oklch(0.97 0.006 80);
  --fg-dim: oklch(0.78 0.012 80);
  --muted: oklch(0.58 0.014 250);

  /* Accent (default hazard orange) */
  --accent: oklch(0.74 0.20 55);
  --accent-ink: oklch(0.14 0.02 55);

  /* Signal colors */
  --signal-red: oklch(0.66 0.24 25);
  --signal-green: oklch(0.78 0.20 135);
  --signal-yellow: oklch(0.88 0.17 95);

  /* Motion */
  --ease: cubic-bezier(.2,.7,.2,1);
}

[data-accent="green"] {
  --accent: oklch(0.80 0.20 135);
  --accent-ink: oklch(0.14 0.04 135);
}
[data-accent="red"] {
  --accent: oklch(0.66 0.24 25);
  --accent-ink: oklch(0.97 0.02 25);
}
[data-accent="cyan"] {
  --accent: oklch(0.80 0.16 210);
  --accent-ink: oklch(0.14 0.03 210);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--fg); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.head { font-family: var(--font-head); letter-spacing: 0.01em; text-transform: uppercase; }

/* Hazard stripes */
.hazard {
  background-image: repeating-linear-gradient(
    135deg,
    var(--accent) 0 14px,
    transparent 14px 28px
  );
}
.hazard-dark {
  background-image: repeating-linear-gradient(
    135deg,
    oklch(0.25 0.01 250) 0 14px,
    oklch(0.18 0.01 250) 14px 28px
  );
}

/* Abstract placeholder for images */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(
      115deg,
      oklch(0.22 0.015 250) 0 6px,
      oklch(0.19 0.015 250) 6px 12px
    );
  overflow: hidden;
  isolation: isolate;
}
.ph::before {
  content: attr(data-label);
  position: absolute;
  top: 10px; left: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  text-transform: uppercase;
  background: var(--bg);
  padding: 3px 6px;
  border: 1px solid var(--line);
}
.ph::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent 60%, oklch(0.10 0.01 250 / 0.9));
  pointer-events: none;
}
/* When the .ph carries a real photo via inline background-image we drop the
   diagonal-stripes pattern and the small "DRIVER 02" label sticker. The
   bottom-of-card gradient (::after) is kept so text overlays remain
   readable.

   The photo is rendered through ::before so we can pan and zoom it via
   CSS custom properties (--focal-x, --focal-y, --zoom) without touching
   the .ph element's own layout. shared.js converts the inline
   background-image to --photo-url at load time. */
.ph.has-photo {
  background-image: none !important;
  background-size: cover;
  background-position: center;
}
.ph.has-photo::before {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  background-image: var(--photo-url, none);
  background-size: cover;
  background-position: var(--focal-x, 50%) var(--focal-y, 50%);
  transform: scale(var(--zoom, 1));
  transform-origin: var(--focal-x, 50%) var(--focal-y, 50%);
  z-index: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  color: var(--fg-dim);
  border-radius: 2px;
}
.chip--accent { border-color: var(--accent); color: var(--accent); }
.chip--live::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--signal-red);
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Monster head placeholder logo — geometric shard */
.monster-head {
  display: inline-block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* Top navigation common */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: oklch(0.13 0.012 250 / 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 14px 28px;
  max-width: 1440px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 22px;
  letter-spacing: 0.04em;
}
.brand b { color: var(--accent); }

/* Horizontal brand: orange shard mark + DARK FORCE wordmark inline.
   Compact, editorial — kept slim so it doesn't dominate the topbar. */
.brand--stack {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  line-height: 1;
  text-decoration: none;
  color: var(--fg);
}
.brand--stack .monster-head,
.brand--stack .brand__mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.brand--stack .brand__wordmark {
  font-family: var(--font-head);
  font-size: 24px;
  letter-spacing: 0.12em;
  white-space: nowrap;
  display: block;
}
.brand--stack .brand__wordmark b {
  color: var(--accent);
  font-weight: inherit;
}
@media (max-width: 760px) {
  .brand--stack { gap: 8px; }
  .brand--stack .monster-head,
  .brand--stack .brand__mark { width: 26px; height: 26px; }
  .brand--stack .brand__wordmark { font-size: 19px; letter-spacing: 0.1em; }
}
.nav {
  display: flex;
  gap: 22px;
  font-family: var(--font-head);
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  flex: 1;
}
.nav a { transition: color .15s var(--ease); }
.nav a:hover, .nav a.active { color: var(--fg); }
.nav a.active { color: var(--accent); }
.topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lang {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  overflow: hidden;
}
.lang button {
  padding: 5px 9px;
  color: var(--fg-dim);
}
.lang button.on { background: var(--fg); color: var(--bg); }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-family: var(--font-head);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  color: var(--fg);
  border-radius: 2px;
  transition: all .15s var(--ease);
}
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn:hover { border-color: var(--fg); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

/* Tweaks panel */
.tweaks {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 14px;
  font-family: var(--font-body);
  font-size: 13px;
  box-shadow: 0 12px 40px oklch(0 0 0 / 0.6);
  display: none;
}
.tweaks.on { display: block; }
.tweaks h4 {
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 12px;
}
.tweaks__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.tweaks__swatches { display: flex; gap: 6px; }
.tweaks__sw {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid transparent;
}
.tweaks__sw.on { border-color: var(--fg); }
.tweaks__toggle {
  width: 34px; height: 18px;
  background: var(--line);
  border-radius: 20px;
  position: relative;
  transition: background .15s;
}
.tweaks__toggle.on { background: var(--accent); }
.tweaks__toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: var(--fg);
  border-radius: 50%;
  transition: transform .15s var(--ease);
}
.tweaks__toggle.on::after { transform: translateX(16px); }

.tweaks__select {
  display: flex;
  gap: 4px;
}
.tweaks__select button {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-dim);
}
.tweaks__select button.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ============================================================
   Responsive — hamburger nav, safe-areas, mobile hero scaling
   ============================================================ */

/* Burger button — hidden on desktop */
.topbar__burger {
  display: none;
  width: 40px;
  height: 40px;
  padding: 10px;
  margin-left: auto;
  position: relative;
  z-index: 52;
}
.topbar__burger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--fg);
  margin: 4px 0;
  transition: transform .25s var(--ease), opacity .2s var(--ease);
  transform-origin: center;
}
.topbar--open .topbar__burger span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.topbar--open .topbar__burger span:nth-child(2) { opacity: 0; }
.topbar--open .topbar__burger span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

body.no-scroll { overflow: hidden; }

/* Soon-state nav link — currently fully HIDDEN. Owner wants the
   Tickets section parked while we figure out whether ticket sales
   actually belong on this site. The page file (/paddock/tickets.html)
   is preserved on disk and in git; only the nav link is hidden. To
   bring it back: change `display: none` below to the previous greyed
   styles (kept commented). */
.nav a.soon {
  display: none !important;
  /*
  Previous greyed-but-visible state:
  color: rgba(255, 255, 255, 0.28) !important;
  pointer-events: auto;
  */
}
/*
.nav a.soon:hover { color: rgba(255, 255, 255, 0.42) !important; }
.nav a.soon::after {
  content: 'soon';
  display: inline-block;
  margin-left: 6px;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  vertical-align: 1px;
}
*/

/* Mobile menu backdrop — sibling of .topbar, injected by shared.js.
   Only matters at the mobile breakpoint where the nav becomes a
   slide-in drawer — at desktop sizes the drawer sits inline so the
   backdrop stays out of the way (display:none). When the menu is
   open, the backdrop catches clicks (closes menu) and visually
   anchors the drawer over the content beneath. */
.topbar__backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .22s var(--ease);
  pointer-events: none;
}
@media (max-width: 820px) {
  .topbar__backdrop { display: block; }
  .topbar.topbar--open + .topbar__backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Respect iOS notch / rounded corners */
.topbar__inner {
  padding-left: max(28px, env(safe-area-inset-left));
  padding-right: max(28px, env(safe-area-inset-right));
}

/* Mobile breakpoint — full-screen drawer */
@media (max-width: 820px) {
  .topbar__inner {
    gap: 16px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .brand { font-size: 18px; gap: 8px; }
  .brand .monster-head { width: 22px; height: 22px; }

  .topbar__burger { display: block; }

  /* Right-side drawer — ~320px wide, leaves the page visible on the left
     so the menu doesn't feel like a curtain. Brand stays visible up top. */
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(320px, 82vw);
    padding: max(96px, calc(72px + env(safe-area-inset-top))) 24px max(24px, env(safe-area-inset-bottom));
    background: var(--bg);
    flex-direction: column;
    gap: 0;
    font-size: 20px;
    letter-spacing: 0.05em;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform .3s var(--ease), opacity .18s var(--ease), visibility 0s linear .3s;
    overscroll-behavior: contain;
  }
  .topbar--open .nav {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition: transform .32s var(--ease), opacity .2s var(--ease), visibility 0s;
  }
  .nav a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    color: var(--fg);
    font-size: 19px;
    letter-spacing: 0.05em;
  }
  .nav a:last-of-type { border-bottom: none; }
  .nav a.active { color: var(--accent); }

  .topbar__right { display: none; }

  /* Tweaks panel shrinks on mobile */
  .tweaks {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
}

/* Very small screens — further tighten */
@media (max-width: 420px) {
  .topbar__inner { padding-left: 16px; padding-right: 16px; gap: 12px; }
  .brand b { display: inline; }
}

/* Prefer larger touch targets on coarse pointers */
@media (pointer: coarse) {
  .btn { padding: 12px 18px; }
  .nav a { padding: 18px 0; }
}
