/* ==========================================================================
   Makerss Hub — The Railway Line
   Plain CSS, no build step. The CSP has no 'unsafe-inline' for styles, so
   nothing on the site may use a style="" attribute; every rule lives here.

   1. Fonts
   2. Tokens (base colours are fixed brand values; do not change them)
   3. Base
   4. Header
   5. Hero and departure board
   6. The line (vertical route spine)
   7. Sections
   8. Closing call and footer
   9. Motion
  10. Responsive
   ========================================================================== */

/* 1. Fonts ---------------------------------------------------------------- */
@font-face {
  font-family: "Saira Extra Condensed";
  src: url("/assets/fonts/saira-xc-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Saira Extra Condensed";
  src: url("/assets/fonts/saira-xc-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Archivo Narrow";
  src: url("/assets/fonts/archivo-narrow-var.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Overpass";
  src: url("/assets/fonts/overpass-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* 2. Tokens --------------------------------------------------------------- */
:root {
  --bg: #F7F5F1;
  --bg-alt: #EFEBE3;
  --surface: #FFFFFF;
  --board: #17171A;
  --tile: #222225;
  --text: #17171A;
  --text-muted: #6B6862;
  --border: #E3DFD6;
  --accent: #B85C1F;
  --accent-strong: #9C4C18;
  --on-accent: #FFFFFF;
  --on-board: #F5F1EA;
  --on-board-muted: #A8A29B;
  --board-accent: #E08A4F;
  --focus-ring: #B85C1F;

  --font-display: "Saira Extra Condensed", "Arial Narrow", sans-serif;
  --font-board: "Archivo Narrow", "Arial Narrow", sans-serif;
  --font-text: "Overpass", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --page: 1264px;
  --gutter: clamp(16px, 3.5vw, 44px);
  --header-h: 96px;
  --radius-board: 12px;
  --radius-tile: 4px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121113;
    --bg-alt: #1A1919;
    --surface: #1C1B1D;
    --board: #0B0B0C;
    --tile: #1B1B1E;
    --text: #F5F1EA;
    --text-muted: #A8A29B;
    --border: #2E2C2C;
    --accent: #E08A4F;
    --accent-strong: #F0A366;
    --on-accent: #121113;
    --focus-ring: #E08A4F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121113;
  --bg-alt: #1A1919;
  --surface: #1C1B1D;
  --board: #0B0B0C;
  --tile: #1B1B1E;
  --text: #F5F1EA;
  --text-muted: #A8A29B;
  --border: #2E2C2C;
  --accent: #E08A4F;
  --accent-strong: #F0A366;
  --on-accent: #121113;
  --focus-ring: #E08A4F;
  color-scheme: dark;
}

/* 3. Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 112px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Buttons: one pill language site-wide; orange only for the live action. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  border-radius: 999px; border: 2px solid transparent;
  font: 400 19px/1 var(--font-text);
  letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.2s var(--ease-out), transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.btn-live { background: var(--accent); color: var(--on-accent); }
.btn-live:hover { background: var(--accent-strong); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(23, 23, 26, 0.18); }
.btn-live:active { transform: translateY(0); box-shadow: none; }
.btn-line { border-color: currentColor; color: var(--text); background: transparent; }
.btn-line:hover { background: var(--text); color: var(--bg); }

/* 4. Header --------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--border); }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 28px; font-weight: 600; text-decoration: none; color: var(--text-muted); }
.back-link:hover { color: var(--text); text-decoration: underline; }
.back-link svg { width: 18px; height: 18px; }
.site-header .wrap {
  height: var(--header-h);
  display: flex; align-items: center; gap: 36px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.logo-mark { width: 52px; height: auto; }
.logo-text { display: grid; line-height: 1.05; }
.logo-word { font: 800 24px/1 var(--font-display); letter-spacing: 0.01em; text-transform: uppercase; }
.logo-tagline { font: 500 12px/1.3 var(--font-text); color: var(--text-muted); letter-spacing: 0.02em; }
.main-nav { display: flex; align-items: center; gap: 36px; }
.main-nav a:not(.btn) { font-size: 18px; font-weight: 400; letter-spacing: -0.045em; text-decoration: none; color: var(--text); }
.main-nav a:not(.btn):hover { text-decoration: underline; }
.nav-toggle { display: none; }

/* 5. Hero ----------------------------------------------------------------- */
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 600px) minmax(0, 560px);
  justify-content: space-between;
  align-items: start;
  padding-top: 72px;
  padding-bottom: 96px;
}
.hero h1 {
  font: 700 112px/0.84 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0;
  max-width: 556px;
}
.hero-sub {
  margin-top: 20px;
  font-size: 23.5px; line-height: 1.3; letter-spacing: -0.012em;
  max-width: 556px;
}
.hero-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 14px; }

/* The departure board */
.board-wrap { margin: 21px 0 0; }
.board {
  background: var(--board);
  color: var(--on-board);
  border-radius: var(--radius-board);
  padding: 14px 18px 18px;
}
.board table { width: 100%; border-collapse: separate; border-spacing: 6px; table-layout: fixed; }
.board th {
  font: 700 clamp(28px, 2.6vw, 40px)/1 var(--font-display);
  text-transform: uppercase; text-align: left;
  padding: 2px 12px 10px;
  border-bottom: 2px solid var(--on-board);
}
.board td {
  background: var(--tile);
  border-radius: var(--radius-tile);
  font: 400 clamp(24px, 2.25vw, 36px)/1 var(--font-board);
  padding: 12px 12px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.board .col-time { width: 21.5%; }
.board .col-status { width: 25.5%; }
.board .is-live { color: var(--board-accent); }
.board-caption { margin-top: 4px; font-size: 15px; color: var(--text-muted); }

.hero h1 { max-width: 600px; }
.hero-proof { margin-top: 22px; font-size: 16px; color: var(--text-muted); }
.hero-proof a { text-decoration: none; border-bottom: 1px solid var(--border); padding-bottom: 2px; }
.hero-proof a:hover { color: var(--text); border-color: currentColor; }
.hero-proof strong { color: var(--text); font-weight: 700; }

.board-top {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 2px 12px 8px;
  font: 600 15px/1 var(--font-board); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--on-board-muted);
}
.board-clock time { color: var(--on-board); font-variant-numeric: tabular-nums; }
.board td { transition: color 0.4s var(--ease-out); }
.board td.flip { animation: flip 0.6s var(--ease-out); }
@keyframes flip {
  from { transform: translateY(-40%); opacity: 0; filter: blur(2px); }
  to { transform: none; opacity: 1; filter: none; }
}
.board-track {
  list-style: none; margin: 10px 12px 0; padding: 12px 0 0;
  display: flex; justify-content: space-between; position: relative;
  font: 600 14px/1 var(--font-board); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--on-board-muted);
}
.board-track::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: 5px; height: 2px; background: #3A3A3E;
}
.board-track li { position: relative; padding-top: 14px; }
.board-track li::before {
  content: ""; position: absolute; top: -12px; left: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--board); border: 2px solid var(--on-board-muted);
}
.board-track li:last-child { color: var(--board-accent); }
.board-track li:last-child::before { border-color: var(--board-accent); background: var(--board-accent); }
.board-track li:last-child { text-align: right; }
.board-track li:last-child::before { left: auto; right: 0; }

/* 6. The line ------------------------------------------------------------- */
.line { position: relative; --line-x: calc(max(var(--gutter), (100% - var(--page)) / 2 + var(--gutter)) + 9px); }
.line::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: var(--line-x);
  width: 6px; background: var(--text); border-radius: 3px; z-index: 1;
}
.line-train {
  position: absolute; left: calc(var(--line-x) - 5px); top: 0;
  width: 16px; height: 44px; border-radius: 8px;
  background: var(--accent);
  box-shadow: 0 3px 8px rgba(23, 23, 26, 0.25);
  will-change: transform; z-index: 2;
}
.stop-section { position: relative; padding: 112px 0; }
.stop-section .wrap { padding-left: calc(var(--gutter) + 64px); }
.stop-section h2 {
  position: relative;
  font: 700 clamp(48px, 7vw, 88px)/0.9 var(--font-display);
  text-transform: uppercase;
  max-width: 14ch;
  margin-bottom: 36px;
}
.stop {
  position: absolute; left: -64px; top: 0.12em;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg); border: 6px solid var(--text); z-index: 2;
}
.stop-warm { background: var(--bg-alt); }
.stop-warm .stop { background: var(--bg-alt); }

/* 7. Sections ------------------------------------------------------------- */
.lead { font-size: 24px; line-height: 1.35; letter-spacing: -0.01em; }
.prose { max-width: 62ch; display: grid; gap: 18px; }
.prose p:not(.lead) { color: var(--text-muted); }
.section-intro { font-size: 22px; line-height: 1.4; max-width: 46ch; margin: -12px 0 48px; color: var(--text-muted); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }

.platform { margin: 0; }
.slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.slot {
  aspect-ratio: 4 / 3; border-radius: 6px;
  display: flex; align-items: flex-end; padding: 14px;
  font: 600 20px/1.1 var(--font-board);
}
.slot.is-filled { background: var(--board); color: var(--on-board); }
.slot.is-filled:nth-child(3) span { color: var(--board-accent); }
:root[data-theme="dark"] .slot.is-filled { box-shadow: inset 0 0 0 1px #2E2C2C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .slot.is-filled { box-shadow: inset 0 0 0 1px #2E2C2C; } }
.slot.is-empty { border: 2px dashed var(--text-muted); color: var(--text-muted); }
.board-leak td { font-size: 26px; padding: 11px 12px 9px; }
.board-leak th { font-size: 28px; }
.board-leak .col-time { width: 22%; }
.board-leak .col-status { width: 32%; }
.board-leak tr.is-gap td { background: transparent; box-shadow: inset 0 0 0 2px #45454B; color: var(--on-board-muted); }
.platform figcaption { margin-top: 12px; font-size: 15px; color: var(--text-muted); }

.route { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.route::before { content: ""; position: absolute; left: 0; right: 15px; top: 12px; height: 6px; background: var(--text); border-radius: 3px; }
.route li { position: relative; padding: 52px 28px 0 0; }
.route li::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 30px; height: 30px; border-radius: 50%; background: var(--bg); border: 6px solid var(--text);
}
.route li.is-terminus::before { background: var(--accent); border-color: var(--accent); }
.route h3 { font: 700 40px/1 var(--font-display); text-transform: uppercase; margin-bottom: 12px; }
.route li.is-terminus h3 { color: var(--accent); }
.route p { color: var(--text-muted); max-width: 30ch; }

.demo { margin: 72px 0 0; }
.demo video { accent-color: var(--accent); width: 100%; height: auto; border-radius: var(--radius-board); background: var(--bg-alt); box-shadow: 0 10px 30px rgba(23, 23, 26, 0.1); }
.demo figcaption { margin-top: 12px; font-size: 15px; color: var(--text-muted); }

.result { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; }
.result-client img { width: 88px; height: 88px; border-radius: 12px; margin-bottom: 20px; background: #FFFFFF; padding: 8px; object-fit: contain; }
.result-client p { font-size: 20px; line-height: 1.45; margin-bottom: 18px; }
.text-link { font-weight: 600; color: var(--accent); }
.text-link::after { content: " \2192"; }
.result-board { background: var(--board); color: var(--on-board); border-radius: var(--radius-board); padding: 18px; }
.result-board dl { margin: 0; display: grid; gap: 6px; }
.result-board dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; background: var(--tile); border-radius: var(--radius-tile); padding: 18px 20px; }
.result-board dt { font: 400 26px/1.1 var(--font-board); }
.result-board dd { margin: 0; font: 800 clamp(56px, 7vw, 88px)/0.9 var(--font-display); color: var(--board-accent); }
.result-board .note { margin: 14px 4px 0; font-size: 14px; line-height: 1.5; color: var(--on-board-muted); }

.tickets { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ticket {
  position: relative; background: var(--bg); border-radius: 0 0 8px 8px; padding: 36px 26px 30px;
  box-shadow: inset 0 10px 0 var(--text), 0 2px 6px rgba(23, 23, 26, 0.06);
}
.ticket::before, .ticket::after {
  content: ""; position: absolute; top: 98px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-alt);
}
.ticket::before { left: -11px; }
.ticket::after { right: -11px; }
.ticket h3 { padding-bottom: 22px; border-bottom: 2px dashed var(--border); }
.ticket h3 { font: 700 34px/0.95 var(--font-display); text-transform: uppercase; margin-bottom: 18px; }
.ticket p { color: var(--text-muted); }

.about { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 64px; align-items: center; }
.about-head { margin-bottom: 0; }
.founder { width: 300px; height: 300px; object-fit: cover; border-radius: 12px; }

.timetable { width: 100%; border-collapse: collapse; font-size: 19px; }
.timetable tr { border-top: 2px solid var(--text); }
.timetable tr:last-child { border-bottom: 2px solid var(--text); }
.timetable th { text-align: left; font: 700 34px/1 var(--font-display); text-transform: uppercase; padding: 22px 32px 22px 0; width: 34%; vertical-align: top; }
.timetable td { padding: 24px 0; color: var(--text-muted); max-width: 60ch; }

/* 8. Closing call and footer --------------------------------------------- */
.closing { position: relative; background: var(--accent); color: var(--on-accent); padding: 120px 0; }
.closing::before {
  content: ""; position: absolute; top: -15px; z-index: 3;
  left: calc(max(var(--gutter), (100% - var(--page)) / 2 + var(--gutter)) - 3px);
  width: 30px; height: 30px; border-radius: 50%; background: var(--text); border: 6px solid var(--on-accent);
}
.closing h2 { font: 800 clamp(56px, 9vw, 120px)/0.88 var(--font-display); text-transform: uppercase; max-width: 12ch; }
.closing p { font-size: 22px; line-height: 1.4; max-width: 48ch; margin-top: 24px; }
.closing-actions { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.btn-ink { background: var(--text); color: var(--bg); }
.btn-ink:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(23, 23, 26, 0.3); }
.closing-mail, .closing-calc a { color: inherit; font-weight: 600; }
.closing-calc { font-size: 18px; }

.site-footer { padding: 56px 0 40px; border-top: 1px solid var(--border); }
.footer-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-top .logo { margin-right: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.footer-nav a { text-decoration: none; font-size: 16px; }
.footer-nav a:hover { text-decoration: underline; }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 15px; color: var(--text-muted); }
.footer-bottom p a { margin-left: 0.3em; }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text);
  font: 500 15px/1 var(--font-text); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* The logo art is dark ink: in dark mode it sits on a card-stock chip. */
:root[data-theme="dark"] .logo-mark { background: #F5F1EA; border-radius: 8px; padding: 4px 6px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-mark { background: #F5F1EA; border-radius: 8px; padding: 4px 6px; }
}
:root[data-theme="dark"] .board, :root[data-theme="dark"] .result-board { box-shadow: inset 0 0 0 1px #2E2C2C; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .board, :root:not([data-theme="light"]) .result-board { box-shadow: inset 0 0 0 1px #2E2C2C; }
}

/* 9. Motion --------------------------------------------------------------- */
.anim [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.anim [data-reveal].is-in { opacity: 1; transform: none; }

/* 10. Responsive ---------------------------------------------------------- */
@media (max-width: 1080px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 48px; padding-top: 64px; }
  .hero h1 { font-size: clamp(60px, 12vw, 120px); max-width: 12ch; }
  .board-wrap { margin: 0; max-width: 640px; }
  .split, .result { grid-template-columns: 1fr; gap: 40px; }
  .route { grid-template-columns: 1fr 1fr; row-gap: 48px; }
  .route::before { display: none; }
  .tickets { grid-template-columns: 1fr; max-width: 560px; }
}
@media (max-width: 860px) {
  .site-header .wrap { height: 76px; gap: 16px; }
  .nav-toggle {
    display: inline-grid; place-content: center; gap: 6px;
    width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 999px; background: transparent; cursor: pointer;
  }
  .nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); transition: transform 0.25s var(--ease-out); }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .main-nav {
    display: none; position: absolute; left: 0; right: 0; top: 76px; z-index: 20;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px var(--gutter) 20px;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 20px; }
  .main-nav .btn { margin-top: 16px; }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .founder { width: 200px; height: 200px; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .logo-tagline { display: none; }
  .hero .wrap { padding-top: 40px; padding-bottom: 64px; gap: 36px; }
  .hero h1 { font-size: clamp(52px, 15.5vw, 80px); }
  .hero-sub { font-size: 19px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .board { padding: 10px 8px 14px; }
  .board table { border-spacing: 4px; }
  .board th { font-size: 22px; padding: 2px 8px 8px; }
  .board td { font-size: 19px; padding: 10px 8px 8px; }
  .board-top, .board-track { font-size: 12px; }
  .line { --line-x: calc(var(--gutter) + 3px); }
  .line::before { width: 4px; }
  .line-train { width: 12px; height: 32px; left: calc(var(--line-x) - 4px); }
  .stop-section { padding: 72px 0; }
  .stop-section .wrap { padding-left: calc(var(--gutter) + 36px); }
  .stop { left: -40px; width: 22px; height: 22px; border-width: 4px; }
  .lead { font-size: 20px; }
  .section-intro { font-size: 19px; margin-bottom: 36px; }
  .board-leak td { font-size: 17px; padding: 9px 7px 7px; }
  .board-leak th { font-size: 20px; }
  .route { grid-template-columns: 1fr; row-gap: 36px; }
  .route li { padding: 0 0 0 48px; }
  .route li::before { width: 26px; height: 26px; border-width: 5px; }
  .route h3 { font-size: 34px; }
  .result-board dt { font-size: 20px; }
  .timetable, .timetable tbody, .timetable tr, .timetable th, .timetable td { display: block; width: auto; }
  .timetable th { padding: 18px 0 6px; }
  .timetable td { padding: 0 0 18px; }
  .closing { padding: 80px 0; }
  .closing::before { left: calc(var(--gutter) - 6px); width: 22px; height: 22px; top: -11px; border-width: 4px; }
  .closing p { font-size: 19px; }
  .closing-actions .btn { flex: 1 1 100%; }
}

/* ==========================================================================
   11. Inner pages: shared section grammar (case study, calculator, legal, 404)
   ========================================================================== */
.container { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.container-text { max-width: calc(760px + 2 * var(--gutter)); }
.section { padding: 104px 0; }
.section-alt { background: var(--bg-alt); }
.section h2, .page-title {
  font: 700 clamp(44px, 6vw, 76px)/0.92 var(--font-display);
  text-transform: uppercase; max-width: 16ch;
}
.page-title { font-size: clamp(56px, 9vw, 120px); max-width: 14ch; }
.section h3 { font: 700 30px/1 var(--font-display); text-transform: uppercase; }
.section-head { max-width: 760px; margin-bottom: 48px; }
.section-head p { margin-top: 20px; font-size: 21px; line-height: 1.45; color: var(--text-muted); }
.hero-sub { margin-top: 22px; font-size: 22px; line-height: 1.4; max-width: 54ch; }
.link-accent { color: var(--text); font-weight: 600; text-decoration: underline; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(23, 23, 26, 0.18); }
.btn-primary[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { border-color: currentColor; color: var(--text); background: transparent; }
.btn-secondary:hover { background: var(--text); color: var(--bg); }
.btn svg { width: 20px; height: 20px; }

/* Legal pages */
.legal { padding: 88px 0 112px; }
.legal .hero-sub { color: var(--text-muted); font-size: 18px; margin-bottom: 40px; }
.legal h2 { font: 700 34px/1 var(--font-display); text-transform: uppercase; margin: 48px 0 14px; max-width: none; }
.legal p, .legal li { color: var(--text-muted); max-width: 68ch; }
.legal p + p { margin-top: 14px; }
.legal ul { padding-left: 1.2em; display: grid; gap: 8px; margin: 14px 0 0; }
.legal strong { color: var(--text); }

/* 404 */
.lost { padding: 112px 0 136px; }
.lost-board { display: inline-flex; gap: 6px; background: var(--board); border-radius: var(--radius-board); padding: 10px; margin-bottom: 40px; }
.lost-board span { background: var(--tile); color: var(--board-accent); border-radius: var(--radius-tile); font: 800 72px/1 var(--font-display); padding: 10px 16px 6px; }
.lost .hero-actions { margin-top: 32px; }

/* ==========================================================================
   12. Marketing cost calculator
   ========================================================================== */
.calc-hero { padding: 96px 0 56px; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.calc-card {
  position: relative; background: var(--bg); border-radius: 0 0 8px 8px; padding: 40px 28px 32px;
  box-shadow: inset 0 10px 0 var(--text), 0 2px 6px rgba(23, 23, 26, 0.06);
}
.calc-card > p { font-size: 17px; color: var(--text-muted); margin: 10px 0 24px; }
.calc-field { margin-bottom: 18px; }
.calc-field:last-child { margin-bottom: 0; }
.calc-field label { display: block; font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.calc-optional { font-weight: 400; color: var(--text-muted); }
.calc-field input {
  width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 6px;
  border: 2px solid var(--border); background: var(--surface); color: var(--text);
  font: 400 19px/1.2 var(--font-text); font-variant-numeric: tabular-nums;
  caret-color: var(--accent);
}
.calc-field input:hover { border-color: var(--text-muted); }
.calc-field input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184, 92, 31, 0.2); }
.calc-field input::placeholder { color: var(--text-muted); opacity: 0.8; }
.calc-actions { margin-top: 40px; text-align: center; }
.calc-hint { margin-top: 12px; font-size: 15px; color: var(--text-muted); }
.calc-gate-inner { max-width: 520px; }
.calc-gate-inner > p { margin: 18px 0 28px; color: var(--text-muted); }
.calc-gate-inner .btn { width: 100%; margin-top: 8px; }
.calc-gate-status { margin-top: 14px; font-size: 15px; color: var(--text-muted); text-align: center; }
/* Results lay out as flex, not a fixed 2-up grid: a hidden card is display:none
   and drops out, so a single result centres instead of sitting in column one. */
.calc-results .calc-grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.calc-results .calc-grid > .calc-card { flex: 1 1 340px; max-width: 560px; }
.calc-result-card { background: var(--board); color: var(--on-board); box-shadow: none; padding-top: 30px; }
.calc-result-card h3 { margin-bottom: 18px; }
.calc-metrics { margin: 0 0 20px; display: grid; gap: 4px; }
.calc-metrics > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; background: var(--tile); border-radius: var(--radius-tile); padding: 11px 14px; }
.calc-metrics dt { font: 400 17px/1.2 var(--font-board); color: var(--on-board-muted); }
.calc-metrics dd { margin: 0; font: 600 19px/1.2 var(--font-board); text-align: right; }
.calc-result-line { font-size: 16px; color: var(--on-board-muted); margin-bottom: 14px; }
.calc-result-line strong { color: var(--on-board); }
.calc-result-highlight { margin-top: 18px; padding-top: 18px; border-top: 1px solid #3A3A3E; font-size: 18px; }
.calc-result-highlight strong { display: block; margin-top: 6px; font: 800 48px/1 var(--font-display); color: var(--board-accent); }
.calc-result-sub { margin-top: 10px; font-size: 15px; color: var(--on-board-muted); }
.calc-result-sub strong { color: var(--on-board); }
.calc-disclaimer { max-width: 64ch; margin: 32px auto 0; text-align: center; font-size: 14px; color: var(--text-muted); }
.cta-section { margin-top: 80px; background: var(--accent); color: var(--on-accent); border-radius: var(--radius-board); padding: 56px clamp(24px, 5vw, 64px); }
.cta-section h2 { color: inherit; }
.cta-section p { margin: 18px 0 28px; font-size: 20px; max-width: 52ch; }
.cta-section .btn-primary { background: var(--text); color: var(--bg); }

/* ==========================================================================
   13. Case study (/mercy-hospital-case-study.html)
   Motion: the hero animates with CSS alone. Everything below it is visible by
   default and only starts hidden once main.js adds .anim to <html>.
   ========================================================================== */
.cs-note { font-size: 14px; color: var(--text-muted); margin-top: 12px; }
.cs-head { max-width: 760px; margin-bottom: 44px; }
.cs-head p { margin-top: 18px; font-size: 20px; color: var(--text-muted); }
.cs-lead { font-size: 22px; line-height: 1.4; margin-top: 22px; }
.cs-copy p + p { margin-top: 14px; color: var(--text-muted); }

.cs-progress { display: none; }
@supports (animation-timeline: scroll()) {
  .cs-progress {
    display: block; position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 150;
    background: var(--accent); transform-origin: left; transform: scaleX(0);
    animation: cs-progress linear both; animation-timeline: scroll(root);
  }
}
@keyframes cs-progress { to { transform: scaleX(1); } }

.cs-hero { padding: 80px 0 96px; }
.cs-hero h1 { font: 700 clamp(48px, 6vw, 84px)/0.9 var(--font-display); text-transform: uppercase; max-width: 20ch; margin-bottom: 44px; }
.cs-client { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.cs-client img { width: 64px; height: 64px; object-fit: contain; background: #FFFFFF; border-radius: 10px; padding: 6px; }
.cs-client strong { display: block; font-size: 18px; }
.cs-client span { display: block; font-size: 15px; color: var(--text-muted); }
.cs-figures { display: grid; grid-template-columns: 1.2fr 1fr; gap: 6px; max-width: 880px; background: var(--board); border-radius: var(--radius-board); padding: 10px; color: var(--on-board); }
.cs-figure { background: var(--tile); border-radius: var(--radius-tile); padding: 24px 24px 22px; }
.cs-figure-num { font: 800 clamp(64px, 8vw, 104px)/0.9 var(--font-display); color: var(--on-board); }
.cs-figure-main .cs-figure-num { color: var(--board-accent); }
.cs-figure p { margin-top: 12px; font: 400 18px/1.3 var(--font-board); color: var(--on-board-muted); }
.cs-hero-sub { margin-top: 32px; font-size: 22px; max-width: 48ch; }
.cs-in { animation: cs-up 0.8s var(--ease-out) both; }
.cs-in-2 { animation-delay: 0.1s; }
.cs-in-3 { animation-delay: 0.2s; }
.cs-in-4 { animation-delay: 0.34s; }
.cs-in-5 { animation-delay: 0.46s; }
.cs-in-6 { animation-delay: 0.6s; }
@keyframes cs-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

.cs-split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.cs-roof { background: var(--board); color: var(--on-board); border-radius: var(--radius-board); padding: 24px; }
.cs-roof-title { font: 600 14px/1 var(--font-board); letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-board-muted); }
.cs-roof ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; padding: 0; }
.cs-roof li { background: var(--tile); border-radius: var(--radius-tile); padding: 9px 14px; font: 400 19px/1.1 var(--font-board); transition: opacity 0.5s ease, transform 0.5s var(--ease-out); }
.anim .cs-roof:not(.is-in) li { opacity: 0; transform: scale(0.9); }
.cs-roof li:nth-child(2) { transition-delay: 0.08s; }
.cs-roof li:nth-child(3) { transition-delay: 0.16s; }
.cs-roof li:nth-child(4) { transition-delay: 0.24s; }
.cs-roof li:nth-child(5) { transition-delay: 0.32s; }
.cs-roof li:nth-child(6) { transition-delay: 0.4s; }
.cs-roof li:nth-child(7) { transition-delay: 0.48s; }
.cs-gap { margin-top: 18px; padding: 14px; border: 2px dashed var(--board-accent); border-radius: var(--radius-tile); font: 600 19px/1.2 var(--font-board); color: var(--board-accent); }
.cs-roof .cs-note { color: var(--on-board-muted); }

.cs-flow { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; margin: 0; padding: 0; }
.cs-flow::before { content: ""; position: absolute; top: 12px; left: 0; right: 15px; height: 6px; border-radius: 3px; background: var(--text); transform-origin: left; transition: transform 1.4s var(--ease-out) 0.2s; }
.anim .cs-flow:not(.is-in)::before { transform: scaleX(0); }
.cs-flow::after { content: ""; position: absolute; top: 7px; left: 0; width: 44px; height: 16px; border-radius: 8px; background: var(--accent); animation: cs-travel 5s var(--ease-out) 1.6s infinite; }
@keyframes cs-travel { 0% { left: 0; opacity: 0; } 8% { opacity: 1; } 90% { opacity: 1; } 100% { left: calc(100% - 60px); opacity: 0; } }
.cs-step { position: relative; padding: 52px 24px 0 0; transition: opacity 0.6s ease, transform 0.6s var(--ease-out); }
.cs-step::before { content: ""; position: absolute; top: 0; left: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--bg); border: 6px solid var(--text); }
.cs-step:last-child::before { background: var(--accent); border-color: var(--accent); }
.anim .cs-flow:not(.is-in) .cs-step { opacity: 0; transform: translateY(18px); }
.cs-step:nth-child(2) { transition-delay: 0.25s; }
.cs-step:nth-child(3) { transition-delay: 0.5s; }
.cs-step:nth-child(4) { transition-delay: 0.75s; }
.cs-step h3 { margin-bottom: 10px; }
.cs-step p { color: var(--text-muted); max-width: 28ch; }
.cs-flow-note { max-width: 60ch; margin-top: 40px; font-size: 20px; }

/* The CRM board: one enquiry card travels New > Contacted > Booked > Done.
   The other cards are blank on purpose: no patient data, real or invented. */
.cs-crm { margin: 64px 0 0; max-width: 920px; background: var(--board); color: var(--on-board); border-radius: var(--radius-board); padding: 22px; }
.cs-crm figcaption { font: 600 14px/1.2 var(--font-board); letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-board-muted); margin-bottom: 16px; }
.cs-board { --g: 6px; --pad: 10px; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--g); }
.cs-col { background: var(--tile); border-radius: var(--radius-tile); padding: 12px var(--pad); min-height: 224px; }
.cs-col-name { height: 22px; font: 600 16px/1 var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; color: var(--on-board); }
.cs-slot { height: 100px; }
.cs-card { background: #2C2C30; border-radius: 6px; padding: 12px 10px; margin-bottom: 8px; }
.cs-card b { display: block; font: 600 16px/1.15 var(--font-board); color: var(--on-board); }
.cs-card span { display: block; margin-top: 4px; font: 400 14px/1 var(--font-board); color: var(--on-board-muted); }
.cs-mover { position: absolute; top: 35px; left: 0; width: calc((100% - 3 * var(--g)) / 4); padding: 0 var(--pad); animation: cs-move 10s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
.cs-mover .cs-card { margin: 0; background: var(--on-board); color: var(--board); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); }
.cs-mover .cs-card b { color: var(--board); }
.cs-mover .cs-card > span:last-child { color: #6B6862; }
.cs-card-tag { display: flex; align-items: center; gap: 6px; font: 600 15px/1 var(--font-board); color: var(--accent-strong); margin-bottom: 9px; }
.cs-card-tag svg { width: 14px; height: 14px; flex: none; }
@keyframes cs-move {
  0% { transform: translateX(0); opacity: 0; }
  5% { opacity: 1; }
  20% { transform: translateX(0); }
  27%, 45% { transform: translateX(calc(100% + var(--g))); }
  52%, 70% { transform: translateX(calc(200% + 2 * var(--g))); }
  77% { transform: translateX(calc(300% + 3 * var(--g))); }
  93% { transform: translateX(calc(300% + 3 * var(--g))); opacity: 1; }
  100% { transform: translateX(calc(300% + 3 * var(--g))); opacity: 0; }
}
.cs-crm .cs-note { color: var(--on-board-muted); }

.cs-stats { display: grid; grid-template-columns: repeat(2, 1fr); max-width: 760px; gap: 6px; background: var(--board); color: var(--on-board); border-radius: var(--radius-board); padding: 10px; }
.cs-stat { background: var(--tile); border-radius: var(--radius-tile); padding: 20px 18px; }
.cs-stat-value { font: 800 clamp(34px, 3.4vw, 48px)/1 var(--font-display); white-space: nowrap; }
.cs-stat-label { margin-top: 8px; font: 400 17px/1.25 var(--font-board); color: var(--on-board-muted); }


.cs-details { margin-top: 24px; }
.cs-details summary { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; padding: 12px 20px; border-radius: 999px; border: 2px solid var(--text); list-style: none; }
.cs-details summary::-webkit-details-marker { display: none; }
.cs-details summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--accent); }
.cs-details[open] summary::after { content: "\2013"; }
.cs-table-wrap { overflow-x: auto; margin: 18px 0 10px; }
.cs-table { width: 100%; border-collapse: collapse; font: 400 17px/1.3 var(--font-board); min-width: 640px; }
.cs-table th, .cs-table td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--border); }
.cs-table th:first-child, .cs-table td:first-child { text-align: left; }
.cs-table thead th { font: 700 18px/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; border-bottom: 2px solid var(--text); }
.cs-table tfoot td { font-weight: 700; border-bottom: none; border-top: 2px solid var(--text); }
.cs-table small { color: var(--text-muted); font-size: inherit; }
.cs-takeaway { margin-top: 32px; padding-top: 24px; border-top: 2px solid var(--text); font-size: 20px; max-width: 64ch; }

.section-dark { background: var(--board); color: var(--on-board); }
.cs-result h2 { color: var(--on-board); }
.cs-outcomes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.cs-outcome { background: var(--tile); border-radius: var(--radius-tile); padding: 30px 28px; }
.cs-outcome-num { font: 800 clamp(64px, 7vw, 96px)/0.9 var(--font-display); color: var(--board-accent); }
.cs-outcome h3 { color: var(--on-board); margin: 18px 0 10px; }
.cs-outcome p { color: var(--on-board-muted); }
.cs-result .cs-note { color: var(--on-board-muted); margin-top: 22px; }

.cs-cta { background: var(--accent); color: var(--on-accent); }
.cs-cta h2 { color: inherit; max-width: 18ch; }
.cs-cta p { margin: 22px 0 32px; font-size: 21px; max-width: 54ch; }
.cs-cta .btn-primary { background: var(--text); color: var(--bg); }
.cs-cta .btn-secondary { color: var(--on-accent); }
.cs-cta .btn-secondary:hover { background: var(--on-accent); color: var(--accent); }

@media (max-width: 860px) {
  .calc-grid, .cs-split { grid-template-columns: 1fr; gap: 32px; }
  .cs-stats { grid-template-columns: 1fr; }
  .cs-flow { grid-template-columns: 1fr; row-gap: 32px; }
  .cs-flow::before { top: 0; bottom: 0; left: 12px; right: auto; width: 6px; height: auto; transform-origin: top; }
  .anim .cs-flow:not(.is-in)::before { transform: scaleY(0); }
  .cs-flow::after { display: none; }
  .cs-step { padding: 0 0 0 52px; }
}
@media (max-width: 640px) {
  .section { padding: 72px 0; }
  .cs-hero { padding: 48px 0 64px; }
  .cs-figures, .cs-outcomes { grid-template-columns: 1fr; }
  .cs-crm, .cs-roof { padding: 14px 10px; }
  .cs-board { --g: 4px; --pad: 5px; }
  .cs-col-name { font-size: 13px; letter-spacing: 0; }
  /* Columns are about 60px wide here: the icon alone says "message". */
  .cs-card-tag span { display: none; }
  .cs-slot { height: 92px; }
  .cs-card { padding: 10px 6px; }
  .lost-board span { font-size: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-flow::after { display: none; }
  .cs-mover { animation: none; }
}
