:root {
  --red: #d92d2d;
  --red-dark: #b01f1f;
  --red-text: #b01f1f;
  --link: #b01f1f;
  --ink: #111214;
  --text: #111214;
  --ink-2: #3b3f45;
  --muted: #5b6370;
  --line: #e5e7eb;
  --field-border: #6b7280;
  --bg: #ffffff;
  --surface: #ffffff;
  --bg-alt: #f4f4f5;
  --row-alt: #fafafa;
  --accent: #f5a524;
  --focus: #1d4ed8;
  --warn-bg: #fff8e6; --warn-line: #e0b84a; --warn-text: #6a4b00;
  --ok-bg: #ecfdf3; --ok-line: #a6e9c1; --ok-text: #05603a;
  --err-bg: #fef2f2; --err-line: #f5b5b5; --err-text: #8a1c1c;
  --chip-bg: #fde8e8; --chip-text: #8a1c1c;
  --danger: #b3261e;
  --ph-a: #e9eaec; --ph-b: #f1f2f4; --ph-line: #c3c7cd;
  --logo-bg: transparent; --logo-pad: 0;
  --shadow: rgba(0,0,0,.08);
  --radius: 10px;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --red-text: #ff8c8c;
  --link: #ff9a9a;
  --ink: #1c1e22;
  --text: #f1f2f4;
  --ink-2: #c9ced6;
  --muted: #a7aeb9;
  --line: #34383f;
  --field-border: #8a93a1;
  --bg: #0e0f11;
  --surface: #17191c;
  --bg-alt: #1d2024;
  --row-alt: #1b1d21;
  --focus: #ffd166;
  --warn-bg: #2b2410; --warn-line: #7a5f1d; --warn-text: #f3d58a;
  --ok-bg: #0f2a1c; --ok-line: #1f6b45; --ok-text: #8ee6b4;
  --err-bg: #2d1414; --err-line: #7a2a2a; --err-text: #ffb4b4;
  --chip-bg: #3a1c1c; --chip-text: #ffb4b4;
  --danger: #ff8c8c;
  --ph-a: #1d1f23; --ph-b: #25282d; --ph-line: #3a3e45;
  --logo-bg: transparent;
  --shadow: rgba(0,0,0,.5);
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --red-text: #ff8c8c;
  --link: #ff9a9a;
  --ink: #1c1e22;
  --text: #f1f2f4;
  --ink-2: #c9ced6;
  --muted: #a7aeb9;
  --line: #34383f;
  --field-border: #8a93a1;
  --bg: #0e0f11;
  --surface: #17191c;
  --bg-alt: #1d2024;
  --row-alt: #1b1d21;
  --focus: #ffd166;
  --warn-bg: #2b2410; --warn-line: #7a5f1d; --warn-text: #f3d58a;
  --ok-bg: #0f2a1c; --ok-line: #1f6b45; --ok-text: #8ee6b4;
  --err-bg: #2d1414; --err-line: #7a2a2a; --err-text: #ffb4b4;
  --chip-bg: #3a1c1c; --chip-text: #ffb4b4;
  --danger: #ff8c8c;
  --ph-a: #1d1f23; --ph-b: #25282d; --ph-line: #3a3e45;
  --logo-bg: transparent;
  --shadow: rgba(0,0,0,.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); color: var(--text); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--link); }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.1; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; text-transform: uppercase; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; text-transform: uppercase; }
h3 { font-size: 1.5rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: #111214; color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.site-footer :focus-visible, .page-head :focus-visible, .hero :focus-visible, .staff-bar :focus-visible, .featured :focus-visible, .section.dark :focus-visible, .skip:focus-visible { outline-color: #ffd166; }

/* Buttons */
.btn { display: inline-block; font-family: var(--display); font-weight: 700; font-size: 1.1rem; letter-spacing: .05em; text-transform: uppercase; text-decoration: none; padding: .6em 1.3em; border-radius: 6px; border: 2px solid transparent; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { border-color: #fff; color: #fff; }
.btn-ghost:hover { background: #fff; color: #111214; }
.btn-outline { border-color: var(--text); color: var(--text); background: transparent; }
.btn-outline:hover { background: var(--text); color: var(--bg); }
.btn-sm { font-size: .95rem; padding: .4em .9em; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 4px solid var(--red); box-shadow: 0 2px 12px var(--shadow); }
.logo { height: 52px; width: auto; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none; } :root:not([data-theme="light"]) .logo-dark { display: block; } }
.logo-plate { height: 52px; width: auto; background: #fff; padding: 6px 12px; border-radius: 8px; margin-bottom: .75rem; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: #fff; }
.logo-ph { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--red); border: 3px solid #fff; font-family: var(--display); font-weight: 800; font-size: 1.6rem; color: #fff; }
.brand-text { font-family: var(--display); font-weight: 800; font-size: 1.7rem; letter-spacing: .03em; color: #fff; line-height: 1; display: flex; flex-direction: column; }
.brand-text small { font-size: .72rem; letter-spacing: .22em; font-weight: 700; color: #cbd0d8; margin-top: 2px; }
.nav { display: flex; align-items: center; gap: .25rem; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; padding: .5rem .8rem; border-radius: 6px; font-size: .95rem; }
.nav a:hover { color: var(--text); background: var(--bg-alt); }
.nav a.active { color: var(--text); box-shadow: inset 0 -3px 0 var(--red); border-radius: 0; }
.nav .nav-cta { margin-left: .5rem; font-size: 1rem; color: #fff; padding: .4em 1em; }
.nav .nav-cta:hover { background: var(--red-dark); color: #fff; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 24px; height: 3px; background: var(--text); border-radius: 2px; position: relative; margin: auto; content: ""; }
.nav-toggle span::before { position: absolute; top: -8px; left: 0; }
.nav-toggle span::after { position: absolute; top: 8px; left: 0; }

/* Placeholders */
.ph { position: relative; aspect-ratio: var(--ratio, 16 / 9); width: 100%; border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; text-align: center; padding: 1rem;
  background: repeating-linear-gradient(45deg, var(--ph-a) 0 14px, var(--ph-b) 14px 28px); color: var(--muted); font-size: .9rem; font-weight: 600; border: 1px dashed var(--ph-line); }
.ph span { background: var(--surface); padding: .25em .7em; border-radius: 999px; }
.ph.dark { background: repeating-linear-gradient(45deg, #1d1f23 0 14px, #25282d 14px 28px); border-color: #3a3e45; color: #9aa0a9; }
.ph.dark span { background: rgba(0,0,0,.55); }

/* Hero */
.hero { position: relative; color: #fff; background: var(--ink); isolation: isolate; }
.hero .ph { position: absolute; inset: 0; z-index: -2; border-radius: 0; border: 0; aspect-ratio: auto; height: 100%; align-content: start; justify-items: end; }
.hero-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 50% 80%; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(17,18,20,.6), rgba(17,18,20,.15) 65%, rgba(17,18,20,0)); }
.hero h1 { text-shadow: 0 2px 16px rgba(0,0,0,.45); }
.hero { min-height: clamp(380px, 48vw, 560px); display: flex; align-items: center; }
.hero-inner { padding: 4rem 0 6rem; max-width: 680px; }
.eyebrow { font-family: var(--display); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-size: 1rem; margin-bottom: .5rem; }
.hero p { font-size: 1.15rem; color: #e5e7eb; max-width: 52ch; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* Sections */
.section { padding: clamp(2.5rem, 7vw, 5rem) 0; }
.section.alt { background: var(--bg-alt); }
.section.dark { background: var(--ink); color: #fff; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-head h2 { margin: 0; }
.page-head { background: var(--ink); color: #fff; padding: clamp(2rem, 6vw, 3.5rem) 0; border-bottom: 4px solid var(--red); }
.page-head h1 { margin: 0 0 .25em; }
.page-head p { color: #cbd0d8; margin: 0; max-width: 60ch; }

/* Next event */
.next { display: grid; grid-template-columns: 130px 1fr auto; gap: 1.5rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--red); border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 8px 24px var(--shadow); margin-top: -3rem; position: relative; z-index: 2; }
.datebox { text-align: center; background: var(--ink); color: #fff; border-radius: 8px; padding: .8rem; }
.datebox .m { font-family: var(--display); letter-spacing: .15em; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.datebox .d { font-family: var(--display); font-size: 3.4rem; font-weight: 800; line-height: 1; }
.datebox .y { font-size: .8rem; color: #9aa0a9; }
.next h3 { margin-bottom: .2em; font-size: 2rem; }
.next .venue { color: var(--ink-2); margin: 0; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.stat { text-align: center; padding: 1.2rem; border: 1px solid #2b2e34; border-radius: var(--radius); }
.stat b { display: block; font-family: var(--display); font-size: 3rem; line-height: 1; color: var(--accent); }
.stat span { color: #cbd0d8; font-size: .9rem; }

/* Grids */
.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-body { padding: 1.1rem 1.25rem 1.4rem; }
.card h3 { margin-bottom: .3em; }
.card p { color: var(--ink-2); margin: 0; }

.steps { counter-reset: s; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { position: relative; padding: 1.5rem; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }
.step::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: #fff; font-family: var(--display); font-weight: 800; font-size: 1.5rem; margin-bottom: .8rem; }

.home-split { display: grid; grid-template-columns: 1fr 340px; gap: 2.5rem; align-items: start; }
.steps-stack { grid-template-columns: 1fr; gap: 1rem; }
.steps-stack .step { padding: 1rem 1.25rem 1rem 4.5rem; }
.steps-stack .step::before { position: absolute; left: 1.1rem; top: 1rem; margin: 0; }
.steps-stack .step h3 { margin-bottom: .2em; }
.steps-stack .step p { margin: 0; }
.featured { background: var(--ink); color: #fff; border-top: 5px solid var(--red); border-radius: var(--radius); padding: 1.75rem; position: sticky; top: 96px; }
.featured h3 { font-size: 1.9rem; }
.featured p { color: #cbd0d8; }
.featured .eyebrow { margin-bottom: .75rem; }
@media (max-width: 860px) { .home-split { grid-template-columns: 1fr; } .featured { position: static; } }

/* Schedule */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; align-items: center; }
.filters .spacer { flex: 1; }
.chip { font: inherit; font-weight: 600; padding: .4em 1em; border-radius: 999px; border: 2px solid var(--field-border); background: var(--surface); color: var(--text); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1.5rem; font-size: .95rem; }
.event-list { display: grid; gap: 1rem; }
.event { display: grid; grid-template-columns: 90px 1fr auto; gap: 1.25rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
.event[hidden] { display: none; }
.event.is-next { border-color: var(--red); box-shadow: 0 0 0 2px var(--red) inset; }
.event.past { opacity: .72; }
.event .datebox { padding: .5rem; }
.event .datebox .d { font-size: 2.2rem; }
.event h3 { margin: 0; font-size: 1.5rem; }
.event .meta { color: var(--ink-2); font-size: .95rem; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .15em .6em; border-radius: 999px; background: var(--bg-alt); color: var(--ink-2); margin-left: .5rem; vertical-align: middle; font-family: var(--body); }
.tag.red { background: var(--red); color: #fff; }

/* Tables / results */
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tabs a { text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.2rem; padding: .3em .9em; border-radius: 6px; border: 2px solid var(--field-border); color: var(--text); }
.tabs a[aria-current="page"] { background: var(--red); border-color: var(--red); color: #fff; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 540px; }
th, td { padding: .65rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
th { font-family: var(--display); letter-spacing: .06em; text-transform: uppercase; font-size: 1rem; background: var(--ink); color: #fff; position: sticky; top: 0; }
tbody tr:nth-child(even) { background: var(--row-alt); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
details.acc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .75rem; }
details.acc summary { cursor: pointer; padding: 1rem 1.25rem; font-family: var(--display); font-weight: 700; font-size: 1.35rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: "+"; font-size: 1.6rem; color: var(--red); }
details.acc[open] summary::after { content: "\2212"; }
details.acc .acc-body { padding: 0 1.25rem 1.25rem; }
.sample-note { font-size: .85rem; color: var(--muted); margin-top: 1rem; }

/* Sponsors */
.sponsor { display: flex; flex-direction: column; gap: .75rem; }
.sponsor .ph { aspect-ratio: 5 / 3; }
.sponsor h3 { margin: 0; }
.sponsor-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }

/* About / people */
.person { text-align: center; }
.person .ph { aspect-ratio: 1; border-radius: 50%; max-width: 180px; margin: 0 auto .75rem; }
.person h3 { margin: 0; font-size: 1.25rem; }
.person p { color: var(--muted); margin: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.two-col { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; align-items: center; }
.faq { max-width: 820px; }

/* Forms */
.form { display: grid; gap: 1rem; max-width: 560px; }
.form label { font-weight: 600; display: grid; gap: .3rem; }
.form input, .form textarea { font: inherit; padding: .7rem .9rem; border: 2px solid var(--field-border); border-radius: 8px; background: var(--surface); color: var(--text); }
.form input:focus-visible, .form textarea:focus-visible, .form select:focus-visible { border-color: var(--focus); }
.field-error { color: var(--err-text); font-size: .85rem; font-weight: 500; }
.success { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-text); padding: 1rem 1.25rem; border-radius: var(--radius); }

.logo-box { display: grid; place-items: center; aspect-ratio: 5 / 3; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery a { display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius); background: var(--bg-alt); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gallery a:hover img { transform: scale(1.04); }
.sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.sheets a { display: block; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sheets img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; background: var(--surface); }
.sheets span { display: block; padding: .4rem .6rem; font-weight: 600; font-size: .85rem; }
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.downloads a { display: block; padding: 1rem 1.25rem; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--radius); text-decoration: none; font-weight: 600; color: var(--text); background: var(--surface); }
.downloads a::after { content: " \2192"; color: var(--red); }

.event h3 a.plain { color: inherit; text-decoration: none; }
.event h3 a.plain:hover { text-decoration: underline; }
.result-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.result-tabs a { text-decoration: none; font-weight: 600; padding: .35em 1em; border: 2px solid var(--text); border-radius: 999px; color: var(--text); }
.result-tabs a:hover { background: var(--text); color: var(--bg); }
.result-tabs a.muted { border-color: var(--line); color: var(--muted); margin-left: auto; }
.result-fig { margin: 0 0 2rem; scroll-margin-top: 90px; }
.result-fig figcaption { font-family: var(--display); font-weight: 700; font-size: 1.5rem; text-transform: uppercase; margin-bottom: .5rem; }
.result-fig img { width: 100%; max-width: 1100px; height: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.event-nav { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1.25rem; margin-top: 1rem; }
.event-nav a { font-weight: 600; }
.event-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.event-links a { display: block; padding: 1rem 1.25rem; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--radius); text-decoration: none; color: var(--text); background: var(--surface); }
.event-links a:hover { border-color: var(--red); }
.event-links span { display: block; color: var(--muted); font-size: .9rem; }

/* Footer */
.site-footer { background: var(--ink); color: #cbd0d8; border-top: 4px solid var(--red); padding-top: 3rem; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding-bottom: 2rem; }
.footer-grid h4 { color: #fff; font-size: 1.2rem; letter-spacing: .08em; text-transform: uppercase; }
.footer-grid a { display: block; color: #cbd0d8; text-decoration: none; padding: .15rem 0; }
.footer-grid a:hover { color: #fff; text-decoration: underline; }
.legal { border-top: 1px solid #2b2e34; padding: 1rem 0 1.5rem; font-size: .85rem; color: #8a909a; }

/* Responsive */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .logo { height: 42px; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); flex-direction: column; align-items: stretch; padding: .5rem 16px 1rem; display: none; border-bottom: 4px solid var(--red); }
  .nav.open { display: flex; }
  .nav a { padding: .8rem .5rem; }
  .nav a.active { box-shadow: inset 4px 0 0 var(--red); padding-left: 1rem; }
  .nav .nav-cta { margin: .5rem 0 0; text-align: center; }
  .next { grid-template-columns: 1fr; margin-top: -2rem; }
  .datebox { display: flex; gap: .6rem; align-items: baseline; justify-content: center; }
  .two-col, .footer-grid { grid-template-columns: 1fr; }
  .event { grid-template-columns: 70px 1fr; }
  .event .btn { grid-column: 1 / -1; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

.bullets { margin: 0 0 1.5rem; padding-left: 1.25rem; }
.bullets li { margin-bottom: .6rem; }
.bullets li::marker { color: var(--red); }

/* Live results link: first in the nav, shown only while an event is being timed. */
.nav .nav-live { background: var(--red); color: #fff; font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase; padding: .35em .95em; border-radius: 999px; margin-right: .5rem; white-space: nowrap; display: inline-flex; align-items: center; gap: .5em; box-shadow: 0 0 0 0 rgba(217,45,45,.55); animation: nav-live-glow 2s ease-out infinite; }
.nav .nav-live:hover { background: var(--red-dark); color: #fff; }
.nav .nav-live.active { box-shadow: 0 0 0 3px rgba(217,45,45,.25); border-radius: 999px; animation: none; color: #fff; }
.nav-live-dot { width: .55em; height: .55em; border-radius: 50%; background: #fff; animation: nav-live-pulse 1.2s ease-in-out infinite; }
@keyframes nav-live-pulse { 50% { opacity: .25; } }
@keyframes nav-live-glow { 0% { box-shadow: 0 0 0 0 rgba(217,45,45,.5); } 70%, 100% { box-shadow: 0 0 0 10px rgba(217,45,45,0); } }
@media (prefers-reduced-motion: reduce) { .nav .nav-live, .nav-live-dot { animation: none; } }
@media (max-width: 860px) { .nav .nav-live { align-self: flex-start; margin: 0 0 .4rem; } }

/* Keep the logo from being squeezed by the extra Live pill. */
.brand, .logo { flex-shrink: 0; }

/* The nav (8 links + Register, and the Live pill during an event) does not fit between 861 and 1000px, so use the
   same hamburger menu as phones up to 1000px (the site's own mobile-menu rules, repeated for this band)... */
@media (min-width: 861px) and (max-width: 1000px) {
  .nav-toggle { display: block; }
  .logo { height: 42px; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); flex-direction: column; align-items: stretch; padding: .5rem 16px 1rem; display: none; border-bottom: 4px solid var(--red); }
  .nav.open { display: flex; }
  .nav a { padding: .8rem .5rem; }
  .nav a.active { box-shadow: inset 4px 0 0 var(--red); padding-left: 1rem; }
  .nav .nav-cta { margin: .5rem 0 0; text-align: center; }
  .nav .nav-live { align-self: flex-start; margin: 0 0 .4rem; }
}
/* ...and tighten the desktop nav a little up to 1180px. */
@media (min-width: 1001px) and (max-width: 1180px) {
  .logo { height: 44px; }
  .bar { gap: .5rem; }
  .nav { gap: 0; }
  .nav a { padding: .5rem .45rem; }
  .nav .nav-live { padding: .3em .8em; margin-right: .25rem; }
  .nav .nav-cta { margin-left: .25rem; padding: .4em .8em; }
}

/* Admin */
.admin-tabs .muted-tab { margin-left: auto; border-color: var(--line); color: var(--muted); }
.flash { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-weight: 500; }
.flash.ok { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-text); }
.flash.error { background: var(--err-bg); border: 1px solid var(--err-line); color: var(--err-text); }
.admin-table td, .admin-table th { vertical-align: middle; }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: .15em .65em; border-radius: 999px; background: var(--bg-alt); color: var(--ink-2); }
.badge.ok { background: var(--ok-bg); color: var(--ok-text); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--bg); }
.posted { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.posted-item { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.posted-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; background: var(--surface); display: block; }
.posted-meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .6rem .8rem; flex-wrap: wrap; }
.posted-table { align-self: start; }
.form select { font: inherit; padding: .7rem .9rem; border: 2px solid var(--field-border); border-radius: 8px; background: var(--surface); color: var(--text); }
.form .check { display: flex; gap: .5rem; align-items: center; font-weight: 500; }
.inline-form { display: block; margin: 0; }
.linklike { background: none; border: 0; padding: .15rem 0; font: inherit; color: #cbd0d8; cursor: pointer; text-align: left; }
.linklike:hover { color: #fff; text-decoration: underline; }
.staff-link { opacity: .9; font-size: .9rem; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Legal / consent */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.6rem; margin-top: 2rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: .4rem; }
.legal a { color: #cbd0d8; }
.consent-box { border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--radius); background: var(--bg-alt); padding: 1rem 1.1rem; display: grid; gap: .75rem; }
.consent-box .consent-intro { margin: 0; font-size: .92rem; color: var(--ink-2); }
.form .check { align-items: flex-start; }
.form .check input[type=checkbox] { margin-top: .3rem; width: 1.1rem; height: 1.1rem; flex: none; }

/* Results: event cards */
.result-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:18px}
.result-card{display:flex;flex-direction:column;justify-content:space-between;border:1px solid var(--line);border-radius:var(--radius);background: var(--surface);color:var(--text);text-decoration:none;overflow:hidden;transition:box-shadow .15s,transform .15s}
.result-card:hover{box-shadow:0 6px 20px var(--shadow);transform:translateY(-2px)}
.rc-top{display:flex;gap:14px;align-items:center;padding:16px}
.rc-date{min-width:58px;text-align:center;background:var(--ink);color:#fff;border-radius:8px;padding:8px 6px;font-family:var(--display);line-height:1}
.rc-date small{display:block;font-size:14px;letter-spacing:.1em;color:var(--accent);text-transform:uppercase}
.rc-date span{font-size:30px}
.result-card h3{margin:0;font-family:var(--display);font-size:24px;text-transform:uppercase}
.rc-venue{color:var(--muted);font-size:13px}
.rc-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:12px 16px;background:var(--bg-alt);flex-wrap:wrap}
.rc-chip{display:inline-block;font-size:12px;font-weight:700;padding:3px 9px;border-radius:999px;background:var(--chip-bg);color:var(--chip-text);margin-right:5px}
.rc-btn{background:var(--red);color:#fff;border-radius:6px;padding:7px 14px;font-weight:700;font-size:13px}

/* Season standings: one consistent look (see Services/StandingsNormalizer.cs) */
.standings table{font-variant-numeric:tabular-nums}
.standings th,.standings td{white-space:nowrap}
.standings th.st-rank,.standings td.st-rank{width:3.5rem;text-align:center;color:var(--muted);font-weight:700}
.standings td.st-driver{font-weight:600;color: var(--text)}
.standings th.st-driver{min-width:12rem}
.standings td.st-points{font-weight:800;color: var(--text)}
.standings td.st-none{color:var(--muted)}
.standings tr.st-top td.st-rank{color:#fff;font-family:var(--display);font-size:1.15rem;font-weight:800}
.standings tr.st-p1 td.st-rank{background:var(--accent);color:#111214}
.standings tr.st-p2 td.st-rank{background:#c9ced6;color:#111214}
.standings tr.st-p3 td.st-rank{background:#e0a878;color:#111214}
.standings tr.st-p1 td{background:var(--warn-bg)}
.standings td.num,.standings th.num{padding-left:.6rem;padding-right:.6rem}
.st-legend{color:var(--muted);font-size:.9rem;margin:1rem 0 0}
@media (max-width:640px){.standings th,.standings td{padding:.5rem .6rem;font-size:.9rem}.standings th.st-driver{min-width:9rem}}

/* Staff view: extra controls shown only to signed-in Admin/Editor */
.staff-bar{background:#1f2937;color:#e5e7eb;font-size:13px}
.staff-bar .wrap{display:flex;gap:16px;align-items:center;flex-wrap:wrap;padding-top:7px;padding-bottom:7px}
.staff-bar a{color:#fff;text-decoration:none;font-weight:600}.staff-bar a:hover{text-decoration:underline}
.sb-who{margin-right:auto;color:var(--accent);font-weight:700}
.staff-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;background: var(--warn-bg);color:var(--warn-text);border:1px dashed var(--warn-line);border-radius:var(--radius);padding:10px 14px;margin-bottom:20px}
.rc-wrap{display:flex;flex-direction:column}.rc-wrap .result-card{flex:1}
.rc-staff{display:flex;gap:12px;font-size:13px;font-weight:600;padding:8px 4px 0}
.rc-chip.rc-none{background:var(--warn-bg);color:var(--warn-text)}
.staff-bar .sb-out{color:#fff;font-weight:700;background:#b01f1f;border-radius:5px;padding:3px 12px;border:0;cursor:pointer;font:inherit;font-weight:700}
.staff-bar .sb-out:hover{background:var(--red)}

/* Theme toggle and accessibility helpers */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 2px solid var(--field-border); border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.theme-toggle:hover { background: var(--bg-alt); }
.bar-tools { display: flex; align-items: center; gap: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
#main:focus { outline: none; }
.table-wrap:focus-visible { outline-offset: -3px; }
.staff-edit{margin:.75rem 0 0;font-size:.85rem}.staff-edit a{font-weight:600}.featured .staff-edit a{color:#ffd166}

/* Standings: PAX and Raw side by side on wide screens, stacked on narrow ones */
.standings-grid { display: grid; gap: 1.5rem 1.75rem; margin-top: 1.5rem; }
.standings-col { min-width: 0; }
.standings-col h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
@media (min-width: 1000px) { .standings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }

/* Event results: PAX and Raw side by side on wide screens, stacked on narrow ones */
.results-grid { display: grid; gap: 1.5rem 1.75rem; margin-bottom: 2rem; }
.results-col { min-width: 0; margin: 0; }
.results-col h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-top: 0; }
.result-more { text-align: right; margin: 0 0 1rem; font-weight: 600; }
.results-grid .result-fig img { max-width: 100%; }
@media (min-width: 1000px) { .results-grid:not(.one) { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }

/* Admin gallery */
.alt-form { display: flex; gap: .4rem; flex: 1; min-width: 0; }
.alt-form input { flex: 1; min-width: 0; font: inherit; padding: .35rem .5rem; border: 2px solid var(--field-border); border-radius: 6px; background: var(--surface); color: var(--text); }


/* Admin data page */
.query-form { max-width: none; }
.query-form textarea { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .95rem; width: 100%; }
.muted-note { color: var(--muted); font-size: .9rem; }

/* Storage meter */
.usage { margin: 0 0 1.5rem; max-width: 560px; }
.usage p { margin: 0 0 .3rem; }
.usage progress { width: 100%; height: 14px; accent-color: var(--red); }

/* Storage panel (admin) and staff-bar chip */
.storage-card { border: 2px solid var(--ok-line); background: var(--ok-bg); color: var(--ok-text); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 0 0 2rem; max-width: 720px; }
.storage-card.storage-warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-text); }
.storage-card.storage-full { border-color: var(--err-line); background: var(--err-bg); color: var(--err-text); }
.storage-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.storage-head h2 { margin: 0; font-size: 1.6rem; color: inherit; }
.storage-badge { font-weight: 800; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; padding: .2em .8em; border-radius: 999px; border: 2px solid currentColor; }
.storage-numbers { margin: .5rem 0 .75rem; font-size: 1.1rem; }
.storage-numbers strong { font-family: var(--display); font-size: 2.6rem; line-height: 1; font-weight: 800; margin-right: .3rem; }
.storage-numbers em { font-style: normal; font-weight: 700; margin-left: .75rem; }
.storage-bar { height: 22px; background: var(--surface); border: 2px solid currentColor; border-radius: 999px; overflow: hidden; }
.storage-fill { height: 100%; background: currentColor; min-width: 0; transition: width .3s; }
.storage-note { margin: .75rem 0 0; font-size: .95rem; }
.sb-storage { padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; font-weight: 700; }
.staff-bar .sb-storage-ok { color: #8ee6b4; }
.staff-bar .sb-storage-warn { color: #ffd166; }
.staff-bar .sb-storage-full { color: #ff9a9a; }

/* Admin gallery: photo cards */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.photo-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.photo-thumb { display: block; aspect-ratio: 4 / 3; background: var(--bg-alt); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-body { padding: .9rem 1rem 1rem; }
.photo-form { display: grid; gap: .45rem; }
.photo-form label { font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.photo-form input { font: inherit; width: 100%; padding: .55rem .7rem; border: 2px solid var(--field-border); border-radius: 8px; background: var(--surface); color: var(--text); }
.photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .35rem; }
.photo-actions .btn { text-align: center; padding: .55em .5em; font-size: 1rem; }
