/* The GSAP styles (decisions MO5, MO6, 3 Dec 2026): the layouts of Marquee, Chapters, Drift, Rise and Deck, and the
   motion that brings them to life. Loaded only by a style that uses one of these pieces (layouts/base.njk).
   Rules that keep every page still and complete (standard v1.5 §5.2):
   - CSS lays the page out; nothing here waits for a script. The opening (words, lines and pictures rising into place)
     is plain CSS, so it plays the moment the page appears, with no loader and nothing hidden: the pictures are on
     screen from the first paint and only move.
   - Scenes tied to scrolling read one number, --p (0 to 1), which assets/js/motion.js sets with GSAP. Without the
     script --p stays 0: the scene simply rests at its first frame. Layouts that only make sense while the script runs
     (the pinned row, the stacked deck) switch on under html[data-live], which motion.js sets.
   - Nothing moves for a visitor who asks for reduced motion: every animation sits inside prefers-reduced-motion:
     no-preference, and motion.js does nothing for them.
   - Transforms only: nothing here changes the layout while it moves, so the page never shifts. */

:root { --dir: 1; --p: 0; }
[dir="rtl"] { --dir: -1; }

/* ---------- Words and lines that rise (hero headings; section headings split by motion.js) ---------- */
/* Each word sits in a box that clips it, the clip reaching a little past the box so the letters' tails and the Arabic
   marks are never cut; a word starts low enough to be fully hidden below it. */
.word, .line { clip-path: inset(-0.3em -0.3em -0.35em -0.3em); }
.word { display: inline-block; vertical-align: top; }
.line { display: block; }
.word__in, .line__in { display: inline-block; }

/* ---------- Header "pill": a small floating menu ---------- */
[data-header="pill"] .site-header {
  position: sticky; inset-block-start: var(--space-3); z-index: 20;
  background: transparent; border: 0; pointer-events: none;
}
[data-header="pill"] .site-header__inner {
  pointer-events: auto; background: var(--color-band); color: var(--color-on-band);
  border-radius: var(--radius-pill); box-shadow: var(--shadow-1);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-6);
  inline-size: calc(100% - var(--space-6)); margin-block-start: var(--space-3);
}
[dir="rtl"][data-header="pill"] .site-header__inner { padding: var(--space-2) var(--space-6) var(--space-2) var(--space-2); }
[data-header="pill"] .site-header__inner:has(.site-nav.is-open) { border-radius: var(--radius-card); }
[data-header="pill"] .brand, [data-header="pill"] .site-nav__list a, [data-header="pill"] .lang-switch { color: var(--color-on-band); }
[data-header="pill"] .site-nav__list a[aria-current="page"] { color: var(--color-on-band); }
[data-header="pill"] .site-header .button { background: var(--color-on-band); border-color: var(--color-on-band); color: var(--color-band); }
[data-header="pill"] .site-header .button:hover { background: var(--color-on-band-muted); border-color: var(--color-on-band-muted); color: var(--color-band); }
[data-header="pill"] .nav-toggle { background: transparent; color: var(--color-on-band); border-color: var(--color-on-band-muted); border-radius: var(--radius-pill); }
[data-header="pill"] .site-header :focus-visible { outline-color: var(--color-on-band); }
/* On a phone the business name is set at body size, so the name and the menu button share one line. */
@media (max-width: 30rem) {
  [data-header="pill"] .brand { font-size: var(--text-body-size); line-height: var(--text-body-line); }
}
@media (min-width: 48rem) {
  [data-header="pill"] .site-header__inner { inline-size: fit-content; max-inline-size: calc(100% - var(--space-8)); gap: var(--space-8); }
}

/* ---------- Hero "marquee" (Marquee): the name in giant type across the opening, a held photo card ---------- */
.hero--marquee { position: relative; overflow: clip; padding-block: var(--space-8) var(--hero-space); }
.hero__marquee {
  font-family: var(--text-display-family); font-size: var(--text-display-size); line-height: var(--text-display-line);
  font-weight: var(--text-display-weight); text-transform: var(--heading-case); letter-spacing: var(--heading-tracking);
  white-space: nowrap; user-select: none; pointer-events: none;
}
:lang(ar) .hero__marquee { letter-spacing: normal; }
.marquee__row { display: flex; }
.marquee__track { display: inline-flex; align-items: center; }
.marquee__row--1 { color: var(--color-ink); }
/* The second line in outline only. Its text is drawn by the stylesheet (content from data-name): it is decoration,
   hidden from screen readers, and as an outline it has no fill colour a contrast check could read. */
.marquee__name { unicode-bidi: isolate; }
.marquee__name::before { content: attr(data-name); color: transparent; -webkit-text-stroke: calc(var(--border-1) * 2) var(--color-ink); }
.marquee__row--2 .marquee__track { transform: translateX(calc(-22% * var(--dir))); }
/* The dot between names: a circle in the accent colour, its box wide enough to space the names. */
.marquee__dot { display: inline-block; inline-size: 0.8em; aspect-ratio: 1; background: radial-gradient(circle, var(--color-accent) 0 19%, transparent 21%); }
.hero--marquee .hero__media {
  position: relative; z-index: 2; margin: 0 auto; inline-size: min(64vw, 20rem);
  margin-block-start: calc(var(--text-display-size) * -1.35);
}
.hero--marquee .hero__media img { aspect-ratio: 4 / 5; object-fit: cover; rotate: -3deg; box-shadow: var(--shadow-2); }
.hero--marquee .hero__inner { gap: var(--space-8); }
.hero--marquee .hero__title { font-size: var(--text-h2-size); line-height: var(--text-h2-line); }
@media (max-width: 47.99rem) {
  .hero--marquee .hero__media { order: -1; }
}
@media (min-width: 48rem) {
  /* The card stands over the two lines of the name; the heading and the action sit side by side below them. */
  .hero--marquee .hero__media {
    position: absolute; inset-inline: 0; inset-block-start: var(--space-8);
    inline-size: calc(var(--text-display-size) * 1.45); margin-block-start: 0;
  }
  .hero--marquee .hero__inner { margin-block-start: var(--space-12); }
  .hero--marquee .hero__text, .hero--rise .hero__text {
    display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); grid-template-rows: 1fr auto; column-gap: var(--space-12);
  }
  .hero--marquee .hero__title, .hero--rise .hero__title { grid-row: span 2; margin: 0; align-self: end; }
  .hero--marquee .hero__lede, .hero--rise .hero__lede { margin-block: 0 var(--space-6); align-self: end; }
}

/* ---------- Hero "staggered" (Chapters): the heading in huge lines set across the grid ---------- */
.hero--staggered { overflow: clip; padding-block: var(--space-12) var(--hero-space); }
.hero--staggered .hero__text { display: contents; }
.hero--staggered .hero__inner { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
.hero--staggered .hero__title { font-size: var(--text-display-size); line-height: var(--text-display-line); max-inline-size: none; margin: 0; }
:lang(ar) .hero--staggered .hero__title { line-height: var(--text-h3-line); }
.hero--staggered .hero__media { overflow: clip; border-radius: var(--radius-card); }
.hero--staggered .hero__media img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0; }
@media (min-width: 48rem) {
  .hero--staggered .hero__inner {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    grid-template-areas: "title title" "lede media" "buttons media";
    grid-template-rows: auto auto 1fr; align-items: start; column-gap: var(--space-12);
  }
  .hero--staggered .hero__title { grid-area: title; }
  .hero--staggered .hero__lede { grid-area: lede; margin: 0; }
  .hero--staggered .button-row { grid-area: buttons; }
  .hero--staggered .hero__media { grid-area: media; }
  .hero--staggered .hero__media { margin-block-start: calc(var(--space-16) * -1); }
  .hero--staggered .line:nth-child(2) { padding-inline-start: 12%; }
  .hero--staggered .line:nth-child(3) { padding-inline-start: 4%; }
  .hero--staggered .line:nth-child(4) { padding-inline-start: 18%; }
}

/* ---------- Hero "drift" (Drift): the heading in the middle, photos floating around it ---------- */
.hero--drift { position: relative; overflow: clip; padding-block: var(--space-12) var(--hero-space); }
.hero--drift .hero__inner { position: relative; justify-items: center; text-align: center; }
.hero--drift .hero__text { position: relative; z-index: 2; max-inline-size: 44rem; display: grid; justify-items: center; }
.hero--drift .hero__title { font-size: var(--text-h2-size); line-height: var(--text-h2-line); }
.hero--drift .button-row { justify-content: center; }
.hero--drift .hero__media img { aspect-ratio: 4 / 5; object-fit: cover; }
.hero--drift .hero__extra { margin: 0; }
.hero--drift .hero__extra img { inline-size: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-card); }
@media (max-width: 47.99rem) {
  .hero--drift .hero__media { order: -1; inline-size: 78%; }
  .hero--drift .hero__more { display: none; }
}
@media (min-width: 48rem) {
  .hero--drift .hero__inner { min-block-size: 40rem; align-content: center; }
  .hero--drift .hero__media, .hero--drift .hero__extra { position: absolute; z-index: 1; }
  .hero--drift .hero__more { display: contents; }
  .hero--drift .hero__text { max-inline-size: 46%; }
  .hero--drift .hero__media { inline-size: 22%; inset-inline-start: 0; inset-block-end: 4%; }
  .hero--drift .hero__extra--1 { inline-size: 14%; inset-inline-start: 6%; inset-block-start: 0; }
  .hero--drift .hero__extra--2 { inline-size: 17%; inset-inline-end: 2%; inset-block-start: 6%; }
  .hero--drift .hero__extra--3 { inline-size: 13%; inset-inline-end: 9%; inset-block-end: 0; }
  /* Each picture floats at its own depth: as the page scrolls they part, the nearer ones faster. */
  .hero--drift .hero__media img { transform: translate(calc(var(--p) * -18% * var(--dir)), calc(var(--p) * 30%)); }
  .hero--drift .hero__extra--1 img { transform: translate(calc(var(--p) * -30% * var(--dir)), calc(var(--p) * -55%)); }
  .hero--drift .hero__extra--2 img { transform: translate(calc(var(--p) * 25% * var(--dir)), calc(var(--p) * -35%)) rotate(calc(var(--p) * 6deg)); }
  .hero--drift .hero__extra--3 img { transform: translate(calc(var(--p) * 35% * var(--dir)), calc(var(--p) * 45%)); }
  .hero--drift .hero__text { transform: translateY(calc(var(--p) * -12%)); }
}

/* ---------- Hero "rise" (Rise): a large statement; the photo below rises and grows to the full width ---------- */
.hero--rise { overflow: clip; padding-block: var(--space-12) var(--space-8); }
.hero--rise .hero__inner { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
.hero--rise .hero__title { font-size: var(--text-h1-size); line-height: var(--text-h1-line); max-inline-size: 22ch; }
.hero--rise .hero__media { overflow: clip; border-radius: var(--radius-card); }
.hero--rise .hero__media img { aspect-ratio: 4 / 5; object-fit: cover; border-radius: 0; }
@media (min-width: 48rem) {
  .hero--rise .hero__media img { aspect-ratio: 21 / 9; }
  /* Starts a little smaller and lower, then grows to the full width as the page scrolls; the picture inside
     settles from a slight zoom. */
  .hero--rise .hero__media { transform: translateY(calc(var(--p) * -4rem)) scale(calc(0.74 + var(--p) * 0.26)); transform-origin: 50% 0; }
  .hero--rise .hero__media img { transform: scale(calc(1.12 - var(--p) * 0.12)); }
}

/* ---------- Hero "deck" (Deck): photo cards dealt onto colour shapes ---------- */
.hero--deck { position: relative; overflow: clip; isolation: isolate; padding-block: var(--space-12) var(--hero-space); }
.hero__shapes span { position: absolute; z-index: -1; display: block; pointer-events: none; }
.hero__shapes span:nth-child(1) {
  inline-size: 46%; aspect-ratio: 1; inset-inline-end: -6%; inset-block-start: 8%;
  background: color-mix(in oklab, var(--color-primary) 22%, var(--color-surface-100));
  border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
  transform: rotate(calc(var(--p) * 40deg));
}
.hero__shapes span:nth-child(2) {
  inline-size: 15%; aspect-ratio: 1; inset-inline-end: 3%; inset-block-end: 4%;
  background: color-mix(in oklab, var(--color-accent) 30%, var(--color-surface-100));
  border-radius: 50%;
  transform: translateY(calc(var(--p) * -60%));
}
.hero__shapes span:nth-child(3) {
  inline-size: 28%; aspect-ratio: 2 / 1; inset-inline-start: -8%; inset-block-start: -4%;
  background: var(--color-surface-200);
  border-radius: var(--radius-pill);
  transform: translateX(calc(var(--p) * 20% * var(--dir)));
}
.hero--deck .hero__inner { gap: var(--space-12); }
.hero--deck .hero__title { font-size: var(--text-h1-size); line-height: var(--text-h1-line); }
.hero--deck .hero__more { display: contents; }
.hero--deck .hero__media, .hero--deck .hero__extra {
  grid-area: deck; justify-self: center; margin: 0; inline-size: min(70%, 22rem);
  background: var(--color-surface-100); padding: var(--space-2); border-radius: var(--radius-card); box-shadow: var(--shadow-2);
}
.hero--deck .hero__media img, .hero--deck .hero__extra img { inline-size: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: calc(var(--radius-card) - var(--space-2)); }
.hero--deck .hero__media { z-index: 3; rotate: 4deg; }
.hero--deck .hero__extra--1 { z-index: 2; rotate: -7deg; }
.hero--deck .hero__extra--2 { z-index: 1; rotate: 11deg; }
.hero--deck .hero__extra--3 { z-index: 0; rotate: -14deg; }
/* As the page scrolls the cards fan out from the stack. */
.hero--deck .hero__extra--1 { transform: translate(calc(var(--p) * -38% * var(--dir)), calc(var(--p) * -6%)) rotate(calc(var(--p) * -8deg)); }
.hero--deck .hero__extra--2 { transform: translate(calc(var(--p) * 36% * var(--dir)), calc(var(--p) * 4%)) rotate(calc(var(--p) * 10deg)); }
.hero--deck .hero__extra--3 { transform: translate(calc(var(--p) * -12% * var(--dir)), calc(var(--p) * 22%)) rotate(calc(var(--p) * -10deg)); }
.hero--deck .hero__media { transform: translateY(calc(var(--p) * -14%)); }
@media (max-width: 47.99rem) {
  .hero--deck .hero__inner { grid-template-areas: "deck" "text"; }
  .hero--deck .hero__text { grid-area: text; }
}
@media (min-width: 48rem) {
  .hero--deck .hero__inner { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); grid-template-areas: "text deck"; }
  .hero--deck .hero__text { grid-area: text; }
}

/* ---------- Projects "collage" (Marquee): scattered, each photo at its own depth ---------- */
.projects--collage > li:nth-child(1) { --depth: 0.5; }
.projects--collage > li:nth-child(2) { --depth: 1.4; }
.projects--collage > li:nth-child(3) { --depth: 0.9; }
.projects--collage > li:nth-child(4) { --depth: 1.8; }
@media (min-width: 48rem) {
  .projects--collage { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-8) var(--space-6); align-items: start; }
  .projects--collage > li:nth-child(1) { grid-column: 1 / span 5; }
  .projects--collage > li:nth-child(2) { grid-column: 7 / span 4; margin-block-start: var(--space-16); }
  .projects--collage > li:nth-child(3) { grid-column: 2 / span 4; }
  .projects--collage > li:nth-child(4) { grid-column: 7 / span 6; margin-block-start: calc(var(--space-16) * -1); }
  .projects--collage > li:nth-child(odd) img { aspect-ratio: 4 / 5; object-fit: cover; }
  .projects--collage > li { transform: translateY(calc((0.5 - var(--p)) * var(--depth) * 9rem)); }
}

/* ---------- Projects "float" (Drift): two columns moving at different speeds ---------- */
@media (min-width: 48rem) {
  .projects--float { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8) var(--space-16); }
  .projects--float > li:nth-child(even) { margin-block-start: var(--space-16); transform: translateY(calc((0.5 - var(--p)) * 10rem)); }
  .projects--float > li:nth-child(odd) { transform: translateY(calc((var(--p) - 0.5) * 3rem)); }
  .projects--float > li:nth-child(4n + 1) img, .projects--float > li:nth-child(4n) img { aspect-ratio: 4 / 5; object-fit: cover; }
}

/* ---------- Projects "pair" (Rise): a large photo and a smaller one laid over its corner ---------- */
@media (min-width: 48rem) {
  .projects--pair { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-6); }
  .projects--pair > li:nth-child(4n + 1) { grid-column: 1 / span 7; }
  .projects--pair > li:nth-child(4n + 2) { grid-column: 7 / span 5; margin-block-start: calc(var(--space-16) * -2); }
  .projects--pair > li:nth-child(4n + 3) { grid-column: 6 / span 7; margin-block-start: var(--space-12); }
  .projects--pair > li:nth-child(4n) { grid-column: 2 / span 5; margin-block-start: calc(var(--space-16) * -2); }
  .projects--pair > li:nth-child(even) { position: relative; z-index: 1; transform: translateY(calc((0.5 - var(--p)) * 7rem)); }
  .projects--pair > li:nth-child(even) figure { background: var(--color-surface-100); padding: var(--space-3); border-radius: var(--radius-card); box-shadow: var(--shadow-2); }
  .projects--pair > li:nth-child(odd) figcaption { max-inline-size: 50%; }
  .projects--pair > li:nth-child(4n + 3) figcaption { margin-inline-start: auto; }
}

/* ---------- Projects "pinned" (Chapters): one row moving sideways while the page holds still ---------- */
/* Without the script: a row that scrolls sideways by touch, wheel or keys. */
.projects--pinned {
  grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(80%, 26rem);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding-block-end: var(--space-4);
}
.projects--pinned > li { scroll-snap-align: start; }
.projects--pinned img { aspect-ratio: 4 / 5; object-fit: cover; }
.projects--pinned:focus-visible { outline: var(--focus-ring) solid var(--color-primary); outline-offset: var(--space-1); }
@media (min-width: 48rem) and (prefers-reduced-motion: no-preference) {
  [data-live] .projects-pin { block-size: 240svh; }
  [data-live] .projects-pin__frame { position: sticky; inset-block-start: 0; block-size: 100svh; display: flex; align-items: center; overflow: clip; }
  [data-live] .projects--pinned {
    display: flex; flex-wrap: nowrap; overflow: visible; scroll-snap-type: none; inline-size: 100%;
    transform: translateX(calc(var(--p) * var(--shift, 0px) * -1 * var(--dir)));
  }
  [data-live] .projects--pinned > li { flex: 0 0 min(26rem, 30vw); }
  [data-live] .projects--pinned > li:nth-child(even) { margin-block-start: var(--space-16); }
}

/* ---------- Projects "deck" (Deck): cards that stack one on another ---------- */
.projects--deck { grid-template-columns: minmax(0, 1fr); max-inline-size: 44rem; margin-inline: auto; gap: var(--space-8); }
.projects--deck figure { background: var(--color-surface-100); padding: var(--space-3); border-radius: var(--radius-card); box-shadow: var(--shadow-2); }
.projects--deck img { aspect-ratio: 3 / 2; object-fit: cover; border-radius: calc(var(--radius-card) - var(--space-3)); }
.projects--deck figcaption { padding: var(--space-3) var(--space-2) var(--space-1); }
.projects--deck > li:nth-child(odd) { --tilt: -3deg; }
.projects--deck > li:nth-child(even) { --tilt: 3deg; }
@media (prefers-reduced-motion: no-preference) {
  [data-live] .projects--deck > li { position: sticky; inset-block-start: calc(var(--space-16) * 1.5); }
  [data-live] .projects--deck > li figure { transform: scale(calc(1 - var(--p) * 0.08)) rotate(calc(var(--tilt) * var(--p))); transform-origin: 50% 0; }
}

/* ---------- Why "chapters" (Chapters): each reason held on screen, a line that fills as you read ---------- */
@media (min-width: 48rem) {
  [data-why="chapters"] .statements { position: relative; grid-template-columns: minmax(0, 1fr); gap: 0; padding-inline-start: var(--space-12); }
  [data-why="chapters"] .statements::before, [data-why="chapters"] .statements::after {
    content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: calc(var(--border-1) * 2); background: var(--color-line);
  }
  [data-why="chapters"] .statements::after { background: var(--color-primary); transform: scaleY(var(--p)); transform-origin: 50% 0; }
  [data-why="chapters"] .statements li {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: var(--space-12); align-items: start;
    min-block-size: 60svh; border: 0; padding-block: var(--space-12);
  }
  [data-why="chapters"] .statements h3 { position: sticky; inset-block-start: var(--space-16); margin: 0; font-size: var(--text-h1-size); line-height: var(--text-h1-line); }
  [data-why="chapters"] .statements p {
    font-size: var(--text-h3-size); line-height: var(--text-h3-line);
    color: color-mix(in oklab, var(--color-ink) calc(var(--lit, 1) * 100%), var(--color-ink-muted));
  }
  [data-live][data-why="chapters"] .statements li { --lit: 0; }
}

/* ---------- Why "split" (Rise): the heading stays while the reasons pass beside it ---------- */
@media (min-width: 48rem) {
  [data-why="split"] .container:has(> .statements) { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: var(--space-16); align-items: start; }
  [data-why="split"] .container:has(> .statements) > :first-child { position: sticky; inset-block-start: var(--space-16); font-size: var(--text-h1-size); line-height: var(--text-h1-line); }
  [data-why="split"] .statements { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  [data-why="split"] .statements li { background: var(--color-surface-100); border: 0; border-radius: var(--radius-card); padding: var(--space-8); box-shadow: var(--shadow-1); }
  [data-why="split"] .statements p { color: var(--color-ink-muted); }
}

/* ---------- The opening: what moves the moment the page appears ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Moving between pages: the browser's own cross-fade (no script). */
  @view-transition { navigation: auto; }

  [data-motion="gsap"] .hero[data-stage] .word__in,
  [data-motion="gsap"] .hero[data-stage] .line__in {
    animation: stage-rise var(--duration-enter) var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * var(--duration-stagger));
  }
  [data-motion="gsap"] .hero[data-stage] .line__in { animation-delay: calc(var(--i, 0) * var(--duration-stagger) * 2); }
  @keyframes stage-rise { from { translate: 0 150%; } }

  [data-motion="gsap"] .hero[data-stage] .hero__lede,
  [data-motion="gsap"] .hero[data-stage] .button-row { animation: stage-lift var(--duration-enter) var(--ease-out) both; animation-delay: calc(var(--duration-stagger) * 6); }
  @keyframes stage-lift { from { translate: 0 1.5rem; } }

  /* Pictures arrive already on screen and only move into place. */
  [data-motion="gsap"] .hero--marquee .marquee__row--1 { animation: stage-slide-in var(--duration-enter) var(--ease-out) both; }
  [data-motion="gsap"] .hero--marquee .marquee__row--2 { animation: stage-slide-in-back var(--duration-enter) var(--ease-out) both; }
  @keyframes stage-slide-in { from { translate: calc(14% * var(--dir)) 0; } }
  @keyframes stage-slide-in-back { from { translate: calc(-14% * var(--dir)) 0; } }
  [data-motion="gsap"] .hero--marquee .hero__media { animation: stage-card var(--duration-enter) var(--ease-out) both; animation-delay: calc(var(--duration-stagger) * 3); }
  @keyframes stage-card { from { translate: 0 18%; rotate: -10deg; } }
  /* While the visitor scrolls out of the opening the name slides sideways, the two lines in opposite directions,
     and the card straightens. */
  [data-motion="gsap"] .hero--marquee .marquee__row--1 .marquee__track { transform: translateX(calc(var(--p) * -24% * var(--dir))); }
  [data-motion="gsap"] .hero--marquee .marquee__row--2 .marquee__track { transform: translateX(calc((-22% + var(--p) * 20%) * var(--dir))); }
  [data-motion="gsap"] .hero--marquee .hero__media img { transform: rotate(calc(var(--p) * 3deg)) scale(calc(1 + var(--p) * 0.06)); }

  [data-motion="gsap"] .hero--staggered .hero__media img { animation: stage-settle calc(var(--duration-enter) * 1.6) var(--ease-out) both; }
  @keyframes stage-settle { from { scale: 1.14; } }
  @media (min-width: 48rem) {
    [data-motion="gsap"] .hero--staggered .line:nth-child(1) .line__in { transform: translateX(calc(var(--p) * -8% * var(--dir))); }
    [data-motion="gsap"] .hero--staggered .line:nth-child(2) .line__in { transform: translateX(calc(var(--p) * 10% * var(--dir))); }
    [data-motion="gsap"] .hero--staggered .line:nth-child(3) .line__in { transform: translateX(calc(var(--p) * -5% * var(--dir))); }
    [data-motion="gsap"] .hero--staggered .hero__media img { transform: translateY(calc(var(--p) * 8%)) scale(1.1); }
  }

  [data-motion="gsap"] .hero--drift .hero__media,
  [data-motion="gsap"] .hero--drift .hero__extra { animation: stage-float-in calc(var(--duration-enter) * 1.4) var(--ease-out) both; }
  [data-motion="gsap"] .hero--drift .hero__extra--1 { --fx: -40%; --fy: -30%; animation-delay: calc(var(--duration-stagger) * 2); }
  [data-motion="gsap"] .hero--drift .hero__extra--2 { --fx: 40%; --fy: -20%; animation-delay: calc(var(--duration-stagger) * 4); }
  [data-motion="gsap"] .hero--drift .hero__extra--3 { --fx: 30%; --fy: 40%; animation-delay: calc(var(--duration-stagger) * 6); }
  [data-motion="gsap"] .hero--drift .hero__media { --fx: -20%; --fy: 20%; }
  @keyframes stage-float-in { from { translate: calc(var(--fx, 0%) * var(--dir)) var(--fy, 0%); scale: 0.9; } }

  [data-motion="gsap"] .hero--rise .hero__media { animation: stage-rise-card calc(var(--duration-enter) * 1.3) var(--ease-out) both; animation-delay: calc(var(--duration-stagger) * 4); }
  @keyframes stage-rise-card { from { translate: 0 22%; } }

  [data-motion="gsap"] .hero--deck .hero__media,
  [data-motion="gsap"] .hero--deck .hero__extra { animation: stage-deal var(--duration-enter) var(--ease-out) both; }
  [data-motion="gsap"] .hero--deck .hero__extra--3 { animation-delay: calc(var(--duration-stagger) * 0); }
  [data-motion="gsap"] .hero--deck .hero__extra--2 { animation-delay: calc(var(--duration-stagger) * 2); }
  [data-motion="gsap"] .hero--deck .hero__extra--1 { animation-delay: calc(var(--duration-stagger) * 4); }
  [data-motion="gsap"] .hero--deck .hero__media { animation-delay: calc(var(--duration-stagger) * 6); }
  @keyframes stage-deal { from { translate: calc(-30% * var(--dir)) 45%; rotate: -24deg; } }
  [data-motion="gsap"] .hero__shapes span { animation: stage-pop calc(var(--duration-enter) * 1.4) var(--ease-out) both; }
  @keyframes stage-pop { from { scale: 0.6; } }
}

/* Without a preference for motion: everything rests in its final place, and the scenes never start. */
@media (prefers-reduced-motion: reduce) {
  .hero[data-stage], .projects, .statements { --p: 0; }
  .hero--rise { --p: 1; }
  [data-why="chapters"] .statements { --p: 1; }
}
