/* Colors are the app's own (dorado/src/constants/theme.ts), so the site and app match. */
:root {
  --text: #10182b;
  --background: #f4f7fb;
  --surface: #e8eef7;
  --selected: #dae4f2;
  --muted: #5a6478;
  --border: #d2dcea;
  --accent: #b8873d;
  /* The accent darkened for text, which needs 4.5:1 contrast on the light backgrounds. */
  --accent-text: #805e20;

  /* Fixed brand pair: navy and gold look the same in light and dark mode, as in the app. */
  --navy: #0b1220;
  --gold: #d8b15e;

  --map-water: #9fd8ea;
  --map-land: #e3f1df;
  --map-road: #ffffff;
  --pin-ring: #ffffff;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f5f3ec;
    --background: #0b1220;
    --surface: #141c30;
    --selected: #1d2740;
    --muted: #98a1b3;
    --border: #243049;
    --accent: #d8b15e;
    --accent-text: #d8b15e;

    --map-water: #0e2338;
    --map-land: #141c30;
    --map-road: #243049;
    --pin-ring: #141c30;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(
      1200px 500px at 20% -20%,
      color-mix(in srgb, var(--accent) 14%, transparent),
      transparent
    ),
    radial-gradient(
      900px 500px at 90% 0%,
      color-mix(in srgb, var(--navy) 9%, transparent),
      transparent
    ),
    var(--background);
  font:
    500 16px/1.5 -apple-system,
    BlinkMacSystemFont,
    'SF Pro Text',
    'Segoe UI',
    Roboto,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}
h1,
h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.muted {
  color: var(--muted);
}
.shell {
  width: min(100% - 32px, 1040px);
  margin: 0 auto;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--background) 85%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.wordmark {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.header-nav {
  display: flex;
  align-items: stretch;
  gap: 28px;
  height: 100%;
  font-size: 15px;
  font-weight: 600;
}
.header-nav a {
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.15s;
}
.header-nav a:hover {
  color: var(--text);
}
/* The current page: a line along the bottom of the bar. */
.header-nav a[aria-current] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.header-nav .nav-cta,
.header-nav .nav-cta:hover {
  color: var(--accent-text);
}
.header-link {
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 600;
}

/* Hero */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 64px;
  padding: 72px 0 96px;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1.05;
}
.lede {
  max-width: 30em;
  margin: 20px 0 32px;
  color: var(--muted);
  font-size: 18px;
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 14px;
  color: #fff;
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.1;
  cursor: default;
}
.store-badge svg {
  width: 24px;
  height: 24px;
}
.store-badge small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.8;
}

/* Phone mockups: an iPhone-proportioned frame around HTML copies of the app's screens. */
.phone {
  position: relative;
  width: 300px;
  aspect-ratio: 300 / 640;
  margin: 0;
  padding: 10px;
  background: #1a1f2b;
  border-radius: 48px;
  box-shadow: 0 30px 60px -20px rgba(11, 18, 32, 0.35);
}
.screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  padding: 0 14px;
  background: var(--background);
  border-radius: 38px;
  font-size: 12px;
}
/* The list scrolls under the tab bar, as in the app; fade it out so it doesn't peek below. */
.screen::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 90px;
  background: linear-gradient(transparent, var(--background) 70%);
}
.phone-map .screen::after {
  display: none;
}
.status {
  height: 44px;
  padding: 14px 18px 0;
  font-size: 13px;
  font-weight: 600;
}
.screen-title {
  padding: 6px 4px 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.i {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--muted);
}
.i-ink {
  color: var(--text);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  font-size: 13px;
}
.search span:first-of-type {
  flex: 1;
}
.search-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
}

.race {
  margin-top: 14px;
  overflow: hidden;
  background: var(--surface);
  border-radius: 18px;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
.race:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -18px rgba(11, 18, 32, 0.55);
}
.race-picture {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  color: var(--gold);
  background: var(--navy);
}
@media (prefers-color-scheme: dark) {
  /* The frame is close to the dark page colour, so outline it. */
  .phone {
    box-shadow:
      0 0 0 1px #2c3854,
      0 30px 60px -20px rgba(0, 0, 0, 0.6);
  }
  .race {
    border: 1px solid var(--border);
  }
  .race-info {
    border-top: 1px solid var(--border);
  }
}
.race-glyph {
  width: 30px;
  height: 30px;
}
.pill {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 1px 8px;
  color: var(--gold);
  background: var(--navy);
  border: 1px solid #243049;
  border-radius: 32px;
  font-size: 11px;
  font-weight: 700;
}
.glass-save {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  backdrop-filter: blur(8px);
}
.glass-save svg {
  width: 14px;
  height: 14px;
}
.race-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px 14px;
}
.race-info strong {
  font-size: 13px;
  font-weight: 600;
}
.race-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}
.register {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
  color: var(--accent-text);
  font-weight: 600;
}
.register svg {
  width: 11px;
  height: 11px;
}

.tabs {
  position: absolute;
  z-index: 1;
  left: 12px;
  right: 12px;
  bottom: 14px;
  display: flex;
  justify-content: space-around;
  padding: 5px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(16px);
}
.tab {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 0 4px;
  color: var(--muted);
  border-radius: 24px;
  font-size: 9.5px;
  font-weight: 600;
}
.tab svg {
  width: 18px;
  height: 18px;
}
.tab.active {
  color: var(--accent-text);
  background: var(--selected);
}

/* Map screen */
.phone-map .screen {
  padding: 0;
}
.map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.phone-map .status {
  position: relative;
}
.search-floating {
  position: relative;
  margin: 0 14px;
}
.pin {
  position: absolute;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--navy);
  background: var(--gold);
  border: 3px solid var(--pin-ring);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-size: 11px;
  font-weight: 700;
  transform: translate(-50%, -50%);
  animation: pin-breathe 2.8s ease-in-out infinite;
}
.pin i {
  width: 8px;
  height: 8px;
  background: var(--navy);
  border-radius: 50%;
}
.pin-group {
  width: 32px;
  height: 32px;
  animation-duration: 3.2s;
}
.pin-selected {
  width: 38px;
  height: 38px;
  color: var(--gold);
  background: var(--navy);
  border-color: var(--gold);
  animation-duration: 2.2s;
}

/* Features */
.features {
  padding: 96px 0;
  background: var(--surface);
  border-block: 1px solid var(--border);
}
.features-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 80px;
}
.features .phone {
  background: #1a1f2b;
}
.feature-list h2 {
  margin-bottom: 28px;
  font-size: clamp(30px, 4vw, 40px);
}
dl {
  display: grid;
  gap: 24px;
  margin: 0;
}
dl div {
  padding-left: 16px;
  border-left: 3px solid var(--accent);
}
dt {
  font-size: 18px;
  font-weight: 600;
}
dd {
  max-width: 28em;
  margin: 4px 0 0;
  color: var(--muted);
}

/* Hero entrance */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
@keyframes pin-breathe {
  0%,
  100% {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow:
      0 8px 16px rgba(0, 0, 0, 0.22),
      0 0 0 6px color-mix(in srgb, var(--gold) 18%, transparent);
  }
}
.hero-copy > * {
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hero-copy > :nth-child(2) {
  animation-delay: 0.08s;
}
.hero-copy > :nth-child(3) {
  animation-delay: 0.16s;
}
.hero .phone {
  animation:
    rise 0.9s 0.12s cubic-bezier(0.2, 0.8, 0.2, 1) both,
    float 5.4s 1.05s ease-in-out infinite;
}
.hero .race {
  animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hero .race:nth-child(4) {
  animation-delay: 0.45s;
}
.hero .race:nth-child(5) {
  animation-delay: 0.55s;
}
.features .phone {
  animation: float 5.8s 0.3s ease-in-out infinite;
}

/* Download */
.download {
  padding: 96px 0;
  text-align: center;
}
.download h2 {
  font-size: clamp(28px, 4vw, 40px);
}
.download p {
  margin: 12px 0 0;
  font-size: 17px;
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0 32px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.footer .wordmark {
  font-size: 16px;
}
.footer {
  flex-wrap: wrap;
  gap: 12px 24px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.footer-links a {
  color: var(--muted);
}
.footer-links a:hover,
.footer-links a[aria-current] {
  color: var(--text);
}

/* Privacy and Terms: same layout as the app's legal screen. */
.legal {
  max-width: 680px;
  padding: 56px 0 80px;
}
.legal h1 {
  font-size: clamp(32px, 5vw, 44px);
}
.legal-updated {
  margin: 8px 0 24px;
  font-size: 14px;
}
.legal-intro {
  margin: 0 0 8px;
  font-size: 17px;
}
.legal section {
  margin-top: 32px;
}
.legal h2 {
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
}
.legal section p {
  margin: 0 0 12px;
  color: var(--muted);
}
.legal section a {
  color: var(--accent-text);
}

@media (max-width: 820px) {
  .header-nav {
    gap: 20px;
  }
  .hero,
  .features-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }
  .hero {
    padding: 48px 0 72px;
  }
  .phone {
    justify-self: center;
    width: min(300px, 100%);
  }
  .features {
    padding: 72px 0;
  }
  .features-inner .phone {
    order: 2;
  }
  .download {
    padding: 72px 0;
  }
}

/* Scroll-in: js/reveal.js adds .is-visible as each [data-reveal] element comes into view. */
.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s ease,
    transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
/* The map's pins drop in one after another once the phone is showing. */
.reveal-ready .phone-map .pin {
  opacity: 0;
}
.reveal-ready .phone-map.is-visible .pin {
  animation: pin-drop 0.55s cubic-bezier(0.3, 1.5, 0.5, 1) both;
  animation-delay: calc(0.45s + var(--i, 0) * 0.12s);
}
@keyframes pin-drop {
  from {
    opacity: 0;
    transform: translate(-50%, -220%) scale(0.6);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 404 page */
.not-found {
  min-height: 60vh;
  padding: 96px 0;
}
.not-found h1 {
  font-size: clamp(36px, 6vw, 56px);
}
