/* Step-by-step reveals (reveal.js). Everything is visible by default; the hidden
   start state applies only on screens, with JavaScript running (html.reveal-ready)
   and no reduced-motion preference, to slides that have not built yet. Most builds
   finish within about 1.5s; the vision slide takes 5.3s, and the ask and use-of-funds slides about 1.6s (per-slide notes below). The WhatsApp
   button on the last slide pulses three times over six seconds after its build.
   Motion tokens: docs/DESIGN.md § Motion. */
:root {
  --reveal-ease: cubic-bezier(0, 0, 0.2, 1);        /* --orba-easing-enter */
  --reveal-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275); /* --orba-easing-spring */
  --reveal-duration: 400ms;                          /* --orba-duration-enter */
  --reveal-step: 110ms;
  --reveal-start: 150ms;
}

[data-reveal] {
  transition: opacity var(--reveal-duration) var(--reveal-ease), transform var(--reveal-duration) var(--reveal-ease);
  transition-delay: calc(var(--reveal-start) + var(--reveal-i, 0) * var(--reveal-step));
}
[data-reveal-stagger] > * {
  transition: opacity 300ms var(--reveal-ease), transform 300ms var(--reveal-spring);
  transition-delay: calc(var(--stagger-start, var(--reveal-start)) + var(--reveal-j, 0) * var(--stagger-step, 20ms));
}
[data-reveal="grow"] { transform-origin: left center; }
[data-reveal="drop"] { transform-origin: center top; }
[data-reveal="raise"] { transform-origin: center bottom; }
[data-slide-key="call_to_action"] a.cta:focus-visible { outline: 2px solid var(--orba-cool); outline-offset: 4px; }
@keyframes cta-pulse {
  0%, 100% { transform: none; box-shadow: 0 0 0 0 color-mix(in srgb, var(--orba-accent) 50%, transparent); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 18px color-mix(in srgb, var(--orba-accent) 0%, transparent); }
}
[data-reveal="pop"] { transition-timing-function: var(--reveal-ease), var(--reveal-spring); }
/* SVG strokes drawn along their own length (pathLength="1"); only where the draw can
   happen, so print and reduced-motion readers get solid lines whatever the browser. */
@media screen and (prefers-reduced-motion: no-preference) {
  .reveal-ready [data-reveal="draw"] {
    stroke-dasharray: 1;
    transition: stroke-dashoffset var(--draw-duration, 900ms) var(--reveal-ease);
    transition-delay: calc(var(--reveal-start) + var(--reveal-i, 0) * var(--reveal-step));
  }
}
svg [data-reveal-stagger] > *, svg[data-reveal-stagger] > * { transform-box: fill-box; transform-origin: center; }

@media screen and (prefers-reduced-motion: no-preference) {
  .reveal-ready .page:not([data-appendix], .is-revealed) :is([data-reveal], [data-reveal-stagger] > *) { transition: none; }
  /* grow, drop, raise and draw keep their own opacity (the roadmap tails sit at 28%). */
  .reveal-ready .page:not([data-appendix], .is-revealed) :is([data-reveal]:not([data-reveal="grow"], [data-reveal="drop"], [data-reveal="raise"], [data-reveal="draw"]), [data-reveal-stagger] > *) { opacity: 0; }
  .reveal-ready .page:not([data-appendix], .is-revealed) [data-reveal="rise"] { transform: translateY(24px); }
  .reveal-ready .page:not([data-appendix], .is-revealed) [data-reveal="grow"] { transform: scaleX(0); }
  .reveal-ready .page:not([data-appendix], .is-revealed) [data-reveal="drop"] { transform: scaleY(0); }
  .reveal-ready .page:not([data-appendix], .is-revealed) [data-reveal="pop"] { transform: scale(0); }
  .reveal-ready .page:not([data-appendix], .is-revealed) [data-reveal="raise"] { transform: scaleY(0); }
  /* 15 Let's talk: the primary (WhatsApp) button pulses three times once the slide is read, then rests. */
  [data-slide-key="call_to_action"].is-revealed a.cta { animation: cta-pulse 1.8s var(--reveal-ease) 700ms 3 both; }
  [data-slide-key="call_to_action"] a.cta:is(:hover, :focus-visible) { animation: none; }
  .reveal-ready .page:not([data-appendix], .is-revealed) [data-reveal-stagger] > * { transform: scale(.4); }
  .reveal-ready .page:not([data-appendix], .is-revealed) [data-reveal="draw"] { stroke-dashoffset: 1; }
  /* 03 Vision: the you-with-Orba marker waits at the average until the slide is read. */
  .reveal-ready .page:not([data-appendix], .is-revealed) .scale-you { transform: translateX(0); transition: none; }
}

/* 02 Vision (#2391, William 2026-09-26): after a 300ms hold, you with Orba leaves the average
   at a linear pace for five seconds, the marker sliding from 1.0 to 0.80 and drawing its trail
   while the written number counts down in step, so the build ends at 5.3s. The eight dots
   stagger in from 200ms and the three role-model portraits (#2643) fade in at 850ms. */
.vision-scale { --draw-duration: 5000ms; }
.scale-you { transition: transform 5000ms linear 300ms; }
.vision-scale .scale-trail { transition-timing-function: linear; transition-delay: 300ms; }
.vision-scale .scale-leaders { --stagger-start: 200ms; --stagger-step: 70ms; }
.vision-scale .scale-people { --reveal-start: 850ms; }

/* 12 Roadmap: the Now line drops in, the three phases cascade, then every bar and
   milestone grows out of its start quarter in date order (--start is the chart
   column each mark already declares). Tails follow their bar. ~1.5s. */
[data-slide-key="roadmap"] .gantt-now { transition-delay: 100ms; }
[data-slide-key="roadmap"] .gantt-phases span { transition-delay: calc(150ms + (var(--start, 1) - 1) * 60ms); }
[data-slide-key="roadmap"] .gantt-mark { transition-delay: calc(250ms + (var(--start, 1) - 1) * 90ms); }

/* 14 The ask: Orba's bar, then the peers top to bottom, then the leaders, each bar before
   its label, then the terms line; 45ms steps over 25 elements finish in about 1.6s. */
[data-slide-key="deal_terms"] { --reveal-step: 45ms; }

/* 14 Use of funds: the bar fills left to right, a segment at a time, each table row
   appearing under its colour; then the runway numbers rise in. ~1.6s. */
[data-slide-key="use_of_funds"] .funds-stack > span { transition-delay: calc(150ms + (var(--seg, 1) - 1) * 140ms); }
[data-slide-key="use_of_funds"] tbody tr { transition-delay: calc(300ms + (var(--seg, 1) - 1) * 140ms); }
[data-slide-key="use_of_funds"] .runway-plan strong { transition-delay: calc(700ms + (var(--seg, 1) - 1) * 180ms); }
[data-slide-key="use_of_funds"] .money-footer { transition-delay: 1200ms; }

/* 06 Checkup gap: the report, three points, then the money band (lead, two counting numbers, who answered). ~1.4s. */
/* 05 Opportunity (#2562): Bangkok, Thailand, then Asia-Pacific, 800ms apart; each map window
   rises, its caption 180ms later, and the dotted path to it fades in just before (~2.6s).
   Once a window is up its map settles from a closer zoom, Bangkok's pin drops and pulses twice.
   reveal.js owns entry/reset; these keyframes restart whenever the slide is read again. */
[data-slide-key="opportunity"] [data-reveal] { transition-delay: var(--opportunity-at); transition-duration: 700ms; transition-timing-function: cubic-bezier(.16, 1, .3, 1); }
@keyframes opw-settle { from { transform: scale(1.22); } }
@keyframes opw-drop { from { opacity: 0; transform: translateY(-18px); } }
@keyframes opw-pulse { 0% { opacity: .75; transform: scale(.35); } 100% { opacity: 0; transform: scale(2.8); } }
@media screen and (prefers-reduced-motion: no-preference) {
  .reveal-ready [data-slide-key="opportunity"].is-revealed .opw-geo-use { animation: opw-settle 1.2s var(--t, 0s) cubic-bezier(.16, 1, .3, 1) both; }
  .reveal-ready [data-slide-key="opportunity"].is-revealed .opw-pin { animation: opw-drop .55s calc(var(--t, 0s) + .6s) cubic-bezier(.16, 1, .3, 1) both; }
  .reveal-ready [data-slide-key="opportunity"].is-revealed .opw-halo { animation: opw-pulse 1.7s calc(var(--t, 0s) + 1.1s) ease-out 2; }
}

/* 06 Solution (#2657): the Orba mark, then each spoke and the arc out of it, clockwise, then the
   orange retest arc and its label. ~1.4s. */
[data-slide-key="thesis"] { --reveal-step: 75ms; --draw-duration: 420ms; }
/* Each arc's arrowhead sits half-way along it, and a draw would leave it showing before the line
   gets there, so the arc also fades in over the first half of its draw. */
@media screen and (prefers-reduced-motion: no-preference) {
  .reveal-ready .care-loop-arc {
    transition-property: stroke-dashoffset, opacity;
    transition-duration: var(--draw-duration), calc(var(--draw-duration) / 2);
    transition-timing-function: var(--reveal-ease), linear;
  }
  .reveal-ready .page:not([data-appendix], .is-revealed) .care-loop-arc { opacity: 0; }
}
/* The first members (A1) and the engine (A2) moved to the appendix in #2652; the appendix never builds. */
/* 10 Competitors: map (150ms), heading (550ms), eight peer rows (650–1630ms),
   then Orba in both (2000ms). The final highlight settles at 2.4s. */
[data-slide-key="competitors"] .landscape-map { transition-delay: 150ms; }
[data-slide-key="competitors"] thead { transition-delay: 550ms; }
[data-slide-key="competitors"] tbody tr { transition-delay: calc(650ms + (var(--reveal-i) - 4) * 140ms); }
[data-slide-key="competitors"] :is(.dot.orba, .orba-row) { transition-delay: 2000ms; }
[data-slide-key="competitors"] .dot.orba { transform-box: fill-box; transform-origin: center; }
/* 11 Founders: four cards pop in reading order. 1.05s. */
[data-slide-key="team_founders"] .founder-grid { --stagger-step: 200ms; }

/* Switching preferences or printing must not animate from a hidden screen state. */
@media (prefers-reduced-motion: reduce), print {
  [data-reveal], [data-reveal-stagger] > * { transition: none; }
}


/* 06 Why now (#2563): the ×11 rises, each search line draws left to right with longevity first,
   the end dots and labels land, then the first-mover line under the number. ~2s. */
.page:has(.trends) { --reveal-step: 130ms; --draw-duration: 1300ms; }

/* 10 Feature matrix (#2650): header, then the fifteen rows in reading order, 90ms apart. About 1.7s. */
[data-slide-key="feature_matrix"] thead { transition-delay: 150ms; }
[data-slide-key="feature_matrix"] tbody tr { transition-delay: calc(400ms + (var(--reveal-i) - 1) * 90ms); }

/* 11 Roadmap with money (#2653): the money rows fade in column by column after the bars. */
[data-slide-key="roadmap"] .gantt-money > span { transition-delay: calc(900ms + (var(--start, 1) - 1) * 70ms); }
/* 13 Use of funds variants (#2653): bars grow one at a time, then their labels, then the cash fact. */
[data-slide-key="use_of_funds"] .uof-bar { transition-delay: calc(150ms + (var(--seg, 1) - 1) * 140ms); }

/* #2653 use of funds: donut segments clockwise, table rows, KPIs last */
[data-slide-key="use_of_funds"] .uof-donut .seg { transition-delay: calc(200ms + (var(--seg, 1) - 1) * 160ms); }
[data-slide-key="use_of_funds"] .uof-kpis > div { transition-delay: calc(1000ms + (var(--seg, 1) - 1) * 200ms); }
