/*
 * Tracks — stopgap site. Every value below is lifted from the app's theme
 * (tracks-app/src/theme): palette.ts + ramp.ts (dark scheme), typography.ts,
 * spacing.ts. Don't invent new values here; if the app changes, change these.
 */

@font-face {
  font-family: "SGEO";
  src: url("/fonts/SpecialGothicExpandedOne-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Afacad";
  src: url("/fonts/Afacad-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Afacad";
  src: url("/fonts/Afacad-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Afacad";
  src: url("/fonts/Afacad-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* palette.ts — dark */
  --background: #141414;
  --surface: #1f1f1f;
  --surface-sunken: #191919;
  --scrim: #000000;
  --border: rgb(255 255 255 / 0.1);
  --content: #ffffff;
  --content-secondary: rgb(255 255 255 / 0.8);
  --content-muted: rgb(255 255 255 / 0.56);
  --accent: #539dff;
  --accent-surface: rgb(83 157 255 / 0.25);
  --on-time: #5aff5c;
  --on-time-surface: rgb(90 255 92 / 0.25);
  --delayed: #ff2d55;
  --delayed-surface: rgb(255 45 85 / 0.25);
  --connector: #d9d9d9;

  /* typography.ts */
  --display: "SGEO", "Arial Black", system-ui, sans-serif;
  --text: "Afacad", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* spacing.ts — UNIT 4 */
  --xs: 4px;
  --sm: 8px;
  --md: 12px;
  --lg: 16px;
  --xl: 20px;
  --xxl: 24px; /* screen gutter */

  /* radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;

  /* PlanRail / LegTimeline */
  --rail: 20px;
  --line: 2px;
  --dot: 10px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--content);
  font-family: var(--text);
  font-size: 17px; /* body */
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* gradients.authBackdrop — the app grey held for the top third, falling to black */
body.backdrop {
  background: linear-gradient(to bottom, var(--background) 36%, var(--scrim));
}

img {
  max-width: 100%;
  height: auto;
}

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

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

.skip {
  position: absolute;
  left: var(--lg);
  top: -100px;
  padding: var(--sm) var(--md);
  background: var(--surface);
  color: var(--content);
  border-radius: var(--r-sm);
  z-index: 1;
}
.skip:focus {
  top: var(--lg);
}

.wrap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--lg);
}
@media (min-width: 480px) {
  .wrap {
    padding: 0 var(--xxl);
  }
}

main {
  flex: 1;
}

/* ---------- type ---------- */

.display {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.15;
}

.secondary {
  color: var(--content-secondary);
}
.muted {
  color: var(--content-muted);
}

/* ---------- LabelPill ---------- */

.pill {
  display: inline-block;
  padding: var(--xs) var(--sm);
  border-radius: var(--r-sm);
  font-family: var(--display);
  font-size: 12px; /* labelPill */
  line-height: 1.2;
  white-space: nowrap;
  color: var(--accent);
  background: var(--accent-surface);
}
.pill.on-time {
  color: var(--on-time);
  background: var(--on-time-surface);
}
.pill.delayed {
  color: var(--delayed);
  background: var(--delayed-surface);
}

/* ---------- landing ---------- */

.hero {
  padding: 72px 0 var(--xxl);
  text-align: center;
}
@media (min-height: 800px) and (min-width: 600px) {
  .hero {
    padding-top: 112px;
  }
}

.wordmark {
  margin: 0;
  font-size: 48px; /* authWordmark */
  line-height: 1;
}
@media (min-width: 600px) {
  .wordmark {
    font-size: 64px;
  }
}

.pitch {
  margin: var(--xl) auto 0;
  max-width: 26em;
  color: var(--content-secondary);
}

.stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--md);
  margin-top: var(--xxl);
}

/* Stand-ins until the official artwork is dropped in — see index.html TODO. */
.store {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-width: 150px;
  height: 52px;
  padding: 0 var(--lg);
  border-radius: var(--r-md);
  border: 1px solid rgb(255 255 255 / 0.56);
  background: var(--scrim);
  color: var(--content);
  text-decoration: none;
  text-align: left;
  line-height: 1.1;
}
.store small {
  font-size: 12px;
  color: var(--content-secondary);
}
.store span {
  font-family: var(--display);
  font-size: 15px;
}
.store:hover {
  border-color: var(--content);
}

/* ---------- the rail (PlanRail's drawing) ---------- */

.rail {
  list-style: none;
  margin: 56px auto 0;
  padding: 0;
  max-width: 460px;
  text-align: left;
}

.stop {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  column-gap: var(--md);
}

.track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* The line: through the whole row, and on through the gap below it. */
.track::before {
  content: "";
  position: absolute;
  left: calc(50% - var(--line) / 2);
  width: var(--line);
  top: 0;
  bottom: 0;
  background: var(--connector);
}
.stop:first-child .track::before {
  top: calc(50% - var(--md) / 2);
}
/* The gap between cards is padding on the rail column, so the dot centres on
   the card while the line still runs through the gap. */
.stop:not(:last-child) .track {
  padding-bottom: var(--md);
}
.stop:last-child .track::before {
  bottom: 50%;
}

.dot {
  position: relative;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--connector);
}
/* Filled at the ends of the line, hollow between. */
.dot.calling {
  background: var(--background);
  border: var(--line) solid var(--connector);
}

.marker {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--rail);
  height: var(--rail);
  border-radius: 50%;
  background: var(--accent);
  color: var(--content);
}
.marker svg {
  width: 12px;
  height: 12px;
}

.card {
  margin: 0;
  padding: var(--md);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
}
.stop:not(:last-child) .card {
  margin-bottom: var(--md);
}
.card.current {
  border-color: var(--accent);
}
.card h2 {
  margin: 0;
  font-size: 17px; /* journeyStation */
}
.card p {
  margin: var(--xs) 0 0;
  font-size: 15px; /* subBody */
  color: var(--content-secondary);
}
.card .pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sm);
  margin-top: var(--sm);
}

.attribution {
  margin: 56px 0 0;
  text-align: center;
}
.eyebrow {
  display: block;
  font-family: var(--display);
  font-size: 10px; /* eyebrow */
  color: var(--content-muted);
  margin-bottom: var(--md);
}
.attribution img {
  width: 173px;
  height: 32px;
  object-fit: contain;
}

/* ---------- legal pages ---------- */

.masthead {
  padding: var(--xxl) 0 0;
}
.home {
  font-family: var(--display);
  font-size: 20px;
  color: var(--content);
  text-decoration: none;
}

.doc {
  padding-top: 48px;
  padding-bottom: var(--xxl);
}
.doc h1 {
  margin: var(--md) 0 0;
  font-size: 24px; /* h1 */
}
@media (min-width: 600px) {
  .doc h1 {
    font-size: 32px;
  }
}
.doc .lede {
  margin: var(--lg) 0 0;
  color: var(--content-secondary);
}
.doc h2 {
  margin: 48px 0 0;
  font-size: 20px; /* h2 */
}
.doc h3 {
  margin: var(--xxl) 0 0;
  font-size: 17px;
  font-weight: 600;
}
.doc p,
.doc ul,
.doc ol {
  margin: var(--md) 0 0;
}
.doc ul,
.doc ol {
  padding-left: 1.25em;
}
.doc li + li {
  margin-top: var(--xs);
}
.doc li::marker {
  color: var(--content-muted);
}
.doc strong {
  font-weight: 600;
}

/* A block that stands apart: the short version, the route in the app. */
.panel {
  margin-top: var(--lg);
  padding: var(--lg);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
}
.panel > :first-child {
  margin-top: 0;
}

.path {
  font-family: var(--display);
  font-size: 15px;
}
.path .sep {
  color: var(--content-muted);
  padding: 0 0.35em;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0 !important;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: var(--sm);
}
.steps li::before {
  content: counter(step);
  font-family: var(--display);
  font-size: 15px;
  color: var(--accent);
  line-height: 1.6;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 var(--xl);
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--content);
  font-weight: 500;
  text-decoration: none;
  margin-top: var(--lg);
}
.button:hover {
  border-color: var(--content-muted);
}
@media (max-width: 479px) {
  .button {
    width: 100%;
  }
}

.note {
  font-size: 15px;
  color: var(--content-secondary);
}

/* Service table — stacked into cards on a phone */
.services {
  width: 100%;
  margin-top: var(--lg);
  border-collapse: collapse;
  font-size: 15px;
}
.services th {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 400;
  color: var(--content-muted);
  text-align: left;
  padding: 0 var(--md) var(--sm) 0;
}
.services td {
  padding: var(--md) var(--md) var(--md) 0;
  border-top: 1px solid var(--border);
  vertical-align: top;
  color: var(--content-secondary);
}
.services td:first-child {
  color: var(--content);
  font-weight: 500;
  white-space: nowrap;
}
@media (max-width: 559px) {
  .services thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .services,
  .services tbody,
  .services tr,
  .services td {
    display: block;
  }
  .services tr {
    padding: var(--md) 0;
    border-top: 1px solid var(--border);
  }
  .services td {
    padding: 0;
    border: 0;
  }
  .services td + td {
    margin-top: var(--xs);
  }
  .services td:last-child::before {
    content: "Where: ";
    color: var(--content-muted);
  }
}

/* ---------- footer ---------- */

.site-footer {
  padding: 40px 0 var(--xxl);
  font-size: 15px;
  color: var(--content-muted);
}
.site-footer .wrap {
  border-top: 1px solid var(--border);
  padding-top: var(--xxl);
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sm) var(--xl);
}
.site-footer a {
  color: var(--content-secondary);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--content);
  text-decoration: underline;
}
.site-footer p {
  margin: var(--md) 0 0;
}

@media (prefers-reduced-motion: no-preference) {
  .store,
  .button,
  .site-footer a {
    transition: border-color 180ms cubic-bezier(0.2, 0, 0, 1),
      color 180ms cubic-bezier(0.2, 0, 0, 1);
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
