/* CALDER METRO — Vignelli × Swiss transit */

:root {
  --bg: #f4f3ef;
  --bg2: #eceae3;
  --ink: #17171a;
  --muted: #5d5c58;
  --hair: rgba(23, 23, 26, .16);
  --cA: #d8382e; --cB: #2b50d6; --cC: #0e8a4c; --cE: #e8a20c; --cK: #7048c8;
  --dark: #141417;
  --amber: #f2a91e;
  --cw: 26px; --ch: 40px; --cfs: 22px; --cg: 3px; --half: 95ms;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--cA); color: var(--bg); }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--ink); border: 3px solid var(--bg2); border-radius: 8px; }
* { scrollbar-width: thin; scrollbar-color: var(--ink) var(--bg2); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.board-sec :focus-visible { outline-color: var(--amber); }

a { color: inherit; }

h1, h2, h3 { font-family: 'Archivo', 'Inter', sans-serif; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 48px; }

/* ---------- chrome ---------- */

.backlink {
  position: fixed; left: 18px; bottom: 18px; z-index: 90;
  font-family: 'Archivo', sans-serif; font-size: 10.5px; font-weight: 700;
  letter-spacing: .16em; text-decoration: none;
  background: var(--ink); color: var(--bg);
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid rgba(244, 243, 239, .3);
  transition: background .25s ease, transform .25s ease;
}
.backlink:hover { background: var(--cA); transform: translateY(-2px); }

.topbar {
  position: sticky; top: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 58px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}
.tb-left { display: flex; align-items: center; gap: 12px; }
.mark-disc {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--cA); color: var(--bg);
  font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 16px;
  flex: none;
}
.tb-name {
  font-family: 'Archivo', sans-serif; font-size: 11.5px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
}
.tb-nav { display: flex; gap: 26px; }
.tb-nav a {
  font-family: 'Archivo', sans-serif; font-size: 11.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  padding: 4px 2px; position: relative;
}
.tb-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 2px; background: var(--cA); transition: right .3s cubic-bezier(.7,0,.2,1);
}
.tb-nav a:hover::after { right: 0; }

/* ---------- hero ---------- */

.hero {
  display: grid; grid-template-columns: 360px minmax(0, 1fr);
  gap: 28px; align-items: stretch;
  padding: 34px 40px 44px 48px;
  min-height: calc(100svh - 58px);
  background-image: radial-gradient(rgba(23,23,26,.05) 1px, transparent 1.2px);
  background-size: 28px 28px;
}
.rail { display: flex; flex-direction: column; padding-top: 14px; padding-bottom: 34px; }

.eyebrow {
  font-family: 'Archivo', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}
.eyebrow.lt { color: rgba(244,243,239,.55); }

.hero h1 {
  margin: 14px 0 18px;
  font-size: clamp(58px, 6.2vw, 86px);
  font-weight: 900; line-height: .92; letter-spacing: -.025em;
  text-transform: uppercase;
}
.lede { font-size: 15px; color: var(--muted); max-width: 34ch; }

.legend { margin-top: 30px; display: flex; flex-direction: column; border-top: 1px solid var(--hair); }
.legend a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 6px 9px 2px; text-decoration: none;
  border-bottom: 1px solid var(--hair);
  transition: background .2s ease, padding-left .25s cubic-bezier(.7,0,.2,1);
}
.legend a:hover { background: rgba(23,23,26,.045); padding-left: 8px; }
.legend .disc { flex: none; }
.legend .lg-name { font-family: 'Archivo', sans-serif; font-size: 13px; font-weight: 700; }
.legend .lg-termini { font-size: 11.5px; color: var(--muted); margin-left: auto; text-align: right; }

.disc {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  color: #fff; font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 13.5px;
}

.clockchip {
  margin-top: 26px; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--bg);
  border-radius: 8px; padding: 9px 14px;
}
.clockchip.dark { margin-top: 0; background: #232329; }
.cc-time {
  font-variant-numeric: tabular-nums;
  font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 17px; letter-spacing: .04em;
}
.cc-label { font-size: 9.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; opacity: .55; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.hint { margin-top: auto; padding-top: 26px; font-size: 12px; color: var(--muted); }

/* ---------- map ---------- */

.map-wrap { position: relative; min-width: 0; display: flex; }
.map-scroll { flex: 1; overflow: hidden; display: flex; }
.map-inner { position: relative; margin: auto; width: 100%; }
#map { display: block; width: 100%; height: auto; max-height: calc(100svh - 140px); }

.st-label {
  font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 500;
  fill: var(--ink);
}
.st-label.b { font-weight: 700; font-size: 15.5px; }
.st-hit { fill: transparent; cursor: pointer; }
.st-hit:focus-visible { outline: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 4; }
.cap-letter {
  font-family: 'Archivo', sans-serif; font-size: 13px; font-weight: 800;
  fill: #fff; text-anchor: middle; dominant-baseline: central;
}
.water-label {
  font-family: 'Archivo', sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: .34em; fill: #b9b5a6;
}

.pan-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  font-family: 'Archivo', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; padding: 7px 12px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .4s ease;
}
.pan-hint.on { opacity: .92; }

.tooltip {
  position: absolute; z-index: 20; width: 250px;
  background: var(--ink); color: var(--bg);
  border-radius: 10px; padding: 14px 16px 12px;
  box-shadow: 0 18px 40px -12px rgba(23,23,26,.45);
  pointer-events: none;
}
.tooltip h4 { font-family: 'Archivo', sans-serif; font-size: 15px; font-weight: 800; letter-spacing: .01em; margin-bottom: 2px; }
.tip-sub { font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; opacity: .5; margin-bottom: 9px; }
.tip-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid rgba(244,243,239,.12); }
.tip-row .disc { width: 18px; height: 18px; font-size: 10.5px; }
.tip-dest { font-size: 12px; font-weight: 500; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tip-times { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.tip-none { font-size: 11.5px; opacity: .55; padding: 4px 0; }

/* ---------- sections shared ---------- */

.sec-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 30px;
  padding: 84px 0 34px;
}
.sec-head h2 {
  font-size: clamp(36px, 4vw, 54px); font-weight: 900;
  letter-spacing: -.02em; line-height: 1; text-transform: uppercase; margin-top: 12px;
}
.sec-side { font-size: 12.5px; color: var(--muted); text-align: right; line-height: 1.7; padding-bottom: 6px; }

/* ---------- departure board ---------- */

.board-sec { background: var(--dark); color: var(--bg); }
.board-sec .sec-head { padding-top: 74px; }
.board-sec h2 { color: var(--bg); }

.board-frame {
  background: #0d0d10; border-radius: 16px;
  padding: 20px 26px 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), inset 0 -14px 34px rgba(0,0,0,.5);
  overflow-x: auto;
}
.board { min-width: max-content; }

.bhead { display: flex; gap: 18px; padding: 0 0 10px 2px; }
.bhead span {
  font-family: 'Archivo', sans-serif; font-size: 9.5px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: rgba(242,169,30,.42);
}
.brow { display: flex; gap: 18px; margin-top: 7px; }
.bcol { display: flex; gap: var(--cg); }

.cell {
  position: relative; width: var(--cw); height: var(--ch);
  perspective: 300px; border-radius: 3px;
  background: #1a1a1f; color: var(--amber);
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: var(--cfs);
  font-variant-numeric: tabular-nums;
}
.cell::after {
  content: ""; position: absolute; left: 0; right: 0; top: calc(50% - .5px); height: 1px;
  background: rgba(0,0,0,.65); z-index: 5; pointer-events: none;
}
.cell .h { position: absolute; left: 0; right: 0; overflow: hidden; background: #232329; }
.cell .ht { top: 0; height: 50%; border-radius: 3px 3px 0 0; }
.cell .hb { bottom: 0; height: 50%; border-radius: 0 0 3px 3px; background: #1e1e24; }
.cell .h i {
  position: absolute; left: 0; width: 100%; height: var(--ch);
  font-style: normal; text-align: center; line-height: var(--ch);
}
.cell .ht i { top: 0; }
.cell .hb i { bottom: 0; }
.cell .ht::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0) 60%);
}
.cell .hb::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(0,0,0,.3), rgba(0,0,0,0) 55%);
}
.cell .f { display: none; z-index: 3; }
.cell.go .f { display: block; }
.cell.go .ht.f { transform-origin: 50% 100%; animation: flipTop var(--half) cubic-bezier(.55,0,.85,.4) forwards; }
.cell.go .hb.f {
  transform-origin: 50% 0%; transform: rotateX(90deg);
  animation: flipBot calc(var(--half) * 1.15) cubic-bezier(.2,.7,.3,1) var(--half) forwards;
  background: #26262c;
}
@keyframes flipTop { to { transform: rotateX(-90deg); } }
@keyframes flipBot { 0% { transform: rotateX(90deg); } 78% { transform: rotateX(-7deg); } 100% { transform: rotateX(0); } }

.cell[data-ln="A"] { color: #ff6a57; }
.cell[data-ln="B"] { color: #7c96ff; }
.cell[data-ln="C"] { color: #43cf88; }
.cell[data-ln="E"] { color: #f5b52a; }
.cell[data-ln="K"] { color: #ab8bff; }

.board-note { padding: 22px 2px 78px; font-size: 12.5px; color: rgba(244,243,239,.45); max-width: 60ch; }

/* ---------- the lines ---------- */

.line-rows { border-top: 1px solid var(--hair); margin-bottom: 96px; }
.line-row {
  display: grid; grid-template-columns: 72px 280px minmax(0, 1fr);
  gap: 26px; align-items: center;
  padding: 26px 0; border-bottom: 1px solid var(--hair);
  transition: background .25s ease;
}
.line-row:hover { background: rgba(23,23,26,.035); }
.line-row .disc { width: 46px; height: 46px; font-size: 21px; margin-left: 6px; }
.lr-name { font-family: 'Archivo', sans-serif; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.lr-termini { font-size: 13px; color: var(--muted); margin-top: 3px; }
.lr-meta {
  font-family: 'Archivo', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 8px;
}
.lr-blurb { font-size: 12.5px; color: var(--muted); margin-top: 6px; max-width: 32ch; }
.strip-scroll { overflow-x: auto; overflow-y: hidden; }
.strip-scroll svg { display: block; }
.strip-label {
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500; fill: var(--ink);
}
.strip-label.b { font-weight: 700; }

/* ---------- riding ---------- */

.riding-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0;
  border-top: 1px solid var(--hair);
  margin-bottom: 100px;
}
.r-col { padding: 30px 34px 10px 0; }
.r-col + .r-col { border-left: 1px solid var(--hair); padding-left: 34px; }
.r-head {
  font-size: 12px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase;
  margin-bottom: 22px;
}
.fare { padding: 14px 0 16px; border-bottom: 1px solid var(--hair); }
.fare:first-of-type { padding-top: 0; }
.fare-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.fare-name { font-family: 'Archivo', sans-serif; font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.fare-price { font-family: 'Archivo', sans-serif; font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.fare p { font-size: 13px; color: var(--muted); }
.fare-note { margin-top: 18px; font-size: 12px; color: var(--muted); font-style: italic; }

.hours { width: 100%; border-collapse: collapse; }
.hours th { text-align: left; font-size: 13.5px; font-weight: 600; padding: 11px 0; border-bottom: 1px solid var(--hair); }
.hours td {
  text-align: right; font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 14px;
  font-variant-numeric: tabular-nums; padding: 11px 0; border-bottom: 1px solid var(--hair);
}
.hours tr:last-child td { color: var(--cA); }
.hours-note { margin-top: 18px; font-size: 12.5px; color: var(--muted); }

.conduct { list-style: none; counter-reset: rule; }
.conduct li {
  counter-increment: rule;
  display: flex; gap: 14px; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--hair);
  font-size: 13.5px;
}
.conduct li::before {
  content: counter(rule, decimal-leading-zero);
  font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 12px;
  color: var(--cA); flex: none;
}
.conduct-note { margin-top: 18px; font-size: 12px; color: var(--muted); font-style: italic; }

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

.footer { background: var(--ink); color: var(--bg); }
.foot-stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 58px 0 46px; border-bottom: 1px solid rgba(244,243,239,.14);
}
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-n { font-family: 'Archivo', sans-serif; font-size: clamp(34px, 3.6vw, 52px); font-weight: 900; letter-spacing: -.02em; line-height: 1; }
.stat-n em { font-style: normal; font-size: .55em; font-weight: 800; }
.stat-l { font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; opacity: .5; }
.foot-cols { display: flex; justify-content: space-between; gap: 40px; padding: 34px 0 90px; }
.foot-brand { display: flex; gap: 14px; align-items: flex-start; }
.foot-name { font-family: 'Archivo', sans-serif; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.foot-sub { font-size: 12px; opacity: .5; margin-top: 4px; }
.foot-note { font-size: 12px; opacity: .55; max-width: 44ch; text-align: right; line-height: 1.8; }
.foot-note a { color: var(--bg); text-decoration-color: rgba(244,243,239,.4); text-underline-offset: 3px; }
.foot-note a:hover { color: #fff; text-decoration-color: var(--cA); }

/* ---------- reveal choreography ---------- */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s cubic-bezier(.2,.65,.25,1), transform .8s cubic-bezier(.2,.65,.25,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .07s; } .reveal.d2 { transition-delay: .14s; }
.reveal.d3 { transition-delay: .21s; } .reveal.d4 { transition-delay: .28s; }
.reveal.d5 { transition-delay: .35s; }

.selftest {
  position: fixed; top: 70px; right: 16px; z-index: 99; width: 340px;
  background: #fff; border: 2px solid var(--ink); border-radius: 10px;
  padding: 14px 16px; font-size: 12px; font-family: 'Inter', monospace;
  white-space: pre-wrap; box-shadow: 0 16px 40px rgba(23,23,26,.25);
}
.noscript { padding: 14px 20px; background: var(--cA); color: #fff; font-size: 13px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .live-dot { animation: none; }
  .cell.go .f { display: none; animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  #map { max-height: none; }
  .sec-side { display: none; }
}

@media (max-width: 700px) {
  :root { --cw: 15px; --ch: 26px; --cfs: 13.5px; --cg: 2px; }
  .wrap { padding: 0 20px; }
  .topbar { padding: 0 16px; }
  .tb-name { display: none; }
  .tb-nav { gap: 16px; }
  .tb-nav a { font-size: 10.5px; }

  .hero { padding: 26px 0 30px; gap: 18px; }
  .rail { padding: 0 20px; }
  .hero h1 { font-size: clamp(54px, 16vw, 72px); }
  .lede { max-width: none; font-size: 14px; }
  .legend .lg-termini { display: none; }
  .hint { padding-top: 20px; }

  .map-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .map-inner { width: 1240px; flex: none; margin: 0; }
  .map-wrap::before, .map-wrap::after {
    content: ""; position: absolute; top: 0; bottom: 0; width: 26px; z-index: 5; pointer-events: none;
  }
  .map-wrap::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
  .map-wrap::after { right: 0; background: linear-gradient(-90deg, var(--bg), transparent); }

  .sec-head { flex-direction: column; align-items: flex-start; gap: 18px; padding: 60px 0 26px; }
  .board-frame { padding: 14px 12px 16px; border-radius: 12px; }
  .bhead { gap: 10px; }
  .brow { gap: 10px; }
  .bcol[data-k="status"], .bhead span[data-k="status"],
  .bcol[data-k="plat"], .bhead span[data-k="plat"] { display: none; }
  .board-note { padding-bottom: 56px; }

  .line-row { grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding: 22px 0; }
  .line-row .disc { width: 42px; height: 42px; font-size: 19px; margin-left: 0; }
  .line-row .strip-scroll { grid-column: 1 / -1; }
  .strip-scroll svg { min-width: 680px; }

  .riding-grid { grid-template-columns: 1fr; margin-bottom: 60px; }
  .r-col { padding: 26px 0 10px; }
  .r-col + .r-col { border-left: none; border-top: 1px solid var(--hair); padding-left: 0; }

  .foot-stats { grid-template-columns: repeat(2, 1fr); gap: 26px 12px; padding: 44px 0 36px; }
  .foot-cols { flex-direction: column; padding: 28px 0 96px; }
  .foot-note { text-align: left; }
  .backlink { left: 12px; bottom: 12px; }
}
