/*
 * cityunlock.app: one stylesheet for every page. Dark only, like the app. Colors are the app's AppColors
 * (lib/services/ui/app_colors.dart). Load it with <link rel="stylesheet" href="/assets/site.css">; it brings
 * the self-hosted Roboto with it. Paths are absolute, so it works from any folder.
 *
 * Reusable components
 *
 *   Page frame
 *     .site-header > .site-header__inner.container > a.brand[href="/"] > img.brand__icon + span.brand__name
 *       (the landing page adds nav.site-nav and .site-header__action; [data-site-header] + site.js adds a
 *       backdrop on scroll, without them the header is simply transparent)
 *     .site-footer > .site-footer__inner.container > .site-footer__brand, ul.site-footer__links, .site-footer__note
 *     .container (centered, max 1160px, side gutter), .skip-link, .visually-hidden
 *
 *   Centered card layout (auth and error pages; 404.html is a working copy of the whole page)
 *     <body class="page-center">
 *       <header class="site-header"><div class="site-header__inner container">
 *         <a class="brand" href="/"><img class="brand__icon" src="/assets/img/logo-120.webp" width="36" height="36"
 *           alt=""><span class="brand__name">City Unlock</span></a></div></header>
 *       <main class="center-main" id="main"><div class="card">…</div></main>
 *       <footer class="site-footer">…</footer>
 *     .card            surface box, max 440px, a flex column with 16px gaps (hidden children take no room)
 *     .card__icon      56px tinted tile for an inline SVG; --success (mint, default), --error, --info
 *     .card__title     the card's h1; focusable headings (tabindex="-1") get no focus ring
 *     .card__text      secondary text;  .card__actions  a column of full-width buttons;  .card__footnote  small print
 *     .stack           any flex column with 16px gaps (set --stack-gap to change it)
 *
 *   Buttons: a.button or button.button
 *     .button                 primary (mint on dark text)
 *     .button--secondary      surface with an outline;   .button--ghost  text only
 *     .button--small, .button--block (full width)
 *     disabled: [disabled] or [aria-disabled="true"]
 *     loading:  .is-loading (+ aria-busy="true"): a spinner replaces the label, the width stays
 *
 *   Fields
 *     .field > label.field__label[for] + .field__control > input.field__input (+ button.field__toggle)
 *            + p.field__hint + p.field__error
 *     invalid: input[aria-invalid="true"] (or .field.is-invalid); .field__error hides itself while empty
 *     .field__toggle is a small "Show"/"Hide" text button inside the input, for passwords
 *
 *   Messages
 *     .notice (+ --success | --error | --info) > svg.notice__icon + .notice__body (> .notice__title)
 *     .spinner   a standalone loading ring (inherits the text color; .spinner--large for 40px)
 *
 *   Store buttons (landing): .store-buttons > a.store-button[data-store] > svg.store-button__icon
 *     + .store-button__text > .store-button__label + .store-button__name; .is-soon while there is no link
 *
 * Tokens: the custom properties on :root below (--color-*, --font-*, --text-*, --radius-*, --space-*, --shadow-*).
 */

/* ---------------------------------------------------------------------------------------------------------------
   Font: Roboto, the app's font, self-hosted (variable, weights 100-900; OFL, its notice is in the files)
   --------------------------------------------------------------------------------------------------------------- */

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/roboto-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/roboto-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------------------------------------------------------
   Tokens
   --------------------------------------------------------------------------------------------------------------- */

:root {
  color-scheme: dark;

  --color-bg: #0b0f14;
  --color-surface: #141a22;
  --color-surface-high: #1c2430;
  --color-outline: #2a3341;
  --color-outline-strong: #3a4557;
  --color-text: #e8edf2;
  --color-text-secondary: #b7c0cc;
  --color-text-muted: #7d8896;

  --color-foot: #2ee6a6; /* footMint: streets walked or run, and the primary color */
  --color-drive: #ffb547; /* driveAmber: roads driven */
  --color-spot: #ff5c8a; /* spotPink: photo spots */
  --color-max: #5cc8ff; /* maxSky: City Unlock Max */
  --color-locked: #465163; /* lockedRoad: streets not explored yet */
  --color-logo: #243147; /* logoBackground */
  --color-places: #ff8f6b; /* the store screenshots' accent for collections */
  --color-rank: #ffd54f; /* the store screenshots' accent for leaderboards */
  --color-danger: #ff4d57; /* dangerRed */
  --color-danger-text: #ff7a82; /* dangerRed, lighter, for small text on dark */

  --color-primary: var(--color-foot);
  --color-primary-hover: #5cefbe;
  --color-on-primary: #0b0f14;
  --color-focus: var(--color-foot);
  --gradient-max: linear-gradient(135deg, var(--color-foot), var(--color-max));

  --font-sans: "Roboto", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.1875rem;
  --leading: 1.6;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --gutter: clamp(16px, 4vw, 32px);
  --container: 1160px;
  --header-height: 64px;

  --shadow-card: inset 0 1px 0 rgb(255 255 255 / 0.04), 0 24px 56px -24px rgb(0 0 0 / 0.75);
  --shadow-float: 0 6px 18px rgb(0 0 0 / 0.5);

  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
  --duration-fast: 160ms;
  --duration: 260ms;
}

/* ---------------------------------------------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 12px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--color-text);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 1.55rem + 3vw, 4rem);
}

h2 {
  font-size: clamp(1.875rem, 1.35rem + 2.1vw, 3rem);
}

h3 {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

p,
ul,
ol,
figure {
  margin: 0;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--color-foot);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

[tabindex="-1"]:focus {
  outline: none;
}

::selection {
  background: rgb(46 230 166 / 0.3);
  color: #fff;
}

[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------------------------------------------------------
   Utilities
   --------------------------------------------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 700;
  text-decoration: none;
  transition: top var(--duration-fast);
}

.skip-link:focus {
  top: 12px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap, 16px);
}

.eyebrow {
  color: var(--color-foot);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.accent {
  color: var(--accent, var(--color-foot));
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-muted {
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------------------------------------------------
   Header and brand
   --------------------------------------------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  border-bottom: 1px solid transparent;
  transition:
    background-color var(--duration),
    border-color var(--duration);
}

.site-header.is-scrolled {
  border-bottom-color: rgb(42 51 65 / 0.75);
  background: rgb(11 15 20 / 0.97);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header.is-scrolled {
    background: rgb(11 15 20 / 0.78);
    -webkit-backdrop-filter: saturate(150%) blur(14px);
    backdrop-filter: saturate(150%) blur(14px);
  }
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 100%;
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
}

.brand__icon {
  width: 36px;
  height: 36px;
  border-radius: 26%;
  box-shadow:
    0 0 0 1px var(--color-outline),
    0 4px 16px -6px rgb(46 230 166 / 0.45);
}

.brand__name {
  white-space: nowrap;
}

.site-nav {
  display: none;
  gap: 2px;
  margin-left: auto;
}

.site-nav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition:
    color var(--duration-fast),
    background-color var(--duration-fast);
}

.site-nav a:hover {
  background: rgb(255 255 255 / 0.05);
  color: var(--color-text);
}

.site-header__action {
  margin-left: auto;
}

@media (min-width: 880px) {
  .site-nav {
    display: flex;
  }

  .site-nav + .site-header__action {
    margin-left: var(--space-2);
  }
}

/* ---------------------------------------------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------------------------------------------- */

.button {
  --button-bg: var(--color-primary);
  --button-bg-hover: var(--color-primary-hover);
  --button-fg: var(--color-on-primary);
  --button-border: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border: 1px solid var(--button-border);
  border-radius: var(--radius-md);
  background: var(--button-bg);
  color: var(--button-fg);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--duration-fast),
    border-color var(--duration-fast),
    color var(--duration-fast),
    transform var(--duration-fast);
}

.button svg {
  flex: none;
  width: 20px;
  height: 20px;
}

.button:hover {
  background: var(--button-bg-hover);
}

.button:active {
  transform: translateY(1px);
}

.button--secondary {
  --button-bg: var(--color-surface-high);
  --button-bg-hover: #243042;
  --button-fg: var(--color-text);
  --button-border: var(--color-outline-strong);
}

.button--ghost {
  --button-bg: transparent;
  --button-bg-hover: rgb(255 255 255 / 0.06);
  --button-fg: var(--color-text);
}

.button--small {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: var(--text-sm);
}

.button--block {
  display: flex;
  width: 100%;
}

.button:disabled,
.button[aria-disabled="true"] {
  background: var(--button-bg);
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.button.is-loading {
  color: transparent;
  cursor: progress;
  opacity: 1;
  pointer-events: none;
}

.button.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2.5px solid var(--button-fg);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.spinner--large {
  width: 40px;
  height: 40px;
  border-width: 3.5px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .button.is-loading::after,
  .spinner {
    animation-duration: 1.6s;
  }
}

/* ---------------------------------------------------------------------------------------------------------------
   Fields
   --------------------------------------------------------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.3;
}

.field__control {
  position: relative;
}

.field__input {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid var(--color-outline-strong);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.4;
  transition:
    border-color var(--duration-fast),
    box-shadow var(--duration-fast);
}

.field__input::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

.field__input:hover {
  border-color: #4a5669;
}

.field__input:focus {
  border-color: var(--color-foot);
  outline: none;
  box-shadow: 0 0 0 3px rgb(46 230 166 / 0.22);
}

.field__input:-webkit-autofill {
  -webkit-text-fill-color: var(--color-text);
  caret-color: var(--color-text);
  box-shadow: inset 0 0 0 100px var(--color-bg);
}

.field__input:-webkit-autofill:focus {
  box-shadow:
    inset 0 0 0 100px var(--color-bg),
    0 0 0 3px rgb(46 230 166 / 0.22);
}

.field__input[aria-invalid="true"],
.field.is-invalid .field__input {
  border-color: var(--color-danger);
}

.field__input[aria-invalid="true"]:focus,
.field.is-invalid .field__input:focus {
  box-shadow: 0 0 0 3px rgb(255 77 87 / 0.25);
}

.field__input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.field__control:has(.field__toggle) .field__input {
  padding-right: 80px;
}

.field__toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-foot);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transform: translateY(-50%);
}

.field__toggle:hover {
  background: rgb(46 230 166 / 0.1);
}

.field__hint {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  line-height: 1.45;
}

.field__error {
  color: var(--color-danger-text);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.field__error:empty {
  display: none;
}

/* ---------------------------------------------------------------------------------------------------------------
   Notices
   --------------------------------------------------------------------------------------------------------------- */

.notice {
  --notice-rgb: 92 200 255;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgb(var(--notice-rgb) / 0.38);
  border-radius: var(--radius-md);
  background: rgb(var(--notice-rgb) / 0.1);
  color: var(--color-text);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.notice--success {
  --notice-rgb: 46 230 166;
}

.notice--error {
  --notice-rgb: 255 77 87;
}

.notice--info {
  --notice-rgb: 92 200 255;
}

.notice__icon {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: rgb(var(--notice-rgb));
}

.notice__body {
  min-width: 0;
}

.notice__title {
  display: block;
  font-weight: 700;
}

/* ---------------------------------------------------------------------------------------------------------------
   Centered card layout
   --------------------------------------------------------------------------------------------------------------- */

.page-center {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.center-main {
  position: relative;
  display: grid;
  flex: 1;
  place-items: center;
  padding: clamp(24px, 6vw, 64px) var(--gutter);
  isolation: isolate;
}

/* A faint glow behind the card */
.center-main::before {
  content: "";
  position: absolute;
  top: 8%;
  left: 50%;
  z-index: -1;
  width: min(720px, 100%);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgb(46 230 166 / 0.09), rgb(46 230 166 / 0));
  transform: translateX(-50%);
  pointer-events: none;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 440px;
  padding: clamp(24px, 6vw, 36px);
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.card__icon {
  --icon-rgb: 46 230 166;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgb(var(--icon-rgb) / 0.12);
  color: rgb(var(--icon-rgb));
}

.card__icon svg {
  width: 28px;
  height: 28px;
}

.card__icon--success {
  --icon-rgb: 46 230 166;
}

.card__icon--error {
  --icon-rgb: 255 77 87;
}

.card__icon--info {
  --icon-rgb: 92 200 255;
}

.card__title {
  font-size: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.card__text {
  color: var(--color-text-secondary);
  font-size: 1rem;
}

.card__text strong {
  color: var(--color-text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.card__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.card__footnote {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ---------------------------------------------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------------------------------------------- */

.site-footer {
  padding: 32px 0 40px;
  border-top: 1px solid var(--color-outline);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}

.site-footer__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

.site-footer__brand .brand {
  font-size: 1rem;
}

.site-footer__brand .brand__icon {
  width: 28px;
  height: 28px;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 0;
  list-style: none;
}

.site-footer a:not(.brand) {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.site-footer a:not(.brand):hover {
  color: var(--color-text);
  text-decoration: underline;
}

.site-footer__note {
  flex-basis: 100%;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

/* ---------------------------------------------------------------------------------------------------------------
   Store buttons
   --------------------------------------------------------------------------------------------------------------- */

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-button {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 12px;
  min-width: 200px;
  min-height: 60px;
  padding: 10px 22px 10px 16px;
  border: 1px solid var(--color-outline-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, #19202a, #11161d);
  color: var(--color-text);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.05);
  transition:
    border-color var(--duration-fast),
    transform var(--duration-fast),
    background-color var(--duration-fast);
}

.store-button__icon {
  flex: none;
  width: 26px;
  height: 26px;
}

.store-button__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.1;
}

.store-button__label {
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.store-button__name {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

a.store-button[href]:hover {
  border-color: var(--color-foot);
  transform: translateY(-1px);
}

.store-button.is-soon {
  cursor: default;
}

.store-button.is-soon .store-button__label {
  color: var(--color-foot);
}

@media (max-width: 479px) {
  .store-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .store-button {
    gap: 10px;
    min-width: 0;
    min-height: 56px;
    padding: 9px 12px;
    border-radius: 14px;
  }

  .store-button__icon {
    width: 22px;
    height: 22px;
  }

  .store-button__name {
    font-size: 1.0625rem;
    white-space: nowrap;
  }
}

/* ---------------------------------------------------------------------------------------------------------------
   Landing page: shared section parts
   --------------------------------------------------------------------------------------------------------------- */

.section {
  position: relative;
  padding: clamp(64px, 9vw, 112px) 0;
}

.section-head {
  max-width: 760px;
  margin: 0 auto clamp(48px, 7vw, 88px);
  text-align: center;
}

.section-head > * + * {
  margin-top: 16px;
}

.section-head__text {
  color: var(--color-text-secondary);
  font-size: var(--text-lg);
}

/* Rise-in on scroll (site.js adds .can-reveal when it can run it) */
.can-reveal [data-reveal] {
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out);
}

.can-reveal [data-reveal]:not(.is-revealed) {
  opacity: 0;
  transform: translateY(28px);
}

/* ---------------------------------------------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(20px, 4vw, 56px) 0 clamp(64px, 9vw, 112px);
  overflow-x: clip;
}

.hero__inner {
  display: grid;
  align-items: center;
  gap: clamp(36px, 5vw, 64px);
}

.hero__copy {
  max-width: 600px;
}

.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-pill);
  background: rgb(20 26 34 / 0.8);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.3;
}

.hero__kicker-dot {
  position: relative;
  flex: none;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--color-foot);
  box-shadow: 0 0 0 4px rgb(46 230 166 / 0.2);
}

.hero__title {
  margin-top: 20px;
  font-size: clamp(2.375rem, 1.5rem + 3.6vw, 4.25rem);
  line-height: 1.03;
  letter-spacing: -0.032em;
}

.hero__lead {
  max-width: 33em;
  margin-top: 20px;
  color: var(--color-text-secondary);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.55;
}

.hero .store-buttons {
  margin-top: 32px;
}

@media (min-width: 960px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  }

  .hero__title .accent {
    display: block;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__copy > * {
    animation: rise 0.9s var(--ease-out) both;
  }

  .hero__copy > :nth-child(2) {
    animation-delay: 0.06s;
  }

  .hero__copy > :nth-child(3) {
    animation-delay: 0.12s;
  }

  .hero__copy > :nth-child(4) {
    animation-delay: 0.18s;
  }

  .hero__visual {
    animation: fade 1.2s var(--ease-out) 0.1s both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

/* ---------------------------------------------------------------------------------------------------------------
   Hero: the animated city map
   --------------------------------------------------------------------------------------------------------------- */

.hero__visual {
  position: relative;
  isolation: isolate;
}

.no-js .hero__visual {
  display: none;
}

/* The app's soft glow behind its scenes */
.hero__visual::before {
  content: "";
  position: absolute;
  top: 10%;
  left: 50%;
  z-index: -1;
  width: 118%;
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgb(46 230 166 / 0.12), rgb(46 230 166 / 0.04) 55%, rgb(46 230 166 / 0));
  transform: translateX(-50%);
  pointer-events: none;
}

.city-map {
  --street-width: 1.2px;
  --lit-width: 2.7px;
  --glow-width: 10px;
  position: relative;
  width: 100%;
  max-width: 600px;
  margin-inline: auto;
}

.city-card {
  position: relative;
  z-index: 2;
  width: min(100%, 320px);
  margin: 0 auto -5%;
  padding: 12px 16px 14px;
  border: 1px solid var(--color-outline);
  border-radius: 18px;
  background: rgb(20 26 34 / 0.96);
  box-shadow: var(--shadow-float);
  line-height: 1.25;
}

.city-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.city-card__title {
  display: block;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 700;
}

.city-card__sub {
  display: block;
  margin-top: 2px;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.city-card__stat {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--color-foot);
}

.city-card__stat svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.city-card__percent {
  font-size: 1.625rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1;
}

.city-card__bar {
  height: 4px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--color-surface-high);
}

.city-card__fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--color-foot);
  transform: scaleX(0.25);
  transform-origin: left center;
}

/* The city's viewBox, so the map takes its room before site.js draws it */
.city-map__canvas {
  position: relative;
  aspect-ratio: 952 / 916;
}

.city {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.city--live {
  will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
  .city {
    opacity: 0;
    transition: opacity 0.9s var(--ease-out);
  }

  .city-map.is-ready .city {
    opacity: 1;
  }
}

.city__blocks {
  fill: #10151c;
}

.city__water {
  fill: #0f1d30;
}

.city__park {
  fill: #0f231a;
}

.city__streets,
.city__limits,
.city__glow,
.city__line,
.city__head,
.city__burst {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.city__streets {
  stroke: var(--color-locked);
  stroke-width: var(--street-width);
}

.city__limits {
  stroke: rgb(255 255 255 / 0.4);
  stroke-width: 1.3px;
}

.city__glow {
  stroke-opacity: 0.28;
  stroke-width: var(--glow-width);
}

.city__line {
  stroke-width: var(--lit-width);
}

.city__glow--foot,
.city__line--foot {
  stroke: var(--color-foot);
}

.city__glow--car,
.city__line--car {
  stroke: var(--color-drive);
}

/* The streets being unlocked right now shine a little brighter */
.city__head {
  stroke: #a1f4d7;
  stroke-width: calc(var(--lit-width) + 0.6px);
}

.city__spot {
  fill: var(--color-spot);
  stroke: var(--color-bg);
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

.city__pulse,
.city__core {
  fill: var(--color-foot);
}

.city__halo {
  fill: rgb(46 230 166 / 0.18);
}

.city__shade {
  fill: rgb(0 0 0 / 0.35);
}

.city__ring {
  fill: #fff;
}

.city__burst {
  stroke: var(--color-foot);
  stroke-width: 2px;
}

.city-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-top: 8px;
  padding: 0;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  line-height: 1.3;
  list-style: none;
}

.city-legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.city-legend__swatch {
  width: 14px;
  height: 4px;
  border-radius: 2px;
  background: var(--swatch);
}

.city-legend__swatch--dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* In the map's empty bottom right corner, outside the city limits */
.city-map__toggle {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--color-outline);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition:
    color var(--duration-fast),
    border-color var(--duration-fast);
}

.city-map__toggle:hover {
  border-color: var(--color-outline-strong);
  color: var(--color-text);
}

.city-map__toggle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.city-map__toggle .icon-play,
.city-map__toggle.is-paused .icon-pause {
  display: none;
}

.city-map__toggle.is-paused .icon-play {
  display: block;
}

@media (max-width: 599px) {
  .city-map {
    --street-width: 1px;
    --lit-width: 2.2px;
    --glow-width: 7px;
  }

  .city-card {
    padding: 10px 14px 12px;
  }

  .city-card__percent {
    font-size: 1.5rem;
  }
}

/* ---------------------------------------------------------------------------------------------------------------
   Features: the app's screens
   --------------------------------------------------------------------------------------------------------------- */

.features {
  overflow-x: clip;
}

.feature-list {
  display: grid;
  gap: clamp(72px, 10vw, 128px);
  max-width: 1040px;
  margin-inline: auto;
}

.feature {
  --accent: var(--color-foot);
  --accent-rgb: 46 230 166;
  display: grid;
  align-items: center;
  gap: 40px;
}

.feature--places {
  --accent: var(--color-places);
  --accent-rgb: 255 143 107;
}

.feature--spots {
  --accent: var(--color-spot);
  --accent-rgb: 255 92 138;
}

.feature--drive {
  --accent: var(--color-drive);
  --accent-rgb: 255 181 71;
}

.feature--rank {
  --accent: var(--color-rank);
  --accent-rgb: 255 213 79;
}

.feature__text {
  max-width: 500px;
}

/* Stacked, the text lines up with the phone under it */
@media (max-width: 899px) {
  .feature__text {
    margin-inline: auto;
  }
}

.feature__kicker {
  color: var(--accent);
}

.feature__title {
  margin-top: 12px;
  font-size: clamp(1.875rem, 1.35rem + 1.9vw, 2.75rem);
  line-height: 1.06;
  letter-spacing: -0.028em;
}

.feature__title .accent {
  display: block;
}

.feature__body {
  margin-top: 20px;
  color: var(--color-text-secondary);
}

.feature__note {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--color-outline);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.feature__note svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--accent);
}

.feature__media {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.feature__media::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: min(135%, 620px);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgb(var(--accent-rgb) / 0.16), rgb(var(--accent-rgb) / 0.05) 55%, rgb(var(--accent-rgb) / 0));
  transform: translate(-50%, -50%);
  pointer-events: none;
}

@media (min-width: 900px) {
  .feature {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(48px, 6vw, 88px);
  }

  .feature__text {
    justify-self: end;
  }

  .feature:nth-child(even) .feature__media {
    order: -1;
  }

  .feature:nth-child(even) .feature__text {
    justify-self: start;
  }
}

/* A phone in a glass frame, like the store screenshots */
.phone {
  --phone-width: 300px;
  --bezel: 10px;
  --screen-radius: calc((var(--phone-width) - var(--bezel) * 2) * 0.09);
  width: min(100%, var(--phone-width));
  padding: var(--bezel);
  border-radius: calc(var(--screen-radius) + var(--bezel));
  background: linear-gradient(
    155deg,
    rgb(255 255 255 / 0.32) 0%,
    rgb(255 255 255 / 0.09) 22%,
    rgb(255 255 255 / 0.05) 55%,
    rgb(255 255 255 / 0.1) 80%,
    rgb(255 255 255 / 0.24) 100%
  );
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.2),
    0 40px 80px -32px rgb(0 0 0 / 0.85),
    0 18px 36px -12px rgb(0 0 0 / 0.5);
}

.phone__screen {
  width: 100%;
  aspect-ratio: 1280 / 2628;
  border-radius: var(--screen-radius);
  background: var(--color-surface);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.6);
  object-fit: cover;
}

@media (max-width: 599px) {
  .phone {
    --phone-width: 264px;
    --bezel: 9px;
  }
}

/* ---------------------------------------------------------------------------------------------------------------
   How it works: four stops on a route
   --------------------------------------------------------------------------------------------------------------- */

.route-steps {
  --node: 44px;
  --gap: 36px;
  display: grid;
  gap: var(--gap);
  padding: 0;
  list-style: none;
}

.route-step {
  position: relative;
  padding-left: calc(var(--node) + 20px);
}

/* The street to the next stop: grey, then lit in mint, stop after stop, as the list scrolls into view */
.route-step:not(:last-child)::before,
.route-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(var(--node) / 2);
  left: calc(var(--node) / 2 - 1.5px);
  width: 3px;
  height: calc(100% + var(--gap));
  border-radius: 2px;
}

.route-step::before {
  background: var(--color-locked);
}

.route-step::after {
  background: var(--color-foot);
  box-shadow: 0 0 12px rgb(46 230 166 / 0.55);
  transform-origin: top center;
}

.route-step__node {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--node);
  height: var(--node);
  border: 2px solid var(--color-foot);
  border-radius: 50%;
  background: var(--color-bg);
  box-shadow:
    0 0 0 6px var(--color-bg),
    0 0 18px rgb(46 230 166 / 0.4);
  color: var(--color-foot);
  font-size: 1.0625rem;
  font-weight: 800;
}

.can-reveal .route-step::after {
  transform: scaleY(0);
  transition: transform 0.55s linear;
}

.can-reveal .route-step__node {
  transition:
    border-color 0.3s,
    color 0.3s,
    box-shadow 0.3s;
}

.can-reveal .route-steps:not(.is-revealed) .route-step__node {
  border-color: var(--color-locked);
  box-shadow: 0 0 0 6px var(--color-bg);
  color: var(--color-text-muted);
}

.can-reveal .route-steps.is-revealed .route-step::after {
  transform: none;
}

.can-reveal .route-step:nth-child(1)::after {
  transition-delay: 0.45s;
}

.can-reveal .route-step:nth-child(2)::after {
  transition-delay: 1s;
}

.can-reveal .route-step:nth-child(3)::after {
  transition-delay: 1.55s;
}

.can-reveal .route-step:nth-child(1) .route-step__node {
  transition-delay: 0.3s;
}

.can-reveal .route-step:nth-child(2) .route-step__node {
  transition-delay: 0.95s;
}

.can-reveal .route-step:nth-child(3) .route-step__node {
  transition-delay: 1.5s;
}

.can-reveal .route-step:nth-child(4) .route-step__node {
  transition-delay: 2.05s;
}

.route-step__title {
  padding-top: 8px;
  font-size: 1.25rem;
  line-height: 1.25;
}

.route-step__text {
  margin-top: 8px;
  color: var(--color-text-secondary);
  font-size: 1rem;
}

@media (min-width: 900px) {
  .route-steps {
    --gap: 32px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .route-step:not(:last-child)::before,
  .route-step:not(:last-child)::after {
    top: calc(var(--node) / 2 - 1.5px);
    left: calc(var(--node) / 2);
    width: calc(100% + var(--gap));
    height: 3px;
  }

  .route-step::after {
    transform-origin: left center;
  }

  .can-reveal .route-step::after {
    transform: scaleX(0);
  }

  .route-step {
    padding-top: calc(var(--node) + 24px);
    padding-left: 0;
  }

  .route-step__title {
    padding-top: 0;
  }
}

/* ---------------------------------------------------------------------------------------------------------------
   City Unlock Max
   --------------------------------------------------------------------------------------------------------------- */

.max-panel {
  position: relative;
  display: grid;
  gap: 40px;
  padding: clamp(28px, 5vw, 56px);
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(var(--color-surface), var(--color-surface)) padding-box,
    linear-gradient(135deg, rgb(46 230 166 / 0.7), rgb(92 200 255 / 0.7) 45%, var(--color-outline) 75%) border-box;
  isolation: isolate;
}

.max-panel::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  z-index: -1;
  width: 70%;
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgb(92 200 255 / 0.14), rgb(92 200 255 / 0));
  pointer-events: none;
}

.max-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
}

.max-word {
  background: var(--gradient-max);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.max-panel__title {
  margin-top: 12px;
}

.max-panel__text {
  max-width: 30em;
  margin-top: 16px;
  color: var(--color-text-secondary);
  font-size: var(--text-lg);
}

.max-perks {
  display: grid;
  gap: 14px;
  padding: 0;
  list-style: none;
}

.max-perk {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-lg);
  background: rgb(11 15 20 / 0.55);
}

.max-perk__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--gradient-max);
  color: var(--color-on-primary);
}

.max-perk__icon svg {
  width: 22px;
  height: 22px;
}

.max-perk__title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

@media (min-width: 900px) {
  .max-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 56px;
  }
}

/* ---------------------------------------------------------------------------------------------------------------
   Last call to action
   --------------------------------------------------------------------------------------------------------------- */

.cta {
  overflow: hidden;
  isolation: isolate;
}

/* A faint street grid, lit in the middle */
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(70 81 99 / 0.38) 1px, transparent 1px),
    linear-gradient(90deg, rgb(70 81 99 / 0.38) 1px, transparent 1px);
  background-position: center center;
  background-size: 58px 50px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 0%, transparent 75%);
  pointer-events: none;
}

.cta::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: min(900px, 140vw);
  aspect-ratio: 1.6;
  background: radial-gradient(closest-side, rgb(46 230 166 / 0.14), rgb(46 230 166 / 0));
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.cta__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cta__icon {
  width: 88px;
  height: 88px;
  border-radius: 26%;
  box-shadow:
    0 0 0 1px var(--color-outline),
    0 18px 48px -12px rgb(46 230 166 / 0.45);
}

.cta__title {
  margin-top: 28px;
}

.cta__text {
  max-width: 30em;
  margin-top: 16px;
  color: var(--color-text-secondary);
  font-size: var(--text-lg);
}

.cta .store-buttons {
  justify-content: center;
  margin-top: 32px;
}

@media (max-width: 479px) {
  .cta .store-buttons {
    width: 100%;
  }
}
