/* OHM race — shared styles. Monochrome + one cyan accent. Mobile-first. */

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-600.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-700.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-var.woff2") format("woff2");
}

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --surface-3: #262626;
  --line: #2e2e2e;
  --line-strong: #4a4a4a;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --dim: #737373;
  --accent: #19c3ff;
  --accent-ink: #001620;
  --accent-soft: rgba(25, 195, 255, 0.12);
  --err: #ff6b6b; /* functional: errors/destructive only */
  --radius: 10px;
  --radius-sm: 6px;
  --gap: 16px;
  --font-head: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tap: 48px;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

h1, h2, h3, h4, .head {
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.02;
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(2.5rem, 9vw, 4.75rem); }
h2 { font-size: clamp(1.75rem, 5.5vw, 2.5rem); }
h3 { font-size: 1.4rem; font-weight: 600; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--radius-sm);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* Layout */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 640px; }
.stack > * + * { margin-top: var(--gap); }
.stack-sm > * + * { margin-top: 8px; }
.stack-lg > * + * { margin-top: 32px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid-2 { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.section { padding: 40px 0; }
.hidden, [hidden] { display: none !important; }

/* Header / footer */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand img { height: 36px; width: auto; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.08em; text-transform: uppercase; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  text-decoration: none; color: var(--muted); border-radius: var(--radius-sm);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--dim); font-size: 0.875rem; margin-top: 48px; }
.site-footer a { color: var(--muted); }

/* Text helpers */
.eyebrow {
  font-family: var(--font-head); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.24em; font-size: 0.85rem; color: var(--accent); margin: 0 0 10px;
}
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 0.875rem; }
.accent { color: var(--accent); }
.mono, .num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.big-num {
  font-family: var(--font-head); font-weight: 700; line-height: 0.9;
  font-size: clamp(6rem, 34vw, 13rem); color: var(--accent); font-variant-numeric: tabular-nums;
}
.lead { font-size: 1.125rem; color: var(--muted); }
.error-text { color: var(--err); font-size: 0.875rem; margin-top: 6px; }

/* Buttons */
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  font-family: var(--font-head); font-weight: 700; font-size: 1.1rem;
  text-transform: uppercase; letter-spacing: 0.06em; text-decoration: none;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.btn:hover { border-color: var(--text); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #4fd3ff; border-color: #4fd3ff; color: var(--accent-ink); }
.btn-light { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-light:hover { background: #fff; color: var(--bg); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger { background: transparent; border-color: var(--err); color: var(--err); }
.btn-danger:hover { background: rgba(255, 107, 107, 0.1); border-color: var(--err); color: var(--err); }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 0.95rem; }
.btn-lg { min-height: 64px; padding: 0 28px; font-size: 1.5rem; }
.btn-block { display: flex; width: 100%; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label {
  font-weight: 600; font-size: 0.875rem; color: var(--text);
}
.field .hint { font-size: 0.8125rem; color: var(--dim); }
.input, .select, .textarea,
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="search"], input[type="date"], input[type="time"], input[type="datetime-local"],
select, textarea {
  width: 100%; min-height: var(--tap);
  padding: 10px 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: 16px; /* avoid iOS zoom */
}
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--err); }
::placeholder { color: var(--dim); }

.check { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; cursor: pointer; }
.check input[type="checkbox"], .check input[type="radio"] {
  width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent);
}
.check span { font-size: 0.9375rem; color: var(--muted); }

fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0; }
legend { padding: 0 8px; font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

/* Segmented control (radio group styled as tabs) */
.segmented { display: flex; gap: 6px; flex-wrap: wrap; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
}
.segmented input:checked + label { background: var(--text); color: var(--bg); border-color: var(--text); }
.segmented input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Cards, badges, notices */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card-tight { padding: 14px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 8px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  white-space: nowrap;
}
.badge-accent { border-color: var(--accent); color: var(--accent); }
.badge-solid { background: var(--text); border-color: var(--text); color: var(--bg); }
.badge-err { border-color: var(--err); color: var(--err); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); display: inline-block; flex: none; }
.dot-on { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dot-off { background: var(--err); }

.notice { border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--surface); }
.notice-err { border-left-color: var(--err); }

/* Tabs / chips */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; min-height: 48px; padding: 0 16px; background: none; border: 0; border-bottom: 3px solid transparent;
  color: var(--muted); font-family: var(--font-head); font-weight: 600; font-size: 1.05rem;
  text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer;
}
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 0.875rem; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th {
  font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.8rem; color: var(--dim); background: var(--surface); position: sticky; top: 0;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface); }
.table .num, .table td.time { text-align: right; font-variant-numeric: tabular-nums; }
.table td.time { font-weight: 600; }

/* Dialog */
dialog {
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 0;
  background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.72); }
.dialog-body { padding: 20px; overflow-y: auto; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* Toasts */
.toast-host { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(480px, calc(100vw - 24px)); pointer-events: none; }
.toast {
  pointer-events: auto; background: var(--text); color: var(--bg); border-radius: var(--radius-sm);
  padding: 12px 16px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.toast-err { background: var(--err); color: #1a0000; }
.toast-ok { background: var(--accent); color: var(--accent-ink); }

/* Loading */
.spinner { width: 22px; height: 22px; border: 3px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 32px 16px; text-align: center; color: var(--dim); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media print {
  :root { --bg: #fff; --text: #000; --muted: #333; --dim: #555; --line: #bbb; --surface: #fff; --accent: #000; }
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .no-print, .toast-host, .btn { display: none !important; }
  .table th { position: static; background: #fff; color: #000; }
  .table-wrap { border: 0; overflow: visible; }
  a { color: #000; text-decoration: none; }
}
