/* ==========================================================================
   Northlink
   Tokens, components and page sections. Fonts are self-hosted latin subsets
   (SIL OFL 1.1, see assets/fonts/LICENSE.txt). Light by default, dark from
   prefers-color-scheme. Motion states are gated on html.js, so every artifact
   renders complete when scripts do not run.
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url("assets/fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 300 500;
  font-display: swap;
  src: url("assets/fonts/newsreader-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("assets/fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Color ---------- */
:root {
  color-scheme: light;
  --bg: #FBFAF8;
  --surface: #FFFFFF;
  --bg-soft: #F3F2EE;
  --ink: #14161A;
  --ink-2: #4B5059;
  --ink-3: #6B707A;
  --line: rgb(20 22 26 / 0.08);
  --line-strong: rgb(20 22 26 / 0.14);
  --accent: #2446C9;
  --accent-hover: #1C389F;
  --on-accent: #FFFFFF;
  --ok: #1F8A4C;
  --warn: #B7791F;
  --alert: #C2412D;
  --shadow-artifact: 0 1px 2px rgb(20 22 26 / 0.05), 0 8px 24px -12px rgb(20 22 26 / 0.12);
  --shadow-toast: 0 10px 30px -10px rgb(20 22 26 / 0.35);
  --cell: color-mix(in oklab, var(--ok) 22%, var(--surface));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B0D11;
    --surface: #12151B;
    --bg-soft: #0F1216;
    --ink: #ECEDEF;
    --ink-2: #A3A8B1;
    --ink-3: #80868F;
    --line: rgb(255 255 255 / 0.07);
    --line-strong: rgb(255 255 255 / 0.13);
    --accent: #93A9FF;
    --accent-hover: #B3C2FF;
    --on-accent: #0B0D11;
    --ok: #3FC27F;
    --warn: #E3A84A;
    --alert: #F07560;
    --shadow-artifact: inset 0 1px 0 rgb(255 255 255 / 0.04);
    --shadow-toast: 0 10px 30px -10px rgb(0 0 0 / 0.6);
    --cell: color-mix(in oklab, var(--ok) 22%, var(--surface));
  }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0B0D11;
    --surface: #12151B;
    --bg-soft: #0F1216;
    --ink: #ECEDEF;
    --ink-2: #A3A8B1;
    --ink-3: #80868F;
    --line: rgb(255 255 255 / 0.07);
    --line-strong: rgb(255 255 255 / 0.13);
    --accent: #93A9FF;
    --accent-hover: #B3C2FF;
    --on-accent: #0B0D11;
    --ok: #3FC27F;
    --warn: #E3A84A;
    --alert: #F07560;
    --shadow-artifact: inset 0 1px 0 rgb(255 255 255 / 0.04);
    --shadow-toast: 0 10px 30px -10px rgb(0 0 0 / 0.6);
    --cell: color-mix(in oklab, var(--ok) 22%, var(--surface));
}
:root[data-theme="light"] { color-scheme: light; }

/* ---------- Type, space, shape, motion ---------- */
:root {
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --fs-h1: clamp(2.75rem, 1.6rem + 4.2vw, 4.75rem);
  --fs-h2: clamp(2rem, 1.4rem + 2vw, 3rem);
  --fs-h3: 1.125rem;
  --fs-lead: clamp(1.125rem, 1.06rem + 0.3vw, 1.25rem);
  --fs-body: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --fs-small: 0.875rem;
  --fs-btn: 0.9375rem;
  --fs-eyebrow: 0.75rem;
  --fs-artifact: 0.8125rem;
  --fs-chip: 0.6875rem;
  --fs-fact: 3rem;
  --fs-two47: clamp(5.5rem, 3rem + 8vw, 9.5rem);

  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;
  --s-16: 4rem;
  --section-y: clamp(4.5rem, 3rem + 4vw, 7rem);
  --gutter: clamp(1.25rem, 0.8rem + 2vw, 2.5rem);
  --container: 75rem;

  --r-btn: 10px;
  --r-artifact: 14px;
  --r-chip: 999px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-press: 140ms;
  --dur-swap: 200ms;
  --dur-ui: 240ms;
  --dur-log: 280ms;
  --dur-msg: 320ms;
  --dur-toast: 400ms;
  --dur-enter: 500ms;
  --dur-hero: 560ms;
  --gap-log: 450ms;
  --intent: 80ms;
  --loop-breathe: 2000ms;
  --loop-dot: 2400ms;
  --loop-caret: 1100ms;
  --loop-ticker: 60s;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[id] { scroll-margin-top: 1.5rem; }
main:focus { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s-4); top: var(--s-2); z-index: 10;
  padding: var(--s-2) var(--s-3); border-radius: var(--r-btn);
  background: var(--ink); color: var(--bg); text-decoration: none; font-size: var(--fs-small);
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

/* ---------- Layout ---------- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.section { padding-block: var(--section-y); border-top: 1px solid var(--line); }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s-8); }
.split-body { align-items: center; row-gap: var(--s-10); }

/* ---------- Type ---------- */
.h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--fs-h1);
  letter-spacing: -0.02em;
  line-height: 1.04;
  max-width: 16ch;
  font-variant-numeric: lining-nums;
}
.h1 em { font-style: italic; color: var(--ink); }
.h1-line { display: block; text-wrap: balance; }
.hero .h1 { max-width: 10em; }
.h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--fs-h2);
  letter-spacing: -0.015em;
  line-height: 1.1;
  max-width: 22ch;
  text-wrap: balance;
}
.h3 { font-size: var(--fs-h3); font-weight: 500; line-height: 1.4; letter-spacing: -0.005em; }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-2); max-width: 36rem; text-wrap: pretty; }

.eyebrow {
  display: flex; gap: 1.2em; align-items: baseline;
  font-family: var(--font-mono); font-size: var(--fs-eyebrow); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.4; color: var(--ink-2);
  font-variant-numeric: tabular-nums slashed-zero;
}
.eyebrow-num { color: var(--accent); }
.eyebrow-extra { margin-left: -0.75em; }
@media (max-width: 40rem) { .eyebrow-extra { display: none; } }

/* Section head rhythm: eyebrow 16 h2 20 lead 48 content */
.section-head .h2 { margin-top: var(--s-4); }
.section-head .lead { margin-top: var(--s-5); }
.section-body { margin-top: var(--s-12); }

.inline-link {
  color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em;
  text-decoration-thickness: 1px; text-decoration-color: color-mix(in oklab, var(--accent) 40%, transparent);
  transition: color var(--dur-swap) ease, text-decoration-color var(--dur-swap) ease;
}
@media (hover: hover) and (pointer: fine) {
  .inline-link:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
}

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 1.125rem;
  border: 1px solid transparent; border-radius: var(--r-btn);
  font-family: var(--font-sans); font-size: var(--fs-btn); font-weight: 500; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition:
    transform var(--dur-press) var(--ease-out),
    background-color var(--dur-swap) ease,
    border-color var(--dur-swap) ease,
    color var(--dur-swap) ease;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn--secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--sm { min-height: 38px; padding: 0 0.875rem; font-size: var(--fs-small); }
.btn svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.link {
  display: inline-flex; align-items: center; gap: 0.35em;
  color: var(--accent); font-weight: 500; font-size: var(--fs-btn);
  text-decoration: underline; text-decoration-color: transparent;
  text-underline-offset: 0.25em; text-decoration-thickness: 1px;
  transition: color var(--dur-swap) ease, text-decoration-color var(--dur-swap) ease;
}
.link-arrow { display: inline-block; transition: transform var(--dur-swap) var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--accent-hover); }
  .btn--secondary:hover { border-color: var(--ink-3); background: var(--bg-soft); }
  .link:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
  .link:hover .link-arrow { transform: translateX(3px); }
}

/* ---------- Status dot ---------- */
.pulse {
  position: relative; display: inline-block; flex: none;
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
}
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit;
  opacity: 0;
}
@keyframes breathe-dot {
  from { transform: scale(1); opacity: 0.5; }
  to { transform: scale(2.6); opacity: 0; }
}
@keyframes breathe-cell {
  from { transform: scale(1); opacity: 0.5; }
  to { transform: scale(1.8); opacity: 0; }
}

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header-inner { display: flex; align-items: center; gap: var(--s-6); min-height: 4.25rem; padding-block: var(--s-2); }
.brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; color: var(--ink); text-decoration: none; }
.brand-logo { display: block; flex: none; }
.brand-logo img { display: block; width: auto; height: 32px; }
.brand-sub {
  padding-left: 0.75rem; border-left: 1px solid var(--line-strong);
  font-size: 12px; line-height: 1.3; color: var(--ink-3); white-space: nowrap;
}
.nav { display: flex; gap: var(--s-6); margin-left: auto; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: var(--fs-btn);
  transition: color var(--dur-swap) ease;
}
.oncall {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--font-mono); font-size: var(--fs-eyebrow); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
}
.site-header .btn { flex: none; }
@media (hover: hover) and (pointer: fine) { .nav a:hover { color: var(--ink); } }
@media (max-width: 52rem) { .oncall { display: none; } }
@media (max-width: 46rem) {
  .nav { display: none; }
  .site-header .btn { margin-left: auto; }
  .brand-logo img { height: 28px; }
}
@media (max-width: 30rem) { .site-header .btn { display: none; } }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 1rem + 4.5vw, 5.5rem) clamp(3.5rem, 2rem + 4vw, 6rem); }
.hero-grid { align-items: center; row-gap: var(--s-10); }
.hero-copy { grid-column: 1 / span 7; }
.hero-art { grid-column: 8 / span 5; }
.hero-copy .h1 { margin-top: var(--s-5); }
.hero-copy .lead { margin-top: var(--s-6); }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-6); margin-top: var(--s-8); }
.hero-note { margin-top: var(--s-4); font-size: var(--fs-small); color: var(--ink-3); }
@media (max-width: 64rem) {
  .hero-copy, .hero-art { grid-column: 1 / -1; }
  .hero-art { max-width: 34rem; }
}

/* ---------- Reveal ---------- */
html.js .reveal { opacity: 0; transform: translateY(8px); }
html.js .reveal.is-in {
  opacity: 1; transform: none;
  transition:
    opacity var(--dur-enter) var(--ease-out),
    transform var(--dur-enter) var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
html.js .reveal--hero.is-in { transition-duration: var(--dur-hero); }
.h1-line + .h1-line { --delay: 80ms; }
.dl-1 { --delay: 60ms; }
.dl-2 { --delay: 120ms; }
.dl-3 { --delay: 180ms; }
.dl-4 { --delay: 240ms; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 0.45em;
  height: 20px; padding: 0 0.5rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-chip);
  font-family: var(--font-mono); font-size: var(--fs-chip); font-weight: 500; line-height: 1;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); flex: none; }
.chip--ok .chip-dot { background: var(--ok); }
.chip--warn .chip-dot { background: var(--warn); }
.chip--alert .chip-dot { background: var(--alert); }
.chip--accent .chip-dot { background: var(--accent); }
.chip--sev { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 45%, transparent); }

/* Status chip: stacked states crossfade in place, width never jumps */
.status { display: inline-grid; justify-items: end; }
.status > .chip {
  grid-area: 1 / 1;
  transition: opacity var(--dur-swap) ease, filter var(--dur-swap) ease;
}
.status > .chip:not(.is-current) { opacity: 0; filter: blur(2px); }

/* ---------- Artifact ---------- */
.artifact {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-artifact);
  box-shadow: var(--shadow-artifact);
  font-family: var(--font-mono);
  font-size: var(--fs-artifact);
  line-height: 1.6;
  font-variant-numeric: tabular-nums slashed-zero;
  color: var(--ink);
  overflow: hidden;
}
.artifact-head {
  display: flex; align-items: center; gap: 0.625rem;
  min-height: 2.75rem; padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-chip); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
}
.artifact-id { margin-left: auto; color: var(--ink-2); }
.artifact-meta {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: 0.875rem 1rem; border-bottom: 1px solid var(--line);
}
.artifact-title { font-family: var(--font-sans); font-size: var(--fs-btn); font-weight: 500; line-height: 1.35; }
.artifact-meta-right { display: flex; align-items: center; gap: var(--s-2); }
.artifact-body { padding: 0.25rem 1rem 0.75rem; }
.artifact-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  min-height: 3rem; padding: 0.5rem 0.5rem 0.5rem 1rem;
  border-top: 1px solid var(--line); background: var(--bg-soft); color: var(--ink-2);
}
.artifact-foot-text { transition: opacity var(--dur-msg) var(--ease-out); }

.replay {
  display: inline-flex; align-items: center; gap: 0.4em;
  min-height: 32px; padding: 0 0.625rem;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
  font-family: var(--font-mono); font-size: var(--fs-chip); font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform var(--dur-press) var(--ease-out), color var(--dur-swap) ease, border-color var(--dur-swap) ease;
}
.replay svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.replay:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .replay:hover { color: var(--ink); border-color: var(--ink-3); } }

/* ---------- Ticket ---------- */
.msg { position: relative; padding: 0.75rem 0; }
.msg + .msg, .msg + .msg-sys, .msg-sys + .msg { border-top: 1px solid var(--line); }
.msg-meta { display: flex; gap: 0.75rem; align-items: baseline; color: var(--ink-3); font-size: var(--fs-chip); letter-spacing: 0.02em; }
.msg-role { color: var(--ink-2); font-weight: 500; }
.msg--us .msg-role { color: var(--accent); }
.msg-body { margin-top: 0.25rem; font-family: var(--font-sans); font-size: var(--fs-btn); line-height: 1.5; color: var(--ink); }
.msg-sys {
  position: relative; display: flex; flex-wrap: wrap; gap: 0 0.9em;
  padding: 0.75rem 0; color: var(--ink-2);
}
.msg-sys time { color: var(--ok); }

.typing {
  position: absolute; left: 0; top: 0.75rem;
  display: flex; align-items: center; gap: 4px; height: 1.25rem;
  opacity: 0; transition: opacity var(--dur-swap) ease;
}
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); }
.is-typing > .typing { opacity: 1; }
.is-typing > .typing i { animation: typing-dot 480ms steps(1, end) infinite; }
.is-typing > .typing i:nth-child(2) { animation-delay: 160ms; }
.is-typing > .typing i:nth-child(3) { animation-delay: 320ms; }
@keyframes typing-dot {
  0% { opacity: 1; }
  33.333% { opacity: 0.3; }
}

/* Sequence states (JS only) */
.seq-step > :not(.typing) {
  transition: opacity var(--dur-msg) var(--ease-out), transform var(--dur-msg) var(--ease-out);
}
.is-seq .seq-step:not(.is-in) > :not(.typing) { opacity: 0; transform: translateY(6px); }
.is-seq .seq-step:not(.is-in):not(.is-typing), .is-seq .inc-row:not(.is-in) { border-top-color: transparent; }
.is-seq .artifact-foot-text:not(.is-in) { opacity: 0; }
.is-resetting, .is-resetting * { transition: none !important; }

/* ---------- Incident ---------- */
.inc-log { padding: 0.5rem 1rem 0.75rem; }
.inc-row {
  display: grid; grid-template-columns: 6px 5ch 9ch minmax(0, 1fr); column-gap: 0.875rem;
  align-items: baseline; padding: 0.5rem 0;
  transition: opacity var(--dur-log) var(--ease-out), transform var(--dur-log) var(--ease-out);
}
.inc-row + .inc-row { border-top: 1px solid var(--line); }
.inc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); align-self: center; }
.inc-row--alert .inc-dot { background: var(--alert); }
.inc-row--ok .inc-dot { background: var(--ok); }
.inc-time { color: var(--ink-3); }
.inc-code { color: var(--ink); font-weight: 500; letter-spacing: 0.04em; }
.inc-text { color: var(--ink-2); }
.is-seq .inc-row:not(.is-in) { opacity: 0; transform: translateY(6px); }
@media (max-width: 30rem) {
  .inc-row { grid-template-columns: 6px 5ch minmax(0, 1fr); }
  .inc-text { grid-column: 3; }
}

/* ---------- Systems band ---------- */
.band { border-block: 1px solid var(--line); background: var(--bg-soft); }

/* ---------- Two promises (under the systems band) ---------- */
.promises { padding-block: clamp(2.5rem, 1.8rem + 2.5vw, 4rem); }
.promise-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); }
@media (max-width: 52rem) { .promise-grid { grid-template-columns: 1fr; } }
.promise {
  position: relative; padding: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-artifact);
  box-shadow: var(--shadow-artifact);
}
.promise-icon {
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 10px;
  background: color-mix(in oklab, var(--accent) 12%, var(--surface)); color: var(--accent);
}
.promise-icon svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.promise-kicker { margin-top: var(--s-5); font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.promise-title { margin-top: var(--s-2); font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem); line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
.promise-body { margin-top: var(--s-3); color: var(--ink-2); line-height: 1.6; max-width: 34rem; }

.band-inner { display: flex; align-items: center; gap: var(--s-8); padding-block: 1.125rem; }
.band-label {
  flex: none; font-family: var(--font-mono); font-size: var(--fs-chip); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}
.ticker { flex: 1; min-width: 0; overflow: hidden; }
.ticker-track { display: flex; width: max-content; max-width: 100%; }
.ticker-list { display: flex; flex-wrap: wrap; row-gap: 0.25rem; }
.ticker-list li {
  font-family: var(--font-mono); font-size: var(--fs-artifact); letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
}
.ticker-list li::after { content: "\00B7" / ""; margin-inline: 0.9em; color: var(--ink-3); }
.ticker-list li:last-child::after { content: none; }

@media (prefers-reduced-motion: no-preference) {
  .ticker.is-running {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  }
  .ticker.is-running .ticker-track { max-width: none; animation: ticker var(--loop-ticker) linear infinite; }
  .ticker.is-running .ticker-list { flex-wrap: nowrap; flex: none; }
  .ticker.is-running .ticker-list li:last-child::after { content: "\00B7" / ""; }
  .ticker.is-running:hover .ticker-track,
  .ticker.is-running:focus-within .ticker-track { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-list[aria-hidden="true"] { display: none; }
}
@keyframes ticker { to { transform: translateX(-50%); } }
@media (max-width: 46rem) {
  .band-inner { flex-direction: column; align-items: stretch; gap: var(--s-3); }
}

/* ---------- Why band ---------- */
.why-grid { align-items: start; row-gap: var(--s-6); }
.why-head { grid-column: 1 / span 6; }
.why-head .h2 { margin-top: var(--s-4); }
.why-body { grid-column: 7 / span 6; margin-top: calc(var(--s-4) + 1.1rem); color: var(--ink-2); font-size: var(--fs-lead); line-height: 1.55; text-wrap: pretty; }
.why .facts { margin-top: clamp(3rem, 2rem + 4vw, 5.5rem); }
@media (max-width: 64rem) { .why-head, .why-body { grid-column: 1 / -1; } .why-body { max-width: 36rem; margin-top: 0; } }

/* ---------- Minnesota ---------- */
.mn-grid { align-items: center; row-gap: var(--s-8); }
.mn-copy { grid-column: 1 / span 7; }
.mn-list { margin-top: var(--s-6); max-width: 36rem; }
.mn-art { grid-column: 9 / span 4; justify-self: center; }
.mn-art img { display: block; width: auto; height: clamp(220px, 18vw, 280px); opacity: 0.42; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mn-art img { opacity: 0.5; } }
:root[data-theme="dark"] .mn-art img { opacity: 0.5; }
@media (max-width: 52rem) {
  .mn-copy { grid-column: 1 / -1; }
  .mn-art { display: none; }
}

/* ---------- Facts row ---------- */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--s-8); row-gap: var(--s-8); }
.fact { padding-top: var(--s-5); border-top: 1px solid var(--line-strong); }
.fact-fig {
  font-family: var(--font-serif); font-weight: 300; font-size: var(--fs-fact);
  letter-spacing: -0.02em; line-height: 1; font-variant-numeric: lining-nums tabular-nums;
}
.fact-label { margin-top: var(--s-3); font-size: var(--fs-small); line-height: 1.5; color: var(--ink-2); max-width: 22ch; }
@media (max-width: 52rem) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-6); } }

/* ---------- 24/7 ---------- */
.two47-mark {
  font-family: var(--font-serif); font-weight: 300; font-size: var(--fs-two47);
  letter-spacing: -0.02em; line-height: 0.9;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
.two47-glyphs { display: inline-flex; align-items: baseline; }
.two47-slash {
  display: inline-block; width: 0.36em; height: 0.68em;
  margin-inline: 0.02em 0.04em; overflow: visible;
}
.two47-slash line { stroke: var(--accent); stroke-width: 1.5; }
.two47-caption {
  margin-top: var(--s-5);
  font-family: var(--font-mono); font-size: var(--fs-eyebrow); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
  font-variant-numeric: tabular-nums slashed-zero;
}

/* ---------- Week grid ---------- */
.weekgrid {
  --wg-cell: 12px;
  --wg-gap: 3px;
  --wg-label: 2.25rem;
  --wg-cols: var(--wg-label) repeat(24, var(--wg-cell));
  display: inline-block; max-width: 100%;
  padding: 1.25rem 1.25rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-artifact);
  box-shadow: var(--shadow-artifact);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums slashed-zero;
}
.wg-ticks, .wg-row { display: grid; grid-template-columns: var(--wg-cols); column-gap: var(--wg-gap); align-items: center; }
.wg-ticks { margin-bottom: 0.5rem; font-size: 11px; line-height: 1; color: var(--ink-3); }
.wg-tick { grid-column-end: span 6; }
.wg-tick:first-child { grid-column-start: 2; }
.wg-rows { display: grid; row-gap: var(--wg-gap); }
.wg-day { font-size: 11px; line-height: 1; color: var(--ink-3); }
.wg-day.is-today { color: var(--ink); }
.wg-cell {
  position: relative; display: block;
  height: var(--wg-cell); border-radius: 3px; background: var(--cell);
}
.wg-cell.is-now { background: var(--ok); }
.wg-cell.is-now::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  border-radius: inherit; background: var(--ok); opacity: 0; pointer-events: none;
}
.wg-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem;
  margin-top: 1rem; padding-top: 0.875rem; border-top: 1px solid var(--line);
  font-size: 12px; line-height: 1.4; color: var(--ink-2);
}
.wg-legend { display: inline-flex; align-items: center; gap: 0.5em; }
.wg-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--cell); }
.wg-covered { color: var(--ok); }

html.js .weekgrid .wg-cell { transition: opacity 320ms var(--ease-out); transition-delay: calc(var(--c, 0) * 12ms); }
html.js .weekgrid:not(.is-in) .wg-cell { opacity: 0; }

@media (min-width: 80rem) { .weekgrid { --wg-cell: 14px; } }
@media (max-width: 30rem) {
  .weekgrid { --wg-cell: 9px; --wg-gap: 3px; --wg-label: 1.75rem; display: block; padding: 1rem 0.875rem 0.875rem; }
  .wg-cell { border-radius: 2.5px; }
  .wg-day, .wg-ticks { font-size: 10px; }
}

/* ---------- Section layouts ---------- */
.always-figure { grid-column: 1 / span 5; }
.always-grid { grid-column: 6 / span 7; justify-self: end; }
.incident-copy { grid-column: 1 / span 5; }
.incident-art { grid-column: 7 / span 6; }
.split-copy { grid-column: 1 / span 5; }
.split-art { grid-column: 7 / span 6; }
@media (max-width: 64rem) {
  .always-figure, .always-grid, .incident-copy, .incident-art, .split-copy, .split-art { grid-column: 1 / -1; justify-self: stretch; }
  .always-grid .weekgrid { display: block; width: max-content; max-width: 100%; }
  .incident-art, .split-art { max-width: 36rem; }
}

.points { display: grid; gap: var(--s-5); margin-top: var(--s-8); }
.point { display: grid; grid-template-columns: 9ch minmax(0, 1fr); gap: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.point-label {
  font-family: var(--font-mono); font-size: var(--fs-eyebrow); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); padding-top: 0.2em;
}
.point-text { color: var(--ink-2); }

/* ---------- Bullets (services) ---------- */
.bullets { display: grid; gap: 0.625rem; }
.bullets li { position: relative; padding-left: 1.125rem; color: var(--ink-2); line-height: 1.5; }
.bullets li::before {
  content: ""; position: absolute; left: 0.125rem; top: 0.62em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3);
}

/* ---------- Receipt (services) ---------- */
.receipt { max-width: 30rem; }
.receipt-head {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.5rem 0.875rem; border-bottom: 1px solid var(--line);
  font-size: var(--fs-chip); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}
.receipt-line { display: flex; gap: 0.625rem; align-items: baseline; padding: 0.75rem 0.875rem; color: var(--ink-2); }
.receipt-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); transform: translateY(-1px); }
.receipt-k { color: var(--ink); font-weight: 500; }

/* ---------- Services ---------- */
.svc { margin-top: var(--s-12); }

/* Accordion: the default everywhere, and the layout below 60rem */
.acc details { border-top: 1px solid var(--line); }
.acc details:last-of-type { border-bottom: 1px solid var(--line); }
.acc summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  min-height: 64px; padding-block: 1rem;
  list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-press) var(--ease-out);
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary:active { transform: scale(0.99); }
.acc summary:focus-visible { outline-offset: 2px; }
.chev { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--ink-3); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-ui) var(--ease-out); }
.acc details[open] .chev { transform: rotate(180deg); }
.js .acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-ui) var(--ease-out); }
.js .acc-inner { min-height: 0; overflow: hidden; opacity: 0; transition: opacity var(--dur-ui) var(--ease-out); }
.js .acc details[data-state="open"] .acc-body { grid-template-rows: 1fr; }
.js .acc details[data-state="open"] .acc-inner { opacity: 1; }
.js .acc details .chev { transform: none; }
.js .acc details[data-state="open"] .chev { transform: rotate(180deg); }

.svc-acc-sum { display: grid; gap: 0.2rem; }
.svc-acc-name { font-size: 1.125rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.35; }
.svc-acc-line { font-size: var(--fs-small); color: var(--ink-2); line-height: 1.5; }
.svc-acc-content { display: grid; gap: var(--s-5); padding: 0.25rem 0 1.5rem; }

/* Tabs: desktop, built up by main.js */
.svc-tabs { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-12); align-items: start; }
.svc.is-enhanced .svc-acc { display: none; }
.svc-list-wrap { position: relative; }
.svc-hl {
  position: absolute; top: 0; left: 0; right: 0; height: 3.5rem;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-artifact);
  transition: transform var(--dur-ui) var(--ease-in-out), height var(--dur-ui) var(--ease-in-out);
}
.svc.is-placing .svc-hl, .svc.is-placing .svc-desc, .svc.is-placing .svc-desc-in { transition: none; }
.svc-list { position: relative; display: grid; }
.svc-tab {
  position: relative; display: block; width: 100%;
  padding: 1rem 1.125rem; border: 0; border-radius: 12px; background: none;
  text-align: left; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-press) var(--ease-out);
}
.svc-tab:active { transform: scale(0.99); }
.svc-tab:focus-visible { outline-offset: -2px; border-radius: 12px; }
.svc-name { display: block; font-size: 1.125rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.5rem; color: var(--ink-3); transition: color var(--dur-swap) ease; }
.svc-tab[aria-selected="true"] .svc-name { color: var(--ink); }
.svc-desc { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-ui) var(--ease-in-out); }
.svc-desc-in {
  min-height: 0; overflow: hidden; opacity: 0;
  font-size: var(--fs-small); line-height: 1.5; color: var(--ink-2);
  transition: opacity var(--dur-ui) var(--ease-out);
}
.svc-desc-in > span { display: block; padding-top: 0.25rem; }
.svc-tab[aria-selected="true"] .svc-desc { grid-template-rows: 1fr; }
.svc-tab[aria-selected="true"] .svc-desc-in { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .svc-tab:hover .svc-name { color: var(--ink-2); }
  .svc-tab[aria-selected="true"]:hover .svc-name { color: var(--ink); }
}

.svc-panels { display: grid; padding-top: 0.75rem; }
/* Outgoing panel leaves fast; the new one arrives a little slower, so the two never read as doubled text */
.svc-panel {
  grid-area: 1 / 1; display: grid; gap: var(--s-6); align-content: start;
  opacity: 0; transform: translateY(-4px); filter: blur(2px); pointer-events: none;
  transition:
    opacity var(--dur-press) var(--ease-out),
    transform var(--dur-press) var(--ease-out),
    filter var(--dur-press) var(--ease-out);
}
.svc-panel.is-active {
  opacity: 1; transform: none; filter: none; pointer-events: auto;
  transition-duration: var(--dur-ui);
  transition-delay: 70ms;
}
.svc.is-instant .svc-panel { transition: none; }
.svc-panel:focus-visible { outline-offset: 8px; border-radius: 12px; }
.svc-panel-title { font-family: var(--font-serif); font-size: 2rem; font-weight: 400; letter-spacing: -0.015em; line-height: 1.15; }
.svc-panel .bullets { font-size: var(--fs-body); }

/* ---------- Checklist (switching) ---------- */
.steps { display: grid; gap: var(--s-6); margin-top: var(--s-8); }
.step { display: grid; grid-template-columns: 3ch minmax(0, 1fr); gap: var(--s-4); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.step-n { font-family: var(--font-mono); font-size: var(--fs-eyebrow); font-weight: 500; letter-spacing: 0.08em; color: var(--accent); padding-top: 0.3em; font-variant-numeric: tabular-nums slashed-zero; }
.step-text { margin-top: 0.25rem; color: var(--ink-2); }

.chk-list { padding: 0.375rem 1rem 0.5rem; }
.chk-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 0.75rem; align-items: center; padding: 0.625rem 0; color: var(--ink); }
.chk-row + .chk-row { border-top: 1px solid var(--line); }
.chk-box { width: 18px; height: 18px; display: block; overflow: visible; }
.chk-box rect { fill: color-mix(in oklab, var(--ok) 12%, var(--surface)); stroke: color-mix(in oklab, var(--ok) 55%, transparent); stroke-width: 1; transition: fill var(--dur-ui) ease, stroke var(--dur-ui) ease; }
.chk-box path {
  fill: none; stroke: var(--ok); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 0;
  transition: stroke-dashoffset var(--dur-ui) var(--ease-out);
}
.chk-text { transition: color var(--dur-ui) ease; }
.is-seq .chk-row:not(.is-in) .chk-box path { stroke-dashoffset: 1; }
.is-seq .chk-row:not(.is-in) .chk-box rect { fill: transparent; stroke: var(--line-strong); }
.is-seq .chk-row:not(.is-in) .chk-text { color: var(--ink-2); }

/* ---------- Report (monthly) ---------- */
.rep-list { padding: 0.375rem 1rem 0.5rem; }
.rep-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); padding: 0.625rem 0; }
.rep-row + .rep-row { border-top: 1px solid var(--line); }
.rep-ok { color: var(--ok); font-weight: 500; }
.rep-next { padding: 0.875rem 1rem 1rem; border-top: 1px solid var(--line); background: var(--bg-soft); }
.rep-next-label { font-size: var(--fs-chip); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.rep-next-text { margin-top: 0.25rem; font-family: var(--font-sans); font-size: var(--fs-btn); line-height: 1.5; color: var(--ink); }
.section--compact { padding-block: clamp(3.5rem, 2.5rem + 3vw, 5.5rem); }

/* ---------- FAQ ---------- */
.faq-wrap { max-width: 44rem; }
.faq { margin-top: var(--s-10); }
.faq summary { font-size: 1.125rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.4; }
.faq-inner p { padding-bottom: 1.4rem; color: var(--ink-2); max-width: 40rem; }
.faq-note { margin-top: var(--s-8); color: var(--ink-2); }

/* ---------- Contact ---------- */
.contact-copy { grid-column: 1 / span 5; }
.contact-art { grid-column: 7 / span 6; }
@media (max-width: 64rem) {
  .contact-copy, .contact-art { grid-column: 1 / -1; }
  .contact-art { max-width: 36rem; margin-top: var(--s-8); }
}
.compose-field {
  display: grid; grid-template-columns: 8ch minmax(0, 1fr); gap: var(--s-3); align-items: baseline;
  padding: 0.625rem 1rem; border-bottom: 1px solid var(--line);
}
.compose-label { color: var(--ink-3); }
.compose-val { color: var(--ink); overflow-wrap: anywhere; }
.compose-body { padding: 0.875rem 1rem 1.25rem; font-family: var(--font-sans); font-size: var(--fs-btn); line-height: 1.6; }
.compose-body p + p { margin-top: 0.125rem; }
.compose-greet { margin-bottom: 0.625rem; }
.compose-prompt { color: var(--ink-2); }
.caret {
  display: inline-block; width: 1px; height: 1.1em; margin-left: 2px;
  background: var(--accent); vertical-align: text-bottom;
}
@keyframes caret-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---------- Toasts (after Sonner): enter from the bottom, stack, leave the same way ---------- */
.toaster {
  position: fixed; z-index: 200;
  left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  width: min(22rem, calc(100% - 2rem)); height: 0;
  margin: 0; padding: 0;
  transform: translateX(-50%);
  pointer-events: none;
}
@media (min-width: 48rem) {
  .toaster { left: auto; right: calc(var(--gutter) + 0.5rem); transform: none; }
}
.toast {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.85rem 1rem;
  border-radius: 12px; background: var(--ink); color: var(--bg);
  box-shadow: var(--shadow-toast);
  font-size: var(--fs-small); line-height: 1.4;
  transform-origin: bottom center;
  transform: translateY(calc(var(--index, 0) * -12px)) scale(calc(1 - var(--index, 0) * 0.05));
  opacity: 1;
  transition: transform var(--dur-toast) ease, opacity var(--dur-toast) ease;
}
.toast[data-mounted="false"] { transform: translateY(100%); opacity: 0; }
.toast[data-hidden="true"] { opacity: 0; }
/* Exit is faster than the entrance, along the same path */
.toast[data-removed="true"] { transform: translateY(100%); opacity: 0; transition-duration: var(--dur-ui); }
.toast svg { flex: none; width: 18px; height: 18px; }
.toast-icon-bg { fill: var(--ok); }
.toast-icon-check { fill: none; stroke: var(--bg); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.toast-title { font-weight: 600; }
.toast-desc { opacity: 0.72; font-family: var(--font-mono); font-size: var(--fs-artifact); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: var(--s-16) calc(var(--s-8) + env(safe-area-inset-bottom, 0px)); color: var(--ink-2); font-size: var(--fs-small); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-10) var(--s-12); align-items: start; }
.footer-logo { display: inline-block; }
.footer-logo img { display: block; width: auto; height: 72px; }
.footer-about { display: grid; gap: var(--s-2); margin-top: var(--s-6); max-width: 34rem; }
.footer-links { display: grid; gap: var(--s-1); justify-items: end; }
.footer-links a, .footer-about a {
  color: var(--ink); text-decoration: underline; text-underline-offset: 0.25em;
  text-decoration-color: var(--line-strong); text-decoration-thickness: 1px;
  transition: text-decoration-color var(--dur-swap) ease;
}
.footer-links a { display: inline-flex; align-items: center; min-height: 36px; }
@media (hover: hover) and (pointer: fine) {
  .footer-links a:hover, .footer-about a:hover { text-decoration-color: currentColor; }
}
.footer-small {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-3) var(--s-8);
  margin-top: var(--s-12); padding-top: var(--s-6); border-top: 1px solid var(--line); color: var(--ink-3);
}
.footer-small-text { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-8); }
@media (max-width: 46rem) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-links { justify-items: start; }
}

/* ---------- 404 ---------- */
.lost { min-height: calc(100dvh - 4.25rem - 1px); display: grid; align-items: center; padding-block: var(--s-16); }
.lost-mark { display: block; }
.lost-mark img { display: block; width: auto; height: 56px; }
.lost .eyebrow { margin-top: var(--s-8); }
.lost .h1 { margin-top: var(--s-4); max-width: 14em; }
.lost .lead { margin-top: var(--s-5); }
.lost .hero-ctas { margin-top: var(--s-8); }

/* ---------- Loops: run only while visible ---------- */
@media (prefers-reduced-motion: no-preference) {
  .pulse::after { animation: breathe-dot var(--loop-dot) var(--ease-out) infinite; }
  .wg-cell.is-now::after { animation: breathe-cell var(--loop-breathe) var(--ease-out) infinite; }
  .caret { animation: caret-blink var(--loop-caret) steps(1, end) infinite; }
}
.is-paused, .is-paused *, .is-paused::after, .is-paused *::after,
html.is-hidden *, html.is-hidden *::before, html.is-hidden *::after {
  animation-play-state: paused !important;
}

/* ---------- Reduced motion: keep fades, drop movement ---------- */
@media (prefers-reduced-motion: reduce) {
  html.js .reveal, html.js .reveal.is-in { transform: none; }
  html.js .reveal.is-in { transition: opacity 200ms ease; transition-delay: 0ms; }
  .is-seq .seq-step:not(.is-in) > :not(.typing),
  .is-seq .inc-row:not(.is-in) { transform: none; }
  .is-typing > .typing i { animation: none; }
  html.js .weekgrid .wg-cell { transition-delay: 0ms; }
  .btn:active, .replay:active, .acc summary:active, .svc-tab:active { transform: none; }
  .link:hover .link-arrow { transform: none; }
  .svc-hl { transition-property: opacity; }
  .svc-panel, .svc-panel.is-active { transform: none; filter: none; }
  .chk-box path { transition: none; }
  .js .acc-body, .chev { transition: none; }
  .toast, .toast[data-mounted="false"], .toast[data-removed="true"] { transform: none; }
}

/* ---------- More contrast ---------- */
@media (prefers-contrast: more) {
  :root { --ink-2: var(--ink); --ink-3: var(--ink); --line: var(--line-strong); }
  .btn--secondary { border-color: var(--ink-2); }
}

/* ---------- Print ---------- */
@media print {
  .site-header .btn, .oncall, .replay, .toaster, .skip-link { display: none !important; }
  html.js .reveal { opacity: 1; transform: none; }
}

/* ---------- Theme switch ---------- */
:root .th-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .th-light { display: none; }
  :root:not([data-theme="light"]) .th-dark { display: block; }
}
:root[data-theme="dark"] .th-light { display: none; }
:root[data-theme="dark"] .th-dark { display: block; }
.theme-toggle {
  display: inline-grid; place-items: center; flex: none;
  width: 2.25rem; height: 2.25rem; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: color var(--dur-hover, 160ms) ease, transform var(--dur-press, 140ms) var(--ease-out);
}
.theme-toggle:active { transform: scale(0.97); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .theme-toggle:hover { color: var(--ink); } }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
