/* ============================================================================
   base.css — reset, primitives, motion
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchored sections must not land under the fixed nav. */
  scroll-padding-top: calc(var(--nav-h) + var(--sp-lg));
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.55;
  letter-spacing: var(--tracking-body);
  color: var(--on-surface);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* The colour tokens are swapped in one go by theme.js. Without a transition
     the whole page hard-cuts between palettes, which on a campus switch looks
     like a page reload rather than a rebrand. 260ms, and colour only —
     never `all`. */
  transition: background-color var(--dur-screen) var(--ease-out),
              color var(--dur-screen) var(--ease-out);
}

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

h1, h2, h3, h4 {
  margin: 0; line-height: 1.12; font-weight: 800;
  font-family: var(--font-display);
  /* The width axis. Archivo ships 75..125 and almost nobody moves it; set
     slightly expanded, the headline reads as signage rather than as body copy
     scaled up. font-stretch is the standards-track way in; the low-level
     variation setting is the fallback for engines that ignore it. */
  font-stretch: calc(var(--wdth-display) * 1%);
  font-variation-settings: "wdth" var(--wdth-display);
}
h1 { font-size: var(--fs-h1); letter-spacing: var(--tracking-display); }
h2 { font-size: var(--fs-h2); letter-spacing: var(--tracking-display); }
h3 { font-size: var(--fs-h3); letter-spacing: var(--tracking-tight); }
p { margin: 0; }

a { color: inherit; text-decoration: none; }

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

button { background: none; border: 0; padding: 0; cursor: pointer; }

ul, ol { margin: 0; padding: 0; list-style: none; }

/* Visible only to screen readers, and to keyboard users when focused. */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--primary); color: var(--on-primary); }

/* ---------------------------------------------------------------------------
   Press feedback
   ---------------------------------------------------------------------------
   The single most load-bearing detail in the whole demo, and a direct port of
   PressableScale.tsx: 0.97 over 160ms. The app's own comment explains why it
   exists — ~95 bare Pressables meant most taps produced nothing until the
   network came back, so riders tapped twice, and that is how a double booking
   starts. A web demo shown on a phone has exactly the same problem.

   Applied via a class rather than a bare `button` selector so that a control
   which should not move (a map pan handle, a scrubber) can simply not opt in.
   -------------------------------------------------------------------------- */
.press {
  transition: transform var(--dur-press) var(--ease-out),
              background-color var(--dur-pop) var(--ease-out),
              border-color var(--dur-pop) var(--ease-out),
              color var(--dur-pop) var(--ease-out),
              box-shadow var(--dur-pop) var(--ease-out);
  touch-action: manipulation;
  /* Kills the 300ms grey flash Android/iOS paint over taps, which arrives
     after the scale has already fired and reads as a second, laggy response. */
  -webkit-tap-highlight-color: transparent;
}
.press:active { transform: scale(var(--press-scale)); }

/* Hover states are gated: a touch device fires :hover on tap, so an ungated
   hover animation plays at the same moment as the press and the two fight. */
@media (hover: hover) and (pointer: fine) {
  .press:hover { filter: brightness(1.04); }
  .press.press--lift:hover { transform: translateY(-2px); }
  .press.press--lift:active { transform: scale(var(--press-scale)); }
}

/* ---------------------------------------------------------------------------
   Entrance
   ---------------------------------------------------------------------------
   Sections rise 12px and fade as they enter the viewport, staggered 60ms apart
   inside a group. Stagger is decorative, so it never gates interaction — the
   element is clickable from the first frame, it is only its opacity that is
   still catching up.
   -------------------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  /* 420ms, not 520: this is decoration on content the visitor is trying to
     read, and every extra 100ms is 100ms of it being unreadable. */
  transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------------------
   Reduced motion
   ---------------------------------------------------------------------------
   Gentler, not none. Movement is the part that causes motion sickness, so
   movement is the part that goes; opacity and colour transitions stay, because
   they are what tells you the interface responded.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .press:active,
  .press.press--lift:hover { transform: none; }

  .reveal { transform: none; }

  /* Anything purely decorative and looping stops outright. */
  .map-car, .pulse, .shimmer { animation: none !important; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 120ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------------
   Shared primitives
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
}

.eyebrow {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.lede {
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.1875rem);
  line-height: 1.6;
  color: var(--on-surface-variant);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  /* A pill, because Uber (999px), Bolt (40px) and Apple (980px) have all
     independently landed there for the same control. Measured, not copied
     from a screenshot. */
  border-radius: var(--r-pill);
  padding: 14px var(--sp-lg);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: var(--tracking-body);
  white-space: nowrap;
}

.btn--primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-cta);
}

.btn--secondary {
  /* Bolt's secondary is a translucent wash of the ink colour rather than a
     grey: rgba(1,34,18,.067) on their green-cast black. Doing the same with
     the campus ink means the secondary button re-tints itself on every campus
     and in dark mode, with no second token to keep in sync. */
  background: color-mix(in srgb, var(--on-surface) 7%, transparent);
  color: var(--on-surface);
  border: 1px solid transparent;
}
@supports not (background: color-mix(in srgb, red 7%, transparent)) {
  .btn--secondary { background: var(--surface); border-color: var(--outline-variant); }
}

.btn--ghost { color: var(--on-surface); }

.btn--gold {
  background: var(--secondary);
  color: var(--on-secondary);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-1);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  background: var(--surface-variant);
  color: var(--on-surface);
}

.chip--gold {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.icon { width: 20px; height: 20px; flex: none; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }
