/* runair.app — one stylesheet for every page. The colours are the app's
   (ios/RunairApp/DesignSystem/Palette.swift): the brand gradient of the icon,
   Duel's ember into rose, Together's teal into ocean. No web fonts and no
   third-party requests: the system's rounded face where there is one. */

:root {
  --brand-1: #ff7a1f;
  --brand-2: #ff4a3a;
  --brand-3: #f01e63;
  --duel-1: #f25a12;
  --duel-2: #e91e5a;
  --together-1: #0a9384;
  --together-2: #1560c0;
  --nearby-1: #7b4dff;
  --nearby-2: #3d6bff;

  --bg: #fbf8f6;
  --wash: #ffe9dc;
  --surface: #ffffff;
  --surface-2: #f4f0ed;
  --text: #16181d;
  --muted: #5b6479;
  --line: rgba(22, 24, 29, 0.09);
  --duel-tint: #e23d1f;
  --together-tint: #0a8a78;
  --shadow: 0 1px 2px rgba(22, 24, 29, 0.06), 0 12px 32px -12px rgba(22, 24, 29, 0.18);

  --rounded: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --radius: 22px;
  --page: 1080px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f13;
    --wash: #2a1510;
    --surface: #181a21;
    --surface-2: #20232c;
    --text: #f3f4f7;
    --muted: #9aa3b5;
    --line: rgba(255, 255, 255, 0.09);
    --duel-tint: #ff6a4d;
    --together-tint: #2dd4bf;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* The background is html's, and html is at least as tall as the window: on
   body it was sized to the content and, on a page shorter than the window,
   tiled the wash again below it. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  min-height: 100%;
  background:
    radial-gradient(1100px 520px at 85% -120px, var(--wash), transparent 70%) no-repeat,
    var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font: 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

h1,
h2,
h3 {
  font-family: var(--rounded);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0;
}

p {
  margin: 0;
}

.wrap {
  width: min(100% - 32px, var(--page));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 10px;
}

:focus-visible {
  outline: 3px solid var(--brand-2);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Header and footer */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 800 1.35rem/1 var(--rounded);
  letter-spacing: -0.02em;
}

.logo img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  box-shadow: 0 4px 12px -4px rgba(240, 30, 99, 0.45);
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 999px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 96px;
  padding-block: 32px 48px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
}

.site-footer nav {
  display: flex;
  gap: 20px;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

/* Shared pieces */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 0.8rem/1 var(--rounded);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--duel-tint);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.92rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font: 700 1rem/1 var(--rounded);
  text-decoration: none;
  color: #fff;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2) 55%, var(--brand-3));
  box-shadow: 0 10px 24px -10px rgba(240, 30, 99, 0.6);
}

.button:hover {
  filter: brightness(1.05);
}

.button.secondary {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: none;
}

.section {
  margin-top: 112px;
}

.section-head {
  max-width: 640px;
  margin-bottom: 36px;
}

.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-top: 12px;
}

.section-head p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.08rem;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding-top: 40px;
}

.hero h1 {
  margin-top: 16px;
  font-size: clamp(2.4rem, 5.6vw, 3.9rem);
}

.hero h1 .accent {
  display: block;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2) 50%, var(--brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lede {
  margin-top: 22px;
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 520px;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero .facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

/* The phone: a duel in progress, drawn in CSS. Decorative — the page says
   the same thing in words. */

.phone {
  justify-self: center;
  width: min(100%, 300px);
  aspect-ratio: 9 / 19;
  padding: 12px;
  border-radius: 48px;
  background: #0c0d11;
  box-shadow:
    0 0 0 2px #2b2e37,
    0 40px 80px -30px rgba(240, 30, 99, 0.45),
    0 20px 40px -20px rgba(0, 0, 0, 0.5);
}

.screen {
  height: 100%;
  border-radius: 37px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 44px 18px 18px;
  color: #fff;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(242, 90, 18, 0.55), transparent 70%),
    #121319;
  font-family: var(--rounded);
}

.screen .status {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.85;
}

.screen .live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.screen .live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
}

.ring {
  --progress: 68%;
  position: relative;
  width: 74%;
  aspect-ratio: 1;
  margin: 4px auto 0;
  border-radius: 50%;
  background: conic-gradient(var(--duel-1), var(--duel-2) var(--progress), rgba(255, 255, 255, 0.1) 0);
}

.ring::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: #121319;
}

.ring .readout {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  text-align: center;
}

.ring .km {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.ring .of {
  margin-top: 6px;
  font-size: 0.78rem;
  opacity: 0.7;
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tile {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
}

.tile b {
  display: block;
  font-size: 1.1rem;
}

.tile span {
  font-size: 0.72rem;
  opacity: 0.7;
}

.lanes {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.lanes-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
}

.lane {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
}

.avatar.a {
  background: linear-gradient(135deg, #f2703a, #e91e5a);
}

.avatar.b {
  background: linear-gradient(135deg, #7b4dff, #3d6bff);
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.bar .you {
  width: 68%;
  background: linear-gradient(90deg, var(--duel-1), var(--duel-2));
}

.bar .them {
  width: 63%;
  background: linear-gradient(90deg, var(--nearby-1), var(--nearby-2));
}

/* The promo video: the real app, recorded in the simulator, with music. It
   plays only when asked. The words come first in the page, the video first
   on the line — opposite the hero's phone. */

.film {
  display: grid;
  grid-template-columns: minmax(0, 340px) 1fr;
  gap: 64px;
  align-items: center;
}

.film .section-head {
  grid-column: 2;
  grid-row: 1;
  margin-bottom: 0;
}

.film video {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  border-radius: 28px;
  background: #121319;
  box-shadow:
    0 40px 80px -30px rgba(240, 30, 99, 0.45),
    0 20px 40px -20px rgba(0, 0, 0, 0.5);
}

/* The two modes */

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.mode {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mode-head {
  padding: 28px 28px 24px;
  color: #fff;
}

.mode.duel .mode-head {
  background: linear-gradient(135deg, var(--duel-1), var(--duel-2));
}

.mode.together .mode-head {
  background: linear-gradient(135deg, var(--together-1), var(--together-2));
}

.mode-head .tag {
  font: 700 0.78rem/1 var(--rounded);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.mode-head h3 {
  margin-top: 10px;
  font-size: 1.9rem;
}

.mode-head p {
  margin-top: 10px;
  opacity: 0.92;
}

.mode ul {
  list-style: none;
  margin: 0;
  padding: 22px 28px 28px;
  display: grid;
  gap: 14px;
}

.mode li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
}

.mode li svg {
  width: 22px;
  height: 22px;
  margin-top: 2px;
}

.mode.duel li svg {
  color: var(--duel-tint);
}

.mode.together li svg {
  color: var(--together-tint);
}

/* Steps */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  font: 800 1rem/1 var(--rounded);
  background: linear-gradient(135deg, var(--duel-1), var(--duel-2));
}

.steps h3 {
  margin-top: 18px;
  font-size: 1.2rem;
}

.steps p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.97rem;
}

/* Privacy promises */

.promises {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.promise {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.promise svg {
  width: 28px;
  height: 28px;
  color: var(--nearby-1);
}

.promise h3 {
  margin-top: 14px;
  font-size: 1.15rem;
}

.promise p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.97rem;
}

.more {
  margin-top: 20px;
  font-weight: 600;
}

/* Closing call */

.cta {
  margin-top: 112px;
  padding: 48px;
  border-radius: 32px;
  color: #fff;
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
    linear-gradient(120deg, var(--brand-1), var(--brand-2) 50%, var(--brand-3));
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.cta h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
}

.cta p {
  margin-top: 10px;
  opacity: 0.92;
  max-width: 520px;
}

.cta .button {
  color: var(--text);
  background: #fff;
  box-shadow: none;
}

/* Long-form pages: privacy, support */

.doc {
  max-width: 720px;
  padding-top: 32px;
}

.doc h1 {
  font-size: clamp(2.2rem, 5vw, 3rem);
}

.doc .updated {
  margin-top: 12px;
  color: var(--muted);
}

.doc .intro {
  margin-top: 24px;
  font-size: 1.12rem;
}

.doc h2 {
  font-size: 1.45rem;
  margin-top: 48px;
}

.doc h3 {
  font-size: 1.1rem;
  margin-top: 28px;
}

.doc p,
.doc ul,
.doc dl {
  margin-top: 14px;
}

.doc ul {
  padding-left: 1.2em;
}

.doc li + li {
  margin-top: 8px;
}

.doc a {
  color: var(--duel-tint);
  text-underline-offset: 3px;
}

.doc .card {
  margin-top: 24px;
  padding: 20px 24px;
  border-radius: 18px;
  background: var(--surface-2);
}

.doc .card p:first-child {
  margin-top: 0;
}

.faq details {
  margin-top: 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 4px 22px;
}

.faq summary {
  cursor: pointer;
  padding: 16px 0;
  font: 700 1.05rem/1.35 var(--rounded);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-weight: 800;
  color: var(--muted);
}

.faq details[open] summary::after {
  content: "–";
}

.faq details > p {
  margin: 0 0 18px;
  color: var(--muted);
}

.notfound {
  text-align: center;
  padding-top: 96px;
}

.notfound h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
}

.notfound p {
  margin: 16px auto 32px;
  color: var(--muted);
  max-width: 420px;
}

/* The page a shared link lands on: /run/<id>, /duel/<code> */

.invite {
  text-align: center;
  padding-top: 88px;
}

.invite h1 {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  margin-top: 14px;
}

.invite p {
  margin: 16px auto 32px;
  color: var(--muted);
  max-width: 440px;
}

.invite .code {
  margin: 20px auto 8px;
  font: 800 clamp(2rem, 8vw, 2.8rem)/1 var(--rounded);
  letter-spacing: 0.12em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.invite .aside {
  margin-top: 48px;
  font-size: 0.95rem;
}

/* Narrow screens */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .film {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .film .section-head,
  .film video {
    grid-column: auto;
    grid-row: auto;
  }

  .film .section-head {
    margin-bottom: 36px;
  }

  .film video {
    justify-self: center;
    width: min(100%, 340px);
  }

  .modes,
  .promises {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .site-nav a {
    padding: 8px 10px;
  }

  .section,
  .cta {
    margin-top: 80px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .mode-head,
  .mode ul {
    padding-inline: 22px;
  }

  .cta {
    padding: 32px 24px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .button {
    transition: filter 0.15s ease;
  }
}
