@font-face { font-family: "DM Serif Display"; src: url("assets/dm-serif.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("assets/work-sans.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("assets/ibm-plex-mono.ttf") format("truetype"); font-weight: 400; font-display: swap; }

:root {
  --bg: #14111b;
  --surface: #1c1826;
  --surface-2: #272135;
  --line: #3b3350;
  --ink: #f3ecdf;
  --muted: #b7aec4;
  --accent: #f4b04a;
  --accent-ink: #1a1206;
  --paper: #efe6d4;
  --paper-ink: #1c1624;
  --paper-muted: #574d66;
  --paper-line: #c9bda4;

  --serif: "DM Serif Display", "Iowan Old Style", Georgia, serif;
  --sans: "Work Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(20px, 4vw, 48px);
  --lab: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 72px; }
html.modal-open { overflow: hidden; }

body {
  margin: 0;
  font: 400 17px/1.6 var(--sans);
  color: var(--ink);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 .92 0 0 0 0 .8 0 0 0 .07 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

h1, h2, h3, h4, p, dl, dd, ul, ol, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.wrap { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--pad); }

.label {
  font: 400 12px/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0;
}

/* ---------- focus ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- skip + header ---------- */
.skip {
  position: absolute; left: 12px; top: -80px; z-index: 50;
  background: var(--accent); color: var(--accent-ink);
  padding: 12px 20px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 64px;
  padding-inline: var(--pad);
  background: rgba(20, 17, 27, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font: 400 26px/1 var(--serif); letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.brand-mark { color: var(--accent); flex: none; }
.nav { display: flex; gap: 4px; overflow-x: auto; padding-inline-end: 4px; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}
.nav a:active { transform: scale(0.97); }
.count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  font: 400 12px/1 var(--mono); background: var(--accent); color: var(--accent-ink); border-radius: 11px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 24px;
  font-weight: 600; font-size: 16px; text-decoration: none; border: 2px solid transparent; border-radius: 4px;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-dark { background: var(--paper-ink); color: var(--paper); }

/* ---------- hero ---------- */
.hero { position: relative; padding-block: 40px 56px; overflow-x: clip; }
.hero::before {
  content: ""; position: absolute; right: -10%; top: -30%; width: 70%; height: 90%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(244, 176, 74, 0.16), rgba(244, 176, 74, 0) 70%);
  animation: breathe 7s ease-in-out infinite;
}
.hero .wrap { position: relative; }
.kicker { font: 400 13px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.kicker-dark { color: var(--paper-muted); }
h1 {
  margin-top: 12px;
  font: 400 clamp(3rem, 11.4vw, 10.5rem)/0.95 var(--serif);
  letter-spacing: -0.03em;
}
.glow { color: var(--accent); text-shadow: 0 0 48px rgba(244, 176, 74, 0.4); animation: glow 5s ease-in-out infinite; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: end; margin-top: 32px; }
.lede { max-width: 56ch; font-size: 19px; line-height: 1.6; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.ledger { display: grid; grid-template-columns: 1.3fr 1fr 1fr; border-top: 2px solid var(--ink); }
.ledger > div { padding: 12px 16px 0 0; }
.ledger > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.ledger dt { font: 400 12px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); order: 2; }
.ledger dd { font: 400 56px/1 var(--serif); letter-spacing: -0.02em; order: 1; }
.ledger > div { display: flex; flex-direction: column; gap: 4px; }

/* ---------- dial / chart ---------- */
.dial { margin-top: 40px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(39, 33, 53, 0.55), rgba(28, 24, 38, 0.55)); padding: 20px 0 8px; }
.dial-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; padding-inline: 20px; margin-bottom: 12px; }
.dial-hint { font-size: 14px; color: var(--muted); }
.chart-scroll { overflow-x: auto; padding-bottom: 8px; scrollbar-color: var(--line) transparent; }
.chart { position: relative; min-width: 980px; padding-inline: 20px; }
.axis, .day-row { display: grid; grid-template-columns: var(--lab) 1fr; }
.ticks { position: relative; height: 28px; }
.ticks span { position: absolute; top: 0; transform: translateX(-50%); font: 400 12px/1 var(--mono); color: var(--muted); }
.ticks span:first-child { transform: none; }
.day-row + .day-row { margin-top: 8px; }
.row-label {
  position: sticky; left: 0; z-index: 4; background: #1b1725;
  display: flex; flex-direction: column; justify-content: center;
  font: 400 12px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.row-label b { font: 400 30px/1 var(--serif); letter-spacing: 0; color: var(--ink); }
.track {
  position: relative; height: calc(var(--lanes) * 58px + 8px);
  background:
    linear-gradient(to right, var(--line) 1px, transparent 1px) 0 0 / calc(100% / 14) 100%,
    linear-gradient(to right, rgba(244, 176, 74, 0.1), rgba(244, 176, 74, 0.02) 45%, rgba(120, 100, 210, 0.12));
  border-right: 1px solid var(--line);
}
.bar {
  position: absolute; z-index: 2;
  top: calc(var(--lane) * 58px + 4px); left: calc(var(--s) * 100%); width: calc(var(--w) * 100%); height: 52px;
  display: flex; flex-direction: column; justify-content: center; gap: 2px; text-align: left;
  padding: 4px 10px; overflow: hidden;
  background: #2f2740; border: 1px solid #5a4f78; border-left: 4px solid var(--ink); border-radius: 2px;
  transform-origin: left center;
  animation: grow 0.7s var(--ease) both; animation-delay: calc(var(--i) * 70ms);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), opacity 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s var(--ease);
}
.bar-t { font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-m { font: 400 12px/1.2 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar:active { transform: scale(0.97); }
.bar.is-dim { opacity: 0.32; }
.bar.is-saved { border-color: var(--accent); border-left-color: var(--accent); }
.bar.is-saved .bar-t::before { content: "◆ "; color: var(--accent); }
.bar.is-lit { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); border-left-color: var(--accent-ink); }
.bar.is-lit .bar-m, .bar.is-lit.is-saved .bar-t::before { color: var(--accent-ink); }

.beam {
  position: absolute; z-index: 5; top: 0; bottom: 0; pointer-events: none;
  left: calc(20px + var(--lab) + (100% - 40px - var(--lab)) * var(--bt, 0.36));
  width: 2px; background: var(--accent); box-shadow: 0 0 18px 3px rgba(244, 176, 74, 0.45);
}
.beam span {
  position: absolute; top: -2px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--accent-ink); padding: 3px 8px; font: 400 12px/1.2 var(--mono); border-radius: 2px;
}

.beam-ctl { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 4px 24px; align-items: center; padding: 8px 20px 12px; }
.beam-read { grid-column: 1 / -1; font-size: 15px; color: var(--ink); min-height: 1.6em; }
.beam-read b { font-weight: 600; color: var(--accent); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(to right, #6b5a8f, var(--accent), #6b5a8f); border-radius: 3px; }
input[type="range"]::-moz-range-track { height: 6px; background: linear-gradient(to right, #6b5a8f, var(--accent), #6b5a8f); border-radius: 3px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: var(--accent); border: 4px solid var(--bg); box-shadow: 0 0 0 2px var(--accent), 0 0 16px rgba(244, 176, 74, 0.6); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 4px solid var(--bg); box-shadow: 0 0 0 2px var(--accent), 0 0 16px rgba(244, 176, 74, 0.6); }

/* ---------- programme ---------- */
.programme { padding-block: 96px 112px; border-top: 1px solid var(--line); }
.prog-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 64px; align-items: start; }
.controls { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 20px; }
.prog-title { font: 400 clamp(2.4rem, 4.2vw, 3.6rem)/1 var(--serif); letter-spacing: -0.02em; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; min-width: 0; }
input[type="text"], select {
  width: 100%; min-height: 48px; padding: 10px 14px; font-size: 16px;
  background: var(--surface); border: 1px solid #5a4f78; border-radius: 4px; color: var(--ink);
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}
input::placeholder { color: #8c8399; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
select option { background: var(--surface); color: var(--ink); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #5a4f78; border-radius: 4px; overflow: hidden; }
.seg label { position: relative; display: block; }
.seg label + label { border-left: 1px solid #5a4f78; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; min-height: 46px; font-size: 15px; font-weight: 500; background: var(--surface); transition: background-color 0.18s var(--ease), color 0.18s var(--ease); }
.seg input:checked + span { background: var(--ink); color: var(--bg); }
.toggles { display: grid; grid-template-columns: 1fr; gap: 8px; }
.toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 8px 14px;
  background: transparent; border: 1px solid #5a4f78; border-radius: 4px; font-weight: 500; text-align: left;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.toggle:active { transform: scale(0.97); }
.toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.toggle[aria-pressed="true"] .count { background: var(--accent-ink); color: var(--accent); }
.reset { align-self: flex-start; min-height: 44px; padding: 0; background: none; border: 0; color: var(--muted); font-size: 15px; text-decoration: underline; text-underline-offset: 4px; transition: color 0.18s var(--ease), transform 0.18s var(--ease); }
.reset:active { transform: scale(0.97); }

.result-count { font: 400 13px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.day { margin-top: 40px; }
.day:first-of-type { margin-top: 24px; }
.day-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font: 400 clamp(1.7rem, 2.6vw, 2.2rem)/1.1 var(--serif); letter-spacing: -0.01em; padding-bottom: 12px; }
.day-h span { font: 400 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.row {
  position: relative; display: grid; grid-template-columns: 120px minmax(0, 1fr) 110px; gap: 24px;
  padding: 24px 12px 24px 0; border-top: 1px solid var(--line);
  transition: background-color 0.2s var(--ease), padding-left 0.2s var(--ease);
}
.row::before { content: ""; position: absolute; left: 0; top: -1px; bottom: 0; width: 4px; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform 0.22s var(--ease); }
.row[data-saved="true"]::before { transform: scaleY(1); }
.row-time { font: 400 22px/1.1 var(--mono); padding-left: 16px; }
.row-time span { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.row-title { font: 400 clamp(1.5rem, 2.3vw, 2rem)/1.15 var(--serif); letter-spacing: -0.01em; }
.row-open { all: unset; cursor: pointer; }
.row-open::after { content: ""; position: absolute; inset: 0; }
.row-open:focus-visible { outline: 2px solid transparent; }
.row-open:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -3px; }
.row-sum { margin-top: 8px; color: #d9d1c4; max-width: 62ch; }
.row-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; font: 400 12px/1.5 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tag { color: var(--accent); }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.price { font: 400 28px/1 var(--serif); }
.saved-mark { font: 400 12px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.go { margin-top: auto; font-size: 22px; transition: transform 0.2s var(--ease); }

.empty { margin-top: 24px; padding: 40px; border: 2px dashed #5a4f78; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.empty-title { font: 400 2rem/1.1 var(--serif); }
.empty .btn { margin-top: 8px; }

/* ---------- shortlist (paper band) ---------- */
.plan { background: var(--paper); color: var(--paper-ink); padding-block: 128px 112px; }
.plan-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 64px; align-items: start; }
.plan-intro { position: sticky; top: 96px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.plan h2 { font: 400 clamp(2.8rem, 5vw, 4.4rem)/0.98 var(--serif); letter-spacing: -0.025em; }
.plan h2:focus-visible { outline: 2px solid var(--paper-ink); outline-offset: 6px; }
.plan-sum { color: var(--paper-muted); max-width: 32ch; }
.plan a:focus-visible, .plan button:focus-visible { outline-color: var(--paper-ink); }
.plan-day { margin-bottom: 40px; }
.plan-day h3 { font: 400 12px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper-muted); padding-bottom: 12px; border-bottom: 2px solid var(--paper-ink); }
.stub {
  position: relative; display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 24px; align-items: center;
  padding: 20px 0; border-bottom: 1px dashed var(--paper-muted);
  animation: rise 0.3s var(--ease) both;
  transition: background-color 0.2s var(--ease), padding-left 0.2s var(--ease);
}
.stub-time { font: 400 24px/1.1 var(--mono); }
.stub-time span { display: block; margin-top: 4px; font-size: 13px; color: var(--paper-muted); }
.stub h4 { font: 400 1.6rem/1.15 var(--serif); }
.stub-open { all: unset; cursor: pointer; display: inline-block; padding-block: 2px; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 5px; transition: text-decoration-color 0.18s var(--ease); }
.stub-open:focus-visible { outline: 2px solid var(--paper-ink); outline-offset: 3px; }
.stub-meta { margin-top: 4px; font-size: 15px; color: var(--paper-muted); }
.clash { margin-top: 8px; font: 400 13px/1.4 var(--mono); color: #8a2a12; }
.clash::before { content: "▲ "; }
.stub-remove { min-height: 44px; padding: 8px 16px; background: transparent; border: 2px solid var(--paper-ink); border-radius: 4px; font-weight: 600; font-size: 15px; color: var(--paper-ink); transition: background-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease); }
.stub-remove:active { transform: scale(0.97); }
.plan-empty { padding: 32px; border: 2px dashed var(--paper-muted); display: flex; flex-direction: column; gap: 16px; align-items: flex-start; max-width: 560px; }
.plan-empty p { max-width: 44ch; }

/* ---------- footer ---------- */
.foot { padding-block: 40px; border-top: 1px solid var(--line); background: var(--bg); }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; font-size: 15px; color: var(--muted); }
.foot-brand { font: 400 24px/1 var(--serif); color: var(--ink); }
.foot-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-underline-offset: 4px; }
.noscript { padding: 24px; text-align: center; }

/* ---------- detail dialog ---------- */
dialog.detail {
  border: 0; padding: 0; margin: 0 0 0 auto; width: min(620px, 100%); max-width: 100%; height: 100dvh; max-height: none;
  background: var(--surface); color: var(--ink); overflow: hidden;
  border-left: 1px solid #5a4f78;
}
dialog.detail[open] { animation: slide 0.26s var(--ease) both; display: block; }
dialog.detail::backdrop { background: rgba(8, 6, 12, 0.74); }
.sheet { height: 100%; overflow-y: auto; display: flex; flex-direction: column; }
.sheet-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.close {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 16px; background: transparent;
  border: 1px solid #5a4f78; border-radius: 4px; font-weight: 600; font-size: 15px;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}
.close:active { transform: scale(0.97); }
.sheet-main { padding: 32px 24px 40px; flex: 1; }
.sheet h2 { margin-top: 12px; font: 400 clamp(2.2rem, 5vw, 3.2rem)/1.04 var(--serif); letter-spacing: -0.02em; }
.strip { margin-top: 28px; }
.strip-track { position: relative; height: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.strip-bar { position: absolute; top: 0; bottom: 0; left: calc(var(--s) * 100%); width: calc(var(--w) * 100%); background: var(--accent); }
.strip-ends { display: flex; justify-content: space-between; margin-top: 6px; font: 400 12px/1 var(--mono); color: var(--muted); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin-top: 24px; border-top: 2px solid var(--ink); }
.facts div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { font: 400 12px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin-top: 2px; font-size: 18px; font-weight: 500; }
.body { margin-top: 28px; max-width: 58ch; }
.body p + p { margin-top: 16px; }
.body p.access { padding: 16px 16px 16px 20px; background: var(--surface-2); border-left: 4px solid var(--accent); }
.body p.access::before { content: "Access"; display: block; margin-bottom: 4px; font: 400 12px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.sheet-foot { position: sticky; bottom: 0; padding: 16px 24px 20px; background: var(--surface); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.save { min-height: 52px; padding: 12px 24px; font-weight: 600; font-size: 17px; border: 2px solid var(--accent); border-radius: 4px; background: transparent; color: var(--accent); transition: background-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease); }
.save:active { transform: scale(0.97); }
.save[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.save-note { font-size: 14px; color: var(--muted); min-height: 1.4em; }
.save-note.warn { color: #ffb59a; }

/* ---------- hover (pointer devices only) ---------- */
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { border-bottom-color: var(--accent); color: var(--accent); }
  .brand:hover .brand-mark { transform: rotate(-8deg); }
  .btn-primary:hover { background: #ffc468; }
  .btn-ghost:hover { border-color: var(--ink); }
  .btn-dark:hover { background: #3a2f4c; }
  .bar:hover { transform: translateY(-2px); border-color: var(--accent); }
  .toggle:hover { border-color: var(--accent); }
  .toggle[aria-pressed="true"]:hover { background: #ffc468; }
  .seg label:hover input:not(:checked) + span { background: var(--surface-2); }
  input[type="text"]:hover, select:hover { border-color: var(--muted); }
  .reset:hover { color: var(--ink); }
  .row:hover { background: var(--surface); padding-left: 8px; }
  .row:hover::before { transform: scaleY(1); }
  .row:hover .go { transform: translateX(6px); }
  .stub:hover { background: rgba(28, 22, 36, 0.06); padding-left: 8px; }
  .stub-open:hover { text-decoration-color: var(--paper-ink); }
  .stub-remove:hover { background: var(--paper-ink); color: var(--paper); }
  .close:hover { background: var(--ink); color: var(--bg); }
  .save:hover { background: rgba(244, 176, 74, 0.14); }
  .save[aria-pressed="true"]:hover { background: #ffc468; }
  .foot-link:hover { color: var(--accent); }
}
.brand-mark { transition: transform 0.2s var(--ease); }

/* ---------- motion ---------- */
@keyframes grow { from { transform: scaleX(0.15); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes breathe { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
@keyframes glow { 0%, 100% { text-shadow: 0 0 28px rgba(244, 176, 74, 0.25); } 50% { text-shadow: 0 0 64px rgba(244, 176, 74, 0.6); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero::before, .glow { animation: none; }
  .bar { animation: fade 0.01s both; }
  .stub { animation: fade 0.3s both; }
  dialog.detail[open] { animation: fade 0.2s both; }
  .bar:hover, .brand:hover .brand-mark, .row:hover .go { transform: none; }
  .bar:active, .btn:active, .toggle:active, .save:active, .close:active { transform: none; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}

/* ---------- tablet / mobile ---------- */
@media (max-width: 1100px) {
  .prog-grid { grid-template-columns: 1fr; gap: 40px; }
  .controls { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; align-items: end; }
  .controls .prog-title, .controls .reset { grid-column: 1 / -1; }
  .toggles { grid-template-columns: 1fr 1fr; align-self: end; }
  .plan-grid { grid-template-columns: 1fr; gap: 40px; }
  .plan-intro { position: static; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 700px) {
  :root { --lab: 48px; }
  body { font-size: 16px; }
  .top { padding-inline: 16px; gap: 4px; }
  .brand { font-size: 23px; }
  .brand-mark { display: none; }
  .nav a { padding: 0 8px; font-size: 14px; gap: 6px; }
  .hero { padding-block: 28px 40px; }
  h1 { font-size: 15.4vw; }
  .lede { font-size: 17px; }
  .ledger dd { font-size: 40px; }
  .ledger dt { font-size: 11px; letter-spacing: 0.08em; }
  .dial { margin-inline: calc(var(--pad) * -1); border-inline: 0; margin-top: 32px; }
  .chart { min-width: 880px; padding-inline: 16px; }
  .beam { left: calc(16px + var(--lab) + (100% - 32px - var(--lab)) * var(--bt, 0.36)); }
  .beam-ctl { grid-template-columns: 1fr; padding-inline: 20px; }
  .row-label b { font-size: 24px; }
  .programme { padding-block: 64px 80px; }
  .controls { grid-template-columns: 1fr; }
  .toggles { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 1fr auto; gap: 8px 16px; padding: 20px 0; }
  .row-time { grid-column: 1 / -1; display: flex; gap: 10px; align-items: baseline; padding-left: 0; font-size: 18px; }
  .row-time span { margin-top: 0; }
  .row-main { grid-column: 1; }
  .row-side { grid-column: 2; grid-row: 2; }
  .row:hover { padding-left: 0; }
  .row[data-saved="true"] { padding-left: 16px; }
  .plan { padding-block: 80px 72px; }
  .stub { grid-template-columns: 1fr auto; gap: 8px 16px; }
  .stub-time { grid-column: 1 / -1; display: flex; gap: 10px; align-items: baseline; font-size: 20px; }
  .stub-time span { margin-top: 0; }
  .stub h4 { font-size: 1.4rem; }
  .empty { padding: 24px; }
  .sheet-top, .sheet-foot { padding-inline: 20px; }
  .sheet-main { padding-inline: 20px; }
  .facts { grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .facts dd { font-size: 16px; }
}
