/* =====================================================================
   Project (case study) pages — shared styles
   Used by project1.html (and later project2.html, …).
   Scale: 1 Figma px = 1p on a 1440px-wide canvas, capped at 1.25×.
   Phones (≤767px) get their own layout at the bottom of this file.
   ===================================================================== */

:root {
  /* Scale stops growing once the 1206p column reaches 1200px (max width of the case studies).
     Was: min(calc(100vw / 1440), 1.25px), which let the column grow to ~1507px. */
  /* Stops growing at a 1200px-wide window: wider screens keep the 1200px look (1 Figma px = 0.833px). */
  --p: min(calc(100vw / 1440), calc(1200px / 1440));
  --ink: #292929;
  --ink-2: #171717;
  --ink-3: #222326;
  --body: #3d4047;
  --body-2: #42454c;
  --muted: #939393;
  --soft: #f3f4f6;
  --lime: #c9fa75;
  --font: "Pluto Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: #fff; overflow-x: clip; }
body { font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; font-weight: inherit; }

/* Text selection: lime highlight with dark text, readable on light and dark backgrounds */
::selection { background: #c9fa75; color: #171717; }

/* Page column: 1206px wide, 117px from the left edge on the 1440 canvas */
.wrap { width: calc(1206 * var(--p)); margin: 0 auto; }
.chapter, .learnings { width: calc(1200 * var(--p)); }

/* Shared text styles */
.eyebrow {            /* "OVERVIEW", "01 · THE TEAM'S SIGH", "ROLE"… */
  font-weight: 500; font-size: calc(16 * var(--p)); line-height: calc(22.895 * var(--p));
  letter-spacing: calc(1.12 * var(--p)); color: var(--muted); text-transform: uppercase;
}
.body-text { font-size: max(14px, calc(16 * var(--p))); line-height: max(22.75px, calc(26 * var(--p))); color: var(--body); }   /* never below 14px on desktop (the scaled 16 tops out at ~13.3px) */
.body-text + .body-text { margin-top: calc(26 * var(--p)); }
.h2 { font-weight: 500; font-size: calc(30 * var(--p)); line-height: calc(34 * var(--p)); letter-spacing: calc(-0.6 * var(--p)); color: var(--ink); }
.tags { display: flex; gap: calc(8 * var(--p)); margin: 0; padding: 0; list-style: none; }
.tags li {
  background: #eaeaea; color: #808080; border-radius: 100px; white-space: nowrap;
  padding: calc(4 * var(--p)) calc(9 * var(--p));
  font-weight: 500; font-size: calc(13 * var(--p)); line-height: calc(14 * var(--p)); letter-spacing: calc(0.195 * var(--p));
}

/* ---------- Page header (logo + menu) ---------- */
.site-header {
  position: relative; height: calc(52 * var(--p)); margin-top: calc(81 * var(--p));
  display: flex; align-items: center; justify-content: space-between;
}
.brand { position: relative; display: block; width: calc(86.48 * var(--p)); height: calc(31.3 * var(--p)); }
.brand img { position: absolute; display: block; max-width: none; }
.brand .logo__cat  { left: 0; top: calc(10.29 * var(--p)); width: calc(75.377 * var(--p)); height: calc(21.007 * var(--p)); }
.brand .logo__a    { left: calc(28.31 * var(--p)); top: calc(10.59 * var(--p)); width: calc(22.027 * var(--p)); height: calc(20.407 * var(--p)); transform: rotate(180deg); transition: transform .5s var(--ease); }
.brand .logo__plus { left: calc(75.48 * var(--p)); top: 0; width: calc(11 * var(--p)); height: calc(11 * var(--p)); transition: transform .5s var(--ease); }
.brand:hover .logo__a { transform: rotate(0deg); }
.brand:hover .logo__plus { transform: rotate(90deg); }

.nav { display: flex; gap: calc(30 * var(--p)); margin-right: calc(16.52 * var(--p)); }
.nav a {
  position: relative; font-weight: 700; font-size: calc(14 * var(--p)); line-height: calc(52 * var(--p));
  letter-spacing: calc(4.2 * var(--p)); color: var(--ink); white-space: nowrap;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: calc(4.2 * var(--p)); bottom: calc(16 * var(--p));
  height: calc(2 * var(--p)); background: var(--lime); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav a:hover::after { transform: scaleX(1); }

/* ---------- Sticky bar (drops in once the header scrolls away) ---------- */
.topbar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 100;
  height: 72px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 calc((100vw - 1206 * var(--p)) / 2) 0 calc((100vw - 1206 * var(--p)) / 2);
  background: #fff; box-shadow: 0 6px 24px rgba(23,23,23,.08), 0 1px 0 rgba(23,23,23,.04);
  transform: translateY(-110%); transition: transform .4s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.topbar > * { opacity: 0; transform: translateY(-14px); transition: opacity .25s ease, transform .4s cubic-bezier(.4,0,.2,1); }
.is-stuck .topbar { transform: none; pointer-events: auto; transition: transform .6s cubic-bezier(.16,1,.3,1); }
.is-stuck .topbar > * { opacity: 1; transform: none; transition: opacity .5s ease .15s, transform .7s cubic-bezier(.16,1,.3,1) .12s; }
.is-stuck .topbar > .nav { transition-delay: .22s, .2s; }

/* ---------- Hero ---------- */
.hero { margin-top: calc(129 * var(--p)); }   /* 181px from the top of the header in Figma */
.hero__client {
  font-weight: 500; font-size: calc(22.895 * var(--p)); line-height: calc(22.895 * var(--p));
  letter-spacing: calc(6.8684 * var(--p)); color: var(--muted); text-transform: uppercase;
}
.hero__title {
  margin-top: calc(3 * var(--p));
  font-weight: 500; font-size: calc(58 * var(--p)); line-height: calc(64 * var(--p)); letter-spacing: calc(-1.16 * var(--p));
  color: var(--ink);
}
.hero__title span { display: block; }
.hero .tags { margin-top: calc(30 * var(--p)); }
.hero__image { margin-top: calc(54 * var(--p)); width: 100%; height: calc(515 * var(--p)); border-radius: calc(16 * var(--p)); overflow: hidden; }
.hero__image img { width: 100%; height: 100%; object-fit: cover; }

.facts {
  margin-top: calc(44 * var(--p)); padding-top: calc(28 * var(--p)); border-top: 1px solid #ccc;
  min-height: calc(121 * var(--p));
  display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(49 * var(--p));
}
.facts dt { margin: 0; }
.facts dd { margin: calc(3 * var(--p)) 0 0; font-size: calc(14 * var(--p)); line-height: calc(22 * var(--p)); color: var(--ink-2); }

/* ---------- Overview ---------- */
.overview { margin-top: calc(212 * var(--p)); display: flex; align-items: flex-start; gap: calc(110 * var(--p)); }
.overview__image { flex: 0 0 calc(619 * var(--p)); height: calc(274 * var(--p)); }
.overview__image img { width: 100%; height: 100%; object-fit: contain; }
/* Blym (project1) has a video here instead: 600px wide, 16:9 like the video; the text stays where it was */
.overview:has(.overview__video) { gap: calc(129 * var(--p)); }
.overview__image.overview__video { flex-basis: calc(600 * var(--p)); height: auto; aspect-ratio: 16 / 9; }
.overview__video .overview__play img { object-fit: cover; display: block; }
/* Overview video (project1): the preview is a button — the card grows like the homepage project cards,
   and the play icon turns from dark glass to white (like the homepage arrow circle) */
.overview__play {
  position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: calc(16 * var(--p)); overflow: hidden; transition: scale .6s cubic-bezier(.22,1,.36,1);
}
.overview__icon {
  position: absolute; left: 54.04%; top: 43.39%;   /* centred on the serum photo, as in the design */
  width: calc(62.5 * var(--p)); aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: rgba(0,0,0,.33); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: inset -0.5px 0.5px 0 1px rgba(255,255,255,.35);
  transition: scale .6s cubic-bezier(.22,1,.36,1), background-color .6s cubic-bezier(.22,1,.36,1), color .6s cubic-bezier(.22,1,.36,1), box-shadow .6s cubic-bezier(.22,1,.36,1);
}
.overview__icon svg { width: 100%; height: 100%; display: block; fill: currentColor; }
.overview__play:hover, .overview__play:focus-visible { scale: 1.06; }
.overview__play:hover .overview__icon, .overview__play:focus-visible .overview__icon {
  scale: 1.15; background: #fff; color: #171717; box-shadow: 0 calc(8 * var(--p)) calc(24 * var(--p)) rgba(0,0,0,.18);
}
.overview__play:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.overview__video video { display: block; width: 100%; height: 100%; object-fit: contain; background: #e2e3e5; border-radius: calc(16 * var(--p)); }
.overview__play[hidden], .overview__video video[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .overview__play, .overview__icon { transition: none; } }
.overview__text { width: calc(458 * var(--p)); margin-top: calc(25 * var(--p)); }
.overview__text .eyebrow { margin-bottom: calc(19 * var(--p)); }

/* ---------- Stat cards (Outcomes + chapter 02) ---------- */
.outcomes { margin-top: calc(212 * var(--p)); }
.outcomes__head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: calc(30 * var(--p)); }
.outcomes__dates { font-size: calc(14 * var(--p)); color: #5b5e66; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(20 * var(--p)); }
.stat {
  position: relative; overflow: clip; background: var(--soft); border-radius: calc(20 * var(--p));
  padding: calc(32 * var(--p)); display: flex; flex-direction: column; gap: calc(12 * var(--p));
}
.stat__num { position: relative; font-weight: 500; font-size: calc(44 * var(--p)); line-height: 1.2; color: var(--ink-3); white-space: nowrap; }
.stat__desc { font-size: calc(16 * var(--p)); line-height: 1.5; color: var(--body-2); }
/* Rolling numbers (built by js/project.js): each digit rolls up and stops on its value when the card
   scrolls in — 1.1s, 70ms between digits, starting just after the card's own fade-in begins */
.odo { display: inline-flex; align-items: baseline; font-variant-numeric: tabular-nums; }
.odo__digit { display: inline-block; height: 1em; line-height: 1; overflow: hidden; vertical-align: bottom; }
.odo__strip { display: flex; flex-direction: column; will-change: transform;
  transition: transform 1.1s cubic-bezier(.16,1,.3,1); transition-delay: calc(var(--d, 0s) + .25s + var(--i) * 70ms); }
.odo__strip > span { display: block; height: 1em; line-height: 1; text-align: center; }
.odo__sym { white-space: pre; }
.odo__said { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.is-in .odo__strip, html:not(.js) .odo__strip { transform: translateY(var(--to)); }
@media (prefers-reduced-motion: reduce) { .odo__strip { transition: none; } }
/* lime squiggle under the number (drawn in when the card scrolls in) */
.squiggle {
  position: absolute; pointer-events: none; max-width: none;
  clip-path: inset(0 100% 0 0); transition: clip-path 1s cubic-bezier(.65,0,.35,1) .35s;
}
.is-in .squiggle, .is-in.squiggle { clip-path: inset(0 0 0 0); }
.squiggle--outcome { left: calc(28.5 * var(--p)); top: calc(58.5 * var(--p)); width: calc(266 * var(--p)); height: calc(34 * var(--p)); }
.squiggle--stat    { left: calc(32 * var(--p));   top: calc(62 * var(--p));   width: calc(110.5 * var(--p)); height: calc(27 * var(--p)); }
.squiggle--number  { left: calc(30.86 * var(--p)); top: calc(52.85 * var(--p)); width: calc(46.3 * var(--p)); height: calc(18.3 * var(--p)); }

/* ---------- Chapters ---------- */
.chapters { margin-top: calc(120 * var(--p)); }
/* space under each chapter (from Figma: content end → next chapter) */
.chapter { margin-bottom: var(--after, calc(182 * var(--p))); }
.chapter--onboarding { --after: calc(162 * var(--p)); }
.chapter--complexity { --after: calc(120 * var(--p)); }
.chapter--ads        { --after: calc(96 * var(--p)); }
.chapter__text { display: flex; align-items: center; gap: var(--gap, calc(20 * var(--p))); }
.chapter__title { width: calc(510 * var(--p)); flex-shrink: 0; padding-bottom: calc(16 * var(--p)); }
.chapter__title h2 {
  margin-top: calc(4 * var(--p));
  font-weight: 500; font-size: calc(40 * var(--p)); line-height: calc(47 * var(--p)); letter-spacing: calc(-0.8 * var(--p)); color: var(--ink-3);
}
.chapter__title h2 span { display: block; }
.chapter__intro { width: var(--intro-w, calc(679 * var(--p))); }
.chapter--wide-gap { --gap: calc(70 * var(--p)); --intro-w: calc(620 * var(--p)); }

.chapter__figure { margin-top: calc(40 * var(--p)); border-radius: calc(32.49 * var(--p)); overflow: hidden; }
.chapter__figure img { width: 100%; }
.chapter .stats { margin-top: calc(40 * var(--p)); }
.chapter .stat { min-height: calc(202 * var(--p)); }

/* Horizontal galleries that run off the right edge (drag or scroll sideways) */
.rail {
  /* from the column's left edge to the right edge of the screen */
  width: calc(50vw + 603 * var(--p));
  display: flex; gap: var(--rail-gap, calc(24 * var(--p)));
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  scrollbar-width: none; user-select: none;
  padding-right: calc(117 * var(--p));
}
.rail::-webkit-scrollbar { display: none; }
.rail.is-dragging { scroll-snap-type: none; }
/* grab hand with a mouse (the gallery can be pulled sideways; js/project.js) */
@media (hover: hover) and (pointer: fine) { .rail { cursor: grab; } .rail.is-dragging { cursor: grabbing; } }
.rail.is-dragging * { pointer-events: none; }
.rail__item { flex: 0 0 calc(942 * var(--p)); scroll-snap-align: start; }
.rail__item img { width: 100%; height: calc(609 * var(--p)); object-fit: cover; border-radius: calc(32.49 * var(--p)); -webkit-user-drag: none; }
.rail__item figcaption { margin-top: calc(20 * var(--p)); width: calc(560 * var(--p)); }   /* 524 in Figma; a little wider so the browser font keeps captions to 2 lines */
.chapter .rail { margin-top: calc(65 * var(--p)); }
/* Galleries in the case studies run the full width of the screen: the first image starts on the text column,
   and once you scroll, images travel from one edge of the page to the other (the space each side of the
   column is padding, so snapping still lines panels up with the column). Mosaics set their own width. */
.chapter .rail:not(.mosaic) {
  --gutter: calc(50vw - 603 * var(--p));
  width: 100vw; margin-left: calc(-1 * var(--gutter));
  padding-left: var(--gutter); padding-right: var(--gutter); scroll-padding-inline: var(--gutter);
}
/* Arrow buttons under a gallery, on the right of the column (js/project.js wires them up) */
.rail-nav { display: flex; justify-content: flex-end; gap: calc(12 * var(--p)); margin-top: calc(24 * var(--p)); }
.rail-nav__btn {
  width: max(40px, calc(48 * var(--p))); height: max(40px, calc(48 * var(--p))); padding: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--ink); border: 1px solid rgba(23,23,23,.2);
  transition: background-color .35s ease, color .35s ease, border-color .35s ease, opacity .35s ease;
}
.rail-nav__btn svg { width: max(16px, calc(18 * var(--p))); height: max(16px, calc(18 * var(--p))); fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; transition: translate .35s cubic-bezier(.22,1,.36,1); }
.rail-nav__btn--prev svg { rotate: 180deg; }
.rail-nav__btn:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); color: #fff; }
.rail-nav__btn:hover:not(:disabled) svg { translate: 2px 0; }
.rail-nav__btn--prev:hover:not(:disabled) svg { translate: -2px 0; }
.rail-nav__btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.rail-nav__btn:disabled { opacity: .3; cursor: default; }
.rail-nav[hidden] { display: none; }
/* "there's more" hint on the → (js/project.js, data-hint): two nudges that get smaller, then rest */
.rail-nav__btn.is-hinting { animation: rail-hint-ring 1.4s ease-in-out; }
.rail-nav__btn.is-hinting svg { animation: rail-hint 1.4s cubic-bezier(.45,0,.25,1); }
@keyframes rail-hint { 0%, 100% { translate: 0 0; } 18% { translate: 5px 0; } 36% { translate: 0 0; } 54% { translate: 3px 0; } 72% { translate: 0 0; } }
@keyframes rail-hint-ring { 0%, 100% { border-color: rgba(23,23,23,.2); } 30%, 60% { border-color: rgba(23,23,23,.6); } }
/* a caption under the gallery sits level with the buttons, on the left */
.rail-nav:has(+ .chapter__caption) { margin-top: calc(20 * var(--p)); }
.rail-nav + .chapter__caption.body-text { margin-top: calc(-1 * max(40px, 48 * var(--p))); }
/* ---------- Moving rows of cards (Blym 04 · Complex flows) ----------
   Two rows that drift left forever at a steady speed, like the Framer site; js/project.js copies the
   cards, sets the speed and the starting point. Card sizes and screenshot positions come from Figma. */
.ticker {
  --t: var(--p);                                                  /* 1 Figma px */
  width: 100vw; margin-left: calc(603 * var(--p) - 50vw); margin-top: var(--ticker-top, calc(40 * var(--p)));
  overflow: clip; display: flex; flex-direction: column; gap: calc(98.49 * var(--t));
}
.ticker__track {
  display: flex; gap: calc(45.67 * var(--t)); width: max-content; padding-right: calc(45.67 * var(--t));
  transform: translateX(calc(50vw - 603 * var(--p) - 526 * var(--t)));   /* before the script runs: as in Figma */
}
.ticker__track.is-running { animation: ticker var(--dur) linear infinite backwards; will-change: transform; }
/* hovering a card (mouse only) stops the whole gallery; it carries on from the same spot when the cursor leaves the cards */
@media (hover: hover) and (pointer: fine) { .ticker:has(.ticker__card:hover) .ticker__track { animation-play-state: paused; } }
@keyframes ticker { from { transform: translateX(var(--from)); } to { transform: translateX(calc(var(--from) - var(--set))); } }
.ticker__card {
  position: relative; flex: none; margin: 0; height: calc(409 * var(--t));
  border-radius: calc(32.49 * var(--t)); overflow: hidden; background: #f3f4f6;
}
.ticker__card--wide { width: calc(601 * var(--t)); }
.ticker__card--narrow { width: calc(424 * var(--t)); }
.ticker__card--dark { background: #464646; }
.ticker__card > img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }   /* a card that is a single image */
.ticker__shot {
  position: absolute; left: calc(var(--x) * var(--t)); top: calc(var(--y) * var(--t));
  width: calc(var(--w) * var(--t)); height: calc(var(--h) * var(--t));
  border-radius: calc(var(--r, 16) * var(--t)); overflow: hidden;
  box-shadow: 0 calc(var(--sy, 6) * var(--t)) calc(var(--sb, 3) * var(--t)) rgba(0,0,0,.06);
}
.ticker__shot img {
  position: absolute; left: var(--il, 0); top: var(--it, 0); width: var(--iwp, 100%); height: var(--ihp, 100%);
  max-width: none; object-fit: cover;
}
.ticker__shot--white { background: #fff; display: grid; place-items: center; }
.ticker__shot--white img { position: static; width: calc(var(--iw) * var(--t)); height: calc(var(--ih) * var(--t)); }
.ticker__tilt {
  position: absolute; left: calc(-118.54 * var(--t)); top: calc(-151.31 * var(--t));
  width: calc(830.247 * var(--t)); height: calc(668.249 * var(--t)); display: grid; place-items: center;
}
.ticker__tilt img { width: calc(726.308 * var(--t)); height: calc(497.209 * var(--t)); max-width: none; object-fit: cover; rotate: -15deg; }

/* Chapter 03: before / after slider */
.compare {
  --pos: 50.17%;
  position: relative; margin-top: calc(20 * var(--p)); height: calc(609 * var(--p));
  border-radius: calc(32.49 * var(--p)); overflow: hidden; cursor: ew-resize; touch-action: pan-y; user-select: none;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; pointer-events: none; }
.compare__before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare__label {
  position: absolute; top: calc(25 * var(--p)); z-index: 2;
  padding: calc(6 * var(--p)) calc(10 * var(--p)); border-radius: calc(10 * var(--p));
  background: rgba(0,0,0,.7); color: #fff; font-size: calc(14 * var(--p)); line-height: calc(26 * var(--p)); letter-spacing: calc(-0.14 * var(--p));
}
.compare__label--before { left: calc(25 * var(--p)); }
.compare__label--after { right: calc(25 * var(--p)); }
.compare__line {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: calc(4 * var(--p)); margin-left: calc(-2 * var(--p));
  background: #fff; z-index: 2; filter: drop-shadow(0 10px 7.5px rgba(0,0,0,.1)) drop-shadow(0 4px 3px rgba(0,0,0,.1));
}
.compare__handle {
  position: absolute; left: 50%; top: 50%; width: calc(56 * var(--p)); height: calc(56 * var(--p));
  transform: translate(-50%, -50%); border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; gap: calc(4 * var(--p));
  filter: drop-shadow(0 20px 12.5px rgba(0,0,0,.1)) drop-shadow(0 8px 5px rgba(0,0,0,.1));
  transition: transform .3s var(--ease);
}
.compare:hover .compare__handle, .compare:focus-visible .compare__handle { transform: translate(-50%, -50%) scale(1.08); }
.compare__handle img { position: static; width: calc(20 * var(--p)); height: calc(20 * var(--p)); }
.compare:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.chapter__note { margin-top: calc(20 * var(--p)); }
.chapter__note h3 { font-weight: 500; font-size: calc(24 * var(--p)); line-height: calc(34 * var(--p)); letter-spacing: calc(-0.48 * var(--p)); color: var(--ink-3); }
.chapter__note p { margin-top: calc(4 * var(--p)); }
.chapter__note strong { font-weight: 700; }

/* Chapter 05: scattered ad creatives. Positions are % of the 1200×554 Figma box so it scales anywhere. */
/* ---------- Orbit of cards (Blym 05 · Beyond the product) ----------
   Proportions from horizonx.so/tools/orbit-cards, scaled so a card is the 210px ad from Figma:
   circle radius 400, frame 576 tall, centre 538 down, bottom 77 cut off and a fade up to 219 from the bottom.
   js/project.js sets each card's angle (--a) every frame. */
.orbit {
  --u: var(--p);
  --radius: calc(400 * var(--u)); --card: calc(210 * var(--u));
  --floor: calc(77 * var(--u)); --horizon: calc(219 * var(--u));
  position: relative; height: calc(576 * var(--u)); margin-top: calc(24 * var(--p));
  overflow: hidden; touch-action: pan-y; user-select: none; cursor: grab;
}
.orbit.is-dragging { cursor: grabbing; }
.orbit:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: calc(16 * var(--p)); }
.orbit__stage {
  position: absolute; inset: 0;
  clip-path: inset(0 0 var(--floor) 0);
  -webkit-mask-image: linear-gradient(to top, transparent var(--floor), #000 var(--horizon));
          mask-image: linear-gradient(to top, transparent var(--floor), #000 var(--horizon));
}
.orbit__card {
  position: absolute; left: 50%; top: calc(100% - var(--floor) + 38.4 * var(--u)); margin: 0;   /* circle centre, 538 from the top */
  width: var(--card); height: var(--card); border-radius: calc(8 * var(--u)); overflow: hidden;
  box-shadow: 0 calc(10 * var(--u)) calc(30 * var(--u)) rgba(23,23,23,.12);
  transform: translate(-50%, -50%) rotate(var(--a, 0deg)) translateY(calc(-1 * var(--radius)));
}
.orbit__card img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

/* ---------- Learnings ---------- */
.learnings { background: var(--soft); border-radius: calc(20 * var(--p)); padding: calc(32 * var(--p)); }
.learnings__grid { margin-top: calc(12 * var(--p)); display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(20 * var(--p)); }
.lesson { position: relative; padding: calc(32 * var(--p)); display: flex; flex-direction: column; gap: calc(12 * var(--p)); }
.lesson__num { position: relative; font-weight: 500; font-size: calc(33 * var(--p)); line-height: 1.2; color: var(--ink-3); }
.lesson__text { font-size: calc(16 * var(--p)); line-height: 1.5; color: var(--body-2); }
.lesson__text strong { display: block; font-weight: 700; margin-bottom: calc(6 * var(--p)); }

/* ---------- More projects strip ---------- */
.more { margin-top: calc(155 * var(--p)); margin-bottom: calc(160 * var(--p)); }
.more .rail { --rail-gap: calc(36 * var(--p)); margin-top: 0; }
.more__item { flex: 0 0 calc(324.5 * var(--p)); scroll-snap-align: start; display: block; border-radius: calc(8 * var(--p)); overflow: hidden; height: calc(172 * var(--p)); }
.more__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); -webkit-user-drag: none; }
.more__item:hover img { transform: scale(1.04); }

/* Footer styles live in css/footer.css (shared with the landing page). */

/* ---------- Scroll-in animation (same feel as the landing page) ----------
   Anything with data-reveal fades in while sliding up slightly when it scrolls into view.
   --d on an element delays it, so groups come in one after another. */
.js [data-reveal] {
  opacity: 0; transform: translateY(16px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .squiggle { clip-path: none; transition: none; }
}

/* Hero entrance (from the Framer version): the text blocks slide in from the right and the big
   image rises, all fading in after a short pause, then settling slowly */
.js .hero > [data-reveal] {
  transform: translateX(30px);
  transition-duration: 1s, 1s; transition-timing-function: cubic-bezier(.22,1,.36,1);
  transition-delay: calc(.3s + var(--d, 0s));
}
.js .hero > .hero__image[data-reveal] { transform: translateY(30px); }
.js .hero > [data-reveal].is-in { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .hero > [data-reveal] { transform: none; transition: none; }
}

/* Page change: a soft cross-fade between pages (browsers without cross-document view transitions,
   e.g. Firefox today, just change page as before) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: page-out .3s ease both; }
::view-transition-new(root) { animation: page-in .45s ease both; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* =====================================================================
   Phones (≤767px)
   ===================================================================== */
@media (max-width: 767px) {
  :root { --p: 1px; }
  .wrap { width: auto; margin: 0 24px; }
  .chapter, .learnings { width: auto; }

  .site-header { margin-top: 24px; height: 44px; }
  .brand { --p: 1px; }
  .nav { margin-right: -4px; gap: 20px; }
  .nav a { font-size: 12px; letter-spacing: 3px; line-height: 44px; }
  .nav a::after { bottom: 12px; right: 3px; }
  .topbar { height: 60px; padding: 0 20px 0 24px; }

  .hero { margin-top: 56px; }
  .hero__client { font-size: 16px; line-height: 20px; letter-spacing: 4px; }
  .hero__title { font-size: 36px; line-height: 42px; letter-spacing: -0.7px; margin-top: 6px; }
  .hero__title span { display: inline; }
  .hero .tags { margin-top: 20px; }
  .hero__image { margin-top: 32px; height: auto; aspect-ratio: 1206 / 515; border-radius: 12px; }
  .facts { margin-top: 28px; padding-top: 24px; grid-template-columns: 1fr 1fr; gap: 24px 20px; }
  .eyebrow { font-size: 13px; letter-spacing: 1px; line-height: 20px; }

  .overview { margin-top: 80px; flex-direction: column; gap: 24px; }
  .overview__image { flex: none; width: 100%; height: auto; aspect-ratio: 619 / 274; }
  .overview__image.overview__video { aspect-ratio: 16 / 9; }
  .overview__text { width: auto; margin-top: 0; }
  .body-text { font-size: 15px; line-height: 25px; }
  .body-text + .body-text { margin-top: 20px; }

  .outcomes { margin-top: 80px; }
  .outcomes__head { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 20px; }
  .h2 { font-size: 26px; line-height: 32px; }
  .stats { grid-template-columns: 1fr; gap: 12px; }
  .stat { padding: 24px; }
  .chapter .stat { min-height: 0; }
  .stat__num { font-size: 36px; }
  .squiggle--outcome { left: 18px; top: 46px; width: 210px; height: 27px; }
  .squiggle--stat    { left: 22px; top: 50px; width: 92px;  height: 22px; }

  .chapters { margin-top: 96px; }
  .chapter, .chapter--onboarding, .chapter--complexity, .chapter--ads { --after: 96px; }
  .chapter__text { flex-direction: column; align-items: flex-start; gap: 16px; }
  .chapter__title { width: auto; padding-bottom: 0; }
  .chapter__title h2 { font-size: 28px; line-height: 34px; letter-spacing: -0.5px; }
  .chapter__title h2 span { display: inline; }
  .chapter__intro { width: auto; }
  .chapter__figure { margin-top: 24px; border-radius: 16px; }

  .rail { width: calc(100% + 24px); padding-right: 24px; }
  .chapter .rail, .chapter--complexity .rail { margin-top: 24px; --rail-gap: 12px; }
  .chapter .rail:not(.mosaic) { --gutter: 24px; }
  .ticker { --t: .55px; width: calc(100% + 48px); margin: 24px 0 0 -24px; }
  .rail__item { flex-basis: 86%; }
  .rail-nav { margin-top: 16px; padding-right: 0; }
  .rail-nav__btn { width: 44px; height: 44px; }
  .rail-nav__btn svg { width: 16px; height: 16px; }
  .rail-nav:has(+ .chapter__caption) { margin-top: 16px; }
  .rail-nav + .chapter__caption.body-text { margin-top: 12px; }   /* full-width caption goes under the buttons */
  .rail__item img { height: auto; aspect-ratio: 942 / 609; border-radius: 16px; }
  .rail__item figcaption { width: auto; margin-top: 12px; }

  .compare { height: auto; aspect-ratio: 1200 / 609; margin-top: 24px; border-radius: 16px; }
  .compare__label { top: 10px; padding: 2px 8px; font-size: 12px; line-height: 20px; border-radius: 8px; }
  .compare__label--before { left: 10px; }
  .compare__label--after { right: 10px; }
  .compare__handle { width: 40px; height: 40px; }
  .compare__handle img { width: 16px; height: 16px; }
  .chapter__note h3 { font-size: 20px; line-height: 28px; }

  .orbit { --u: .45px; margin-top: 8px; }

  .learnings { padding: 24px 8px; }
  .learnings .h2 { padding: 0 16px; }
  .learnings__grid { grid-template-columns: 1fr; margin-top: 4px; }
  .lesson { padding: 24px 16px 8px; }
  .lesson__num { font-size: 28px; }
  .squiggle--number { left: 14px; top: 42px; width: 40px; height: 16px; }


  .more { margin-top: 96px; margin-bottom: 80px; }
  .more .rail { --rail-gap: 16px; }
  .more__item { flex-basis: 260px; height: 138px; }
}

/* Reading progress (js/project.js): 3px lime line on the bottom edge of the sticky bar */
.topbar__progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: #c9fa75; transform: scaleX(0); transform-origin: left;
}
/* not faded or slid in with the logo and menu, and it follows the scroll with no lag */
.topbar > .topbar__progress, .is-stuck .topbar > .topbar__progress { opacity: 1; transition: none; }
