/* TrainTrack — Ink Board, on the web.
   Tokens mirror Shared/Theme.swift (dark values). */

:root {
  --ground: #0E121B;
  --card: #161C28;
  --card-alt: #121826;
  --rule: #222A38;
  --rule-strong: #2A3242;
  --text: #F2EEE6;
  --muted: #9AA3B2;
  --dim: #5C6678;
  --faint: #3A4355;
  --good: #34C759;
  --warn: #F2A537;
  --bad: #DD3439;
  --nec: #DD3439;
  --njcl: #03A3DF;
  --mne: #08A652;
  --rarv: #F2A537;
  --main: #FFD411;
  --pasc: #94219A;

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --measure: 62ch;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--dim); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 4px; }

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

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---- Type ---------------------------------------------------------------- */

.eyebrow {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  font-family: var(--display);
  font-weight: 700;
  line-height: .95;
  letter-spacing: .005em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

h1.display { font-size: clamp(52px, 9vw, 112px); margin: 0; }
h2.display { font-size: clamp(36px, 5vw, 56px); margin: 0 0 12px; }
h3.display { font-size: 26px; margin: 0 0 6px; font-weight: 600; }

.lede { font-size: clamp(18px, 2.2vw, 22px); color: var(--muted); max-width: var(--measure); margin: 20px 0 0; }
.lede strong { color: var(--text); font-weight: 600; }
p { max-width: var(--measure); }

/* ---- Header -------------------------------------------------------------- */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand span { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: .02em; }
.top nav { display: flex; gap: 22px; font-size: 15px; font-weight: 500; color: var(--muted); }
.top nav a { text-decoration: none; white-space: nowrap; }
.top nav a:hover { color: var(--text); }

/* ---- The board (hero) ---------------------------------------------------- */

.hero { padding: 24px 0 72px; }

.board {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  position: relative;   /* no overflow clipping: the alert hangs over the bottom edge */
}
.board-head {
  border-radius: var(--radius) var(--radius) 0 0;
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1.4fr .8fr 1.4fr;
  gap: 16px;
  padding: 14px 24px 12px;
  border-bottom: 1px solid var(--rule);
  background: var(--card-alt);
}
.board-row {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1.4fr .8fr 1.4fr;
  gap: 16px;
  align-items: center;
  padding: 26px 24px 28px;
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
}
.board-row .time { font-size: clamp(34px, 5vw, 56px); font-weight: 700; line-height: 1; }
.board-row .train { display: flex; align-items: center; gap: 10px; font-size: clamp(26px, 3.6vw, 40px); font-weight: 600; }
.board-row .to { font-size: clamp(26px, 3.6vw, 40px); font-weight: 600; color: var(--muted); }
.chip {
  display: inline-block; font-family: var(--body); font-size: 12px; font-weight: 800; letter-spacing: .06em;
  color: #fff; background: var(--nec); padding: 4px 8px; border-radius: 6px; line-height: 1;
}
.status { font-size: clamp(22px, 3vw, 34px); font-weight: 700; letter-spacing: .04em; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.status[data-tone="good"] { color: var(--good); }
.status[data-tone="quiet"]::before { background: var(--dim); }

/* Track tile: dashed while unknown, then flips to solid. */
.tile { perspective: 600px; width: clamp(64px, 8vw, 88px); height: clamp(64px, 8vw, 88px); }
.tile-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.tile.is-known .tile-inner { transform: rotateX(180deg); }
.tile-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 14px; display: grid; place-items: center; text-align: center; line-height: 1;
}
.tile-face small { display: block; font-family: var(--body); font-size: 10px; letter-spacing: .18em; font-weight: 700; margin-bottom: 4px; }
.tile-face.unknown { border: 2px dashed var(--faint); color: var(--dim); font-size: 28px; }
.tile-face.known { background: var(--text); color: var(--ground); transform: rotateX(180deg); font-size: clamp(34px, 4.5vw, 48px); font-weight: 700; }
.tile-face.known small { color: var(--dim); }

/* Lock-screen alert that rides on top of the board. */
.alert {
  position: absolute; left: 50%; top: calc(100% - 22px); transform: translate(-50%, 24px);
  width: min(92%, 520px);
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: start;
  background: rgba(242,238,230,.96); color: #14181F;
  border-radius: 18px; padding: 12px 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.25);
  opacity: 0; transition: opacity .35s ease, transform .5s cubic-bezier(.2,.7,.2,1);
  font-family: var(--body);
}
.alert.is-visible { opacity: 1; transform: translate(-50%, 0); }
.alert img { width: 40px; height: 40px; border-radius: 10px; }
.alert b { display: block; font-size: 15px; font-weight: 700; }
.alert span { font-size: 14px; line-height: 1.3; color: #3b3f47; }
.alert time { font-size: 12px; color: #7a7d84; }

.hero-copy { margin-top: 104px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--text); color: var(--ground); border-radius: 14px; padding: 0 26px; height: 56px;
  text-decoration: none; transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: #fff; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--text); }
.cta-note { color: var(--dim); font-size: 15px; }

/* ---- Sections ------------------------------------------------------------ */

section { padding: 64px 0; border-top: 1px solid var(--rule); }
section .eyebrow { margin-bottom: 14px; }

/* Alerts list: what the app tells you, in its own words. */
.alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 28px; }
.alerts article {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px;
  display: grid; gap: 8px; align-content: start;
}
.alerts .when { display: flex; justify-content: space-between; align-items: baseline; }
.alerts .when b { font-family: var(--display); font-size: 22px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.alerts .when b[data-tone="good"] { color: var(--good); }
.alerts .when b[data-tone="warn"] { color: var(--warn); }
.alerts .when span { font-size: 13px; color: var(--dim); }
.alerts p { margin: 0; font-size: 15px; color: var(--muted); }

/* Phones */
.phones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 36px; }
.phone { display: grid; gap: 14px; }
.phone figure { margin: 0; }
.screen {
  border-radius: 34px; border: 1px solid var(--rule-strong); background: #000; padding: 8px;
  box-shadow: 0 30px 60px rgba(0,0,0,.45);
}
.screen img { border-radius: 26px; width: 100%; }
.phone figcaption { display: grid; gap: 4px; }
.phone figcaption b { font-family: var(--display); font-size: 24px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.phone figcaption span { color: var(--muted); font-size: 15px; }
.step { font-family: var(--display); font-size: 13px; letter-spacing: .2em; color: var(--dim); }

/* Two-up feature rows */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.duo p { color: var(--muted); }
.hubs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.hubs li {
  font-family: var(--display); font-weight: 600; font-size: 20px; text-transform: uppercase; letter-spacing: .03em;
  padding: 6px 12px; border-radius: 10px; border: 1px solid var(--rule-strong); color: var(--text);
}

/* Share link demo */
.link-demo { display: grid; gap: 12px; margin-top: 18px; }
.link-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; color: var(--text);
  background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px;
  overflow-wrap: anywhere;
}
.link-demo .arrow { color: var(--dim); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.sheet {
  background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 18px 20px;
  display: grid; gap: 6px; max-width: 420px;
}
.sheet .display { font-size: 30px; }
.sheet .btn { height: 46px; font-size: 18px; margin-top: 10px; }

/* Fine print + FAQ */
.fine { color: var(--muted); }
.fine p { margin: 0 0 12px; }
dl { margin: 24px 0 0; display: grid; gap: 22px; max-width: var(--measure); }
dt { font-family: var(--display); font-size: 24px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
dd { margin: 6px 0 0; color: var(--muted); }

/* Footer */
footer { border-top: 1px solid var(--rule); padding: 36px 0 48px; color: var(--dim); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; }
footer nav { display: flex; gap: 20px; }
footer a { text-decoration: none; color: var(--muted); }
footer a:hover { color: var(--text); }

/* Prose pages (privacy) */
.prose { padding: 24px 0 72px; }
.prose h1.display { font-size: clamp(44px, 7vw, 80px); }
.prose h2 { font-family: var(--display); font-size: 28px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; margin: 40px 0 8px; }
.prose p, .prose li { color: var(--muted); max-width: var(--measure); }
.prose li { margin: 6px 0; }
.prose strong { color: var(--text); font-weight: 600; }
.prose .meta { color: var(--dim); font-size: 15px; margin-top: 10px; }

/* ---- Responsive ---------------------------------------------------------- */

@media (max-width: 820px) {
  .phones { grid-template-columns: 1fr; gap: 36px; max-width: 420px; }
  .duo { grid-template-columns: 1fr; gap: 28px; }
  .board-head { display: none; }
  .board-row {
    grid-template-columns: auto 1fr auto; grid-template-areas:
      "time to tile"
      "train train tile"
      "status status status";
    gap: 10px 16px; padding: 20px 18px 22px;
  }
  .board-row .time { grid-area: time; }
  .board-row .to { grid-area: to; align-self: end; }
  .board-row .train { grid-area: train; }
  .board-row .tile { grid-area: tile; }
  .board-row .status { grid-area: status; border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 6px; }
  .alert { position: static; transform: none; width: auto; margin: 12px 12px 14px; }
  .alert.is-visible { transform: none; }
  .hero-copy { margin-top: 44px; }
  .top nav { gap: 16px; }
}

@media (max-width: 480px) {
  .top nav a:first-child { display: none; }   /* "How it works" is one scroll away anyway */
  .brand span { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile-inner, .alert, .btn { transition: none; }
}
