/* RaceStatus site styles */

:root {
  --bg: #0d0f12;
  --bg-alt: #14171c;
  --panel: #1b1f26;
  --line: #2a2f38;
  --text: #eef1f5;
  --muted: #a3abb8;
  --green: #1fd16b;
  --yellow: #ffd21f;
  --red: #ff3b3b;
  --white: #f4f4f4;
  --accent: var(--yellow);
  --radius: 14px;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
img { max-width: 100%; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 480px) { .wrap { padding: 0 16px; } }

h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 800; text-transform: uppercase; }
h1 span { color: var(--accent); }
h2 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 700; text-transform: uppercase; }
h3 { font-size: 1.45rem; font-weight: 700; }

.eyebrow {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: .14em; color: var(--accent); margin: 0 0 .6em; font-size: .95rem;
}
.lead { font-size: 1.12rem; color: var(--muted); max-width: 38em; }
.note { color: var(--muted); margin-top: 2rem; }
.muted { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-block; background: var(--accent); color: #111; font-weight: 600;
  text-decoration: none; padding: .8em 1.4em; border-radius: 10px; border: 2px solid var(--accent);
  transition: transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-small { padding: .45em 1em; font-size: .9rem; }
.btn-block { display: block; text-align: center; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(13, 15, 18, .9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo {
  display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none;
  font-family: var(--display); font-weight: 800; font-size: 1.5rem; text-transform: uppercase; letter-spacing: .03em;
}
.logo img { height: 36px; width: auto; border-radius: 4px; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:not(.btn):hover { color: var(--text); }
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } }

/* Hero */
.hero { position: relative; padding: 64px 0 0; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; padding-bottom: 64px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-board { display: flex; flex-direction: column; align-items: center; gap: 18px; min-width: 0; }
.hero-board .led-frame { width: min(100%, 520px); }
@media (max-width: 900px) {
  .hero { padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
}

.checker {
  height: 18px;
  background: conic-gradient(#fff 25%, #111 0 50%, #fff 0 75%, #111 0) 0 0 / 18px 18px;
  opacity: .9;
}

/* LED board frame + canvas (drawn by app.js) */
.led-frame {
  --glow: transparent;
  background: #050607; border: 10px solid #23272e; border-radius: 16px; padding: 10px;
  box-shadow: 0 0 0 1px #000, 0 28px 80px -24px var(--glow);
  transition: box-shadow .35s ease;
}
.led-frame[data-glow="green"] { --glow: rgba(0, 255, 0, .55); }
.led-frame[data-glow="yellow"] { --glow: rgba(255, 215, 0, .55); }
.led-frame[data-glow="red"] { --glow: rgba(255, 0, 0, .55); }
.led-frame[data-glow="white"] { --glow: rgba(255, 255, 255, .4); }
.led-frame[data-glow="black"] { --glow: rgba(255, 170, 0, .18); }
.led-canvas { display: block; width: 100%; height: auto; }
.led-frame-wide { border-width: 8px; padding: 8px; border-radius: 12px; }

.flag-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.flag-pills button {
  font: 600 .9rem var(--body); cursor: pointer; padding: .5em 1.1em; border-radius: 999px;
  border: 2px solid var(--line); background: var(--panel); color: var(--text);
}
.flag-pills [aria-pressed="true"][data-hero="green"] { border-color: #00ff00; color: #6dff6d; }
.flag-pills [aria-pressed="true"][data-hero="yellow"] { border-color: var(--yellow); color: var(--yellow); }
.flag-pills [aria-pressed="true"][data-hero="red"] { border-color: var(--red); color: #ff7070; }
.flag-pills [aria-pressed="true"][data-hero="white"] { border-color: #fff; color: #fff; }
.flag-pills [aria-pressed="true"][data-hero="checkered"] {
  border-color: #fff; color: #fff;
  background: conic-gradient(#3a3a3a 25%, #1b1f26 0 50%, #3a3a3a 0 75%, #1b1f26 0) 0 0 / 10px 10px;
}

/* Sections */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .section { padding: 60px 0; } }

/* Product cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 32px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: #3a414d; transform: translateY(-2px); }
.card p { color: var(--muted); margin: 0; }
.card-tag {
  display: inline-block; font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; font-size: .8rem; padding: 2px 10px; border-radius: 6px; margin-bottom: 14px; color: #111;
}
.tag-green { background: var(--green); }
.tag-yellow { background: var(--yellow); }
.tag-red { background: var(--red); color: #fff; }
.tag-white { background: var(--white); }

/* Steps */
.steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.steps p { color: var(--muted); margin: 0; }
.step-num {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #111; font-family: var(--display); font-weight: 800; font-size: 1.3rem; margin-bottom: 14px;
}
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* ── App demo ─────────────────────────────────────────── */
.demo { margin-top: 80px; padding-top: 8px; }
.demo-head { margin-bottom: 28px; }
.demo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
.demo-board { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.board-caption { color: var(--muted); font-size: .85rem; text-align: center; }
.demo-note { font-size: .92rem; }

@media (max-width: 900px) {
  .demo-grid { grid-template-columns: 1fr; gap: 20px; }
  .demo-board {
    top: 64px; z-index: 5; background: var(--bg-alt); padding: 10px 0;
    margin: 0 -16px; padding-left: 16px; padding-right: 16px;
  }
  .demo-board .board-caption { display: none; }
  .phone { justify-self: center; }
}

/* Phone shell */
.phone {
  width: 100%; max-width: 360px; background: #000; border-radius: 40px; padding: 12px;
  border: 1px solid #333; box-shadow: 0 30px 80px -30px rgba(0,0,0,.9), inset 0 0 0 2px #1a1a1a;
}
.phone-screen {
  background: #121212; border-radius: 30px; overflow: hidden; height: 640px;
  display: flex; flex-direction: column; color: #f2f2f2; font-size: 14px;
}
.app-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 12px; background: #1e1e1e; border-bottom: 1px solid #2c2c2c;
}
.app-title { font-weight: 700; font-size: 18px; }
.conn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #9a9a9a; }
.conn i { width: 12px; height: 12px; border-radius: 50%; background: limegreen; display: block; }
.app-body { flex: 1; overflow-y: auto; padding: 10px; }
.app-page { display: flex; flex-direction: column; gap: 10px; height: 100%; }

.app-tabs { display: grid; grid-template-columns: repeat(4, 1fr); background: #1e1e1e; border-top: 1px solid #2c2c2c; }
.app-tabs button {
  background: none; border: 0; color: #9a9a9a; font: 600 11.5px var(--body); padding: 12px 2px 16px; cursor: pointer;
  border-top: 3px solid transparent;
}
.app-tabs button[aria-current="page"] { color: #fff; border-top-color: #512DA8; }
.app-tabs button:disabled { opacity: .3; cursor: not-allowed; }

/* App buttons (gradients match the MAUI app) */
.ab {
  font: 700 16px var(--body); border: 1px solid #fff; border-radius: 8px; cursor: pointer;
  min-height: 44px; padding: 6px 8px; color: #fff; box-shadow: 0 2px 3px rgba(0,0,0,.35);
  transition: transform .06s ease, filter .1s ease;
}
.ab:active { transform: translateY(1px) scale(.98); filter: brightness(1.15); }
.ab:disabled { opacity: .45; cursor: default; }
.ab-green { background: linear-gradient(#66BB6A, #004D00); }
.ab-yellow { background: linear-gradient(#FFFF99, #CCAA00); color: #000; }
.ab-red { background: linear-gradient(#FF6666, #990000); }
.ab-white { background: linear-gradient(#F5F5F5, #AAAAAA); color: #000; }
.ab-checker { background: linear-gradient(#B0B0B0, #404040); }
.ab-purple { background: linear-gradient(#B39DDB, #512DA8); }
.ab-dark { background: linear-gradient(#333, #000); color: orangered; }
.ab-grey { background: #666; }
.ab-big { font-size: 22px; }
.span2 { grid-column: span 2; }

.lap-row {
  display: grid; grid-template-columns: auto 1fr 1fr 1fr 1fr; gap: 8px; align-items: center;
  border: 1px solid #555; border-radius: 6px; padding: 6px 10px;
}
.lap-label { font-weight: 700; }
.lap-num { font-size: 30px; font-weight: 700; text-align: center; }
.lap-row .ab { padding: 0; font-size: 15px; }
.lap-row .ab-big { font-size: 22px; }

.flag-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 10px; }
.flag-grid .ab { font-size: 19px; }

.rc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rc-grid .ab { font-size: 15px; min-height: 48px; }
.car-box {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 1px solid #555; border-radius: 6px; padding: 10px;
}
.car-entry { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 13px; }
.car-entry input {
  width: 100%; font: 700 36px var(--body); text-align: center; background: #000; color: #fff;
  border: 0; border-bottom: 2px solid #512DA8; padding: 4px 0; border-radius: 0;
}
.car-btns { display: grid; gap: 6px; }
.car-btns .ab { font-size: 13px; min-height: 40px; }

.send-mode {
  border: 1px solid #555; border-radius: 6px; margin: 0; padding: 6px 10px 8px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; font-size: 13px;
}
.send-mode legend { font-weight: 700; padding: 0 4px; font-size: 12px; color: #bbb; }
.send-mode label, .chk { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.send-mode input, .chk input { accent-color: #7e57c2; width: 16px; height: 16px; margin: 0; }
.t-box { border: 1px solid #555; border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.t-head { font-weight: 700; font-size: 12.5px; color: #ccc; }
.t-display { font: 700 30px var(--mono); text-align: center; line-height: 1.1; }
.t-small { font-size: 22px; }
.t-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.t-row input[type="number"] {
  width: 56px; font: 600 16px var(--body); background: #000; color: #fff; border: 1px solid #555; border-radius: 4px; padding: 4px 6px;
}
.t-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.t-btns .ab { font-size: 13px; min-height: 36px; padding: 4px; }
.t-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chk { font-size: 13px; }
.chk-big { font-size: 15px; font-weight: 600; margin-top: 2px; }
.mini-flags { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: auto; }
.mini-flags .ab { font-size: 13px; min-height: 38px; padding: 2px; }

.feed-row { justify-content: space-between; }
.endpoint {
  flex: 1; background: #00C800; color: #000; font-weight: 700; text-align: center; border-radius: 4px; padding: 6px;
}
.feed-dot { width: 14px; height: 14px; border-radius: 50%; background: red; display: block; }
.feed-dot.on { background: limegreen; }
.feed {
  margin: 0; background: #000; color: #8fd18f; font: 500 10.5px/1.45 var(--mono); padding: 8px; border-radius: 4px;
  height: 118px; overflow: hidden; white-space: pre;
}

/* Integrations */
.integ-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; }
.integ { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.integ p { color: var(--muted); margin: 0 0 .8em; }
.integ p:last-child { margin-bottom: 0; }
.integ-feature { grid-row: span 3; border-color: #3a414d; }
.integ-feature > p:first-of-type { color: var(--text); }
.ticks { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 28px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .45em; width: 14px; height: 14px; border-radius: 3px;
  background: conic-gradient(#fff 25%, #111 0 50%, #fff 0 75%, #111 0) 0 0 / 7px 7px;
}
.integ-grid > .integ:not(.integ-feature) { grid-column: 2 / span 2; }
@media (max-width: 860px) {
  .integ-grid { grid-template-columns: 1fr; }
  .integ-feature { grid-row: auto; }
  .integ-grid > .integ:not(.integ-feature) { grid-column: auto; }
}

/* Downloads */
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 32px; }
.download { border: 1px dashed var(--line); border-radius: var(--radius); padding: 26px; }
.download p { color: var(--muted); margin: 0 0 14px; }
.store-btn { display: inline-flex; align-items: center; gap: .5em; }
.download .store-note { margin: 18px 0 10px; }
.download .store-note:last-child { margin-bottom: 0; }
.soon {
  display: inline-block; font-size: .8rem; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px;
}

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; }
.contact-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.contact-list { margin: 24px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; }
.contact-list dt { color: var(--muted); font-weight: 500; }
.contact-list dd { margin: 0; }
.contact-list a { color: var(--text); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; gap: 28px; } }

/* Footer */
.site-footer { padding: 28px 0; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
