/* Self-hosted Latin subsets (SIL Open Font License); nothing loads from Google. */
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/atkinson-hyperlegible-400.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/atkinson-hyperlegible-700.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 500 800; font-display: swap; src: url("fonts/bricolage-grotesque.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("fonts/jetbrains-mono.woff2") format("woff2"); }
html, body { margin: 0; }
.clock a.tag { pointer-events: auto; color: inherit; text-decoration: none; transition: color .2s, border-color .2s; }
.clock a.tag:hover, .clock a.tag:focus-visible { color: #fff; border-color: rgba(255, 255, 255, .45); outline: none; }
/* Layout: a fixed WebGL diorama behind a single scrolling column of chapter cards, one per moment of the evening. */
:root {
  --night: #07111f;      /* the logo's outer ring */
  --deep: #0c1a2e;
  --panel: rgba(9, 20, 36, 0.78);
  --line: rgba(160, 190, 230, 0.18);
  --paper: #f8fafd;
  --muted: #9fb0c6;
  --slate: #536174;
  --signal: #16dde2;     /* the logo's cyan tile */
  --blue: #249fef;
  --lamp: #ffcf8a;       /* warm window light */
  --yes: #3ddc97;
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
html { background: var(--night); scroll-snap-type: y mandatory; }
body {
  background: var(--night);
  color: var(--paper);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
#scene {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  height: 100lvh; /* phones: stay one size while the address bar slides away */
  display: block;
  z-index: 0;
  filter: saturate(1.4) contrast(1.06); /* richer colour across the whole scene */
}
/* Shown only when WebGL is unavailable: a plain painted sky so the copy still reads in order. */
.sky-fallback {
  position: fixed; inset: 0; z-index: 0; display: none;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 9%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 76% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 31%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 21% 41%, #fff 50%, transparent 51%),
    radial-gradient(40px 40px at 21.2% 15%, #0c1a2e 45%, transparent 47%),
    radial-gradient(40px 40px at 20% 16%, #f4f1e6 45%, transparent 47%),
    linear-gradient(180deg, #040a14 0%, #0c1a2e 60%, #1a2c47 100%);
}
body.no-gl .sky-fallback { display: block; }
body.no-gl #scene { display: none; }
/* Reduced motion: chapters cross-fade through this instead of flying the camera. */
.veil { position: fixed; inset: 0; z-index: 1; background: var(--night); opacity: 0; pointer-events: none; transition: opacity .26s ease; }
.veil.on { opacity: 1; }
body.no-gl .veil { display: none; }

/* ---------- chrome ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  padding-bottom: 14px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7,17,31,.75), rgba(7,17,31,0));
}
.brand { display: flex; align-items: center; gap: 10px; pointer-events: auto; text-decoration: none; color: var(--paper); }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand span { font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.clock {
  font-family: var(--f-mono); font-variant-numeric: tabular-nums;
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: 10px;
}
.clock b { color: var(--paper); font-weight: 600; font-size: 22px; letter-spacing: .02em; }
.clock .tag {
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
  font-size: 11px; color: var(--muted);
}
.loadbar { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--signal); z-index: 6; transition: width .3s, opacity .6s; }

.rail {
  position: fixed; z-index: 4;
  left: max(20px, env(safe-area-inset-left, 0px)); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
}
.rail button {
  all: unset; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 5px 8px 5px 0; color: #d6dce8;
  text-shadow: 0 1px 2px rgba(4, 8, 18, .75), 0 0 10px rgba(4, 8, 18, .55); /* legible over bright sky and busy town */
  transition: color .3s;
}
.rail button::before {
  content: ""; width: 14px; height: 1px; background: currentColor; transition: width .3s;
  box-shadow: 0 1px 2px rgba(4, 8, 18, .6);
}
.rail button span { opacity: 0; transform: translateX(-4px); transition: opacity .3s, transform .3s; white-space: nowrap;
  padding: 2px 7px; margin-left: -4px; border-radius: 4px; background: rgba(6, 12, 24, .42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.rail:hover button span, .rail button.on span { opacity: 1; transform: none; }
.rail button.on { color: var(--signal); }
.rail button:hover { color: #fff; }
/* On the opening screen the headline sits where the labels would; show only the ticks. */
body.at-start .rail button span { opacity: 0; }
.rail button.on::before { width: 28px; }
.rail button:focus-visible { outline: 1px solid var(--signal); outline-offset: 2px; }

/* ---------- chapters ---------- */
main { position: relative; z-index: 2; }
.chapter {
  min-height: 100vh; min-height: 100svh;
  scroll-snap-align: center; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: flex-end;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 18vh;
}
.chapter:first-child { justify-content: flex-start; align-items: center; padding-block: 10vh; }
.chapter.center { justify-content: center; }
.card {
  width: min(440px, 100%);
  min-width: 0;
  margin-right: clamp(0px, 5vw, 80px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 26px 28px 28px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; flex-direction: column; gap: 12px;
}
.chapter:first-child .card {
  background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  width: min(760px, 100%); margin-left: clamp(0px, 8vw, 140px); padding: 0;
}
.stamp {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--signal); display: flex; gap: 10px; align-items: center;
}
.stamp::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.chapter:first-child .stamp::after { max-width: 120px; }
.chapter:first-child .card { text-shadow: 0 2px 22px rgba(7, 17, 31, 0.9); } /* reads over the rooftops */
h1, h2 {
  font-family: var(--f-display); margin: 0; text-wrap: balance; letter-spacing: -0.025em; line-height: 1.02;
}
h1 { font-size: clamp(48px, 9vw, 112px); font-weight: 800; }
h1 em { font-style: normal; color: var(--lamp); }
h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; }
.card p { margin: 0; color: #c9d4e3; max-width: 62ch; }
.chapter:first-child p { font-size: 19px; max-width: 46ch; }
.hint { font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.hint::before { content: "↓  "; color: var(--signal); }

/* schedule chip: the real weekday row from the TV app */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 4px; }
.days span {
  font-family: var(--f-mono); font-size: 11px; text-align: center; padding: 6px 0; border-radius: 4px;
  border: 1px solid var(--line); color: var(--slate);
}
.days span.on { color: var(--signal); border-color: rgba(22,221,226,.55); background: rgba(22,221,226,.08); }
.window { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.window b { color: var(--paper); font-weight: 600; }

.durations { display: flex; flex-wrap: wrap; gap: 6px; }
.durations span { font-family: var(--f-mono); font-size: 12px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.durations span.pick { border-color: var(--signal); color: var(--signal); }

.verdict { display: flex; gap: 8px; }
.verdict span { flex: 1; text-align: center; padding: 9px 0; border-radius: 999px; font-weight: 700; font-size: 15px; }
.verdict .ok { background: var(--signal); color: var(--night); }
.verdict .no { border: 1px solid var(--line); color: var(--muted); }

.facts { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.facts li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; font-size: 15px; color: #c9d4e3; }
.facts li b { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 400; padding-top: 3px; }

.stores { display: grid; gap: 8px; margin-top: 6px; }
.stores a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 4px; text-decoration: none; color: var(--paper);
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
  transition: border-color .2s, background .2s;
}
.stores a:hover, .stores a:focus-visible { border-color: var(--signal); background: rgba(22,221,226,.06); outline: none; }
.stores a.primary { background: var(--paper); color: var(--night); border-color: var(--paper); }
.stores a.primary:hover, .stores a.primary:focus-visible { background: #fff; }
.stores small { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.price { font-family: var(--f-display); font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.price small { font-family: var(--f-body); font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.note { font-size: 13px; color: var(--muted); }


@media (max-width: 760px) {
  body { font-size: 16px; }
  .rail { display: none; }
  .clock .tag { display: none; }
  /* Phones: each chapter is exactly one full-height screen (the browser toolbar collapsed) and snaps to its top
     edge, so the toolbar showing or hiding never moves the page or the scene, and no neighbouring chapter peeks
     in. The card sits at the bottom, lifted clear of where the toolbar covers the screen when it is showing. */
  .chapter { box-sizing: border-box; height: 100vh; height: 100lvh; min-height: 0; align-items: flex-end; justify-content: center; scroll-snap-align: start;
    padding-block: 0 calc(12px + env(safe-area-inset-bottom, 0px)); padding-block: 0 calc(12px + 100lvh - 100svh + env(safe-area-inset-bottom, 0px)); }
  .card { margin-right: 0; padding: 15px 17px 17px; gap: 8px; background: rgba(9, 20, 36, 0.92); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .chapter:first-child { align-items: flex-end; padding-block: 0 5vh; padding-block: 0 calc(5svh + 100lvh - 100svh); } /* the sky and rooftops sit above the headline */
  .chapter:first-child .card { margin-left: 0; gap: 10px; }
  .chapter:first-child p { font-size: 16px; }
  h1 { font-size: clamp(40px, 11.5vw, 56px); }
  h2 { font-size: 23px; line-height: 1.06; }
  .card p { font-size: 15px; line-height: 1.42; }
  .stamp { font-size: 11px; }
  .days span { padding: 4px 0; font-size: 10px; }
  .window { font-size: 12px; }
  .durations { gap: 5px; }
  .durations span { font-size: 11px; padding: 3px 8px; }
  .verdict span { padding: 6px 0; font-size: 14px; }
  .facts { gap: 5px; margin-top: 0; }
  .facts li { grid-template-columns: 68px 1fr; gap: 8px; font-size: 13px; line-height: 1.35; }
  .facts li b { font-size: 10px; padding-top: 2px; letter-spacing: .08em; }
  .price { font-size: 34px; }
  .price small { font-size: 13px; }
  .stores { gap: 6px; margin-top: 2px; }
  .stores a { padding: 9px 12px; font-size: 15px; }
  .stores small { font-size: 10px; }
  .note { font-size: 12px; line-height: 1.35; }
}
@media (prefers-reduced-motion: reduce) {
  .rail button, .rail button span, .rail button::before { transition: none; }
}
