/* Glei website. Layout: one narrow column of text, widgets shown at iOS sizes (1 CSS px = 1 pt), scaled up in the hero. */
:root {
  --page: #fbfaf7;
  --ink: #1b1c1f;
  --muted: #6b6d73;
  --line: #e4e2dc;
  --flap: #f5c84b;

  /* iOS system colours (light) for the widget replicas. */
  --widget: #f2f2f7;
  --label: #000;
  --secondary: rgba(60, 60, 67, 0.6);
  --tint: #007aff;
  --red: #ff3b30;

  --long-distance: #ab0020;
  --regional: #0060f0;
  --bus: #646464;
  --westbahn: #1e9e4a;
  --sev: #ebc81e;

  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0f1012;
    --ink: #f2f1ee;
    --muted: #9a9ca3;
    --line: #26282d;
    --widget: #1c1c1e;
    --label: #fff;
    --secondary: rgba(235, 235, 245, 0.6);
    --tint: #0a84ff;
    --red: #ff453a;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 17px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 3px; }

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

/* Header */
.top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 24px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.top img { width: 32px; height: 32px; border-radius: 7.5px; }

/* Split-flap board: dark in both appearances, like the boards at the station. */
.board {
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 0.6%;
  width: min(1200px, calc(100% - 2 * max(16px, env(safe-area-inset-left))));
  margin: clamp(24px, 8vw, 88px) auto 0;
  padding: 1.4%;
  border-radius: 10px;
  background: #141414;
  box-shadow: inset 0 0 0 1px #000, 0 24px 48px -28px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.cell {
  position: relative;
  aspect-ratio: 0.7;
  perspective: 300px;
  font: 700 8.6cqw/1 var(--display);
  font-stretch: condensed;
  color: #f4f3ef;
}
.half {
  position: absolute;
  left: 0; right: 0;
  height: 50%;
  overflow: hidden;
  background: #262626;
  backface-visibility: hidden;
}
.half b {
  position: absolute;
  left: 0; right: 0;
  height: 200%;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.half.upper { top: 0; border-radius: 3px 3px 0 0; background: #2b2b2b; transform-origin: bottom; }
.half.lower { bottom: 0; border-radius: 0 0 3px 3px; transform-origin: top; }
.half.lower b { top: -100%; }
.half.upper b { top: 0; }
/* The split between the flaps. */
.cell::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: calc(50% - 0.5px);
  height: 1px;
  background: #0b0b0b;
  z-index: 2;
}
.leaf { z-index: 1; }

.reveal { transition: opacity 0.7s ease, transform 0.7s ease; }
.intro .reveal { opacity: 0; transform: translateY(12px); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 56px;
  align-items: center;
  padding-block: 56px 72px;
}
.hero p { margin: 0; max-width: 32ch; font-size: 22px; line-height: 1.4; letter-spacing: -0.01em; }
/* Apple's badge, unaltered; at least 40px high. */
.store { display: inline-block; margin-top: 28px; }
.store img { display: block; height: 48px; width: auto; }

/* A home screen strip behind the widget. */
.screen {
  position: relative;
  padding: 40px 28px 22px;
  border-radius: 44px;
  background:
    radial-gradient(120% 80% at 10% 0%, #7d5a74 0%, transparent 60%),
    radial-gradient(120% 90% at 100% 100%, #33475f 0%, transparent 55%),
    linear-gradient(160deg, #6a4c66, #2b3a52);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.45);
}
.screen { max-width: 100%; }
.screen .scale { zoom: var(--zoom, 1); }
.screen .caption {
  text-align: center;
  color: #fff;
  font-size: 12px;
  margin-top: 6px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Sections */
section { padding-block: 64px; border-top: 1px solid var(--line); }
h2 {
  font: 650 28px/1.15 var(--display);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.lede { color: var(--muted); max-width: 52ch; margin: 0 0 36px; }

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.facts li { color: var(--muted); font-size: 16px; }

.sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-end;
}

/* Lock screen */
.lock {
  width: 320px;
  max-width: 100%;
  padding: 26px 20px 30px;
  border-radius: 44px;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(90% 70% at 20% 10%, #4a6a8c 0%, transparent 60%),
    linear-gradient(170deg, #26384e, #0f1724);
}
.lock .inline { font-size: 15px; font-weight: 600; opacity: 0.85; }
.lock .clock { font: 600 84px/1 var(--display); letter-spacing: -0.02em; margin: 2px 0 14px; }

.word {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--muted);
}
.word b { color: var(--ink); font-weight: 600; }

footer {
  border-top: 1px solid var(--line);
  padding-block: 32px 48px;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}
footer nav { display: flex; gap: 20px; }

/* Text pages (privacy, imprint) */
.text { max-width: 680px; padding-block: 24px 72px; }
.text h1 { font: 700 36px/1.1 var(--display); letter-spacing: -0.03em; margin: 0 0 24px; }
.text h2 { font-size: 20px; margin: 36px 0 8px; }
.text p, .text li { color: var(--ink); }
.text .meta { color: var(--muted); font-size: 15px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-block: 24px 56px; }
  .screen { justify-self: start; }
  .facts { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 460px) {
  .screen { padding: 28px 14px 16px; border-radius: 34px; }
}

/* ===== Widget replicas: same measures as the SwiftUI views (pt = px). ===== */
.widget {
  background: var(--widget);
  color: var(--label);
  border-radius: 22px;
  padding: 16px;
  font-family: var(--text);
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  overflow: hidden;
}
.widget.medium { width: 338px; height: 158px; }
.widget.small { width: 158px; height: 158px; }

.w-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.w-head .title, .w-head .count { font-size: 15px; font-weight: 600; white-space: nowrap; }
.w-head .title { overflow: hidden; text-overflow: ellipsis; }
.w-rows { display: flex; flex-direction: column; gap: 6px; }
.w-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }

.row { display: flex; align-items: center; gap: 6px; height: 18px; }
.row .dep { width: 50px; font-size: 14px; font-weight: 600; position: relative; font-variant-numeric: tabular-nums; }
.row .dep.late { color: var(--red); }
.row .dep .pill {
  position: absolute; left: 34px; top: -8px;
  font-size: 9px; font-weight: 800; color: #fff;
  background: var(--red); border-radius: 99px; padding: 0 3px;
  box-shadow: 0 0 0 1px var(--widget);
}
.row .arr { width: 34px; text-align: right; font-size: 12px; color: var(--secondary); font-variant-numeric: tabular-nums; }
.bar { flex: 1; display: flex; align-items: center; gap: 3px; min-width: 0; }
.plat {
  min-width: 21px; height: 16px; padding: 0 3px;
  border: 1px solid var(--secondary); border-radius: 4px;
  font-size: 10px; font-weight: 700; color: var(--secondary);
  display: grid; place-items: center;
}
.seg {
  height: 16px; border-radius: 3px; color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
  white-space: nowrap; overflow: hidden; padding: 0 3px;
}
.seg.rjx { background: var(--long-distance); }
.seg.s { background: var(--regional); }
.seg.wb { background: var(--westbahn); }
.seg.bus { background: var(--bus); }
.seg.sev { background: var(--sev); color: #000; }
.gap { width: 10px; flex: none; display: flex; justify-content: center; gap: 1.5px; }
.gap i { width: 2.5px; height: 2.5px; border-radius: 50%; background: var(--secondary); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; color: var(--tint);
  background: color-mix(in srgb, var(--tint) 12%, transparent);
  border-radius: 7px; padding: 3px 8px;
}
.chip svg { width: 13px; height: 13px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--tint) 30%, transparent); }
.dots i.on { background: var(--tint); }

/* Small */
.pair { display: grid; grid-template-columns: 13px 1fr; column-gap: 7px; font-size: 12px; font-weight: 600; color: var(--secondary); line-height: 15px; }
.pair svg { width: 13px; height: 15px; }
.pair .stem { display: flex; justify-content: center; gap: 0; height: 5px; }
.pair .stem i { width: 2px; height: 2px; border-radius: 50%; background: var(--secondary); }
.big { font: 700 26px/1.1 var(--display); margin-top: auto; font-variant-numeric: tabular-nums; }
.next { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Lock screen rectangular */
.rect { text-align: left; width: 170px; margin: 0 auto; font-size: 13px; line-height: 1.3; }
.rect .t { font-weight: 600; font-size: 15px; }
.rect .plat { border-color: rgba(255, 255, 255, 0.7); color: #fff; display: inline-grid; vertical-align: -3px; }
