/* Project pages (/project/<slug>/): the case study template.
   Layout, spacing and motion come from design_handoff_case_study_page (the prototype's frame() lives in project.js);
   colours, type, wordmark and components are the homepage's Atlas system (same custom properties as index.html).
   Base rules are each section's final, static state (reduced motion and no JS); .motion adds the pinned tracks and
   the starting values that project.js scrubs. */
:root {
  --night: #24050A;
  --foundation: #431B23;
  --foundation-2: #55252F;
  --paper: #E9DECA;
  --metal: #C9A570;
  --metal-hover: #D8B781;
  --ink: #1E1517;
  --rule-dark: rgba(233, 222, 202, .2);
  --rule-dark-2: rgba(233, 222, 202, .34);
  --on-dark-2: rgba(233, 222, 202, .84);
  --surface: #33090F;                     /* image ground on night (night + paper at about 6%) */
  --night-a: 36, 5, 10;                   /* night as rgb, for the prototype's ink shades at the same alphas */
  --found-a: 67, 27, 35;                  /* foundation as rgb */

  --display: "Cormorant Garamond", "Cormorant", Garamond, "Iowan Old Style", "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --side: max(clamp(20px, 3vw, 48px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));   /* the prototype's side padding, clear of a landscape notch */
  --gutter: clamp(16px, 4.2vw, 72px);     /* the homepage's .wrap */
  --maxw: 1400px;
  --nav-h: 76px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-io: cubic-bezier(.7, 0, .2, 1);  /* the prototype's curtain and clip reveals */
  --r-lg: 16px; --r-md: 12px; --r-sm: 8px; --r-pill: 999px;
  --shadow-dark-1: 0 24px 64px rgba(0, 0, 0, .28);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0; background: var(--night); color: var(--paper);
  font: 400 18px/28px var(--sans); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; overflow-x: clip;
  transition: background-color .9s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--metal); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--metal); color: var(--ink); }
.skip { position: fixed; left: 16px; top: -60px; z-index: 200; background: var(--paper); color: var(--ink); padding: 12px 18px; font-weight: 500; text-decoration: none; }
.skip:focus { top: 16px; }
main:focus { outline: none; }   /* the skip link's target takes focus (tabindex=-1) without a ring around the whole page */

/* ---------- Type (homepage) ---------- */
.label { font: 500 12px/16px var(--mono); letter-spacing: .08em; text-transform: uppercase; margin: 0; }
.body { font: 400 18px/28px var(--sans); margin: 0; }
img.fill { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; }

/* ---------- Buttons (homepage) ---------- */
.btn {
  --bg: var(--paper); --fg: var(--ink);
  display: inline-flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 26px;
  background: var(--bg); color: var(--fg); border: 0; border-radius: var(--r-sm); cursor: pointer;
  font: 500 16px/1 var(--sans); letter-spacing: .005em; text-decoration: none; white-space: nowrap;
  transition: background-color .35s var(--ease), color .35s var(--ease), box-shadow .35s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; transition: transform .45s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--gold { --bg: var(--metal); --fg: var(--ink); }
.btn--gold:hover { --bg: var(--metal-hover); }
.btn--pill { border-radius: var(--r-pill); min-height: 52px; }
.btn--line { --bg: transparent; --fg: var(--paper); box-shadow: inset 0 0 0 1px var(--rule-dark-2); }
.btn--line:hover { box-shadow: inset 0 0 0 1px var(--paper); }
.p-btns { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Cursor (homepage .cursor; fine pointers, motion only) ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 150; pointer-events: none; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--metal); display: none; transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background-color .35s, box-shadow .35s, opacity .3s; }
.has-cursor .cursor { display: grid; place-items: center; opacity: 0; }
.has-cursor .cursor.is-live { opacity: 1; }
.cursor.is-link { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
.cursor.is-label { width: 92px; height: 92px; margin: -46px 0 0 -46px; background: var(--foundation); box-shadow: 0 0 0 1px rgba(233, 222, 202, .4); }
.cursor__label { font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--paper); opacity: 0; transition: opacity .25s; white-space: nowrap; }
.cursor.is-label .cursor__label { opacity: 1; }
.cursor.is-label.on-media { background: var(--paper); box-shadow: 0 0 0 1px rgba(36, 5, 10, .25); }
.cursor.on-media .cursor__label { color: var(--foundation); }

/* ---------- Chapter indicator ---------- */
.chap { position: fixed; left: max(20px, env(safe-area-inset-left, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 40; pointer-events: none; min-width: 240px; padding: 12px 18px 14px; border-radius: var(--r-lg); background: rgba(var(--night-a), .9); display: flex; flex-direction: column; gap: 10px; opacity: 0; transform: translateY(16px); transition: opacity .2s ease, transform .6s var(--ease); }
.chap.is-on { opacity: 1; transform: none; transition: opacity .5s ease, transform .6s var(--ease); }   /* steps aside quickly, comes back gently */
.chap__row { display: flex; gap: 10px; white-space: nowrap; }
.chap__client { color: var(--paper); }
.chap__name { color: var(--metal); }
.chap__track { height: 2px; background: var(--rule-dark); }
.chap__bar { display: block; height: 2px; width: 0; background: var(--metal); }

/* ---------- Shared pinned-section scaffolding ---------- */
.stage { position: relative; height: 100vh; overflow: hidden; }
.motion .stage { position: sticky; top: 0; }
.p-head { font: 500 clamp(62px, 8.8vw, 165px)/.92 var(--display); letter-spacing: -.015em; color: var(--paper); margin: 0; }
.mask { overflow: hidden; padding-bottom: .08em; }
.motion .mask .p-head { transform: translateY(105%); transition: transform 1.2s var(--ease); }
.motion .mask.is-in .p-head { transform: none; }
.p-prog { position: absolute; left: var(--side); right: var(--side); bottom: 24px; display: flex; align-items: center; gap: 20px; color: var(--on-dark-2); pointer-events: none; }
.p-prog__track { flex: 1; height: 1px; background: var(--rule-dark); }
.p-prog__track i { display: block; height: 100%; width: 100%; background: var(--metal); }
.motion .p-prog__track i { width: 0; }

/* ---------- 1. Hero ---------- */
.p-hero { position: relative; height: 100svh; min-height: 640px; overflow: hidden; background: var(--night); }
.p-hero__media { position: absolute; inset: 0; overflow: hidden; }
.p-hero__img { position: absolute; inset: 0; transform: scale(1.04); }
.p-hero__img img { width: 100%; height: 100%; object-fit: cover; }
.p-hero__shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(var(--night-a), .6) 0%, rgba(var(--night-a), 0) 18%, rgba(var(--night-a), .25) 32%, rgba(var(--night-a), .7) 56%, rgba(var(--night-a), .9) 76%, var(--night) 100%); }
.p-hero__curtain { position: absolute; inset: 0; background: var(--night); pointer-events: none; transform: translateY(-101%); }
.motion .p-hero__curtain { transform: translateY(0%); transition: transform 1.5s var(--ease-io) .15s; }
.motion.is-loaded .p-hero__curtain { transform: translateY(-101%); }
.p-hero__txt { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 var(--side) clamp(28px, 4vh, 48px); display: flex; flex-direction: column; gap: clamp(24px, 3vw, 40px); }
.p-hero__title { font: 500 clamp(62px, 10.4vw, 198px)/.9 var(--display); letter-spacing: -.015em; color: var(--paper); text-shadow: 0 .04em .3em rgba(var(--night-a), .6); display: flex; flex-wrap: wrap; column-gap: .22em; }
.p-hero__w { display: inline-block; overflow: hidden; padding-bottom: .06em; }
.p-hero__w > span { display: inline-block; }
.motion .p-hero__w > span { transform: translateY(110%); transition: transform 1.4s var(--ease); }
.motion.is-loaded .p-hero__w > span { transform: translateY(0%); }
.p-hero__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 20px clamp(24px, 3vw, 56px); padding-top: 20px; border-top: 1px solid var(--rule-dark); }
.motion .p-hero__meta { opacity: 0; transition: opacity 1s ease 1.4s; }
.motion.is-loaded .p-hero__meta { opacity: 1; }
.p-hero__tag { font: 400 clamp(18px, 1.5vw, 22px)/1.4 var(--sans); color: var(--paper); }
.p-hero__fact { display: flex; flex-direction: column; gap: 6px; }
.p-hero__fact .label { color: var(--on-dark-2); }
.p-hero__fact span:last-child { font: 400 16px/24px var(--sans); color: var(--paper); }
.p-hero__visit { grid-column-end: -1; display: flex; align-items: flex-end; justify-content: flex-end; }   /* the last column, also when the row wraps */
.p-hero__visit a { font: 500 16px/1 var(--sans); color: var(--paper); text-decoration: none; border-bottom: 1px solid var(--metal); padding: 14px 0 4px; }

/* ---------- 2. Statement ---------- */
.p-stmt { position: relative; background: var(--night); }
.motion .p-stmt { height: 240vh; }
.p-stmt__frame { position: absolute; right: var(--side); top: 14vh; bottom: 14vh; width: min(34vw, 560px); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.p-stmt__img { position: absolute; inset: 0; }
.motion .p-stmt__img { transform: scale(1.12); }
.p-stmt__img img { width: 100%; height: 100%; object-fit: cover; }
.p-stmt__txt { position: absolute; left: var(--side); right: calc(min(34vw, 560px) + clamp(48px, 7vw, 120px)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 28px; }
.p-stmt__label { color: var(--metal); }
.p-stmt__text { max-width: 1000px; font: 500 clamp(35px, 4.6vw, 88px)/1.02 var(--display); letter-spacing: -.012em; color: var(--paper); }
.motion .p-stmt__text [data-w] { opacity: .16; transition: opacity .2s linear; }

/* ---------- 3. Brief ---------- */
.p-brief { background: var(--night); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.p-brief__media { position: relative; min-height: min(100vh, 1040px); overflow: hidden; background: var(--surface); }
.p-brief__par { position: absolute; left: 0; right: 0; top: -10%; bottom: -10%; }
.p-brief__par img { width: 100%; height: 100%; object-fit: cover; }
.p-brief__copy { padding: clamp(56px, 7vw, 120px) clamp(20px, 5vw, 96px); display: flex; flex-direction: column; justify-content: center; gap: clamp(36px, 4vw, 56px); }
.motion .p-brief__copy { opacity: 0; transform: translateY(28px); transition: opacity 1.1s ease, transform 1.3s var(--ease); }
.motion .p-brief__copy.is-in { opacity: 1; transform: translateY(0); }
.p-brief__block { display: flex; flex-direction: column; gap: 14px; padding-top: 24px; border-top: 1px solid var(--rule-dark); }
.p-brief__block .label { color: var(--on-dark-2); }
.p-brief__block .body { font-size: 19px; line-height: 30px; color: var(--on-dark-2); }

/* ---------- 4. Stacking cards ---------- */
.p-stack { background: var(--night); }
.p-stack__stage { height: 100vh; padding: 12px; }
.motion .p-stack__stage { position: sticky; top: 0; }
.p-stack__card { position: relative; width: 100%; height: 100%; border-radius: var(--r-md); overflow: hidden; background: var(--surface); transform-origin: 50% 0%; }
.motion .p-stack__card { will-change: transform; }
.p-stack__pair { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: var(--night); }
.p-stack__pair > div { position: relative; overflow: hidden; }
.p-stack__shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(20deg, rgba(var(--night-a), .9) 0%, rgba(var(--night-a), .6) 30%, rgba(var(--night-a), 0) 60%); }
.p-stack__txt { position: absolute; left: var(--side); right: var(--side); bottom: clamp(24px, 3.4vw, 48px); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 48px; pointer-events: none; }
.p-stack__body, .p-wall__body { max-width: 460px; font: 400 18px/28px var(--sans); color: var(--paper); padding-bottom: 10px; }
.p-stack__dim { position: absolute; inset: 0; background: var(--night); opacity: 0; pointer-events: none; }
.p-stack__gap { height: 0; }
.motion .p-stack__gap { height: 75vh; }
.motion .p-stack__gap--last { height: 55vh; }

/* ---------- 5. Social wall ---------- */
.p-wall { position: relative; background: var(--foundation); }
.motion .p-wall { height: 300vh; }
.p-wall .stage { perspective: 1800px; }
.p-wall__wall { position: absolute; left: 50%; top: 54%; width: min(86vw, 128vh); display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.2%; transform: translate(-50%, -50%) rotateX(16deg) rotateZ(-3deg); transform-origin: 50% 50%; }
.motion .p-wall__wall { transform: translate(-50%, -50%) scale(6); will-change: transform; }
.p-wall__tile { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-sm); background: var(--foundation-2); }
.p-wall__tile[data-col="0"], .p-wall__tile[data-col="2"], .p-wall__tile[data-col="4"] { transform: translate3d(0, -6%, 0); }
.p-wall__tile[data-col="1"], .p-wall__tile[data-col="3"] { transform: translate3d(0, 6%, 0); }
.motion .p-wall__tile { transform: none; will-change: transform; }
.p-wall__shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(var(--found-a), .95) 0%, rgba(var(--found-a), .7) 26%, rgba(var(--found-a), 0) 52%); }
.p-wall__txt { position: absolute; left: var(--side); right: var(--side); bottom: clamp(56px, 8vh, 88px); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px 48px; pointer-events: none; }
.motion .p-wall__shade { opacity: 0; }
.motion .p-wall__txt { opacity: 0; transform: translateY(30px); }
.p-head--wall { font-size: clamp(57px, 7.7vw, 140px); }

/* ---------- 6. Results ---------- */
.p-res { position: relative; background: var(--foundation); }
.motion .p-res { height: 760vh; }
/* outcomes with no figures: the ledger's stretch of the pin is left out, each outcome keeps its length */
.motion .p-res--outcomes { height: 560vh; }
.p-res__feed { position: absolute; left: -4%; right: -4%; top: -10%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; transform: rotate(-6deg); opacity: .55; }
.p-res__col { display: flex; flex-direction: column; gap: 12px; }
.motion .p-res__col { will-change: transform; }
.p-res__col:nth-child(even) { transform: translate3d(0, -60px, 0); }
.p-res__tile { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-sm); overflow: hidden; background: var(--foundation-2); }
.p-res__shade { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 70% 70% at 50% 50%, rgba(var(--found-a), .9) 0%, rgba(var(--found-a), .7) 60%, rgba(var(--found-a), .4) 100%); }
.p-res__solid { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(90deg, rgba(var(--found-a), .7) 0%, rgba(var(--found-a), .6) 40%, rgba(var(--found-a), .35) 60%, rgba(var(--found-a), 0) 85%); }
.p-res__dim { position: absolute; inset: 0; pointer-events: none; background: var(--foundation); opacity: .62; }
.p-res__head { position: absolute; z-index: 1; left: var(--side); top: clamp(80px, 11vh, 96px); font: 500 clamp(53px, 5.9vw, 106px)/1 var(--display); letter-spacing: -.015em; color: var(--paper); text-shadow: 0 2px 28px rgba(var(--night-a), .8); pointer-events: none; }
.p-res__head .dot { color: var(--metal); }
.p-res__count { position: absolute; inset: 0; padding: clamp(130px, 17vh, 160px) var(--side) clamp(56px, 8vh, 88px); display: flex; flex-direction: column; justify-content: flex-end; }
.motion .p-res__count { will-change: transform, opacity; }
.p-res__row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); align-items: end; gap: 16px 48px; padding: clamp(14px, 2.4vh, 28px) 0 clamp(10px, 1.6vh, 20px); }
.p-res__line { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--rule-dark-2); transform-origin: 0 50%; }
.p-res__mask { overflow: hidden; padding-bottom: .04em; }
.p-res__num { display: block; font: 500 clamp(92px, 18.7vh, 242px)/.86 var(--display); letter-spacing: -.02em; color: var(--metal); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.p-res__label { display: flex; align-items: baseline; gap: 20px; max-width: 440px; padding-bottom: clamp(10px, 1.6vh, 22px); }
.p-res__label .label { color: var(--metal); flex: none; }
.p-res__label span:last-child { font: 400 clamp(17px, 1.4vw, 21px)/1.4 var(--sans); color: var(--paper); }
.motion .p-res__line { transform: scaleX(0); }
.motion .p-res__num { transform: translateY(105%); }
.motion .p-res__label { opacity: 0; }
/* one real figure: the ledger becomes a single, larger line centred in the stage rather than a stack with two empty rows */
.p-res__count--single { justify-content: center; padding-top: clamp(150px, 22vh, 200px); }
.p-res__count--single .p-res__num { font-size: clamp(120px, 30vh, 380px); line-height: .84; }
.p-res__count--single .p-res__row { padding-top: clamp(20px, 3vh, 36px); }
.p-res__count--single .p-res__label { padding-bottom: clamp(18px, 3vh, 40px); }
/* Word figures keep the same reveal, with a size that fits the ledger's narrowest column. */
.p-res__count .p-res__row .p-res__num--word { font-size: clamp(56px, 9vw, 150px); line-height: .95; }
.p-res__out { position: absolute; inset: 0; padding: 150px var(--side) 96px; display: flex; flex-wrap: wrap; align-items: center; gap: 32px clamp(32px, 6vw, 120px); pointer-events: none; }
.p-res__texts { flex: 1 1 420px; position: relative; align-self: stretch; min-height: 240px; }
.p-res__oc { position: absolute; left: 0; right: 0; top: 50%; display: flex; flex-direction: column; gap: 22px; opacity: 0; transform: translateY(-30%); transition: opacity .7s ease, transform .9s var(--ease); }
.p-res__oc .label { color: var(--metal); }
.p-res__oh { font: 500 clamp(50px, 6.1vw, 110px)/.95 var(--display); letter-spacing: -.015em; color: var(--paper); }
.p-res__oc .body { max-width: 520px; font-size: 19px; line-height: 30px; color: var(--on-dark-2); }
.p-res__oimg--static { display: none; }
.p-res__frame { flex: 0 1 min(38vw, 560px); position: relative; align-self: stretch; min-height: 260px; border-radius: var(--r-md); overflow: hidden; background: var(--foundation-2); }
.p-res__oi { position: absolute; inset: 0; clip-path: inset(100% 0 0 0); transition: clip-path 1s var(--ease-io); }
.motion .p-res__out { opacity: 0; }
/* static results (reduced motion, no JS): the ledger, then every outcome with its image, in reading order */
html:not(.motion) .p-res .stage { height: auto; overflow: hidden; padding: clamp(80px, 11vh, 96px) 0 clamp(56px, 8vh, 88px); }
html:not(.motion) .p-res__head { position: relative; left: auto; top: auto; padding: 0 var(--side); }
html:not(.motion) .p-res__count, html:not(.motion) .p-res__out { position: relative; inset: auto; }
html:not(.motion) .p-res__count { padding-top: clamp(32px, 6vh, 64px); padding-bottom: 0; }
html:not(.motion) .p-res__dim { opacity: .62; }
html:not(.motion) .p-res__out { display: block; padding-top: clamp(56px, 8vh, 88px); padding-bottom: 0; pointer-events: auto; }
html:not(.motion) .p-res__texts { display: grid; gap: clamp(56px, 8vh, 96px); }
html:not(.motion) .p-res__oc { position: relative; top: auto; opacity: 1; transform: none; display: grid; grid-template-columns: minmax(0, 1fr) min(38vw, 560px); grid-template-rows: auto auto 1fr; column-gap: clamp(32px, 6vw, 120px); align-content: start; }
html:not(.motion) .p-res__oc > :not(.p-res__oimg--static) { grid-column: 1; }
html:not(.motion) .p-res__oimg--static { display: block; position: relative; grid-column: 2; grid-row: 1 / span 3; aspect-ratio: 4 / 5; border-radius: var(--r-md); overflow: hidden; background: var(--foundation-2); }
html:not(.motion) .p-res__frame, html:not(.motion) .p-res .p-prog { display: none; }

/* ---------- 7. Next project ---------- */
.p-next { position: relative; background: var(--night); }
.motion .p-next { height: 220vh; }
.p-next__link { position: absolute; inset: 0; display: block; text-decoration: none; color: inherit; }
.p-next__link:focus-visible { outline-offset: -6px; }
.p-next__clip { position: absolute; inset: 0; clip-path: inset(7% 3% 17% 38% round 10px); background: var(--mat, var(--surface)); }
.p-next__img { position: absolute; inset: 0; transform: scale(1.05); }
.motion .p-next__clip { clip-path: inset(28% 12% 28% 56% round 14px); }
.motion .p-next__img { transform: scale(1.25); }
/* an image on a mat ("mat" in nextProject.image, for a magazine cover): its box is the window (project.js keeps the two
   together as it opens), so the image is always whole, centred in it, and settles 1.07 -> 1 */
.p-next__mat { position: absolute; inset: 7% 3% 17% 38%; }
.motion .p-next__mat { inset: 28% 12% 28% 56%; }
.p-next__cover { position: absolute; inset: 0; margin: auto; width: auto; height: auto; max-width: 84%; max-height: 84%; box-shadow: var(--shadow-dark-1); }
.motion .p-next__cover { transform: scale(1.07); }
.p-next__mat ~ .p-next__shade { display: none; }
.p-next__shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(var(--night-a), 0) 60%, rgba(var(--night-a), .35) 100%); }
.p-next__txt { position: absolute; left: var(--side); width: calc(34vw - var(--side)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 24px; pointer-events: none; }
.p-next__txt .label { color: var(--paper); }
.p-next__name { font: 500 clamp(57px, 7vw, 140px)/.92 var(--display); letter-spacing: -.015em; color: var(--paper); }
.p-next__bar { position: absolute; z-index: 2; left: var(--side); right: var(--side); bottom: clamp(28px, 5vh, 52px); display: flex; justify-content: space-between; align-items: center; gap: 24px 48px; flex-wrap: wrap; pointer-events: none; }
.p-next__prog { flex: 1 1 280px; max-width: 420px; display: flex; }
.p-prog__track--thick { height: 2px; }
.p-next__bar .p-btns { pointer-events: auto; }

/* ---------- 8. CTA ---------- */
.p-cta { position: relative; background: var(--night); }
.motion .p-cta { height: 320vh; }
.p-cta .stage { background: var(--night); }
.p-cta__img { position: absolute; inset: 0; }
.motion .p-cta__img { transform: scale(1.25); will-change: transform; }
.p-cta__shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(var(--night-a), .97) 0%, rgba(var(--night-a), .8) 34%, rgba(var(--night-a), 0) 72%), linear-gradient(90deg, rgba(var(--night-a), .7) 0%, rgba(var(--night-a), 0) 60%); }
.p-cta__mask { position: absolute; inset: 0; width: 100%; height: 100%; display: none; pointer-events: none; }
.motion .p-cta__mask { display: block; }
.p-cta__mask text { font-family: var(--display); }
/* the cut-out drawn on a canvas from that SVG (project/lets-talk.js), in its place; the script scales it about the full stop */
.p-cta__cut { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: none; pointer-events: none; transform-origin: 0 0; will-change: transform; }
.motion .p-cta__cut { display: block; }
.p-cta__txt { position: absolute; left: var(--side); right: var(--side); bottom: clamp(48px, 9vh, 96px); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px 64px; }
.motion .p-cta__shade { opacity: 0; }
.motion .p-cta__txt { opacity: 0; transform: translateY(30px); }
/* keyboard focus on the call or the email button shows the finished CTA at once, whatever the scroll (beats the inline styles) */
.motion .p-cta:focus-within .p-cta__shade { opacity: 1 !important; }
.motion .p-cta:focus-within .p-cta__txt { opacity: 1 !important; transform: none !important; pointer-events: auto !important; }
.p-cta__head { display: flex; flex-direction: column; gap: clamp(18px, 2.4vh, 28px); max-width: 980px; }
.p-cta__label { display: flex; align-items: center; gap: 14px; color: var(--metal); }
.p-cta__label i { width: 9px; height: 9px; border-radius: 50%; background: var(--metal); flex: none; }
.p-head--cta { font-size: clamp(57px, 8.1vw, 154px); letter-spacing: -.02em; text-wrap: balance; }
.p-cta__body { margin: 0; max-width: 34em; font-size: 19px; line-height: 30px; color: var(--on-dark-2); }
.p-cta__txt .p-btns { padding-bottom: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) { :root { --nav-h: 64px; } }
/* phones, small tablets and touch screens: pinned lengths about 40% shorter, the social wall as a plain tile grid */
@media (max-width: 899px), (pointer: coarse) {
  .motion .p-stmt { height: 144vh; }
  .motion .p-stack__gap { height: 45vh; }
  .motion .p-stack__gap--last { height: 33vh; }
  .motion .p-res { height: 456vh; }
  .motion .p-res--outcomes { height: 350vh; }
  .motion .p-next { height: 132vh; }
  .motion .p-cta { height: 192vh; }
  .p-wall, .motion .p-wall { height: auto; }
  .p-wall .stage, .motion .p-wall .stage { position: relative; height: auto; overflow: visible; display: flex; flex-direction: column; gap: 32px; padding: clamp(72px, 12vw, 120px) var(--side) clamp(72px, 12vw, 120px); perspective: none; }
  .p-wall__wall, .motion .p-wall__wall { position: relative; left: auto; top: auto; width: 100%; transform: none; gap: 8px; grid-template-columns: repeat(3, 1fr); order: 2; will-change: auto; }
  .p-wall__tile, .motion .p-wall__tile, .p-wall__tile[data-col] { transform: none; will-change: auto; }
  .p-wall__shade, .p-wall .p-prog { display: none; }
  .p-wall__txt, .motion .p-wall__txt { position: relative; left: auto; right: auto; bottom: auto; opacity: 1; transform: none; order: 1; }
}
@media (max-width: 899px) {
  .stage, .motion .stage { height: 100svh; }
  .p-head { font-size: clamp(48px, 13vw, 96px); }
  /* the statement in one column: the image above, the words below, never over each other. A long statement shortens the
     image (down to 18svh) instead of running up under it, and a short one keeps its place at the foot. The stage is the
     visible height with Safari's toolbars showing */
  .p-stmt .stage { height: 100svh; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: calc(var(--nav-h) + 16px) var(--side) 7svh; }
  .p-stmt__frame { position: relative; inset: auto; width: auto; flex: 0 1 42svh; min-height: 18svh; }
  .p-stmt__txt { position: relative; inset: auto; transform: none; gap: 20px; flex: none; }
  .p-stmt__text { font-size: clamp(30px, 8vw, 48px); line-height: 1.06; }
  .p-brief__media { min-height: 72svh; }
  .p-brief__block .body, .p-res__oc .body { font-size: 17px; line-height: 27px; }
  .p-stack__stage { height: 100svh; padding: 8px; }
  .p-stack__body, .p-wall__body { font-size: 17px; line-height: 27px; }
  .p-head--wall { font-size: clamp(44px, 12vw, 80px); }
  .p-res__head { font-size: clamp(44px, 12vw, 72px); }
  .p-res__row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .p-res__num { font-size: clamp(92px, 30vw, 160px); }
  .p-res__count:not(.p-res__count--single) .p-res__num { font-size: clamp(44px, min(30vw, 10.5svh), 160px); }   /* two or three figures fit under the heading on a short screen */
  .p-res__count--single .p-res__num { font-size: clamp(110px, 34vw, 200px); }
  .p-res__label span:last-child { font-size: 17px; }
  .p-res__out { padding: calc(var(--nav-h) + 96px) var(--side) 64px; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 20px; }
  .p-res__texts { flex: 0 0 auto; min-height: 300px; }
  .p-res__oc { gap: 14px; }
  .p-res__oh { font-size: clamp(34px, 9vw, 56px); line-height: 1; }
  .p-res__frame { flex: 1 1 auto; min-height: 0; width: 100%; }
  html:not(.motion) .p-res__oc { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: 14px; }
  html:not(.motion) .p-res__oimg--static { grid-column: 1; grid-row: auto; margin-top: 10px; }
  .p-next__clip { clip-path: inset(31% 0% 23% 0% round 10px); }
  .motion .p-next__clip { clip-path: inset(36% 8% 26% 8% round 14px); }
  .p-next__mat { inset: 31% 0% 23% 0%; }
  .motion .p-next__mat { inset: 36% 8% 26% 8%; }
  .p-next__txt { top: calc(var(--nav-h) + 40px); right: var(--side); width: auto; transform: none; gap: 16px; }
  .p-next__name { font-size: clamp(44px, 12vw, 80px); }
  .p-next__bar { gap: 20px; }
  .p-next__prog { flex-basis: 100%; max-width: none; }
  .p-head--cta { font-size: clamp(44px, 12vw, 96px); }
  .p-cta__txt { gap: 24px; }
  .p-btns .btn { flex: 0 1 auto; }
}
/* tablets: a compact indicator, and the statement sits clear of it */
@media (min-width: 600px) and (max-width: 899px) {
  .chap { left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); min-width: 0; padding: 8px 12px 10px; gap: 8px; border-radius: var(--r-sm); }
  .p-stmt .stage { padding-bottom: calc(7svh + 48px); }
  .p-stack__txt { bottom: 72px; }
}
@media (max-width: 599px) { .chap { display: none; } }
@media (max-width: 899px) and (max-height: 640px) {   /* a short phone screen: two or three figures with tighter rows and labels */
  .p-res__count:not(.p-res__count--single) .p-res__row { padding: 8px 0 6px; }
  .p-res__count:not(.p-res__count--single) .p-res__label { padding-bottom: 6px; }
  .p-res__count:not(.p-res__count--single) .p-res__label span:last-child { font-size: 15px; line-height: 1.45; }
}
@media (max-height: 500px) { .chap { display: none; } }   /* a phone held sideways: no room for the pill over the content */
/* an image whose content gives a phone crop of its own ("phoneFocus" in the project JSON) */
@media (max-width: 899px) {
  img[style*="--pf"] { object-position: var(--pf) !important; transform-origin: var(--pf) !important; }
  img[style*="--pz"] { transform: scale(var(--pz)) !important; }
}
/* a stack card's second, tall file ("phoneImage") is served by the card's shape, not the width: whenever it stands
   upright (the card is the screen less a few pixels, and templates/project.html asks the same query). Its own crop goes
   with it and beats the phone one above, which stays with the first file on a phone held sideways */
@media (orientation: portrait) {
  img[style*="--tf"] { object-position: var(--tf) !important; transform: scale(var(--tz, 1)) !important; transform-origin: var(--tf) !important; }
}
/* a phone held sideways: the name runs across the band, so an image on a mat sits smaller at its right end, clear of the name */
@media (max-width: 899px) and (orientation: landscape) { .p-next__cover { max-height: 70%; margin-right: var(--side); } }
@media (max-width: 400px) { .btn { padding: 0 20px; } }

