/* ============================================================
   MAIN STYLESHEET

   This file defines *structure*: spacing, type scale, layout,
   component shapes. It never hardcodes a colour — every colour
   is read from a CSS variable that a theme file sets.

   That split is what makes theming safe: swapping the theme in
   _config.yml changes the palette and nothing else, so no page
   can drift out of line with the others.

   Theme files live in assets/css/themes/ and are loaded BEFORE
   this file. See CONTENT-GUIDE.md → "Changing the colours".
   ============================================================ */

/* ---- 1. Design tokens (non-colour) ------------------------- */

:root {
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-heading: "Lora", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Fluid type scale — grows smoothly between 360px and 1200px */
  --step--1: clamp(0.82rem, 0.79rem + 0.13vw, 0.89rem);
  --step-0:  clamp(1rem, 0.96rem + 0.19vw, 1.11rem);
  --step-1:  clamp(1.2rem, 1.13rem + 0.32vw, 1.42rem);
  --step-2:  clamp(1.44rem, 1.32rem + 0.52vw, 1.8rem);
  --step-3:  clamp(1.73rem, 1.54rem + 0.82vw, 2.29rem);
  --step-4:  clamp(2.07rem, 1.78rem + 1.25vw, 2.91rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6rem;

  --container: 900px;
  --container-wide: 1180px;
  --gutter: clamp(1.1rem, 4vw, 2rem);

  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --border: 1px solid var(--color-border);
  --shadow-sm: 0 1px 2px var(--color-shadow);
  --shadow-md: 0 4px 16px var(--color-shadow);
  --shadow-lg: 0 12px 40px var(--color-shadow);

  --ease: cubic-bezier(0.2, 0, 0.2, 1);
  --header-h: 68px;
}

/* ---- 2. Base ------------------------------------------------ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-heading);
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { margin: 0 0 var(--space-5); }

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.18s var(--ease);
}
a:hover { color: var(--color-link-hover); }

img { max-width: 100%; height: auto; display: block; }

hr {
  border: 0;
  border-top: var(--border);
  margin: var(--space-7) 0;
}

code, pre { font-family: var(--font-mono); font-size: 0.9em; }

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection { background: var(--color-selection); color: var(--color-selection-text); }

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 200;
  padding: var(--space-3) var(--space-5);
  background: var(--color-accent);
  color: var(--color-on-accent);
  border-radius: var(--radius);
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: var(--space-4); color: var(--color-on-accent); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---- 3. Layout ---------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--wide { max-width: var(--container-wide); }

main { display: block; min-height: 50vh; padding-bottom: var(--space-9); }

/* ---- 4. Header & navigation --------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: var(--border);
}

.site-header__inner {
  max-width: var(--container-wide);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-heading);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--color-heading);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.brand:hover { color: var(--color-accent); }
.brand__mark { color: var(--color-accent); display: inline-flex; }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  white-space: nowrap;
}
.site-nav a:hover { color: var(--color-accent); background: var(--color-surface-alt); }
.site-nav a.is-current { color: var(--color-accent); background: var(--color-accent-soft); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  padding: 0;
  background: none;
  border: var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle__bar {
  display: block;
  width: 18px; height: 2px;
  margin-inline: auto;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.22s var(--ease), opacity 0.22s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    inset: 100% 0 auto 0;
    background: var(--color-bg);
    border-bottom: var(--border);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-3) var(--gutter) var(--space-5);
    max-width: var(--container-wide);
    margin-inline: auto;
  }
  .site-nav a { padding: var(--space-3) var(--space-3); font-size: 1.02rem; }
}

/* ---- 5. Hero (home) ----------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(var(--space-8), 12vw, var(--space-9)) 0 var(--space-8);
  margin-bottom: var(--space-8);
  overflow: hidden;
  border-bottom: var(--border);
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: var(--hero-image-opacity);
  filter: var(--hero-image-filter);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--hero-overlay);
}
.hero__inner { max-width: var(--container-wide); }
.hero__eyebrow {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}
.hero__eyebrow a { color: inherit; }
.hero__title {
  font-size: var(--step-4);
  margin-bottom: var(--space-4);
}
.hero__tagline {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--color-text);
  max-width: 34ch;
  margin-bottom: 0;
}
@media (min-width: 700px) { .hero__tagline { max-width: 46ch; } }

/* ---- 6. Page head (inner pages) ----------------------------- */

.page-head {
  padding: var(--space-8) 0 var(--space-6);
  margin-bottom: var(--space-7);
  border-bottom: var(--border);
  background: var(--color-surface-alt);
}
.page-head__title { margin-bottom: var(--space-3); }
.page-head__subtitle {
  font-size: var(--step-1);
  color: var(--color-text-muted);
  max-width: 60ch;
  margin: 0;
}

/* ---- 7. Prose ------------------------------------------------ */

.prose > h2 { margin-top: var(--space-8); }
.prose > h3 { margin-top: var(--space-6); }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 var(--space-5); padding-left: 1.35em; }
.prose li { margin-bottom: var(--space-2); }
.prose blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-2) 0 var(--space-2) var(--space-5);
  border-left: 3px solid var(--color-accent);
  color: var(--color-text-muted);
  font-style: italic;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--color-text);
}

.section-intro { max-width: 62ch; color: var(--color-text-muted); }

/* ---- 8. Buttons & pills ------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.66em 1.3em;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.btn--primary {
  background: var(--color-accent);
  color: var(--color-on-accent);
}
.btn--primary:hover {
  background: var(--color-accent-hover);
  color: var(--color-on-accent);
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: var(--color-link);
  border-color: var(--color-ui-border);
}
.btn--ghost:hover { background: var(--color-surface-alt); border-color: var(--color-accent); }

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  list-style: none;
  margin: 0 0 var(--space-6);
  padding: 0;
}

.pill {
  display: inline-block;
  padding: 0.2em 0.75em;
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 1.6;
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  white-space: nowrap;
}
.pill--muted { background: var(--color-surface-alt); color: var(--color-text-muted); }

/* ---- 9. Cards ------------------------------------------------ */

.cards {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: var(--space-7);
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  padding: var(--space-5);
  background: var(--color-surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--color-border-strong); }
.card h3 { font-size: var(--step-1); margin-bottom: var(--space-2); }
.card h3 a { color: inherit; text-decoration: none; }
/* Stretched-link: the anchor's ::after covers the whole card (its
   nearest `position: relative` ancestor), so the entire box is
   clickable and hovering anywhere in it triggers the anchor's own
   :hover — not just the title text. */
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card h3 a:hover { color: var(--color-accent); text-decoration: underline; }
.card p:last-child { margin-bottom: 0; }
.card__meta { font-size: var(--step--1); color: var(--color-text-muted); }

/* A card with no link inside (e.g. a publication teaser still under
   embargo) should not promise a click it cannot deliver. */
.card--static { cursor: default; }
.card--static:hover { box-shadow: var(--shadow-sm); transform: none; border-color: var(--color-border); }

/* ---- 10. Research entries ----------------------------------- */

.research-item {
  padding-block: var(--space-8);
  border-bottom: var(--border);
}
.research-item:last-of-type { border-bottom: 0; }

.research-item__grid {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}
@media (min-width: 820px) {
  .research-item__grid.has-figure { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
}
/* Without a figure the body would stretch the full wide container, giving
   lines far too long to read comfortably. Cap it at a sane measure. */
.research-item__grid:not(.has-figure) .research-item__body { max-width: 68ch; }

.research-item__period {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}
.research-item__title { font-size: var(--step-2); margin-bottom: var(--space-3); }
.research-item__summary {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-style: italic;
  margin-bottom: var(--space-5);
}
.research-item__figure { margin: 0; }
.research-item__figure img {
  width: 100%;
  border-radius: var(--radius);
  border: var(--border);
  background: var(--color-surface);
}
.research-item__figure figcaption {
  margin-top: var(--space-3);
  font-size: var(--step--1);
  color: var(--color-text-muted);
}
/* Full-width figure below the text. Capped well short of the container:
   these are tall, detailed panels, and at full page width they would
   need more scrolling than reading. */
.research-item__figure--wide {
  margin-top: var(--space-7);
  max-width: 660px;
  margin-inline: auto;
}
.research-item__figure--wide figcaption { text-align: center; }
.research-item__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
}

/* ---- 11. Publications --------------------------------------- */

.pub-year {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--step-1);
  margin: var(--space-7) 0 var(--space-5);
  color: var(--color-text-muted);
}
.pub-year::after {
  content: "";
  flex: 1;
  border-top: var(--border);
}

.pub-list { list-style: none; margin: 0; padding: 0; }

.pub {
  position: relative;
  padding: var(--space-5) 0 var(--space-5) var(--space-6);
  border-bottom: var(--border);
}
.pub:last-child { border-bottom: 0; }
.pub::before {
  content: "";
  position: absolute;
  left: 0; top: calc(var(--space-5) + 0.62em);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-border-strong);
}
.pub--featured::before { background: var(--color-accent); }

.pub__title {
  font-family: var(--font-heading);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 var(--space-2);
  color: var(--color-heading);
}
.pub__title a { color: inherit; text-decoration: none; }
.pub__title a:hover { color: var(--color-accent); text-decoration: underline; }
.pub__authors { margin: 0 0 var(--space-2); color: var(--color-text-muted); font-size: 0.96rem; }
.pub__authors strong { color: var(--color-text); font-weight: 600; }
.pub__venue {
  margin: 0;
  font-size: 0.94rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
}
.pub__journal { font-style: italic; color: var(--color-text); }

/* ---- 12. Gallery -------------------------------------------- */

.gallery-album { margin-bottom: var(--space-8); }
.gallery-album__caption { color: var(--color-text-muted); max-width: 60ch; }

.gallery {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 700px) {
  .gallery { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}

.gallery__item { margin: 0; }
.gallery__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--color-surface-alt);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
}
.gallery__btn img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.gallery__btn:hover img { transform: scale(1.05); opacity: 0.92; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: var(--color-lightbox-bg);
  backdrop-filter: blur(4px);
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: min(1100px, 100%);
  max-height: 86vh;
  width: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.lightbox__close, .lightbox__nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  font-size: 1.5rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  cursor: pointer;
}
.lightbox__close { top: var(--space-5); right: var(--space-5); }
.lightbox__nav--prev { left: var(--space-4); }
.lightbox__nav--next { right: var(--space-4); }
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(0, 0, 0, 0.75); }
.lightbox__caption {
  position: absolute;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  text-align: center;
  color: #fff;
  font-size: var(--step--1);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* ---- 13. Learning Lab demos --------------------------------- */

/* Hub page: one heading per group of labs. */
.lab-section__title {
  margin-top: var(--space-8);
  padding-bottom: var(--space-3);
  border-bottom: var(--border);
}
.lab-section__title + .section-intro { margin-top: var(--space-4); }

/* Lab page: breadcrumb above the title. */
.lab-head__eyebrow {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}
.lab-head__eyebrow a { color: inherit; }

/* Lab page: previous / next across the whole sequence. */
.lab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: var(--border);
}
.lab-nav__side { flex: 1 1 240px; min-width: 0; }
.lab-nav__side--end { text-align: right; }
.lab-nav__link {
  display: inline-block;
  text-decoration: none;
  color: var(--color-heading);
}
.lab-nav__link:hover .lab-nav__title { color: var(--color-accent); text-decoration: underline; }
.lab-nav__dir {
  display: block;
  font-size: var(--step--1);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}
.lab-nav__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.02rem;
}

.demo__blurb { max-width: 68ch; }
.demo__blurb p:last-child { margin-bottom: var(--space-6); }

.demo__widget {
  background: var(--color-surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.demo__stage {
  position: relative;
  background: var(--color-canvas-bg);
  border-bottom: var(--border);
  min-height: 120px;
}
.demo__stage canvas { display: block; width: 100% !important; height: auto !important; }

/* Compact per-site sliders sitting directly under the canvas. */
.demo__sites {
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-alt);
  border-bottom: var(--border);
}
.demo__sites-title {
  margin: 0 0 var(--space-3);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.demo__sites-grid {
  display: grid;
  gap: var(--space-3) var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
}
.site-control__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}
.site-control__label,
.site-control__value {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}
.site-control__label { color: var(--color-text); }
.site-control__value { color: var(--color-accent); font-weight: 600; }
.site-control input[type="range"] { height: 18px; }

.demo__panel {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5);
}
@media (min-width: 760px) {
  .demo__panel { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
}

.demo__controls { display: grid; gap: var(--space-4); align-content: start; }

.control__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-1);
}
.control__label { font-size: 0.9rem; font-weight: 500; color: var(--color-text); }
.control__value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-accent);
  font-weight: 600;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 5px; border-radius: 3px; background: var(--color-track);
}
input[type="range"]::-moz-range-track {
  height: 5px; border-radius: 3px; background: var(--color-track);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px; height: 17px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--color-surface);
  box-shadow: var(--shadow-sm);
}
input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--color-surface);
}

.control--toggle label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}
.control--toggle input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.demo__readouts {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  padding: var(--space-4);
  background: var(--color-surface-alt);
  border-radius: var(--radius);
}
.readout {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  font-size: 0.87rem;
}
.readout__label { color: var(--color-text-muted); }
.readout__value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-heading);
  text-align: right;
}

.demo__takeaway {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-5);
  padding: var(--space-5);
  background: var(--color-accent-soft);
  border-radius: var(--radius);
  border-left: 3px solid var(--color-accent);
}
.demo__takeaway p { margin: 0; }
.demo__takeaway strong { color: var(--color-accent); }

.demo__footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  margin-top: var(--space-4);
  font-size: var(--step--1);
  color: var(--color-text-muted);
}

.demo__nojs {
  padding: var(--space-6);
  text-align: center;
  color: var(--color-text-muted);
}

/* ---- 14. Footer --------------------------------------------- */

.site-footer {
  margin-top: var(--space-9);
  padding-top: var(--space-8);
  background: var(--color-footer-bg);
  border-top: var(--border);
  color: var(--color-footer-text);
}
.site-footer__inner {
  max-width: var(--container-wide);
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  padding-bottom: var(--space-7);
}
.site-footer__heading {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-footer-heading);
  margin-bottom: var(--space-4);
}
.site-footer address {
  font-style: normal;
  margin-bottom: var(--space-3);
  max-width: 30ch;
}
.site-footer p { margin: 0 0 var(--space-2); }
.site-footer a { color: var(--color-footer-link); }
.site-footer a:hover { color: var(--color-accent); }
.social { list-style: none; margin: 0; padding: 0; }
.social li { margin-bottom: var(--space-2); }

.site-footer__legal {
  max-width: var(--container-wide);
  padding-block: var(--space-4) var(--space-5);
  border-top: var(--border);
  font-size: var(--step--1);
  color: var(--color-text-muted);
}
.site-footer__legal p { margin: 0; }

/* ---- 15. Motion preferences --------------------------------- */

@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;
  }
  .card:hover, .btn--primary:hover { transform: none; }
  .gallery__btn:hover img { transform: none; }
}

/* ---- 16. Print ---------------------------------------------- */

@media print {
  .site-header, .site-footer, .demo__widget, .skip-link, .hero__media { display: none !important; }
  body { color: #000; background: #fff; }
  a { text-decoration: underline; }
}
