/* BM3 Racing site. Same tokens as the app (light and dark), no scripts, no third-party requests. */
@font-face { font-family: "Reddit Sans"; src: url("../fonts/RedditSans-VF.ttf") format("truetype"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono-VF.ttf") format("truetype"); font-weight: 100 800; font-display: swap; }

:root {
  --font-ui: "Reddit Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 72px;
  --radius-sm: 8px; --radius-lg: 14px; --radius-full: 999px;
  --measure: none;
  --page: 1160px;

  --bg-app: #f6f6f8; --bg-surface: #ffffff; --bg-inset: #eff0f3; --bg-band: #0f1011;
  --line: #e2e3e8; --line-strong: #cfd1d8;
  --text: #16171a; --text-2: #474a52; --text-3: #646872;
  --accent: #5e6ad2; --accent-text: #4650b8; --accent-hover: #505cc6; --on-accent: #ffffff; --accent-soft: #e9eaf8;
  --attention: #905c00; --attention-soft: #f7efe0;
  --focus: #5e6ad2;
  --brand-lime: #e0ff37; --brand-blue: #20a0e7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg-app: #0f1011; --bg-surface: #141516; --bg-inset: #0a0b0c; --bg-band: #0a0b0c;
    --line: #25272b; --line-strong: #34343a;
    --text: #f7f8f8; --text-2: #d0d6e0; --text-3: #9ba0aa;
    --accent: #5e6ad2; --accent-text: #9aa4ff; --accent-hover: #6975dc; --on-accent: #ffffff; --accent-soft: #1b1d33;
    --attention: #e2b84d; --attention-soft: #241f10;
    --focus: #828fff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg-app); color: var(--text); font: 400 16px/1.6 var(--font-ui); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--bg-surface); color: var(--text); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); z-index: 10; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--space-4); }

/* header band: dark in both themes (the logo is made for dark) */
.band { background: var(--bg-band); color: #f7f8f8; }
.band .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 64px; flex-wrap: wrap; padding-top: var(--space-2); padding-bottom: var(--space-2); }
.brand img { width: 160px; }
.nav { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.nav a { color: #d0d6e0; text-decoration: none; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); font-weight: 500; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { background: #1c1d20; color: #fff; }
.nav a[aria-current="page"] { color: #fff; background: #1c1d20; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 700; }
h2 { font-size: 26px; font-weight: 650; margin-bottom: var(--space-4); }
h3 { font-size: 18px; font-weight: 600; margin-bottom: var(--space-2); letter-spacing: -0.01em; }
p { margin: 0 0 var(--space-4); max-width: var(--measure); }
.eyebrow { font: 600 12px/16px var(--font-ui); text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-text); margin-bottom: var(--space-3); }
.lead { font-size: 19px; color: var(--text-2); }
.muted { color: var(--text-3); }
.mono { font-family: var(--font-mono); font-size: 0.92em; }

section { padding: var(--space-7) 0; }
section + section { border-top: 1px solid var(--line); }
.hero { padding: var(--space-8) 0 var(--space-7); }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-top: var(--space-5); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 var(--space-5); border-radius: var(--radius-sm); font: 600 15px/1 var(--font-ui); text-decoration: none; border: 1px solid var(--line-strong); background: var(--bg-surface); color: var(--text); }
.btn:hover { background: var(--bg-inset); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn[aria-disabled="true"] { background: var(--bg-inset); border-color: var(--line); color: var(--text-3); cursor: not-allowed; }

/* panels */
.card { background: var(--bg-surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); }
.grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card p:last-child { margin-bottom: 0; }
.card.callout { background: var(--attention-soft); border-color: var(--attention); }
.card.callout h2, .card.callout h3 { color: var(--attention); }
.card.info { background: var(--accent-soft); border-color: var(--accent); }

.pill { display: inline-block; font: 600 12px/1 var(--font-ui); padding: 6px 10px; border-radius: var(--radius-full); border: 1px solid var(--line-strong); color: var(--text-2); background: var(--bg-surface); letter-spacing: 0.02em; }
.pill.attn { color: var(--attention); border-color: var(--attention); background: var(--attention-soft); }

ul.plain { margin: 0 0 var(--space-4); padding-left: 1.2em; max-width: var(--measure); }
ul.plain li { margin-bottom: var(--space-2); }
ol.steps { margin: 0 0 var(--space-4); padding-left: 1.4em; max-width: var(--measure); }
ol.steps li { margin-bottom: var(--space-3); }

.shot { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-surface); }
.shot .dark { display: none; }
@media (prefers-color-scheme: dark) { .shot .light { display: none; } .shot .dark { display: block; } }
figcaption { font-size: 14px; color: var(--text-3); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); }
figure { margin: 0; }

dl.faq dt { font-weight: 600; margin-top: var(--space-5); }
dl.faq dd { margin: var(--space-1) 0 0; color: var(--text-2); max-width: var(--measure); }

footer { border-top: 1px solid var(--line); padding: var(--space-6) 0 var(--space-7); color: var(--text-3); font-size: 14px; }
footer p { max-width: none; }
footer a { color: var(--text-2); }

@media (max-width: 640px) {
  section { padding: var(--space-6) 0; }
  .hero { padding: var(--space-7) 0 var(--space-6); }
  .brand img { width: 130px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a { transition: background-color 120ms cubic-bezier(0.2, 0, 0, 1); }
}

/* ---------- header: social icons ---------- */
.band .wrap { column-gap: var(--space-5); }
.social { display: flex; gap: 0; margin-left: auto; }
.social a { color: #d0d6e0; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); }
.social a:hover { background: #1c1d20; color: var(--brand-lime); }
.social-foot a { margin: 0 2px; }
.nav { margin-left: auto; }
.nav + .social { margin-left: 0; }

/* ---------- home hero (dark in both themes, channel colours) ---------- */
.hero.dark { position: relative; overflow: hidden; background: var(--bg-band); color: #f7f8f8; border-bottom: 1px solid #25272b; padding: var(--space-8) 0; }
.hero.dark + section { border-top: 0; }
.hero.dark .lead { color: #d0d6e0; }
.hero.dark h1 { font-size: clamp(36px, 6vw, 60px); letter-spacing: -0.03em; font-weight: 800; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-6); align-items: center; }
.avatar { width: 200px; height: 200px; border-radius: 50%; box-shadow: 0 0 0 1px #25272b; }
.btn.brand { background: var(--brand-lime); border-color: var(--brand-lime); color: #0a0b0c; }
.btn.brand:hover { background: #ecff6e; border-color: #ecff6e; color: #0a0b0c; }
.btn.ghost { background: transparent; border-color: #4a4d55; color: #f7f8f8; }
.btn.ghost:hover { background: #1c1d20; color: #fff; }
.btn svg { margin-right: var(--space-2); }
.streak { position: absolute; left: 0; height: 2px; width: 22%; background: linear-gradient(90deg, transparent, var(--brand-blue)); opacity: 0; pointer-events: none; }
.streak.s1 { top: 22%; } .streak.s2 { top: 58%; width: 30%; } .streak.s3 { top: 82%; width: 16%; }

/* ---------- latest videos: player + list ---------- */
.vwrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-5); align-items: stretch; }
.vwrap:not(.ready) { display: block; }
.vfallback { background: var(--bg-surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: #000; }
.player iframe, .player .play { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play { padding: 0; margin: 0; background: #000; cursor: pointer; display: block; }
.play img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 200ms; }
.play:hover img { opacity: 0.88; }
.play-icon { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; background: var(--brand-lime); }
.play-icon::after { content: ""; position: absolute; left: 29px; top: 22px; border-left: 22px solid #0a0b0c; border-top: 14px solid transparent; border-bottom: 14px solid transparent; }
.play:focus-visible { outline-offset: -4px; }
.now { padding-top: var(--space-4); }
.now h3 { font-size: 22px; margin: var(--space-2) 0 0; }
.vside { position: relative; min-height: 320px; }
.vlist { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-2); scrollbar-width: thin; }
.vitem { display: flex; gap: var(--space-3); align-items: flex-start; width: 100%; padding: var(--space-2); text-align: left; font: inherit; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; min-height: 44px; }
.vitem:hover { background: var(--bg-surface); border-color: var(--line); }
.vthumb { flex: 0 0 132px; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-inset); border: 1px solid var(--line); display: block; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vtext { min-width: 0; display: block; }
.vtitle { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; line-height: 1.3; font-size: 15px; }
.vmeta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-1); font-size: 13px; color: var(--text-3); }
.vitem:hover .vtitle { color: var(--accent-text); }
.tag-new { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--radius-full); background: var(--brand-lime); color: #0a0b0c; font: 700 11px/1 var(--font-ui); letter-spacing: 0.02em; }
.tag-new::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #0a0b0c; }
.now .vmeta { font-size: 14px; }

/* support card */
.card.support { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-5); align-items: start; border-color: var(--line-strong); }
.card.support h2 { margin-bottom: var(--space-3); }
.support-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-lime); color: #0a0b0c; display: inline-flex; align-items: center; justify-content: center; }
.support-icon svg { width: 28px; height: 28px; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: 0; }
.chips li { padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-full); background: var(--bg-surface); font-weight: 500; }
.follow .btn { gap: 0; }

/* ---------- motion (only when the visitor has not asked for less) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes dash { 0% { transform: translateX(-30%); opacity: 0; } 15% { opacity: 0.9; } 100% { transform: translateX(520%); opacity: 0; } }
  @keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.7); opacity: 0.45; } }
  .hero-text > * { animation: rise 640ms cubic-bezier(0.2, 0, 0, 1) both; }
  .hero-text > :nth-child(2) { animation-delay: 90ms; } .hero-text > :nth-child(3) { animation-delay: 180ms; }
  .avatar { animation: rise 720ms cubic-bezier(0.2, 0, 0, 1) 200ms both; }
    .streak { animation: dash 4800ms cubic-bezier(0.4, 0, 0.2, 1) infinite; }
  .streak.s2 { animation-delay: 1600ms; } .streak.s3 { animation-delay: 3100ms; }
  .tag-new::before { animation: pulse 1800ms ease-in-out infinite; }
  .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 520ms cubic-bezier(0.2, 0, 0, 1), transform 520ms cubic-bezier(0.2, 0, 0, 1); }
  .js .reveal.in { opacity: 1; transform: none; }
  .card.lift, .chips li { transition: transform 200ms cubic-bezier(0.2, 0, 0, 1), border-color 200ms; }
  .card.lift:hover { transform: translateY(-3px); border-color: var(--line-strong); }
  .chips li:hover { transform: translateY(-2px); border-color: var(--accent); }
}
@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .avatar { width: 112px; height: 112px; order: -1; }
  .hero.dark { padding: var(--space-7) 0; }
  .vwrap { grid-template-columns: 1fr; }
  .vside { min-height: 0; }
  .vlist { position: static; overflow: visible; }
  .card.support { grid-template-columns: 1fr; }
  .social { order: 1; margin-left: auto; }
  .nav { order: 2; flex-basis: 100%; margin-left: 0; }
}

/* inline logo that replaces the written name: transparent version on dark pages, the original badge on light pages */
.brandmark { display: inline-flex; align-items: center; line-height: 0; }
.brandmark img { height: 1.1em; width: auto; display: block; }
h2:has(.brandmark), .social-foot { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-3); }
.social-foot .brandmark img { height: 1.5em; }
.social-foot { row-gap: var(--space-1); }

/* sticky header */
.band { position: sticky; top: 0; z-index: 20; }
section[id] { scroll-margin-top: 88px; }

/* donate button in the sticky header (channel yellow) */
.donate { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-4); border-radius: var(--radius-full); background: var(--brand-lime); color: #0a0b0c; font: 700 14px/1.2 var(--font-ui); text-decoration: none; white-space: nowrap; }
.donate:hover { background: #ecff6e; color: #0a0b0c; }
.donate:focus-visible { outline-color: var(--brand-lime); }
.donate svg { flex: none; }
.donate .short { display: none; }
@media (max-width: 480px) { .band .social { display: none; } .donate { margin-left: auto; } }
@media (max-width: 760px) { .donate { order: 1; } .donate .long { display: none; } .donate .short { display: inline; } .social { margin-left: auto; } }
