/* Base: design tokens, reset, shared utilities, phase visibility, topbar + dock, footer. */
/* Layout breakpoints are in em (16px = 1em) so a larger default text size switches to the roomier layouts. */

:root {
  --bg: #1b1f27; --bg-2: #20252f; --surface: #262c37; --surface-2: #2e3542;
  --line: rgba(255,255,255,.09); --line-strong: rgba(255,255,255,.16);
  --text: #f4f3ee; --text-dim: #d3d7de; --muted: #9aa3b2;
  --accent: #ffe52e; --accent-ink: #1b1f27; --accent-soft: rgba(255,229,46,.12);   /* Guillaume's yellow (CV + previous site) */
  --claude: #d97757; --claude-soft: rgba(217,119,87,.16);                            /* Claude coral: spark, send button, spinner */
  --ok: #7fd48b;
  --term-bg: #15181e; --term-bar: #1d2129; --term-line: #333a47; --term-text: #e9e7e1; --term-dim: #8a919d;
  --font-sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, "Cascadia Code", "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease-out: cubic-bezier(.165,.84,.44,1); --ease-in-out: cubic-bezier(.645,.045,.355,1); --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --gutter: clamp(1.25rem, 5vw, 6rem); --maxw: 1200px;
  --radius-sm: 8px; --radius: 14px; --radius-lg: 22px;
  --topbar-h: 64px;
  --z-topbar: 40; --z-intro: 100;
  color-scheme: dark;

  /* Fluid type scale (360px -> 1440px). */
  --step--2: clamp(.72rem, .7rem + .09vw, .78rem);
  --step--1: clamp(.84rem, .8rem + .17vw, .95rem);
  --step-0: clamp(1rem, .96rem + .19vw, 1.13rem);
  --step-1: clamp(1.15rem, 1.06rem + .4vw, 1.42rem);
  --step-2: clamp(1.35rem, 1.18rem + .74vw, 1.85rem);
  --step-3: clamp(1.62rem, 1.33rem + 1.3vw, 2.5rem);
  --step-4: clamp(1.95rem, 1.45rem + 2.2vw, 3.45rem);
  --step-5: clamp(2.35rem, 1.5rem + 3.75vw, 4.9rem);
  --step-6: clamp(2.8rem, 1.45rem + 6vw, 6.9rem);
  /* Content edge shared by the topbar and the footer (resolved against their own width). */
  --page-inline: max(var(--gutter), (100% - var(--maxw)) / 2);
}

/* ---------- Reset (zero specificity so every module can override it) ---------- */

*, *::before, *::after { box-sizing: border-box; }

:where(html) {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  scroll-padding-top: calc(var(--topbar-h) + 1rem);
  scrollbar-color: #3d4452 var(--bg);
}

:where(body) {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-0)/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

:where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol, pre) { margin: 0; }
:where(h1, h2, h3, h4, h5, h6) { font-weight: 600; line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; }
:where(p, li, dd, blockquote) { text-wrap: pretty; }
:where(ul, ol)[class] { padding: 0; list-style: none; }
:where(a) { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
:where(button, input, select, textarea) { font: inherit; color: inherit; letter-spacing: inherit; }
:where(button) { padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:where(button:disabled) { cursor: default; }
:where(img, picture, video, canvas) { display: block; max-width: 100%; height: auto; }
:where(strong, b) { font-weight: 650; }
:where(em) { font-style: italic; }
:where(code, kbd, samp, pre) { font-family: var(--font-mono); font-size: .92em; }
:where(details > summary) { cursor: pointer; }
:where(details > summary::-webkit-details-marker) { display: none; }
:where(table) { border-collapse: collapse; }
[hidden]:not([hidden="until-found"]) { display: none !important; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
/* Headings, sections and <main> only receive focus programmatically (after the intro, skip link). */
:is(h1, h2, h3, main, section)[tabindex="-1"]:focus { outline: none; }

/* ---------- Shared utilities ---------- */

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.mono {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; color: var(--accent); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.container { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 48px;
  padding: .7rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font: 600 .95rem/1.15 var(--font-sans);
  letter-spacing: -.005em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .2s var(--ease-out), background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn > [aria-hidden="true"] { transition: transform .25s var(--ease-out); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 28px -14px rgba(255,229,46,.7); }
.btn-ghost { border-color: var(--line-strong); background: rgba(255,255,255,.02); color: var(--text); }
.btn-sm { min-height: 40px; padding: .45rem 1rem; border-radius: 10px; font-size: .86rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: default; transform: none; }
@media (max-width: 23.74em) {
  .btn { white-space: normal; }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  max-width: 100%;
  padding: .32rem .62rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(255,255,255,.025);
  color: var(--text-dim);
  font: 500 .76rem/1.35 var(--font-mono);
  letter-spacing: .01em;
}
.chip-dot::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--agent, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--agent, var(--accent)) 18%, transparent);
}
.chip-accent { border-color: rgba(255,229,46,.35); background: var(--accent-soft); color: var(--text); }

@media (hover: hover) {
  .btn-primary:hover { background: #fff07a; box-shadow: 0 14px 34px -14px rgba(255,229,46,.85); }
  .btn-ghost:hover { border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.06); }
  .btn:hover > [aria-hidden="true"]:last-child { transform: translateX(2px); }
}

/* ---------- Page chrome: skip link, reading progress ---------- */

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: calc(var(--z-intro) + 10);
  padding: .7rem 1.1rem;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
  transform: translateY(calc(-100% - 1.5rem));
  transition: transform .25s var(--ease-out);
}
.skip-link:focus, .skip-link:focus-visible { transform: none; outline-color: var(--text); }

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: calc(var(--z-topbar) + 1);
  height: 2px;
  pointer-events: none;
  transition: opacity .4s ease;
}
.reading-progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(255,229,46,.55);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- Phases (set on <html data-phase>) ---------- */

/* Scroll lock while the intro covers the page. */
html.is-locked, html.is-locked body { overflow: hidden; }

/* The intro overlay (internals are styled by intro.css / agents.css). */
.intro { position: fixed; inset: 0; z-index: var(--z-intro); }

/* Until main.js decides, nothing of the report may flash. */
html.js[data-phase="boot"], html.js[data-phase="boot"] body { background: var(--bg); }
html.js[data-phase="boot"] :is(#topbar, #report, #footer, .skip-link, .reading-progress) { visibility: hidden; }

/* A slow connection: a quiet spinner, only if the decision takes more than a moment. */
@media (prefers-reduced-motion: no-preference) {
  html.js[data-phase="boot"] body::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 2px solid var(--line-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: boot-fade .4s ease .8s forwards, boot-spin .9s linear infinite;
  }
}
@keyframes boot-fade { to { opacity: 1; } }
@keyframes boot-spin { to { transform: rotate(1turn); } }

/* The report chrome only makes sense once the report is on stage. */
html.js:not([data-phase="report"]) .reading-progress { opacity: 0; }

/* Without JS: no intro, the report is the page, JS-only controls disappear. */
.no-js .intro, .no-js [data-action], .no-js #motion-toggle { display: none !important; }
/* The intro modules failed to load: nothing to replay. */
.no-intro [data-action="replay"] { display: none !important; }
/* main.js never booted (see the inline script in index.html): its controls would do nothing. */
.js-broken :is([data-action], #motion-toggle) { display: none !important; }

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "logo dock actions";
  align-items: center;
  column-gap: 1rem;
  height: var(--topbar-h);
  padding-inline: max(var(--page-inline), env(safe-area-inset-left)) max(var(--page-inline), env(safe-area-inset-right));
  isolation: isolate;
  container: topbar / inline-size;
}

/* Opaque + blurred surface, faded in after the first scroll (opacity only). */
.topbar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-bottom: 1px solid var(--line);
  background: rgba(27,31,39,.8);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  backdrop-filter: saturate(150%) blur(16px);
  box-shadow: 0 10px 30px -18px rgba(0,0,0,.65);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.topbar.is-scrolled::before { opacity: 1; }

.logo {
  grid-area: logo;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 .35rem 0 .1rem;
  margin-left: -.1rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font: 750 1.72rem/1 var(--font-sans);
  letter-spacing: -.11em;
}
.logo > span { color: var(--accent); }

/* The dock: one small robot per agent; the label is a tooltip but stays the link's accessible name. */
.dock {
  grid-area: dock;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(38,44,55,.62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.dock-item {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.dock-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255,255,255,.07);
  opacity: 0;
  transition: opacity .2s ease;
}
.dock-item::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 14px;
  height: 2px;
  margin-left: -7px;
  border-radius: 2px;
  background: var(--agent, var(--accent));
  box-shadow: 0 0 10px var(--agent, var(--accent));
  transform: scaleX(0);
  transition: transform .3s var(--ease-out);
}
/* No opacity transition: when the flying robots land, the dock ones must appear in the same frame. */
.dock-robot {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 34px;
  transition: transform .3s var(--ease-spring);
}
.dock-robot > svg { display: block; width: 100%; height: 100%; overflow: visible; }

.dock-item.is-active::before { opacity: 1; }
.dock-item.is-active::after { transform: scaleX(1); }
.dock-item.is-active .dock-robot { transform: translateY(-2px); }
.dock.is-awaiting .dock-robot { opacity: 0; transition: none; }

.dock-label {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .42rem .62rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.6);
  font: 600 .68rem/1 var(--font-mono);
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: opacity .16s ease, transform .2s var(--ease-out);
  pointer-events: none;
}
.dock-label::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--agent, var(--accent));
}
.dock-item:focus-visible .dock-label { opacity: 1; transform: translate(-50%, 0); }
.dock-item:focus-visible .dock-robot { transform: translateY(-2px) scale(1.08); }

@media (hover: hover) {
  .dock-item:hover::before { opacity: 1; }
  .dock-item:hover .dock-robot { transform: translateY(-2px) scale(1.08); }
  .dock-item:hover .dock-label { opacity: 1; transform: translate(-50%, 0); }
}

/* Actions: language, replay, contact. */
.topbar-actions {
  grid-area: actions;
  justify-self: end;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}

.lang-switch,
.replay-btn,
.topbar-contact {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s var(--ease-out);
}
.lang-switch:active, .replay-btn:active, .topbar-contact:active { transform: scale(.96); }

.lang-switch {
  width: 40px;
  color: var(--text);
  font: 700 .72rem/1 var(--font-mono);
  letter-spacing: .06em;
}

.replay-btn {
  gap: .45rem;
  padding: 0 .95rem 0 .8rem;
  color: var(--text-dim);
  font-size: .86rem;
  font-weight: 500;
}
.replay-icon { display: grid; place-items: center; width: 16px; height: 16px; color: var(--accent); }
.replay-icon > svg { display: block; width: 16px; height: 16px; }

.topbar-contact {
  padding: 0 1.05rem;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .86rem;
  font-weight: 650;
}

@media (hover: hover) {
  .lang-switch:hover, .replay-btn:hover { border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.06); color: var(--text); }
  .replay-btn:hover .replay-icon { transform: rotate(-40deg); }
  .topbar-contact:hover { border-color: #fff07a; background: #fff07a; }
}
.replay-icon { transition: transform .4s var(--ease-out); }

/* Below a 1080px viewport the replay button keeps only its icon (its label stays the accessible name).
   A container query in rem (60.74rem = the topbar's content box at 1080px), so that larger text also drops the label. */
@container topbar (max-width: 60.74rem) {
  .replay-btn { width: 40px; padding: 0; }
  .replay-btn .label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Tablets: the side columns can no longer mirror each other, so the dock centres in the space left. */
@media (min-width: 45em) and (max-width: 56.24em) {
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
}

/* Narrow screens: two rows, the dock gets the full width so all seven agents stay visible. */
@media (max-width: 44.99em) {
  :root { --topbar-h: 104px; }
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: 52px 52px;
    grid-template-areas: "logo actions" "dock dock";
    column-gap: .75rem;
    padding-inline: max(.75rem, env(safe-area-inset-left)) max(.75rem, env(safe-area-inset-right));
  }
  .logo { padding-left: .25rem; font-size: 1.6rem; }
  .dock {
    align-self: start;
    justify-self: stretch;
    justify-content: space-between;
    gap: 0;
    padding: 2px;
    border-radius: 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .dock::-webkit-scrollbar { display: none; }
  .dock-item { flex: 1 0 40px; width: auto; height: 44px; border-radius: 11px; }
  .dock-item:focus-visible { outline-offset: -3px; } /* the scrollable dock would clip an outer ring */
  .dock-item::after { bottom: 2px; }
  .dock-robot { width: 28px; height: 32px; }
  .dock-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    border: 0;
    opacity: 0;
  }
  .topbar-actions { gap: .4rem; }
  .lang-switch, .replay-btn, .topbar-contact { height: 42px; }
  .lang-switch, .replay-btn { width: 42px; }
  .topbar-contact { padding: 0 1rem; }
}

@media (max-width: 21.24em) {
  .topbar-actions { gap: .3rem; }
  .topbar-contact { padding: 0 .8rem; font-size: .82rem; }
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  padding-block: 2.25rem calc(2.25rem + env(safe-area-inset-bottom));
  padding-inline: max(var(--page-inline), env(safe-area-inset-left)) max(var(--page-inline), env(safe-area-inset-right));
  border-top: 1px solid var(--line);
  background: var(--bg);
  color: var(--text-dim);
  container: footer / inline-size;
}

.footer-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem 2.5rem;
}

.footer-brand { display: flex; align-items: center; gap: .9rem; white-space: nowrap; }
.footer-mark { color: var(--text); font: 750 1.45rem/1 var(--font-sans); letter-spacing: -.11em; padding-right: .2em; }
.footer-mark > span { color: var(--accent); }
.footer-rights { color: var(--muted); font: 500 .72rem/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }

.footer-disclaimer {
  justify-self: center;
  max-width: 34rem;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.55;
  text-align: center;
}
.footer-spark { color: var(--claude); margin-right: .15rem; }

.footer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 1.25rem; }

.motion-toggle,
.back-top {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-height: 44px;
  padding: 0 .2rem;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: .84rem;
  white-space: nowrap;
  transition: color .2s ease;
}

.motion-switch {
  position: relative;
  flex: none;
  width: 34px;
  height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  transition: background-color .2s ease, border-color .2s ease;
}
.motion-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .25s var(--ease-out), background-color .2s ease;
}
.motion-toggle[aria-pressed="true"] .motion-switch { border-color: var(--accent); background: var(--accent); }
.motion-toggle[aria-pressed="true"] .motion-switch::after { background: var(--accent-ink); transform: translateX(14px); }
.motion-toggle:disabled { cursor: default; opacity: .75; }

.back-top-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
  transition: transform .25s var(--ease-out), border-color .2s ease;
}

@media (hover: hover) {
  .motion-toggle:not(:disabled):hover, .back-top:hover { color: var(--text); }
  .back-top:hover .back-top-icon { border-color: var(--accent); transform: translateY(-2px); }
}

/* Container queries in rem: the footer follows its content box (62rem ≈ a 1100px viewport, 33.74rem ≈ 600px)
   and the text size, so larger text gets the narrower layouts instead of overflowing. */
@container footer (max-width: 62rem) {
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .footer-disclaimer { grid-column: 1 / -1; grid-row: 2; justify-self: start; text-align: left; }
  .footer-actions { flex-wrap: wrap; justify-content: flex-start; gap: .5rem 1.25rem; }
  .motion-toggle .motion-label { white-space: normal; }
}

/* Phones: brand + back-to-top arrow, the disclaimer, then the motion switch under a hairline. */
@media (max-width: 37.49em) {
  .site-footer { padding-block: 1.5rem calc(1.25rem + env(safe-area-inset-bottom)); }
}
@container footer (max-width: 33.74rem) {
  .footer-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand back" "disclaimer disclaimer" "motion motion";
    gap: .9rem 1rem;
  }
  .footer-brand { grid-area: brand; min-width: 0; }
  .footer-disclaimer { grid-area: disclaimer; grid-row: auto; }
  .footer-actions { display: contents; }
  .back-top { grid-area: back; justify-content: center; min-width: 44px; padding: 0; }
  .back-top > span:first-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .back-top-icon { width: 40px; height: 40px; }
  .motion-toggle { grid-area: motion; justify-self: stretch; padding-top: .6rem; border-top: 1px solid var(--line); border-radius: 0; }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  html.motion-enabled:not(.is-locked) { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
}

html.motion-reduced { scroll-behavior: auto !important; }
html.motion-reduced *, html.motion-reduced *::before, html.motion-reduced *::after {
  animation-duration: 1ms !important;
  animation-delay: 0ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 1ms !important;
  transition-delay: 0ms !important;
}

/* ---------- User preferences ---------- */

@media (prefers-reduced-transparency: reduce) {
  .topbar::before { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .dock { background: var(--surface); }
}

@media (prefers-contrast: more) {
  :root { --muted: #c9d0db; --line: rgba(255,255,255,.22); --line-strong: rgba(255,255,255,.4); --text-dim: #eceef2; }
}

@media (forced-colors: active) {
  .reading-progress > span { background: Highlight; }
  .dock-item.is-active { outline: 2px solid Highlight; }
  .motion-toggle[aria-pressed="true"] .motion-switch { background: Highlight; }
}

/* ---------- Print: the report on paper, without the show ---------- */

@media print {
  :root {
    --bg: #fff; --bg-2: #fff; --surface: #fff; --surface-2: #f4f4f2;
    --line: #d5d5d0; --line-strong: #b9b9b2;
    --text: #111; --text-dim: #2a2a2a; --muted: #555;
    --accent: #7a6400; --accent-ink: #fff; --accent-soft: #fff7c2;
    --term-bg: #f6f6f4; --term-bar: #ececea; --term-line: #ccc; --term-text: #111; --term-dim: #555;
    color-scheme: light;
  }
  .intro, .skip-link, .reading-progress, .topbar, .footer-actions { display: none !important; }
  html, body { background: #fff !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
