/* =========================================================================
   Scrollytelling Onepager
   Colours use OKLCH.
   ========================================================================= */

@font-face {
  font-family: "RotisSans";
  src: url("./fonts/RotisSansSerifW01-Extra.woff2") format("woff2"); /* Chrome 26+, Opera 23+, Firefox 39+ */
  font-style: normal;
  font-weight: 600;
  font-display: block;
}

:root {
  color-scheme: light;

  --background: oklch(0.985 0.008 120);
  --foreground: oklch(0.22 0.03 150);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.22 0.03 150);
  --primary: oklch(0.42 0.13 148);
  --primary-foreground: oklch(0.985 0.008 120);
  --secondary: oklch(0.95 0.02 130);
  --secondary-foreground: oklch(0.3 0.06 150);
  --muted: oklch(0.95 0.016 130);
  --muted-foreground: oklch(0.5 0.03 150);
  --accent: oklch(0.8184 0.0587 79.77);
  --accent-foreground: oklch(0.27 0.05 70);
  --border: oklch(0.9 0.016 135);

  --radius: 0.5rem;
  --maxw: 72rem;

  --font-sans: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --font-heading: "RotisSans", Arial, "Helvetica Neue", Helvetica, sans-serif;
  
  /* Diagonal "opens in new tab" arrow, used as a mask so it can be tinted
     with currentColor. Avoids the U+2197 glyph, which Inter's subset lacks. */

  --icon-external: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7'/%3E%3Cpath d='M9 7h8v8'/%3E%3C/svg%3E");
}

/* ------------------------------- Reset --------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  margin: 0;
  overflow-wrap: break-word;
}
h4 
{
  font-size: 1.125rem;
  line-height: 1.35;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

/* Hide app until Vue mounts to avoid raw-template flash */
[v-cloak] {
  display: none;
}

/* ---------------------------- Utilities -------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--section-eyebrow, var(--primary));
  margin: 0;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 2rem;
  height: 1px;
  background: var(--section-rule, var(--accent));
}

/* ============================== Sections ==============================
   Every section carries a set of local --section-* theme tokens. Child
   components (cards, figures, stats, lists, slider) read these tokens, so
   adding one modifier class to a <section> re-themes everything inside it.

   Available: .section--light  .section--card   .section--secondary
              .section--muted  .section--primary .section--dark
              .section--accent
   ====================================================================== */
.section {
  padding-block: 5rem;

  /* Defaults = light page background */
  --section-bg: transparent;
  --section-fg: var(--foreground);
  --section-lead: color-mix(in oklch, var(--foreground) 80%, transparent);
  --section-body: color-mix(in oklch, var(--foreground) 75%, transparent);
  --section-quiet: var(--muted-foreground);
  --section-eyebrow: var(--primary);
  --section-rule: var(--accent);
  --section-accent: var(--primary);
  --section-border: var(--border);
  --section-surface: var(--card);
  --section-surface-border: var(--border);
  --section-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --section-icon-bg: var(--secondary);
  --section-icon-fg: var(--primary);
  /* Prose links: resting colour, hover colour and focus-ring colour */
  --section-link: var(--primary);
  --section-link-hover: var(--foreground);
  --section-focus: var(--primary);

  background: var(--section-bg);
  color: var(--section-fg);
}
@media (min-width: 768px) {
  .section {
    padding-block: 7rem;
  }
}

/* ---- Light variants: only the backdrop changes --------------------- */
.section--light {
  --section-bg: var(--background);
}
.section--card {
  --section-bg: var(--card);
}
.section--secondary {
  --section-bg: var(--secondary);
}
.section--muted {
  --section-bg: var(--muted);
}
/* Amber panel — swap the green/amber roles so accents stay legible */
.section--accent {
  --section-bg: var(--accent);
  --section-fg: var(--accent-foreground);
  --section-lead: color-mix(in oklch, var(--accent-foreground) 85%, transparent);
  --section-body: color-mix(in oklch, var(--accent-foreground) 80%, transparent);
  --section-quiet: color-mix(in oklch, var(--accent-foreground) 70%, transparent);
  --section-eyebrow: var(--primary);
  --section-rule: var(--primary);
  --section-accent: var(--primary);
  --section-border: color-mix(in oklch, var(--accent-foreground) 20%, transparent);
  --section-surface: color-mix(in oklch, var(--background) 70%, transparent);
  --section-surface-border: color-mix(in oklch, var(--accent-foreground) 15%, transparent);
  --section-shadow: none;
  --section-icon-bg: color-mix(in oklch, var(--primary) 12%, transparent);
  --section-icon-fg: var(--primary);
  --section-link: var(--primary);
  --section-link-hover: var(--accent-foreground);
  --section-focus: var(--primary);
}

/* ---- Inverted variants: light type on a deep backdrop -------------- */
.section--primary,
.section--dark {
  --section-fg: var(--primary-foreground);
  --section-lead: color-mix(in oklch, var(--primary-foreground) 85%, transparent);
  --section-body: color-mix(in oklch, var(--primary-foreground) 80%, transparent);
  --section-quiet: color-mix(in oklch, var(--primary-foreground) 65%, transparent);
  --section-eyebrow: var(--accent);
  --section-rule: var(--accent);
  --section-accent: var(--accent);
  --section-border: color-mix(in oklch, var(--primary-foreground) 15%, transparent);
  --section-surface: color-mix(in oklch, var(--primary-foreground) 6%, transparent);
  --section-surface-border: color-mix(in oklch, var(--primary-foreground) 15%, transparent);
  --section-shadow: none;
  --section-icon-bg: color-mix(in oklch, var(--primary-foreground) 12%, transparent);
  --section-icon-fg: var(--primary-foreground);
  --section-link: var(--accent);
  --section-link-hover: var(--primary-foreground);
  --section-focus: var(--accent);
}
.section--primary {
  --section-bg: var(--primary);
}
.section--dark {
  --section-bg: oklch(0.19 0.028 152);
}

/* -------------------- Scroll reveal animation -------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Punchier "pop" variant – used for cards: rises, scales up and overshoots. */
.reveal--pop {
  opacity: 0;
  transform: translateY(46px) scale(0.94);
  transition:
    opacity 0.55s ease,
    transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.reveal--pop.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
@media (prefers-reduced-motion: reduce) {
  .reveal--pop {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* =============================== Nav ================================== */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  z-index: 50;
  opacity: 1;
  background: color-mix(in oklch, var(--background) 90%, transparent);
}
.progress__bar {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.15s ease-out;
}

.nav {
  position: fixed;
  inset: 4px 0 auto 0;
  z-index: 40;
}
/* Frosted bar lives on a pseudo-element so the fixed .nav__overlay is
   not trapped in a backdrop-filter containing block when scrolled. */
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  background: color-mix(in oklch, var(--background) 90%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: opacity 0.5s;
  pointer-events: none;
}
.nav--scrolled::before {
  opacity: 1;
}

.nav__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0.75rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
}

/* Fluid logo: scales with the viewport, 44px tall on mobile → 72px on desktop.
   Height drives the size; width follows the SVG aspect ratio (595.3 : 249.4). */
.brand__logo {
  display: block;
  height: clamp(2.75rem, 2.1rem + 2.8vw, 4.5rem);
  width: auto;
  /* The logo's own green/blue would sink into the dark hero, so render it
     white there and restore the brand colours once the bar turns light. */
  filter: brightness(0) invert(1);
  transition: filter 0.5s;
}
.nav--scrolled .brand__logo {
  filter: none;
}

/* -------------------------- Hamburger toggle -------------------------- */
.nav__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  border: 1px solid color-mix(in oklch, var(--primary-foreground) 35%, transparent);
  background: color-mix(in oklch, var(--primary-foreground) 10%, transparent);
  color: var(--primary-foreground);
  border-radius: 999px;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color 0.4s, color 0.4s, border-color 0.4s;
}
.nav--scrolled .nav__toggle {
  border-color: var(--border);
  background: color-mix(in oklch, var(--foreground) 6%, transparent);
  color: var(--foreground);
}
.nav__toggle-label {
  text-transform: uppercase;
}
.nav__toggle-icon {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--primary-foreground);
  padding: 0.5rem;
  transition: background-color 0.4s;
}
.nav--scrolled .nav__toggle-icon {
  background: var(--primary);
}
.nav__toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--primary);
  transition: transform 0.3s ease, opacity 0.2s ease;
}
.nav--scrolled .nav__toggle-bar {
  background: var(--primary-foreground);
}
/* open (X) state */
.nav--open .nav__toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav--open .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav--open .nav__toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------------------- Full-width dropdown panel --------------------- */
.nav__overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: color-mix(in oklch, var(--primary) 92%, black 8%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(5rem, 12vh, 8rem) 1.25rem 2.5rem;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.nav--open .nav__overlay {
  opacity: 1;
  visibility: visible;
}

.nav__close {
  position: fixed;
  top: clamp(1rem, 2.5vh, 1.5rem);
  right: clamp(1rem, 4vw, 2.5rem);
  z-index: 46;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  border: 1px solid color-mix(in oklch, var(--primary-foreground) 35%, transparent);
  background: color-mix(in oklch, var(--primary-foreground) 10%, transparent);
  color: var(--primary-foreground);
  border-radius: 999px;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color 0.2s, border-color 0.2s;
}
.nav__close:hover,
.nav__close:focus-visible {
  background: color-mix(in oklch, var(--primary-foreground) 20%, transparent);
  border-color: var(--primary-foreground);
}
.nav__close-label {
  text-transform: uppercase;
}
.nav__close-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--primary-foreground);
}
.nav__close-bar {
  position: absolute;
  width: 1rem;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
}
.nav__close-bar:nth-child(1) {
  transform: rotate(45deg);
}
.nav__close-bar:nth-child(2) {
  transform: rotate(-45deg);
}

.nav__menu {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
}
.nav__menu-eyebrow {
  margin: 0 0 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.nav__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
}
@media (min-width: 768px) {
  .nav__links {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 3rem;
  }
}

.nav__link {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 0.25rem;
  border-bottom: 1px solid color-mix(in oklch, var(--primary-foreground) 18%, transparent);
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 500;
  color: color-mix(in oklch, var(--primary-foreground) 80%, transparent);
  transition: color 0.2s, padding-left 0.2s;
  opacity: 0;
  transform: translateY(12px);
}
.nav--open .nav__link {
  animation: navLinkIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.nav__link:hover,
.nav__link:focus-visible {
  color: var(--primary-foreground);
  padding-left: 0.75rem;
}
.nav__link-index {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.nav__link--active {
  color: var(--primary-foreground);
}
.nav__link--active .nav__link-index {
  color: var(--primary-foreground);
}

.nav--open .nav__link { animation-delay: 0.08s; }
.nav--open li:nth-child(2) .nav__link { animation-delay: 0.12s; }
.nav--open li:nth-child(3) .nav__link { animation-delay: 0.16s; }
.nav--open li:nth-child(4) .nav__link { animation-delay: 0.2s; }
.nav--open li:nth-child(5) .nav__link { animation-delay: 0.24s; }
.nav--open li:nth-child(6) .nav__link { animation-delay: 0.28s; }
.nav--open li:nth-child(7) .nav__link { animation-delay: 0.32s; }
.nav--open li:nth-child(8) .nav__link { animation-delay: 0.36s; }

@keyframes navLinkIn {
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .nav__link {
    opacity: 1;
    transform: none;
  }
  .nav--open .nav__link {
    animation: none;
  }
}

/* =============================== Hero ================================= */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  text-align: center;
}
.hero__img,
.hero__video,
.hero__overlay,
.hero__scrim {
  position: absolute;
  inset: 0;
}
.hero__img,
.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* -------------------------- Hero background video ----------------------
   Expects videos/hero-lab.mp4 (plus an optional .webm). It sits above the
   still image and fades in only once it really starts playing, so a missing
   file, a slow connection or reduced-motion simply leaves the image visible.
   Recommended source: 10-20 s silent loop, 1920x1080, H.264, under ~4 MB.
   ---------------------------------------------------------------------- */
.hero__video {
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}
.hero__video.is-playing {
  opacity: 1;
}
/* No motion wanted: never show the video, keep the still image */
@media (prefers-reduced-motion: reduce) {
  .hero__video {
    display: none;
  }
}

/* Pause/play control – required for auto-playing motion (BITV 2.0 / WCAG 2.2.2) */
.hero__video-toggle {
  position: absolute;
  right: 1.5rem;
  bottom: 2rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid color-mix(in oklch, var(--primary-foreground) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in oklch, var(--primary) 35%, transparent);
  color: var(--primary-foreground);
  transition: background-color 0.2s, border-color 0.2s;
}
.hero__video-toggle[hidden] {
  display: none;
}
.hero__video-toggle:hover,
.hero__video-toggle:focus-visible {
  background: color-mix(in oklch, var(--primary) 70%, transparent);
  border-color: var(--primary-foreground);
}
.hero__video-toggle svg {
  width: 0.875rem;
  height: 0.875rem;
  fill: currentColor;
}
/* Pause bars while playing, play triangle once paused */
.hero__icon-play {
  display: none;
}
.hero__video-toggle[data-paused] .hero__icon-pause {
  display: none;
}
.hero__video-toggle[data-paused] .hero__icon-play {
  display: block;
}
.hero__overlay {
  background: color-mix(in oklch, var(--primary) 45%, transparent);
}
.hero__scrim {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3),
    transparent 45%,
    rgba(0, 0, 0, 0.55)
  );
}
.hero__content {
  position: relative;
  z-index: 10;
  max-width: 66rem;
  padding-inline: 1.5rem;
  color: var(--primary-foreground);
}
.hero__eyebrow {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: color-mix(in oklch, var(--primary-foreground) 80%, transparent);
}
.hero__title {
  font-size: clamp(2.75rem, 6vw, 9rem);
  line-height: 1.05;
  text-wrap: balance;
}
.hero__subtitle {
  margin: 1.5rem auto 0;
  font-size: clamp(1.125rem, 2vw, 2.5rem);
  line-height: 1.6;
  text-wrap: pretty;
  /* color: color-mix(in oklch, var(--primary-foreground) 85%, transparent); */
}
.hero__title,
.hero__subtitle {
  text-shadow:
    0 0 3px color-mix(in oklch, var(--foreground) 80%, transparent);
}
.hero__hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: color-mix(in oklch, var(--primary-foreground) 80%, transparent);
}
.hero__hint span:first-child {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
}
.hero__mouse {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 1.25rem;
  height: 2.25rem;
  padding: 0.25rem;
  border: 1px solid color-mix(in oklch, var(--primary-foreground) 50%, transparent);
  border-radius: 999px;
}
.hero__wheel {
  width: 0.25rem;
  height: 0.5rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--primary-foreground) 80%, transparent);
  animation: hero-bounce 1.4s infinite;
}
@keyframes hero-bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(6px); opacity: 0.4; }
}

/* ============================ Separator =============================== */
.sep {
  position: relative;
  display: flex;
  align-items: center;
  /* min-height: 80vh; */
  min-height: 40vh;
  overflow: hidden;
}
.sep__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sep__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    color-mix(in oklch, var(--primary) 90%, transparent),
    color-mix(in oklch, var(--primary) 70%, transparent) 55%,
    color-mix(in oklch, var(--primary) 30%, transparent)
  );
}
.sep__content {
  position: relative;
  z-index: 10;
  max-width: 40rem;
  color: var(--background);
}
.sep__chapter {
  margin: 0 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--accent);
}
.sep__chapter::before {
  content: "";
  width: 2.5rem;
  height: 1px;
  background: var(--accent);
}
.sep__title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1.1;
  text-wrap: balance;
}
.sep__desc {
  max-width: 34rem;
  margin-top: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.6;
  text-wrap: pretty;
  color: color-mix(in oklch, var(--background) 85%, transparent);
}

/* ========================= Text + Image =============================== */
.ti__grid {
  display: grid;
  gap: 2.5rem;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.5rem;
}
@media (min-width: 1024px) {
  .ti__grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}
.ti__media--right {
  order: -1;
}
@media (min-width: 1024px) {
  .ti__media {
    padding-block: 2rem;
  }
  .ti__media--right {
    order: 2;
  }
  .ti__sticky {
    position: sticky;
    top: 6rem;
  }
}
.figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--section-surface-border, var(--border));
  border-radius: 0.75rem;
  background: var(--section-surface, var(--card));
  box-shadow: var(--section-shadow, 0 1px 3px rgba(0, 0, 0, 0.08));
}
.figure__img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.figure__caption {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--section-quiet, var(--muted-foreground));
}

/* Full-width figure/chart embedded in the flowing text column.
   Spans the entire width of the text body, not just one grid column. */
.figure--full {
  margin: 2.5rem 0 0;
}
.figure--full .figure__img {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  /* Charts keep a light plate so dark sections don't invert the artwork */
  background: var(--card);
}
.figure--full .figure__caption {
  border-top: 1px solid var(--section-surface-border, var(--border));
}
/* Chart variant: pad the image so data visualisations breathe */
.figure--chart .figure__img {
  padding: 1.25rem;
  aspect-ratio: 16 / 9;
}

.ti__body {
  min-width: 0;
}
@media (min-width: 1024px) {
  .ti__body--right {
    order: 1;
  }
}
.ti__title {
  margin-top: 1rem;
  font-size: clamp(1.875rem, 3vw, 2.25rem);
  line-height: 1.2;
  text-wrap: balance;
  color: inherit;
}
.ti__lead {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.6;
  text-wrap: pretty;
  color: var(--section-lead, color-mix(in oklch, var(--foreground) 80%, transparent));
}

.stats {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
  margin: 2rem 0 0;
  padding: 0;
}
@media (min-width: 640px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .stats__grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats__grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .stats__grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  border: 1px solid var(--section-surface-border, var(--border));
  border-radius: var(--radius);
  background: var(--section-surface, var(--card));
  padding: 1rem;
}
.stat__value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--section-accent, var(--primary));
  margin: 0;
}
.stat__label {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--section-quiet, var(--muted-foreground));
}

.blocks {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.block__heading {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  color: inherit;
}
.block__text {
  line-height: 1.6;
  text-wrap: pretty;
  color: var(--section-body, color-mix(in oklch, var(--foreground) 75%, transparent));
}
.block__text p {
  margin: 1.25rem 0 0;
}
.slide__text p {
  margin: .5rem 0 0;
}
.slide__text h3:not(:first-child),
.slide__text h4:not(:first-child) {
  margin: 1.25rem 0 0;
}

/* ---------------- Lists in flowing text (element-level) ---------------- */
/* Plain <ul>/<ol> written anywhere in the text column are styled by tag, so
   CMS authors need no classes. Component lists always carry a class and are
   excluded via :not([class]). Native list markers are kept (not replaced by
   pseudo-elements) so screen readers still announce these as lists. */

.slide__text ul:not([class]),
.ti__body ul:not([class]),
.ti__body ol:not([class]) {
  margin: 1.25rem 0 0;
  padding-left: 1.375rem;
  line-height: 1.6;
  color: var(--section-body, color-mix(in oklch, var(--foreground) 75%, transparent));
}
.slide__text ul:not([class]),
.ti__body ul:not([class]) {
  list-style: disc;
}
.slide__text ol:not([class]),
.ti__body ol:not([class]) {
  list-style: decimal;
}
.slide__text ul:not([class]) > li,
.ti__body ul:not([class]) > li,
.ti__body ol:not([class]) > li {
  padding-left: 0.375rem;
  text-wrap: pretty;
}
.slide__text ul:not([class]) > li + li,
.ti__body ul:not([class]) > li + li,
.ti__body ol:not([class]) > li + li {
  margin-top: 0.5rem;
}
/* Amber bullets, brand-green numerals in the display face */
.slide__text ul:not([class]) > li::marker,
.ti__body ul:not([class]) > li::marker {
  color: var(--section-rule, var(--accent));
}
.ti__body ol:not([class]) > li::marker {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--section-accent, var(--primary));
}
/* Emphasis inside list items reads at full contrast */
.slide__text ul:not([class]) strong,
.ti__body ul:not([class]) strong,
.ti__body ol:not([class]) strong {
  font-weight: 600;
  color: var(--section-fg, var(--foreground));
}

/* Nested lists: tighter, slightly smaller, quieter markers */
.slide__text ul:not([class]) ul:not([class]),
.slide__text ul:not([class]) ol:not([class]),
.ti__body ul:not([class]) ul:not([class]),
.ti__body ul:not([class]) ol:not([class]),
.ti__body ol:not([class]) ul:not([class]),
.ti__body ol:not([class]) ol:not([class]) {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
}
.slide__text ul:not([class]) ul:not([class]),
.ti__body ul:not([class]) ul:not([class]) {
  list-style: circle;
}
.slide__text ul:not([class]) ul:not([class]) > li::marker
.ti__body ul:not([class]) ul:not([class]) > li::marker {
  color: color-mix(
    in oklch,
    var(--section-accent, var(--primary)) 55%,
    transparent
  );
}

/* ---------------- Links in flowing text (element-level) ---------------- */
/* Plain <a href> written in prose is styled by tag, so CMS authors need no
   classes. Component links (nav, footer, brand) all carry a class and are
   excluded via :not([class]). Underlines are kept — colour alone must never
   be the only way to identify a link (WCAG 1.4.1). */
.ti__body a:not([class]),
.ti__lead a:not([class]),
.slider__intro a:not([class]),
.slide__text a:not([class]),
.figure__caption a:not([class]),
.cards__intro a:not([class]),
.card__text a:not([class]) {
  color: var(--section-link, var(--primary));
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(
    in oklch,
    var(--section-link, var(--primary)) 40%,
    transparent
  );
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  border-radius: 0.125rem;
  transition: color 0.2s, text-decoration-color 0.2s, background-color 0.2s;
}
.ti__body a:not([class]):hover,
.ti__lead a:not([class]):hover,
.slider__intro a:not([class]):hover,
.slide__text a:not([class]):hover,
.figure__caption a:not([class]):hover,
.cards__intro a:not([class]):hover,
.card__text a:not([class]):hover {
  color: var(--section-link-hover, var(--foreground));
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
}
/* Visible keyboard focus: amber ring plus a tinted plate */
.ti__body a:not([class]):focus-visible,
.ti__lead a:not([class]):focus-visible,
.slider__intro a:not([class]):focus-visible,
.slide__text a:not([class]):focus-visible,
.figure__caption a:not([class]):focus-visible,
.cards__intro a:not([class]):focus-visible,
.card__text a:not([class]):focus-visible {
  outline: 2px solid var(--section-focus, var(--primary));
  outline-offset: 2px;
  background: color-mix(
    in oklch,
    var(--section-focus, var(--primary)) 15%,
    transparent
  );
  text-decoration-color: currentColor;
}

/* External links get a discreet arrow so the new context is visible.
   Drawn as a masked SVG rather than the "↗" character, because U+2197 is
   outside the loaded Inter subset and would fall back to a tofu box.
   The mask is tinted with currentColor, so it follows every section theme. */
.ti__body a:not([class])[target="_blank"]::after,
.ti__lead a:not([class])[target="_blank"]::after,
.slider__intro a:not([class])[target="_blank"]::after,
.slide__text a:not([class])[target="_blank"]::after,
.figure__caption a:not([class])[target="_blank"]::after,
.cards__intro a:not([class])[target="_blank"]::after,
.card__text a:not([class])[target="_blank"]::after {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.25em;
  vertical-align: -0.02em;
  background-color: currentColor;
  -webkit-mask: var(--icon-external) center / contain no-repeat;
  mask: var(--icon-external) center / contain no-repeat;
}

/* =============================== Slider =============================== */
/* Background comes from a .section--* modifier in the markup */
.slider__head {
  max-width: 48rem;
}
.slider__title {
  margin-top: 1rem;
  font-size: clamp(1.875rem, 3vw, 2.25rem);
  line-height: 1.2;
  text-wrap: balance;
  color: inherit;
}
.slider__intro {
  margin-top: 1rem;
  max-width: 42rem;
  font-size: 1.125rem;
  line-height: 1.6;
  text-wrap: pretty;
  color: var(--section-body, color-mix(in oklch, var(--foreground) 75%, transparent));
}
.slider__card {
  margin-top: 2.5rem;
  overflow: hidden;
  border: 1px solid var(--section-surface-border, var(--border));
  border-radius: 1rem;
  background: var(--section-surface, var(--card));
  box-shadow: var(--section-shadow, 0 1px 3px rgba(0, 0, 0, 0.08));
  display: grid;
}
@media (min-width: 768px) {
  .slider__card {
    grid-template-columns: 1fr 1fr;
  }
}

/* ------------------------------- Slides -------------------------------
   Every .slide holds its own image AND caption, so one element = one slide
   (CMS-friendly). All slides share a single grid cell, which means the card
   is always as tall as the tallest slide — no height jump when switching.
   --------------------------------------------------------------------- */
.slider__stack {
  position: relative;
  display: grid;
  grid-area: 1 / 1 / -1 / -1;
}
@media (min-width: 768px) {
  .slider__stack {
    grid-template-columns: 1fr 1fr;
  }
}
.slide {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, visibility 0.7s;
}
.slide--active {
  opacity: 1;
  visibility: visible;
}
@media (min-width: 768px) {
  .slide {
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
  }
}
/* Fallback for browsers without subgrid: mirror the parent template */
@supports not (grid-template-columns: subgrid) {
  @media (min-width: 768px) {
    .slide {
      grid-template-columns: 1fr 1fr;
    }
  }
}
.slide__media {
  /* <figure> needs its margin reset; position anchors the overlaid caption */
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
@media (min-width: 768px) {
  .slide__media {
    aspect-ratio: auto;
    min-height: 26rem;
  }
}
.slide__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Overlaid image caption. The gradient scrim
   guarantees legible text over any photograph, so the colours here are fixed
   to the global light/dark pair instead of the section theme — same approach
   as .slider__counter. */
.slide__figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.5rem 1.25rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--background);
  text-wrap: pretty;
  overflow-wrap: break-word;
  background: linear-gradient(
    to top,
    color-mix(in oklch, var(--foreground) 88%, transparent) 0%,
    color-mix(in oklch, var(--foreground) 70%, transparent) 45%,
    transparent 100%
  );
  /* Purely decorative scrim must not intercept clicks meant for the slide */
  pointer-events: none;
}
/* …but a link in the caption must still be usable. It sits on
   the scrim, not on a section surface, so it keeps the caption's own colour
   rather than the themed link colour, which would lose contrast here. */
.slide__figcaption a {
  pointer-events: auto;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.slide__figcaption a:focus-visible {
  outline: 2px solid var(--background);
  outline-offset: 2px;
}
@media (min-width: 768px) {
  .slide__figcaption {
    padding: 3rem 1.75rem 1.25rem;
    font-size: 0.875rem;
  }
}
.slide__caption {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.75rem 1.75rem calc(var(--slider-controls-h, 2.75rem) + 1.75rem);
}
@media (min-width: 768px) {
  .slide__caption {
    padding: 2.5rem 2.5rem calc(var(--slider-controls-h, 2.75rem) + 2.5rem);
  }
}
.slide__stat {
  margin: 0 0 0.75rem;
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--section-accent, var(--primary));
}
.slide__title {
  font-size: 1.5rem;
  color: var(--section-accent, var(--primary));
  overflow-wrap: break-word;
}
.slide__text {
  margin-top: 1rem;
  line-height: 1.6;
  text-wrap: pretty;
  overflow-wrap: break-word;
  color: var(--section-body, color-mix(in oklch, var(--foreground) 75%, transparent));
}
.slider__counter {
  position: absolute;
  top: 1rem;
  left: 1rem;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--background);
  background: color-mix(in oklch, var(--foreground) 70%, transparent);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
/* Controls are chrome, not slide content: a single shared row docked to the
   bottom of the caption column, sharing the card's grid cell with the slides
   and aligned to the same padding edges as the caption text. */
.slider__controls {
  grid-area: 1 / 1 / -1 / -1;
  align-self: end;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0 1.75rem 1.75rem;
  pointer-events: none;
}
.slider__controls > * {
  pointer-events: auto;
}
@media (min-width: 768px) {
  .slider__controls {
    grid-column: 2 / -1;
    padding: 0 2.5rem 2.5rem;
  }
}
.arrows {
  margin-left: auto;
}
.dots {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  min-width: 0;
}
.dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  background: none;
}
.dot::before {
  content: "";
  display: block;
  height: 0.75rem;
  width: 0.75rem;
  border-radius: 999px;
  background: var(--section-border, var(--border));
  transition: width 0.2s, background-color 0.2s;
}
.dot:hover::before {
  background: var(--section-quiet, var(--muted-foreground));
}
.dot--active {
  width: 2.75rem;
}
.dot--active::before {
  width: 1.5rem;
  background: var(--section-accent, var(--primary));
}
.dot:focus-visible {
  outline: 2px solid var(--section-focus, var(--primary));
  outline-offset: -2px;
  border-radius: var(--radius);
}
.arrows {
  display: flex;
  gap: 0.5rem;
}
.arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--section-border, var(--border));
  border-radius: 999px;
  background: transparent;
  color: inherit;
  transition: background-color 0.2s, color 0.2s;
}
.arrow:hover {
  background: var(--section-accent, var(--primary));
  color: var(--primary-foreground);
}
.section--primary .arrow:hover,
.section--dark .arrow:hover {
  color: var(--accent-foreground);
}
.arrow svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* =============================== Cards ================================ */
.cards__title {
  margin-top: 1rem;
  max-width: 48rem;
  font-size: clamp(1.875rem, 3vw, 2.25rem);
  line-height: 1.2;
  text-wrap: balance;
  color: inherit;
}
.cards__intro {
  margin-top: 1rem;
  max-width: 42rem;
  font-size: 1.125rem;
  line-height: 1.6;
  text-wrap: pretty;
  color: var(--section-body, color-mix(in oklch, var(--foreground) 75%, transparent));
}
.cards__grid {
  margin-top: 2rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .cards__grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .cards__grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .cards__grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--section-surface-border, var(--border));
  border-radius: 0.75rem;
  background: var(--section-surface, var(--card));
  padding: 1.5rem;
  box-shadow: var(--section-shadow, 0 1px 3px rgba(0, 0, 0, 0.08));
  transition: transform 0.3s;
}
.card:hover {
  transform: translateY(-4px);
}
.card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: var(--section-icon-bg, var(--secondary));
  color: var(--section-icon-fg, var(--primary));
  transform: scale(0.6) rotate(-8deg);
  opacity: 0;
  transition:
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.4s ease;
  transition-delay: 0.25s;
}
.card.is-visible .card__icon {
  transform: scale(1) rotate(0);
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .card__icon {
    transform: none;
    opacity: 1;
    transition: none;
  }
}
.card__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}
.card__value {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--section-accent, var(--primary));
}
.card__title {
  margin-top: 0.5rem;
  font-size: 1.25rem;
  color: inherit;
}
.card__title:first-child {
  margin-top: 0;
  color: inherit;
}
.card__text {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
  text-wrap: pretty;
  color: var(--section-quiet, var(--muted-foreground));
}

/* =============================== Footer =============================== */

.footer {
  border-top: 1px solid var(--border);
  background: var(--background);
  padding-block: 3rem;
}
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .footer__inner {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}
.footer__brand {
  max-width: 34rem;
}
.footer__nav {
  flex-shrink: 0;
}
.footer__nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}
@media (min-width: 768px) {
  .footer__nav-list {
    justify-content: flex-end;
  }
}
.footer__nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color 0.2s;
}
.footer__nav-link:hover,
.footer__nav-link:focus-visible {
  color: var(--primary);
}
.footer__name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}
.footer__tag {
  margin: 0.25rem 0 0;
  max-width: 28rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}
.footer__meta {
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--muted-foreground);
  margin: 1rem 0 0;
}

/* ------------------------ Reduced motion ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero__wheel {
    animation: none;
  }
  .slide {
    transition: none;
  }
}
