/* ui · shape: Long Document · theme: Paper · nav: N4 masthead · footer: F1 · tone: austere */

/* ---------- tokens ---------- */
:root {
  --color-bg: oklch(98.6% 0.006 85);
  --color-surface: oklch(96.4% 0.008 85);
  --color-ink: oklch(22% 0.014 262);
  --color-muted: oklch(43% 0.014 262);
  --color-line: oklch(88% 0.01 262);
  --color-accent: oklch(44% 0.15 262);
  --color-focus: oklch(46% 0.17 262);
  --color-ok: oklch(58% 0.14 150);
  --color-warn: oklch(80% 0.15 90);
  --color-alert: oklch(56% 0.19 27);

  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --radius-l: 1.25rem;
  --wrap: 72rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  overflow-x: clip;
}

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0;
  overflow-wrap: anywhere;
}

p { margin: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

a:hover { text-decoration-thickness: 2px; }

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

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.icon {
  width: 1.125em;
  height: 1.125em;
  flex: none;
}

/* ---------- masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--color-line);
}

.masthead-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  padding-block: var(--space-4);
  font-size: 0.9375rem;
}

.masthead-nav a {
  color: var(--color-muted);
  text-decoration: none;
}

.masthead-nav a:hover {
  color: var(--color-ink);
  text-decoration: underline;
}

/* ---------- progress ---------- */
.progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 10;
  pointer-events: none;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  padding-block: var(--space-32) var(--space-24);
}

.hero > :not(.hero-ribbon) {
  position: relative;
  z-index: 1;
}

.hero-ribbon {
  display: none;
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 4.5rem;
  z-index: 0;
  pointer-events: none;
}

.ribbon-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  mask-image: linear-gradient(90deg, transparent 0, var(--color-ink) 8%, var(--color-ink) 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, var(--color-ink) 8%, var(--color-ink) 92%, transparent 100%);
}

.visual-card.visual-digi {
  aspect-ratio: 1 / 1;
}

.visual-digi .call-pill {
  top: 16%;
}

.visual-digi .enquiry-card {
  top: 40%;
}

.ribbon-line {
  fill: none;
  stroke: var(--color-line);
  stroke-width: 2;
}

.ribbon-text {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  fill: var(--color-muted);
}

.hero-title h1 {
  font-size: clamp(3.25rem, 9vw + 0.5rem, 8.5rem);
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.positioning {
  margin-block-start: var(--space-6);
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2.2vw + 0.6rem, 2rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
  max-width: 28rem;
}

.intro {
  margin-block-start: var(--space-8);
  max-width: 60ch;
  color: var(--color-muted);
  font-size: 1.1875rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-block-start: var(--space-12);
}

.hero-links a {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-6) var(--space-3) var(--space-4);
  border: 1px solid var(--color-line);
  border-radius: 999px;
  color: var(--color-ink);
  text-decoration: none;
  background: var(--color-bg);
  max-width: 100%;
}

.hero-links a:hover {
  text-decoration: none;
  border-color: var(--color-ink);
}

.link-label {
  color: var(--color-muted);
  font-size: 0.875rem;
}

.link-text {
  font-weight: 500;
}

/* ---------- about ---------- */
.about {
  padding-block: var(--space-8) var(--space-16);
}

.about h2 {
  font-size: clamp(1.25rem, 1vw + 0.9rem, 1.5rem);
  margin-block-end: var(--space-4);
  color: var(--color-muted);
}

.about p {
  max-width: 60ch;
  font-size: 1.1875rem;
  line-height: 1.65;
}

/* ---------- projects: base (stacked, readable everywhere) ---------- */
.projects {
  padding-block: var(--space-24);
}

.projects > h2 {
  font-size: clamp(2.5rem, 4vw + 0.5rem, 4rem);
  margin-block-end: var(--space-16);
}

.story {
  position: relative;
}

.story-anchor,
.story-index,
.story-marker {
  display: none;
}

.story-stage {
  display: grid;
  gap: var(--space-8);
}

.step {
  display: grid;
  gap: var(--space-8);
  padding: var(--space-8);
  background: var(--color-surface);
  border-radius: var(--radius-l);
  min-width: 0;
}

.step-visual {
  min-width: 0;
}

.step-copy {
  display: grid;
  gap: var(--space-8);
  align-content: start;
  min-width: 0;
}

.visual-card {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-l);
}

.step h3 {
  font-size: clamp(1.875rem, 3.2vw + 0.5rem, 3.25rem);
}

.project-head { min-width: 0; }

.project-what {
  margin-block-start: var(--space-3);
  font-size: 1.25rem;
  line-height: 1.45;
  max-width: 36rem;
}

.notes {
  display: grid;
  gap: var(--space-3);
  max-width: 62ch;
}

.notes li {
  padding-inline-start: var(--space-6);
  position: relative;
}

.notes li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.8em;
  width: 0.75rem;
  height: 1px;
  background: var(--color-muted);
}

.side-note {
  color: var(--color-muted);
  font-size: 0.9375rem;
  max-width: 62ch;
}

.meta {
  display: grid;
  gap: var(--space-4);
  padding-block-start: var(--space-6);
  border-top: 1px solid var(--color-line);
  font-size: 0.9375rem;
}

.meta div {
  display: grid;
  gap: var(--space-1);
}

.meta dt {
  color: var(--color-muted);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta dd { margin: 0; }

.project-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  align-self: flex-start;
  font-weight: 500;
}

/* Scene pieces shared by all four visuals (positions are % of the card). */
.mac {
  position: absolute;
  inset: 10% 9%;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--space-3);
}

.mac-bar {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 8%;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
}

.mac-desk {
  position: absolute;
  inset: 8% 0 0 0;
}

/* Tiler windows: every window is a desk-sized box moved and scaled with transform only. */
.win {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  background: var(--color-bg);
  box-shadow: 0 0 0 1px var(--color-line);
}

.win::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 12%;
  background: var(--color-line);
}

/* Resting layout (used without motion): halves. */
.win-a { transform: translate(0%, 0%) scale(0.5, 1); }
.win-b { transform: translate(50%, 0%) scale(0.5, 0.5); }
.win-c { transform: translate(50%, 50%) scale(0.25, 0.5); }
.win-d { transform: translate(75%, 50%) scale(0.25, 0.5); }

/* Digi Works: call pill turns into enquiry card. */
.call-pill {
  position: absolute;
  top: 26%;
  inset-inline: 0;
  margin-inline: auto;
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: 999px;
  background: var(--color-ink);
  color: var(--color-bg);
  font-weight: 500;
}

.call-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-ok);
}

.enquiry-card {
  position: absolute;
  top: 44%;
  inset-inline: 12%;
  display: grid;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-l);
}

.enquiry-label {
  font-weight: 600;
  font-size: 1.125rem;
}

.skel {
  display: block;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--color-line);
}

.skel-w1 { width: 90%; }
.skel-w2 { width: 70%; }
.skel-w3 { width: 50%; }

/* FSH: board with three sensor blocks and a three-step LED. */
.visual-fsh {
  aspect-ratio: 1 / 1;
}

.board {
  position: absolute;
  top: 50%;
  inset-inline: 12%;
  translate: 0 -50%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-content: start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-l);
}

.board-head {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  padding-bottom: var(--space-2);
}

.block {
  display: flex;
  align-items: flex-end;
  min-height: 4.5rem;
  padding: var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--space-3);
  font-size: 0.9375rem;
  font-weight: 500;
}

.block-temp { grid-column: 1 / -1; }

.led {
  position: relative;
  width: 1rem;
  height: 1rem;
}

.led i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.led-g { background: var(--color-ok); opacity: 1; }
.led-y { background: var(--color-warn); opacity: 0; }
.led-r { background: var(--color-alert); opacity: 0; }

/* Oakhold: calm bubble and a line that draws in, no numbers or axes. */
.bubble {
  position: absolute;
  top: 16%;
  left: 10%;
  width: 58%;
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  background: var(--color-ink);
  border-radius: var(--radius-l) var(--radius-l) var(--radius-l) var(--space-1);
}

.bubble .skel {
  background: var(--color-bg);
  opacity: 0.5;
}

.chart {
  position: absolute;
  left: 8%;
  bottom: 12%;
  width: 84%;
  height: auto;
  overflow: visible;
}

.chart-line {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-draw {
  transform-box: view-box;
  transform-origin: 0 0;
}

.chart-dot {
  fill: var(--color-accent);
}

/* ---------- index lists ---------- */
.index {
  padding-block: var(--space-16) var(--space-24);
  border-top: 1px solid var(--color-line);
}

.index > h2 {
  margin-block-end: var(--space-8);
  font-size: clamp(2.5rem, 4vw + 0.5rem, 4rem);
}

.rows {
  display: grid;
}

.row {
  display: grid;
  gap: var(--space-3) var(--space-8);
  padding-block: var(--space-6);
  border-top: 1px solid var(--color-line);
}

.row:last-child {
  border-bottom: 1px solid var(--color-line);
}

.row h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.row-title {
  font-weight: 500;
}

.row-when {
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.row-body {
  display: grid;
  gap: var(--space-1);
  color: var(--color-ink);
  max-width: 60ch;
}

.row-body p { color: var(--color-muted); }
.row-body .row-title { color: var(--color-ink); }

.list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-8);
  padding-block: var(--space-4);
  border-top: 1px solid var(--color-line);
}

.list li:last-child {
  border-bottom: 1px solid var(--color-line);
}

.list .when {
  color: var(--color-muted);
  font-size: 0.9375rem;
}

@media (min-width: 48rem) {
  .row {
    grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  }
}

/* ---------- contact ---------- */
.contact {
  padding-block: var(--space-16) var(--space-24);
  border-top: 1px solid var(--color-line);
}

.contact > h2 {
  font-size: clamp(2.5rem, 4vw + 0.5rem, 4rem);
  margin-block-end: var(--space-8);
}

.closing {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2vw + 0.6rem, 2.25rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  max-width: 30rem;
}

.contact .hero-links { margin-block-start: var(--space-12); }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--color-line);
  font-size: 0.9375rem;
  color: var(--color-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4) var(--space-8);
  padding-block: var(--space-8);
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-6);
}

.footer a { color: var(--color-muted); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .project-link,
  .hero-links a {
    transition: background-color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
  }

  /* JS fallback for browsers without view timelines */
  .motion-fallback .reveal {
    opacity: 0;
    transform: translate3d(0, 3rem, 0);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  }

  .motion-fallback .is-in {
    opacity: 1;
    transform: none;
  }

  @supports (animation-timeline: view()) {
    .progress {
      animation: progress linear both;
      animation-timeline: scroll(root block);
    }

    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 38%;
    }

    .hero-title {
      animation: hero-out linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 70%;
    }

    .hero h1 {
      animation: drift-title linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 100%;
    }

    .positioning {
      animation: drift-positioning linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 100%;
    }

    .hero-links {
      animation: drift-links linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 100%;
    }

    /* Experience and Awards: focus list. The row in the middle is full strength. */
    #experience .row,
    #awards .list li {
      position: relative;
      animation: focus-row linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }

    /* Accent rule on the active row: a non-text cue that scales in. */
    #experience .row::before,
    #awards .list li::before {
      content: "";
      position: absolute;
      inset-inline: 0;
      top: 0;
      height: 2px;
      background: var(--color-accent);
      transform: scaleX(0);
      transform-origin: 0 50%;
      animation: focus-rule linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }
  }

  /* Projects pinned step story: desktop only, needs view timelines. */
  @supports (animation-timeline: view()) {
    @media (min-width: 64rem) and (min-height: 700px) {
      .hero-ribbon {
        display: block;
      }

      .story {
        height: 400vh;
        view-timeline: --story block;
      }

      .story-anchor {
        display: block;
        position: absolute;
        inset-inline-start: 0;
        top: 0;
        width: 1px;
        height: 1px;
      }

      .anchor-2 { top: 79.5vh; }
      .anchor-3 { top: 154.5vh; }
      .anchor-4 { top: 229.5vh; }

      .story-stage {
        position: sticky;
        top: 0;
        height: 100vh;
        display: grid;
        grid-template-columns: 12rem minmax(0, 1fr) 22rem;
        grid-template-rows: minmax(0, 1fr);
        column-gap: var(--space-8);
        align-items: center;
      }

      .story-index {
        display: block;
        position: relative;
        grid-column: 1;
        grid-row: 1;
      }

      .story-steps li {
        height: 2.75rem;
        display: flex;
        align-items: center;
        padding-inline-start: var(--space-4);
      }

      .story-steps a {
        color: var(--color-muted);
        text-decoration: none;
        font-size: 0.9375rem;
        white-space: nowrap;
      }

      .story-steps a:hover {
        color: var(--color-ink);
        text-decoration: underline;
      }

      .story-marker {
        display: block;
        position: absolute;
        inset-inline-start: 0;
        top: 0;
        width: 2px;
        height: 2.75rem;
        background: var(--color-accent);
        animation: marker-move linear both;
        animation-timeline: --story;
        animation-range: cover 20% cover 80%;
      }

      .step {
        display: contents;
        padding: 0;
        background: none;
        border-radius: 0;
      }

      .step-visual {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
      }

      .step-copy {
        grid-column: 3;
        grid-row: 1;
        align-self: center;
        gap: var(--space-6);
      }

      .step h3 {
        font-size: clamp(1.75rem, 2.2vw + 0.6rem, 2.5rem);
      }

      @media (max-height: 860px) {
        .step-copy {
          gap: var(--space-4);
        }

        .step h3 {
          font-size: clamp(1.625rem, 2vw + 0.5rem, 2.25rem);
        }

        .notes {
          gap: var(--space-2);
        }

        .meta {
          gap: var(--space-3);
          padding-block-start: var(--space-4);
        }
      }

      @media (max-height: 780px) {
        .project-what {
          font-size: 1.125rem;
        }

        .notes li {
          line-height: 1.5;
        }

        .step-copy {
          gap: var(--space-3);
        }
      }

      .step-visual .visual-card {
        aspect-ratio: auto;
        height: min(40rem, 70vh);
      }

      /* Each step's visual and copy fade and slide in and out on the story timeline. */
      .step-1 > * { animation: story-1 linear both; animation-timeline: --story; animation-range: cover 20% cover 80%; }
      .step-2 > * { animation: story-2 linear both; animation-timeline: --story; animation-range: cover 20% cover 80%; }
      .step-3 > * { animation: story-3 linear both; animation-timeline: --story; animation-range: cover 20% cover 80%; }
      .step-4 > * { animation: story-4 linear both; animation-timeline: --story; animation-range: cover 20% cover 80%; }

      /* Tiler: windows move through halves, thirds and full screen. */
      .win-a { animation: win-a linear both; animation-timeline: --story; animation-range: cover 20% cover 33%; }
      .win-b { animation: win-b linear both; animation-timeline: --story; animation-range: cover 20% cover 33%; }
      .win-c { animation: win-c linear both; animation-timeline: --story; animation-range: cover 20% cover 33%; }
      .win-d { animation: win-d linear both; animation-timeline: --story; animation-range: cover 20% cover 33%; }

      /* Digi Works: call pill turns into enquiry card. */
      .call-pill { animation: morph-pill linear both; animation-timeline: --story; animation-range: cover 36.5% cover 48%; }
      .enquiry-card { animation: morph-card linear both; animation-timeline: --story; animation-range: cover 36.5% cover 48%; }

      /* FSH: LED steps green, yellow, red. */
      .led-g { animation: led-g linear both; animation-timeline: --story; animation-range: cover 51.5% cover 63.5%; }
      .led-y { animation: led-y linear both; animation-timeline: --story; animation-range: cover 51.5% cover 63.5%; }
      .led-r { animation: led-r linear both; animation-timeline: --story; animation-range: cover 51.5% cover 63.5%; }

      /* Oakhold: bubble, then the line draws, then the end point. */
      .bubble { animation: bubble-in linear both; animation-timeline: --story; animation-range: cover 66.5% cover 72%; }
      .chart-draw { animation: chart-draw linear both; animation-timeline: --story; animation-range: cover 68% cover 78%; }
      .chart-dot { animation: dot-in linear both; animation-timeline: --story; animation-range: cover 75.5% cover 79.5%; }
    }
  }

  @keyframes progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }

  @keyframes reveal {
    from {
      opacity: 0;
      transform: translate3d(0, 6rem, 0);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes hero-out {
    to {
      opacity: 0.2;
      transform: translate3d(0, -2.5rem, 0) scale(0.97);
    }
  }

  @keyframes drift-title {
    to { translate: 0 -2.5rem; }
  }

  @keyframes drift-positioning {
    to { translate: 0 -1.25rem; }
  }

  @keyframes drift-links {
    to { translate: 0 -0.625rem; }
  }

  /* Dim floor 0.9: muted text stays at or above 4.6:1 on the page background (WCAG AA). */
  @keyframes focus-row {
    0% { opacity: 0.9; transform: translate3d(0, 0, 0); }
    50% { opacity: 1; transform: translate3d(0.5rem, 0, 0); }
    100% { opacity: 0.9; transform: translate3d(0, 0, 0); }
  }

  @keyframes focus-rule {
    0% { transform: scaleX(0); }
    50% { transform: scaleX(1); }
    100% { transform: scaleX(0); }
  }

  @keyframes marker-move {
    0%, 23.5% { transform: translateY(0); }
    26.5%, 48.5% { transform: translateY(2.75rem); }
    51.5%, 73.5% { transform: translateY(5.5rem); }
    76.5%, 100% { transform: translateY(8.25rem); }
  }

  /* Hand-off windows: 23.5-26.5, 48.5-51.5, 73.5-76.5 (pin %). Outgoing slides up and out,
     incoming slides up from below, both cross-dissolve inside the window. */
  @keyframes story-1 {
    0%, 23.5% { opacity: 1; transform: none; visibility: visible; }
    26.5%, 100% { opacity: 0; transform: translate3d(0, -3rem, 0); visibility: hidden; }
  }

  @keyframes story-2 {
    0%, 23.5% { opacity: 0; transform: translate3d(0, 3rem, 0); visibility: hidden; }
    26.5%, 48.5% { opacity: 1; transform: none; visibility: visible; }
    51.5%, 100% { opacity: 0; transform: translate3d(0, -3rem, 0); visibility: hidden; }
  }

  @keyframes story-3 {
    0%, 48.5% { opacity: 0; transform: translate3d(0, 3rem, 0); visibility: hidden; }
    51.5%, 73.5% { opacity: 1; transform: none; visibility: visible; }
    76.5%, 100% { opacity: 0; transform: translate3d(0, -3rem, 0); visibility: hidden; }
  }

  @keyframes story-4 {
    0%, 73.5% { opacity: 0; transform: translate3d(0, 3rem, 0); visibility: hidden; }
    76.5%, 100% { opacity: 1; transform: none; visibility: visible; }
  }

  @keyframes win-a {
    0% { transform: translate(6%, 14%) scale(0.46, 0.5); }
    33% { transform: translate(0%, 0%) scale(0.5, 1); }
    66% { transform: translate(0%, 0%) scale(0.3333, 1); }
    100% { transform: translate(0%, 0%) scale(1, 1); }
  }

  @keyframes win-b {
    0% { transform: translate(44%, 8%) scale(0.46, 0.4); }
    33% { transform: translate(50%, 0%) scale(0.5, 0.5); }
    66% { transform: translate(33.333%, 0%) scale(0.3333, 1); opacity: 1; }
    100% { transform: translate(33.333%, 0%) scale(0.3333, 1); opacity: 0; }
  }

  @keyframes win-c {
    0% { transform: translate(22%, 56%) scale(0.4, 0.36); }
    33% { transform: translate(50%, 50%) scale(0.25, 0.5); }
    66% { transform: translate(66.667%, 0%) scale(0.3333, 0.5); opacity: 1; }
    100% { transform: translate(66.667%, 0%) scale(0.3333, 0.5); opacity: 0; }
  }

  @keyframes win-d {
    0% { transform: translate(60%, 52%) scale(0.34, 0.38); }
    33% { transform: translate(75%, 50%) scale(0.25, 0.5); }
    66% { transform: translate(66.667%, 50%) scale(0.3333, 0.5); opacity: 1; }
    100% { transform: translate(66.667%, 50%) scale(0.3333, 0.5); opacity: 0; }
  }

  @keyframes morph-pill {
    0% {
      opacity: 1;
      transform: translate3d(0, 0, 0);
    }
    100% {
      opacity: 0;
      transform: translate3d(0, -1rem, 0);
    }
  }

  @keyframes morph-card {
    0% {
      opacity: 0;
      transform: translate3d(0, 1rem, 0);
    }
    100% {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes led-g {
    0%, 30% { opacity: 1; }
    34%, 100% { opacity: 0; }
  }

  @keyframes led-y {
    0%, 32% { opacity: 0; }
    36%, 62% { opacity: 1; }
    66%, 100% { opacity: 0; }
  }

  @keyframes led-r {
    0%, 64% { opacity: 0; }
    68%, 100% { opacity: 1; }
  }

  @keyframes bubble-in {
    0% {
      opacity: 0;
      transform: translate3d(0, 1.5rem, 0);
    }
    100% {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes chart-draw {
    0% { transform: scaleX(0); }
    100% { transform: scaleX(1); }
  }

  @keyframes dot-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
  }
}

/* Reduced motion: no animation, no transition, everything static and visible. */
@media (prefers-reduced-motion: reduce) {
  .progress { display: none; }
}
