/* Relay Tracker — Dawn Ridge web brand. Mirrors lib/core/theme/app_theme.dart. */
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('./assets/fonts/Manrope-Regular.woff2') format('woff2'),
       url('./assets/fonts/Manrope-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('./assets/fonts/Manrope-Medium.woff2') format('woff2'),
       url('./assets/fonts/Manrope-Medium.ttf') format('truetype');
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('./assets/fonts/Manrope-SemiBold.woff2') format('woff2'),
       url('./assets/fonts/Manrope-SemiBold.ttf') format('truetype');
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('./assets/fonts/Manrope-Bold.woff2') format('woff2'),
       url('./assets/fonts/Manrope-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('./assets/fonts/Manrope-ExtraBold.woff2') format('woff2'),
       url('./assets/fonts/Manrope-ExtraBold.ttf') format('truetype');
}

:root {
  --pine: #1F3D33;
  --coral: #E8674A;
  --coral-2: #F0836A;
  --fog: #F7F8F6;
  --surface: #FFFFFF;
  --surface-alt: #ECF1EC;
  --sage: #BFD8C9;
  --text-hi: #22302B;
  --text-lo: #5B685F;
  --divider: #E4E9E4;
  --blue: #2C6BAF;
  --amber: #B45309;
  --slate: #4E7488;
  --shadow: 0 8px 24px rgba(31, 61, 51, 0.10);
  --radius: 20px;
  --radius-lg: 24px;
  --maxw: 1080px;
  --ink-on-accent: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  :root {
    --pine: #9DC3AE;           /* accent flips to sage in dark, per app theme */
    --coral: #F0836A;
    --coral-2: #F0836A;
    --fog: #0F1613;
    --surface: #171F1B;
    --surface-alt: #1F2A24;
    --sage: #2A5244;
    --text-hi: #E8EEE9;
    --text-lo: #93A39A;
    --divider: #263129;
    --slate: #A9C4D4;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    --ink-on-accent: #10201A;
  }
}
:root[data-theme="dark"] {
  --pine: #9DC3AE; --coral: #F0836A; --coral-2: #F0836A; --fog: #0F1613;
  --surface: #171F1B; --surface-alt: #1F2A24; --sage: #2A5244; --text-hi: #E8EEE9;
  --text-lo: #93A39A; --divider: #263129; --slate: #A9C4D4;
  --shadow: 0 8px 28px rgba(0,0,0,0.45); --ink-on-accent: #10201A;
}
:root[data-theme="light"] {
  --pine: #1F3D33; --coral: #E8674A; --coral-2: #F0836A; --fog: #F7F8F6;
  --surface: #FFFFFF; --surface-alt: #ECF1EC; --sage: #BFD8C9; --text-hi: #22302B;
  --text-lo: #5B685F; --divider: #E4E9E4; --slate: #4E7488;
  --shadow: 0 8px 24px rgba(31,61,51,0.10); --ink-on-accent: #FFFFFF;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'tnum' 1; /* tabular figures, like the app */
  background: var(--fog);
  color: var(--text-hi);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Deliberately NO overflow-x: hidden here. It propagates to the viewport (html
     is overflow:visible), so anything too wide was clipped and unreachable
     instead of scrollable — which is exactly how the hero shipped chopped off on
     every phone without anyone seeing it. The rotated phone art is already
     contained by .hero's own overflow:hidden. If a sideways scrollbar appears,
     that is the bug reporting itself; fix the overflowing element, don't hide it. */
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
a { color: var(--pine); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ---------- header ---------- */
header.site {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--fog) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--divider);
}
.nav { display: flex; align-items: center; gap: 20px; height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 19px; letter-spacing: -0.4px; color: var(--text-hi); }
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; border-radius: 9px; overflow: hidden; box-shadow: var(--shadow); flex: none; }
.brand .mark img { width: 100%; height: 100%; }
.nav .links { margin-left: auto; display: flex; gap: 26px; align-items: center; }
.nav .links a { color: var(--text-lo); font-weight: 600; font-size: 15px; }
.nav .links a:hover { color: var(--text-hi); text-decoration: none; }
@media (max-width: 720px) { .nav .links a.hide-sm { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 13px 24px; font-weight: 800; font-size: 16px;
  border: 0; cursor: pointer; font-family: inherit; transition: transform .06s ease, filter .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-pine  { background: var(--pine); color: var(--ink-on-accent); }
.btn-ghost { background: var(--surface); color: var(--text-hi); border: 1px solid var(--divider); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 40px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 55% at 72% 12%, color-mix(in srgb, var(--coral) 16%, transparent), transparent 70%),
    radial-gradient(70% 60% at 12% 0%, color-mix(in srgb, var(--sage) 40%, transparent), transparent 65%);
}
/* minmax(0, …) — NOT a bare `1fr`. A bare fr track is minmax(auto, 1fr), and
   that `auto` floor is the track's min-content width, which a grid will not go
   below. The search card's min-content is ~403px (an <input> with no `size`
   contributes its default 20-character box, and .btn is nowrap), so a bare fr
   pinned this whole column at 403px on every phone and hung the hero off the
   right edge — where body's overflow-x:hidden silently chopped it. */
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--coral); }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 0 color-mix(in srgb, var(--coral) 60%, transparent); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--coral) 55%,transparent);} 70%{box-shadow:0 0 0 10px transparent;} 100%{box-shadow:0 0 0 0 transparent;} }
h1.hero-title { font-size: clamp(38px, 6.4vw, 62px); line-height: 1.03; letter-spacing: -1.6px; font-weight: 800; margin: 16px 0 14px; color: var(--text-hi); }
.hero-sub { font-size: 19px; color: var(--text-lo); max-width: 30em; margin: 0 0 26px; }
.hero-sub strong { color: var(--text-hi); font-weight: 700; }

/* search card */
.search { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; max-width: 480px; }
.search label { display: block; font-weight: 700; font-size: 13px; letter-spacing: 0.4px; color: var(--text-lo); margin: 0 0 10px; text-transform: uppercase; }
.search .row { display: flex; gap: 10px; min-width: 0; }
.search input {
  /* width:0 as well as min-width:0 — min-width alone does not stop a text
     input contributing its intrinsic ~20-character width to the flex row's
     min-content size. flex-grow gives the width back. */
  flex: 1; min-width: 0; width: 0; font-family: inherit; font-size: 16px; font-weight: 600;
  padding: 13px 16px; border-radius: 999px; border: 1px solid var(--divider);
  background: var(--fog); color: var(--text-hi);
}
.search input:focus { outline: none; border-color: var(--pine); }
.search .hint { margin: 12px 2px 2px; font-size: 13.5px; color: var(--text-lo); }
/* nowrap so the URL wraps as a unit instead of breaking after "relay-" and
   splitting the domain across two lines. Safe only while the card is wider than
   the chip (~352px) — below 560px it is not, so it goes back to normal there
   rather than forcing a sideways scroll. */
.search .hint code { background: var(--surface-alt); padding: 2px 7px; border-radius: 6px; font-size: 12.5px; color: var(--text-hi); white-space: nowrap; }

/* hero art: phones */
.phones { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 0; min-height: 380px; }
.phone { border-radius: 30px; overflow: hidden; box-shadow: var(--shadow), 0 2px 0 var(--divider); border: 1px solid var(--divider); background: var(--surface); }
.phone img { width: 100%; display: block; }
.phone.back { width: 190px; transform: rotate(-6deg) translateX(28px); opacity: .96; }
.phone.front { width: 218px; transform: rotate(4deg) translateX(-24px); z-index: 2; }
@media (max-width: 900px) { .phones { min-height: 0; } .phone.back { width: 150px; } .phone.front { width: 176px; } }

/* tab gallery — the front phone swaps between the app's four tabs.
   aspect-ratio (every capture is 1080x2400) reserves the box up front, so
   swapping panels never reflows the hero. */
.phone.front { position: relative; aspect-ratio: 1080 / 2400; }
.phone.front .shot { position: absolute; inset: 0; }
.phone.front .shot img { height: 100%; object-fit: cover; }
.phone.front .shot:not([hidden]) { animation: shot-in .28s ease both; }
@keyframes shot-in { from { opacity: 0; } to { opacity: 1; } }

/* width:fit-content + max-width:100% — hugs the labels when there is room and
   wraps to a second row when there is not, so the strip can never push the
   hero wider than the screen the way the search card once did. */
/* Hidden until the script takes over — without JS the tabs would be dead
   controls, and the hero is perfectly fine as the single Race shot it was. */
.tabs { display: none; }
.gallery.is-live .tabs {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px;
  width: fit-content; max-width: 100%; margin: 18px auto 0; padding: 4px;
  background: var(--surface); border: 1px solid var(--divider);
  border-radius: 999px; box-shadow: var(--shadow);
}
.tab {
  font-family: inherit; font-size: 13.5px; font-weight: 700; white-space: nowrap;
  color: var(--text-lo); background: none; border: 0; border-radius: 999px;
  padding: 8px 15px; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.tab:hover { color: var(--text-hi); }
.tab[aria-selected="true"] { background: var(--pine); color: var(--ink-on-accent); }
.tab:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .phone.front .shot:not([hidden]) { animation: none; }
  .tab { transition: none; }
}

/* ---------- sections ---------- */
section { padding: 64px 0; }
.section-label { font-weight: 700; font-size: 14px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--coral); margin: 0 0 10px; }
h2.section-title { font-size: clamp(26px, 3.6vw, 36px); letter-spacing: -0.8px; font-weight: 800; margin: 0 0 12px; color: var(--text-hi); }
.section-intro { font-size: 18px; color: var(--text-lo); max-width: 46em; margin: 0 0 36px; }
.alt-bg { background: var(--surface-alt); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.step .n { width: 34px; height: 34px; border-radius: 10px; background: var(--pine); color: var(--ink-on-accent); font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.step h3 { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.step p { margin: 0; color: var(--text-lo); font-size: 15.5px; }

/* feature grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.feature { padding: 4px; }
.feature .ic { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-alt); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 20px; }
.feature h3 { margin: 0 0 5px; font-size: 17px; font-weight: 700; }
.feature p { margin: 0; color: var(--text-lo); font-size: 15px; }

/* racer split: copy + screenshots */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 28px; } }
.shots { display: flex; gap: 16px; justify-content: center; }
.shots .phone { width: 200px; }
.shots .phone:nth-child(2) { margin-top: 34px; }
@media (max-width: 480px) { .shots .phone { width: 150px; } }
ul.ticks { list-style: none; padding: 0; margin: 8px 0 26px; }
ul.ticks li { position: relative; padding-left: 30px; margin: 12px 0; font-size: 16.5px; color: var(--text-hi); }
ul.ticks li::before { content: "✓"; position: absolute; left: 0; top: -1px; width: 22px; height: 22px; background: color-mix(in srgb, var(--pine) 12%, transparent); color: var(--pine); border-radius: 7px; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* waitlist */
.waitlist { background: var(--pine); color: #fff; border-radius: var(--radius-lg); padding: 40px; text-align: center; }
.waitlist h2 { color: #fff; margin: 0 0 8px; font-size: 28px; letter-spacing: -0.6px; }
.waitlist p { color: color-mix(in srgb, #fff 82%, transparent); margin: 0 auto 22px; max-width: 34em; }
.waitlist form { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; }
.waitlist input { flex: 1; min-width: 0; border: 0; border-radius: 999px; padding: 14px 18px; font-family: inherit; font-size: 16px; font-weight: 600; }
.waitlist input:focus { outline: 2px solid var(--coral-2); }
.waitlist .note { font-size: 13px; margin-top: 14px; color: color-mix(in srgb, #fff 65%, transparent); }
.waitlist .ok { display: none; font-weight: 700; font-size: 18px; }

/* races strip */
.races { text-align: center; }
.race-pills { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }
.race-pill { background: var(--surface); border: 1px solid var(--divider); border-radius: 999px; padding: 10px 20px; font-weight: 700; color: var(--text-hi); box-shadow: var(--shadow); }
.race-pill span { color: var(--text-lo); font-weight: 500; font-size: 14px; }
a.race-pill { text-decoration: none; }
a.race-pill:hover { border-color: var(--pine); color: var(--pine); }
.races .note { color: var(--text-lo); font-size: 14px; max-width: 44em; margin: 18px auto 0; }

/* footer */
footer.site { border-top: 1px solid var(--divider); padding: 40px 0; color: var(--text-lo); font-size: 14.5px; }
footer.site .fnav { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
footer.site .fnav .brand { font-size: 16px; }
footer.site .fnav .spacer { margin-left: auto; }
footer.site a { color: var(--text-lo); font-weight: 600; }
footer.site .creed { margin-top: 16px; font-weight: 700; color: var(--text-hi); }

/* ---------- phones / tablet (≤ 720px) ---------- */
@media (max-width: 720px) {
  .nav { gap: 12px; }
  .brand { font-size: 17px; gap: 10px; }
}

/* ---------- phones (≤ 560px) ---------- */
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  section { padding: 44px 0; }

  /* Minimal mobile header: brand + theme toggle only (the page is one scroll). */
  .nav .links a { display: none; }

  /* Hero: tighter, and a single clean phone instead of the overlapped pair. */
  .hero { padding: 40px 0 28px; }
  .hero-sub { font-size: 17px; margin-bottom: 22px; }

  /* Stack the field and its button. Side by side on a 360px phone the nowrap
     button leaves the input ~70px of text room and "Search your team's name"
     is cut off mid-word — same reason the waitlist form stacks. */
  .search { padding: 16px; }
  .search .row { flex-direction: column; }
  .search .row .btn { width: 100%; }
  /* Undo the row-layout width:0 — stacked, `width` is the CROSS size and
     flex-grow no longer gives it back, so width:0 would collapse the field. */
  .search .row input { width: 100%; }
  /* Too narrow to hold the URL on one line — let it break again. */
  .search .hint code { white-space: normal; }
  .phones { min-height: 0; }
  .phone.back { display: none; }
  .phone.front { transform: none; width: 64vw; max-width: 260px; }
  .tabs { margin-top: 14px; }
  .tab { padding: 8px 11px; font-size: 12.5px; }

  /* Racer screenshots share the row and never overflow. */
  .shots { gap: 12px; }
  .shots .phone { width: auto; flex: 1 1 0; max-width: 44vw; }
  .shots .phone:nth-child(2) { margin-top: 0; }

  .section-intro { font-size: 16.5px; }
  ul.ticks li { font-size: 15.5px; }

  /* Waitlist: stack the email + button, comfortable padding. */
  .waitlist { padding: 28px 20px; }
  .waitlist h2 { font-size: 24px; }
  .waitlist form { flex-direction: column; }
  .waitlist form .btn { width: 100%; }
}
