/* ============================================================
   IRON GT SERIES — broadcast overlay design system
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@500;600;700;800&family=Saira:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* surfaces — asphalt */
  --bg:      #07080a;
  --bg2:     #0c0e12;
  --panel:   #13161c;
  --panel2:  #1a1e26;
  --line:    rgba(255,255,255,0.09);
  --line2:   rgba(255,255,255,0.16);

  /* ink */
  --text:    #f3f5f8;
  --muted:   #8b929e;
  --faint:   #5b626d;

  /* accent (overridable by tweak) */
  --accent:     #ff2e3f;
  --accent-2:   #ff5a52;
  --accent-ink: #ffffff;

  /* broadcast sector colours */
  --sec-purple: #b14cff;
  --sec-green:  #1fd27c;
  --sec-yellow: #ffd21a;

  /* type */
  --display: 'Saira Condensed', 'Arial Narrow', sans-serif;
  --body:    'Saira', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  --skew: -11deg;           /* broadcast parallelogram shear */
  --maxw: 1280px;
}

/* ---- visual direction: TELEMETRY ---- */
[data-theme="telemetry"] {
  --bg:      #060a0d;
  --bg2:     #0a1015;
  --panel:   #0f161c;
  --panel2:  #142029;
  --accent:     #18e3ff;
  --accent-2:   #5beaff;
  --accent-ink: #04161b;
  --display: 'JetBrains Mono', monospace;
  --skew: 0deg;
}

/* ---- visual direction: CARBON ---- */
[data-theme="carbon"] {
  --bg:      #0a0b0c;
  --bg2:     #111315;
  --panel:   #16191b;
  --panel2:  #1f2326;
  --line:    rgba(255,255,255,0.07);
  --accent:     #c8ff2e;
  --accent-2:   #d8ff63;
  --accent-ink: #10160a;
  --skew: 0deg;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
}
::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* asphalt texture under everything */
.bg-grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 600px at 80% -10%, rgba(255,255,255,0.05), transparent 60%),
    repeating-linear-gradient(115deg, rgba(255,255,255,0.012) 0 2px, transparent 2px 9px),
    var(--bg);
}
[data-theme="telemetry"] .bg-grain {
  background:
    linear-gradient(rgba(24,227,255,0.05), transparent 30%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 40px),
    var(--bg);
}

.app { position: relative; z-index: 1; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ============================================================
   Type helpers
   ============================================================ */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
  display: inline-flex; align-items: center; gap: 9px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; background: var(--accent);
}
.display {
  font-family: var(--display);
  font-weight: 800; line-height: 0.92; letter-spacing: -0.01em;
  text-transform: uppercase; margin: 0;
}
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

/* skew utility — flattens automatically in telemetry/carbon (--skew:0) */
.skew  { transform: skewX(var(--skew)); }
.unskew{ transform: skewX(calc(-1 * var(--skew))); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; font-size: 16px;
  padding: 13px 22px; border: 0; color: var(--accent-ink);
  background: var(--accent);
  transform: skewX(var(--skew));
  transition: filter .15s, transform .15s, background .15s;
}
.btn > * { display: inline-block; transform: skewX(calc(-1 * var(--skew))); }
.btn:hover { filter: brightness(1.08); }
.btn:active { filter: brightness(0.95); }
.btn.ghost {
  background: transparent; color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--line2);
}
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); filter:none; }
.btn.sm { font-size: 13px; padding: 9px 15px; }
.btn.block { width: 100%; justify-content: center; }

/* buy me a coffee pill */
.coffee {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: 0.04em;
  padding: 8px 14px; color: var(--text);
  background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .15s, color .15s; white-space: nowrap;
}
.coffee:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.coffee svg { width: 16px; height: 16px; flex: none; }

/* discord pill */
.discord {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: 0.04em;
  padding: 8px 14px; color: var(--text);
  background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .15s, color .15s;
}
.discord:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.discord svg { width: 16px; height: 16px; fill: currentColor; }

/* ============================================================
   Header / nav
   ============================================================ */
.hdr {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg2) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.hdr-accent { height: 3px; background: linear-gradient(90deg, var(--accent), transparent 70%); }
.hdr-in {
  max-width: var(--maxw); margin: 0 auto; padding: 0 28px;
  height: 66px; display: flex; align-items: center; gap: 26px;
}
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.brand-mark {
  width: 30px; height: 30px; background: var(--accent);
  transform: skewX(var(--skew));
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; color: var(--accent-ink);
  font-size: 17px;
}
.brand-mark span { transform: skewX(calc(-1 * var(--skew))); }
.brand-name {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: 19px; letter-spacing: 0.02em; line-height: 1;
}
.brand-name b { color: var(--accent); font-weight: 800; }
.brand-sub { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.34em; color: var(--muted); }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link {
  position: relative; font-family: var(--display); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; font-size: 15px;
  color: var(--muted); padding: 9px 14px; transition: color .15s;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2px; background: var(--accent);
}
.hdr-cta { display: flex; align-items: center; gap: 12px; margin-left: 8px; }

/* language switcher */
.langsw { position: relative; }
.langbtn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.05em; padding: 8px 12px;
  background: var(--panel2); color: var(--text); border: 0;
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s, color .15s;
}
.langbtn:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.langbtn b { font-weight: 700; }
.langmenu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 100;
  background: var(--panel2); box-shadow: 0 8px 28px rgba(0,0,0,0.55), inset 0 0 0 1px var(--line2);
  min-width: 150px; display: flex; flex-direction: column; gap: 0;
}
.langmenu button {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; background: transparent; border: 0; text-align: left;
  color: var(--muted); transition: background .12s, color .12s;
  font-family: var(--mono); font-size: 13px; border-bottom: 1px solid var(--line);
}
.langmenu button:last-child { border-bottom: 0; }
.langmenu button:hover { background: var(--panel); color: var(--text); }
.langmenu button.on { color: var(--accent); }
.langmenu button b { font-weight: 700; width: 24px; flex: none; }
.langmenu button span { color: inherit; opacity: .8; }

/* mobile nav toggle */
.nav-toggle { display: none; }

/* ============================================================
   Live status chip
   ============================================================ */
.livechip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text);
  padding: 6px 11px; background: rgba(0,0,0,0.35);
  box-shadow: inset 0 0 0 1px var(--line2);
}
.dot-live {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media image-slot { width: 100%; height: 100%; display: block; }
.hero-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, var(--bg) 6%, rgba(7,8,10,0.62) 46%, rgba(7,8,10,0.12) 100%),
    linear-gradient(0deg, var(--bg) 2%, transparent 40%);
}
.hero-in {
  position: relative; z-index: 2;
  max-width: var(--maxw); margin: 0 auto; padding: 92px 28px 104px;
  min-height: 560px; display: flex; flex-direction: column; justify-content: center;
}
.hero h1 { font-size: clamp(58px, 9vw, 132px); margin: 18px 0 0; }
.hero h1 .ln2 { color: var(--accent); display: block; }
.hero-lead {
  margin: 22px 0 0; max-width: 520px; font-size: 19px; color: var(--text);
  opacity: 0.9;
}
.hero-actions { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }

/* next-race flag strip in hero */
.nextflag {
  display: inline-flex; align-items: stretch; margin-top: 8px;
  background: rgba(0,0,0,0.42); box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--mono); width: max-content; max-width: 100%;
}
.nextflag .lab {
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 11px; letter-spacing: 0.16em;
  padding: 9px 12px; display: flex; align-items: center;
}
.nextflag .val {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 9px 16px; font-size: 13px; color: var(--text);
}
.nextflag .val b { color: var(--text); font-weight: 700; }
.nextflag .val .sep { color: var(--faint); }

/* ============================================================
   Live timing tower (decorative widget)
   ============================================================ */
.tower {
  position: absolute; right: 28px; top: 50%; transform: translateY(-50%);
  z-index: 3; width: 268px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: inset 0 0 0 1px var(--line2), 0 24px 60px rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
}
.tower-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 13px; background: var(--accent); color: var(--accent-ink);
}
.tower-h b { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; font-size: 14px; }
.tower-h span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; }
.tr {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center;
  gap: 10px; padding: 8px 13px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 13px;
}
.tr:last-child { border-bottom: 0; }
.tr .pos { font-weight: 700; color: var(--muted); text-align: center; }
.tr.p1 .pos { color: var(--accent); }
.tr .drv { color: var(--text); letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr .num { display: inline-block; width: 22px; color: var(--faint); }
.tr .gap { font-size: 12px; color: var(--muted); }
.tr .gap.purple { color: var(--sec-purple); }
.tower-foot {
  display: flex; gap: 5px; padding: 9px 13px; background: rgba(0,0,0,0.3);
}
.secdot { flex: 1; height: 5px; background: var(--line2); }
.secdot.g { background: var(--sec-green); }
.secdot.p { background: var(--sec-purple); }
.secdot.y { background: var(--sec-yellow); }

/* ============================================================
   Discord Widget
   ============================================================ */
.discord-widget {
  position: absolute; right: 28px; top: 50%; transform: translateY(-50%);
  z-index: 3; width: 284px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: inset 0 0 0 1px var(--line2), 0 24px 60px rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  border-radius: 4px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow 0.25s;
}
.discord-widget:hover {
  box-shadow: inset 0 0 0 1px var(--accent), 0 24px 60px rgba(0,0,0,0.55);
}
.dw-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 13px;
  background: var(--panel2);
  border-bottom: 1px solid var(--line2);
  flex-shrink: 0;
}
.dw-head b {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; font-size: 13px; flex: 1; color: var(--text);
}
.dw-head-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em;
  color: var(--muted); text-transform: uppercase;
}
.dw-live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #23a55a; flex-shrink: 0;
  animation: dw-pulse 2.2s ease-in-out infinite;
}
@keyframes dw-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(35,165,90,0.7); }
  60%       { box-shadow: 0 0 0 5px rgba(35,165,90,0); }
}
.dw-body {
  padding: 16px 14px 12px; display: flex; flex-direction: column; gap: 14px; flex: 1;
}
.dw-server { display: flex; align-items: center; gap: 12px; }
.dw-server-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dw-server-icon svg { width: 22px; height: 22px; fill: var(--accent-ink); }
.dw-server-name { font-family: var(--display); font-weight: 800; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
.dw-online { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.dw-dot-green { width: 7px; height: 7px; border-radius: 50%; background: #23a55a; flex-shrink: 0; }
.dw-members-label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; color: var(--faint); text-transform: uppercase; margin-bottom: 8px; }
.dw-avatars { display: flex; gap: 6px; flex-wrap: wrap; }
.dw-avatar {
  position: relative; width: 34px; height: 34px; border-radius: 50%;
  background: var(--panel2); overflow: visible;
  border: 2px solid var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--muted);
}
.dw-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.dw-status {
  position: absolute; bottom: -1px; right: -1px;
  width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--panel);
}
.dw-status-online { background: #23a55a; }
.dw-status-idle { background: #f0b132; }
.dw-status-dnd { background: #f23f43; }
.dw-divider { height: 1px; background: var(--line); }
.dw-info-rows { display: flex; flex-direction: column; gap: 8px; }
.dw-info-row { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); line-height: 1.3; }
.dw-info-icon { font-size: 13px; flex-shrink: 0; }
.dw-foot {
  padding: 10px 13px;
  background: var(--panel2);
  border-top: 1px solid var(--line2);
  flex-shrink: 0;
}
.dw-join {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 9px 16px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--display); font-weight: 800;
  font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; border-radius: 3px;
  transition: filter 0.2s, transform 0.2s;
  cursor: pointer;
}
.dw-join:hover { filter: brightness(1.18); transform: translateY(-1px); }
.dw-join svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
@media (max-width: 1080px) { .discord-widget { display: none; } }

/* ============================================================
   Section scaffolding
   ============================================================ */
.section { padding: 84px 0; position: relative; }
.section.tight { padding: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 40px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(34px, 5vw, 58px); }
.section-head .lead { color: var(--muted); max-width: 480px; margin: 12px 0 0; }

/* ============================================================
   "Ce facem" feature blocks
   ============================================================ */
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feat {
  background: var(--panel); padding: 26px 22px 30px;
  box-shadow: inset 0 0 0 1px var(--line);
  position: relative; overflow: hidden;
  transition: box-shadow .18s, transform .18s;
}
.feat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent);
  transform: scaleY(0); transform-origin: top; transition: transform .22s;
}
.feat:hover { box-shadow: inset 0 0 0 1px var(--line2); transform: translateY(-3px); }
.feat:hover::before { transform: scaleY(1); }
.feat .idx { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: 0.1em; }
.feat h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 23px; margin: 16px 0 8px; letter-spacing: 0.01em; }
.feat p { margin: 0; color: var(--muted); font-size: 15px; }

/* ============================================================
   Race card
   ============================================================ */
.race {
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line);
  display: grid; grid-template-columns: 300px 1fr; overflow: hidden;
  transition: box-shadow .18s;
}
.race:hover { box-shadow: inset 0 0 0 1px var(--line2); }
.race-map { position: relative; min-height: 240px; background: var(--bg2); border-right: 1px solid var(--line); }
.race-map image-slot { width: 100%; height: 100%; display: block; }
.race-round {
  position: absolute; left: 0; top: 16px; z-index: 2;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--display); font-weight: 800; font-size: 14px; letter-spacing: 0.08em;
  padding: 7px 16px 7px 14px; text-transform: uppercase;
  transform: skewX(var(--skew));
}
.race-round span { display: inline-block; transform: skewX(calc(-1 * var(--skew))); }
.race-body { padding: 24px 26px 26px; display: flex; flex-direction: column; }
.race-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.race-cc { font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; color: var(--muted); }
.race h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 32px; line-height: 1.0; margin: 4px 0 0; text-wrap: balance; }
.race-loc { color: var(--muted); font-size: 14px; margin-top: 7px; }

.status {
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; padding: 6px 11px; white-space: nowrap;
}
.status.open   { color: var(--sec-green);  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sec-green) 50%, transparent); }
.status.filling{ color: var(--sec-yellow); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sec-yellow) 50%, transparent); }
.status.full   { color: var(--faint);      box-shadow: inset 0 0 0 1px var(--line2); }

.race-data {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); margin: 20px 0 0;
  box-shadow: 0 0 0 1px var(--line);
}
.dcell { background: var(--panel); padding: 12px 14px; }
.dcell .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.dcell .v { font-family: var(--display); font-weight: 700; font-size: 19px; margin-top: 3px; text-transform: uppercase; }
.dcell .v small { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; display: block; text-transform: none; letter-spacing: 0; }

.race-data.compact .dcell { padding: 8px 10px; }
.race-data.compact .dcell .k { font-size: 10px; letter-spacing: 0.11em; }
.race-data.compact .dcell .v { font-size: 15px; margin-top: 2px; }
.race-data.compact .dcell .v small { font-size: 11px; }

.race-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; flex-wrap: wrap; }
.fmt { display: flex; gap: 7px; flex-wrap: wrap; }
.pill {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em;
  padding: 6px 11px; color: var(--text); background: var(--panel2);
  box-shadow: inset 0 0 0 1px var(--line);
  display: inline-flex; align-items: center; gap: 6px;
}
.pill b { color: var(--accent); font-weight: 700; }

/* grid availability bar */
.gridbar { margin-top: 14px; }
.gridbar .lab { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.06em; margin-bottom: 6px; }
.gridbar .track { height: 6px; background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line); position: relative; }
.gridbar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }

/* ============================================================
   Featured (big) race
   ============================================================ */
.feature { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line2); display: grid; grid-template-columns: 1.15fr 1fr; overflow: hidden; }
.feature-media { position: relative; min-height: 420px; background: var(--bg2); }
.feature-media image-slot { width: 100%; height: 100%; display: block; }
.feature-tag {
  position: absolute; left: 0; top: 22px; background: var(--accent); color: var(--accent-ink);
  font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 14px; padding: 9px 20px 9px 16px; transform: skewX(var(--skew)); z-index: 2;
}
.feature-tag span { display: inline-block; transform: skewX(calc(-1 * var(--skew))); }
.feature-body { padding: 38px 38px 36px; display: flex; flex-direction: column; }
.feature-body h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(40px, 5vw, 64px); line-height: 0.9; margin: 10px 0 0; }
.countdown { display: flex; gap: 10px; margin: 26px 0; }
.cd { background: var(--bg2); box-shadow: inset 0 0 0 1px var(--line); padding: 12px 0; text-align: center; flex: 1; }
.cd .n { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; }
.cd .u { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; margin-top: 5px; }

/* ============================================================
   Schedule strip (home)
   ============================================================ */
.sched { display: flex; flex-direction: column; }
.srow {
  display: grid; grid-template-columns: 64px 80px 1fr 120px 140px 110px 130px; align-items: center; gap: 16px;
  padding: 17px 18px; border-bottom: 1px solid var(--line);
  font-family: var(--body); cursor: pointer; transition: background .14s;
}
.srow:hover { background: var(--panel); }
.srow .r { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.srow-thumb { width: 80px; height: 50px; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.srow-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; display: block; transition: opacity .2s; }
.srow:hover .srow-thumb img { opacity: 1; }
.srow .nm { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 21px; letter-spacing: 0.01em; }
.srow .nm small { display: block; font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: 0.04em; color: var(--muted); text-transform: none; }
.srow .meta { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.srow .arrow { justify-self: end; color: var(--faint); transition: transform .15s, color .15s; }
.srow:hover .arrow { color: var(--accent); transform: translateX(4px); }

/* ============================================================
   CTA band
   ============================================================ */
.cta-band {
  position: relative; overflow: hidden;
  background: var(--accent); color: var(--accent-ink);
  padding: 64px 0;
}
.cta-band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.cta-band h2 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(34px, 5vw, 60px); line-height: 0.92; margin: 0; }
.cta-band p { margin: 12px 0 0; font-size: 17px; opacity: 0.82; max-width: 420px; }
.cta-band .btn { background: var(--accent-ink); color: var(--accent); }
.cta-stripes { position: absolute; inset: 0; opacity: 0.1; pointer-events: none;
  background: repeating-linear-gradient(115deg, rgba(0,0,0,0.6) 0 18px, transparent 18px 44px); }

/* ============================================================
   About page
   ============================================================ */
.about-hero { padding: 96px 0 30px; }
.about-hero h1 { font-size: clamp(52px, 8vw, 110px); margin: 16px 0 0; }
.prose { max-width: 720px; }
.prose p { font-size: 19px; color: #d6dae1; margin: 0 0 18px; }
.prose p b { color: var(--text); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); padding: 28px 24px; position: relative; }
.step .t { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: 0.12em; }
.step h4 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 26px; margin: 14px 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.step .big { position: absolute; right: 18px; top: 10px; font-family: var(--display); font-weight: 800; font-size: 70px; color: var(--line2); line-height: 1; }

.rules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.rule { display: flex; gap: 14px; padding: 20px 22px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); align-items: flex-start; }
.rule .mk { width: 30px; height: 30px; flex: none; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--display); font-weight: 800; transform: skewX(var(--skew)); }
.rule .mk span { transform: skewX(calc(-1 * var(--skew))); }
.rule h4 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 19px; margin: 0 0 4px; }
.rule p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ============================================================
   Signup form
   ============================================================ */
.form-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: start; }
.fieldset { display: grid; gap: 18px; }
.field label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.field label .req { color: var(--accent); }
.input, .select, .textarea {
  width: 100%; background: var(--panel); color: var(--text);
  border: 0; box-shadow: inset 0 0 0 1px var(--line2);
  padding: 13px 15px; font-family: var(--body); font-size: 16px;
  transition: box-shadow .15s; outline: none;
}
.input:focus, .select:focus, .textarea:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.input::placeholder { color: var(--faint); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 19px) 20px, calc(100% - 13px) 20px; background-size: 6px 6px; background-repeat: no-repeat; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.choice { display: flex; gap: 10px; flex-wrap: wrap; }
.choice button {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em;
  padding: 10px 16px; background: var(--panel); color: var(--muted);
  border: 0; box-shadow: inset 0 0 0 1px var(--line2); transition: all .14s;
}
.choice button.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { display: none; }
.check .box { width: 22px; height: 22px; flex: none; background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--line2); display: grid; place-items: center; margin-top: 1px; }
.check input:checked + .box { background: var(--accent); box-shadow: none; }
.check .box svg { width: 13px; height: 13px; stroke: var(--accent-ink); opacity: 0; }
.check input:checked + .box svg { opacity: 1; }
.check span.txt { font-size: 14.5px; color: var(--muted); }
.check span.txt a { color: var(--accent); }

/* signup summary aside */
.summary { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line2); position: sticky; top: 84px; }
.summary-h { background: var(--accent); color: var(--accent-ink); padding: 16px 20px; font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; font-size: 18px; display: flex; align-items: center; justify-content: space-between; }
.summary-b { padding: 20px; display: grid; gap: 14px; }
.sline { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 13px; }
.sline:last-of-type { border-bottom: 0; }
.sline .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.sline .v { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 17px; text-align: right; }
.sline .v.empty { color: var(--faint); font-weight: 400; font-family: var(--mono); font-size: 13px; text-transform: none; }

/* success overlay */
.entry-ok { text-align: center; padding: 60px 24px; }
.entry-ok .seal { width: 88px; height: 88px; margin: 0 auto 24px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; transform: skewX(var(--skew)); }
.entry-ok .seal svg { width: 44px; height: 44px; transform: skewX(calc(-1 * var(--skew))); stroke: var(--accent-ink); }
.entry-ok h2 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(40px, 6vw, 72px); margin: 0; }
.entry-ok p { color: var(--muted); font-size: 18px; margin: 14px 0 28px; }

/* ============================================================
   Ticker
   ============================================================ */
.ticker {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  height: 38px; background: var(--bg2); border-top: 1px solid var(--line);
  display: flex; align-items: stretch; overflow: hidden;
}
.ticker-lab {
  background: var(--accent); color: var(--accent-ink); flex: none;
  display: flex; align-items: center; padding: 0 16px;
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 13px; z-index: 2;
}
.ticker-track { display: flex; align-items: center; white-space: nowrap; animation: ticker 38s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding: 0 26px; letter-spacing: 0.04em; }
.ticker-item b { color: var(--text); }
.ticker-item .hl { color: var(--accent); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
body.has-ticker .app { padding-bottom: 38px; }

/* ============================================================
   Footer
   ============================================================ */
.footer { border-top: 1px solid var(--line); padding: 50px 0 40px; background: var(--bg2); }
.footer-in { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; align-items: flex-start; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.fcol h5 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); margin: 0 0 14px; }
.fcol a { display: block; color: var(--muted); font-size: 15px; padding: 4px 0; transition: color .14s; }
.fcol a:hover { color: var(--accent); }
.footer-bot { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--faint); }

/* placeholder map look (under image-slot, shows if empty) */
.map-ph { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.035) 0 10px, transparent 10px 20px); }
.map-ph span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--faint); text-transform: uppercase; }

/* re-skin the user-fillable image slots for the dark broadcast theme */
image-slot::part(frame) {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 11px, transparent 11px 22px),
    radial-gradient(120% 120% at 70% 0%, rgba(255,255,255,0.05), transparent 60%),
    var(--bg2);
}
image-slot::part(empty) { color: var(--muted); font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
image-slot::part(ring) { border-color: var(--line2); }

/* ============================================================
   Entrance — content is ALWAYS visible at rest; animation is a
   pure enhancement that only plays where the timeline runs.
   (Never gate visibility on animation: some embeds freeze the
    document timeline at frame 0.)
   ============================================================ */
.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  /* animate ONLY transform — opacity stays 1 even if the timeline freezes */
  .reveal { animation: revealIn .55s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes revealIn { from { transform: translateY(14px); } to { transform: none; } }
  .feat-grid .reveal:nth-child(2) { animation-delay: .07s; }
  .feat-grid .reveal:nth-child(3) { animation-delay: .14s; }
  .feat-grid .reveal:nth-child(4) { animation-delay: .21s; }
  .steps .reveal:nth-child(2) { animation-delay: .08s; }
  .steps .reveal:nth-child(3) { animation-delay: .16s; }
  .rules .reveal:nth-child(2) { animation-delay: .06s; }
  .rules .reveal:nth-child(3) { animation-delay: .12s; }
  .rules .reveal:nth-child(4) { animation-delay: .18s; }
}

/* ============================================================
   Responsive
   ============================================================ */

/* ---- Mobile safety boundary (≤ 1023px — desktop 1024px+ is 100% untouched) ---- */
@media (max-width: 1023px) {
  /* Smooth momentum scrolling on iOS; eliminate scroll jank */
  body {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior-y: contain;
  }
  /* Remove expensive backdrop-filter blur on mobile — biggest scroll jank source */
  .hdr {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: color-mix(in srgb, var(--bg2) 98%, transparent);
  }
  /* Prevent any child from punching through the viewport horizontally */
  .app, .wrap, .hdr-in, .section, .hero-in {
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 1080px) {
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .tower { display: none; }
  .feature { grid-template-columns: 1fr; }
  .feature-media { min-height: 280px; }
  .form-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 820px) {
  .nav, .hdr-cta .discord-text { display: none; }
  .nav.open { display: flex; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg2); border-bottom: 1px solid var(--line); padding: 8px; gap: 2px; }
  .nav.open .nav-link { padding: 14px 16px; font-size: 18px; }
  .nav.open .nav-link.active::after { display: none; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .race { grid-template-columns: 1fr; }
  .race-map { min-height: 180px; border-right: 0; border-bottom: 1px solid var(--line); }
  .race-data { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .rules { grid-template-columns: 1fr; }
  .srow { grid-template-columns: 40px 1fr auto; }
  .srow .meta, .srow .arrow { display: none; }
  .srow .meta.keep { display: block; grid-column: 2; }
  .srow-thumb { display: none; }
  /* Header overflow fix — hide non-essential CTA buttons, keep only lang + hamburger */
  .hdr-cta a.discord { display: none; }
  .hdr-cta .coffee { display: none; }
  .hdr-in { gap: 12px; }
  .hdr-cta { gap: 8px; margin-left: auto; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 18px; }
  .hero-in { padding: 64px 18px 80px; min-height: 460px; }
  .feat-grid { grid-template-columns: 1fr; }
  .race-data { grid-template-columns: 1fr 1fr; }
  .row2 { grid-template-columns: 1fr; }
  /* Tighten header further on very small screens */
  .hdr-in { padding: 0 14px; gap: 8px; }
  .langbtn { padding: 6px 9px; font-size: 11px; }
  .brand-name { font-size: 17px; }
}
