/* City Drive docs. Colors, type and shapes mirror the app (city-drive/UI/Style.swift,
   Menu/MenuBackgroundView.swift, Menu/LevelCardCell.swift, Menu/SettingsUIKit.swift):
   evening-city sky, teal and amber glows, glass settings cards, level-card gradients,
   white capsule "Start" buttons and the procedurally drawn skyline with a running road. */
:root {
  --sky-top: #0a1433;
  --sky-mid: #143066;
  --sky-horizon: #2e5e9e;
  --sky-bottom: #080d1c;
  --teal: #29dbb3;
  --amber: #ffbd38;
  --star: #ffcc33;
  --blue: #4d8cf2;
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.78);
  --text-3: rgba(255, 255, 255, 0.55);
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.1);
  --glass: rgba(255, 255, 255, 0.16);
  --glass-border: rgba(255, 255, 255, 0.35);
  --radius: 18px;
  --radius-lg: 28px;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--sky-bottom);
  -webkit-font-smoothing: antialiased;
}

/* The menu sky: gradient to the horizon, faint city-map grid, teal and amber glows.
   A fixed layer instead of background-attachment, which iOS Safari ignores. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle 46vmax at 96% 92%, rgba(255, 189, 56, 0.2), rgba(255, 189, 56, 0) 100%),
    radial-gradient(circle 46vmax at 4% -4%, rgba(41, 219, 179, 0.22), rgba(41, 219, 179, 0) 100%),
    url("map.svg") 0 0 / 240px 240px repeat,
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-horizon) 100%);
}

h1, h2, h3, .brand, .button, .section-label, summary, .badge, .chip {
  font-family: var(--rounded);
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
p { text-wrap: pretty; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

strong { font-weight: 650; color: var(--text); }

.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 1120px; }

.icon { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8, 13, 28, 0.62);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--card-border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.nav { display: flex; gap: 4px; }
.nav a {
  font-family: var(--rounded);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); background: var(--glass); border-color: var(--glass-border); }

main { flex: 1; padding-bottom: 72px; }

/* Buttons: the white Start capsule and the glass capsule from the level cards */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #fff;
  color: #1a4099;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.button:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3); }
.button .icon { width: 15px; height: 15px; }
.button.glass { background: var(--glass); border-color: var(--glass-border); color: #fff; box-shadow: none; font-size: 16px; }
.button.glass:hover { background: rgba(255, 255, 255, 0.22); }

/* Section labels like the settings screen ("GRAPHICS", "SOUND") */
.section-label {
  margin: 56px 0 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.section-title { font-size: clamp(28px, 4.4vw, 40px); font-weight: 800; margin: 0 0 10px; }
.section-intro { color: var(--text-2); margin: 0 0 28px; max-width: 680px; }

/* Glass cards, as on the settings screen */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 0 0 14px;
}
.card h2 { font-size: 21px; font-weight: 700; margin: 0 0 8px; }
.card p { margin: 0 0 10px; color: var(--text-2); }
.card p:last-child { margin-bottom: 0; }
.card ul { margin: 6px 0 0; padding-left: 20px; color: var(--text-2); }
.card li { margin: 4px 0; }
.card li::marker { color: var(--teal); }

/* Doc page title */
.page-title { padding: 52px 0 28px; }
.page-title h1 { font-size: clamp(34px, 6vw, 48px); font-weight: 800; margin-bottom: 12px; }
.page-title p { font-size: 19px; color: var(--text-2); margin: 0; max-width: 640px; }
.updated {
  display: inline-block;
  margin-top: 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-2);
  font-size: 14px;
}

/* Contact card: gradient of the first level card */
.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  background: linear-gradient(160deg, #408cf2, #1a4099 75%);
  border-color: rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 34px -14px rgba(64, 140, 242, 0.8);
}
.contact h2 { font-size: 24px; font-weight: 800; }
.contact p { color: rgba(255, 255, 255, 0.88); }
.contact .button { color: #1a4099; }

/* FAQ */
details.card { padding: 0; }
summary {
  list-style: none;
  cursor: pointer;
  padding: 17px 54px 17px 22px;
  position: relative;
  font-size: 17px;
  font-weight: 700;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -7px;
  border-right: 2.5px solid var(--teal);
  border-bottom: 2.5px solid var(--teal);
  transform: rotate(45deg);
  transition: transform 0.2s ease, margin-top 0.2s ease;
}
details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
summary:hover { color: #fff; }
summary:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; border-radius: var(--radius); }
.answer { padding: 0 22px 18px; }
.answer p { margin: 0 0 10px; }
.answer ul { margin: 0 0 10px; }
.answer > :last-child { margin-bottom: 0; }

/* Level-card style tiles: theme gradient, light rim, colored glow, number badge */
.level {
  --a: #408cf2;
  --b: #1a4099;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(165deg, var(--a), var(--b) 78%);
  box-shadow: 0 14px 30px -16px var(--a);
  padding: 22px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}
.level::after {
  /* the card's soft decor ring, like the medallion in the result panel */
  content: "";
  position: absolute;
  right: -46px;
  bottom: -46px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 18px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.level h3 { font-size: 21px; font-weight: 800; margin: 14px 0 8px; }
.level p { margin: 0; color: rgba(255, 255, 255, 0.92); font-size: 15.5px; line-height: 1.5; }
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: none;
  white-space: nowrap;
}
.chip .icon { width: 11px; height: 11px; }
.stars { color: var(--star); letter-spacing: 1px; text-shadow: 0 0 6px rgba(255, 204, 51, 0.7); }

/* Marketing: hero */
.hero { text-align: center; padding: 48px 0 8px; }
.app-icon {
  width: 104px;
  height: 104px;
  border-radius: 24px;
  box-shadow: 0 16px 40px -10px rgba(41, 219, 179, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.eyebrow { margin: 22px 0 10px; font-family: var(--rounded); font-weight: 700; color: var(--teal); letter-spacing: 0.02em; }
.hero h1 { font-size: clamp(38px, 7vw, 66px); font-weight: 800; letter-spacing: -0.02em; margin: 0 auto 18px; max-width: 900px; }
.hero h1 .accent { color: var(--amber); }
.lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--text-2); max-width: 680px; margin: 0 auto 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.meta { margin: 16px 0 0; font-size: 15px; color: var(--text-3); }
.hero-shot { position: relative; margin: 44px auto 0; max-width: 1040px; }
.hero-shot::before {
  content: "";
  position: absolute;
  inset: 12% 6% -4%;
  background: radial-gradient(closest-side, rgba(41, 219, 179, 0.35), rgba(41, 219, 179, 0));
  filter: blur(30px);
  z-index: -1;
}
.hero-shot img { display: block; width: 100%; height: auto; filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.5)); }
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 34px 0 0; padding: 0; list-style: none; }
.facts .chip { font-size: 14px; padding: 7px 15px; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--card-border); }

/* Marketing: features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Marketing: real-city band */
.city-shot {
  position: relative;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.8);
  background: var(--sky-mid);
}
.city-shot img { display: block; width: 100%; height: auto; aspect-ratio: 2000 / 857; object-fit: cover; }
.city-shot figcaption {
  /* a dark glass panel, like the result panel over the top-down view */
  position: absolute;
  left: 20px;
  bottom: 20px;
  max-width: 540px;
  padding: 20px 24px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(41, 41, 41, 0.78), rgba(5, 5, 5, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.city-shot h2 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; margin-bottom: 6px; }
.city-shot p { margin: 0; color: var(--text-2); max-width: 640px; }

/* Marketing: lessons */
.groups { columns: 2; column-gap: 16px; }
.group { break-inside: avoid; margin: 0 0 16px; padding: 18px 18px 8px; display: inline-block; width: 100%; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px 10px; }
.group-head h3 { font-size: 20px; font-weight: 800; }
.group-head .chip { background: rgba(255, 255, 255, 0.08); }
.lessons { list-style: none; margin: 0; padding: 0; }
.lesson { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 10px 4px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.lesson:first-child { border-top: 0; }
.lesson .badge { grid-row: span 2; align-self: start; background: linear-gradient(165deg, var(--a), var(--b)); border-color: rgba(255, 255, 255, 0.3); }
.lesson b { font-family: var(--rounded); font-weight: 700; font-size: 16.5px; line-height: 1.35; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lesson span { font-size: 14.5px; line-height: 1.45; color: var(--text-3); }
.lesson .chip { font-size: 11.5px; padding: 2px 9px; background: rgba(255, 189, 56, 0.16); color: var(--amber); }

/* Marketing: packs */
.packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.pack { display: flex; flex-direction: column; align-items: flex-start; }
.pack .badge .icon { width: 13px; height: 13px; }
.pack .chip { margin-top: auto; }
.pack p { margin-bottom: 16px; }
.note { margin: 18px 0 0; font-size: 15px; color: var(--text-3); text-align: center; }

/* Marketing: screenshots, a swipeable row like the level carousel */
.screens {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78%, 760px);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 16px 18px;
  margin: 0 -16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.screens img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1600 / 736;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  scroll-snap-align: center;
  box-shadow: 0 18px 36px -20px rgba(0, 0, 0, 0.8);
  background: var(--sky-mid);
}
.swipe-hint { margin: 2px 0 0; text-align: center; font-size: 14px; color: var(--text-3); }

/* Marketing: final call to action */
.cta { text-align: center; padding: 38px 24px; margin-top: 56px; }
.cta .app-icon { width: 84px; height: 84px; border-radius: 19px; }
.cta h2 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; margin: 18px 0 8px; }
.cta p { max-width: 560px; margin: 0 auto 24px; }

/* Footer: the menu skyline drifting over a road with a running dashed line */
.site-footer { margin-top: auto; color: var(--text-3); font-size: 14px; }
.city { position: relative; height: 188px; overflow: hidden; }
.skyline { position: absolute; left: 0; right: 0; bottom: 22px; background-repeat: repeat-x; background-position: 0 100%; }
.skyline.far { height: 170px; background-image: url("skyline-far.svg"); background-size: 720px 170px; animation: drift-far 90s linear infinite; }
.skyline.near { height: 120px; background-image: url("skyline-near.svg"); background-size: 600px 120px; animation: drift-near 48s linear infinite; }
.road { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; background: var(--sky-bottom); border-top: 1px solid rgba(255, 255, 255, 0.1); }
.road::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 11px;
  height: 2.5px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 22px, transparent 22px 38px);
  animation: dash 0.9s linear infinite;
}
@keyframes drift-far { to { background-position: -720px 100%; } }
@keyframes drift-near { to { background-position: -600px 100%; } }
@keyframes dash { to { background-position: -38px 0; } }
.footer-bar { background: var(--sky-bottom); padding: 6px 0 26px; }
.footer-bar .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.footer-bar a { color: var(--text-2); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skyline, .road::after { animation: none; }
  .button { transition: none; }
}

@media (max-width: 1000px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .packs { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .groups { columns: 1; }
  .city-shot img { aspect-ratio: 4 / 3; }
  .city-shot figcaption { position: static; max-width: none; border: 0; border-radius: 0; padding: 18px 20px 20px; background: rgba(8, 13, 28, 0.88); }
  .screens { grid-auto-columns: 88%; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav a { padding: 6px 10px; }
  .features, .packs { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .contact .button { width: 100%; }
  .actions .button { width: 100%; padding: 13px 18px; font-size: 17px; }
  .cta { padding: 30px 16px; }
  .city { height: 150px; }
  .skyline.far { height: 128px; background-size: 542px 128px; animation-name: drift-far-sm; }
  .skyline.near { height: 90px; background-size: 450px 90px; animation-name: drift-near-sm; }
}
@media (max-width: 370px) {
  .brand span { display: none; }
}
@keyframes drift-far-sm { to { background-position: -542px 100%; } }
@keyframes drift-near-sm { to { background-position: -450px 100%; } }
