:root {
  --paper: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --field: #f2f2f0;
  --invert-ground: #111111;
  --invert-ink: #f2f2f0;
  --ui-line: #e3e3e3;
  --xv-halo: none;
  --xv-ai: #e2401f; /* coral text darkened for contrast on white; the dot stays brand coral */

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  --measure: 132rem;   /* content runs wide; only very large screens get extra air */
  --gutter: clamp(2rem, 4vw, 5.5rem);
  --wall: 100%;
  --side: clamp(1.25rem, 4.5vw, 5.5rem);

  --t-display: clamp(2.5rem, 13.4vw, 12.25rem);
  --t-head: clamp(2.25rem, 6vw, 6.4rem);        /* headline: the hero's size, used by every section heading */
  --t-heading: clamp(1.65rem, 2.9vw, 2.85rem);  /* heading: captions, principles, figures */
  --t-statement: clamp(1.375rem, 2.2vw, 2rem);
  --t-body: 1.0625rem;
  --t-small: 0.875rem;

  --section: clamp(7.5rem, 14vw, 13.75rem);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --lead: 120ms;
  --settle: 700ms;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d0d0d;
    --ink: #ececec;
    --muted: #9b9b9b;
    --field: #171717;
    --invert-ground: #d8d8d4;
    --invert-ink: #0d0d0d;
    --ui-line: #2a2a2a;
    --xv-halo: 0 0 6px var(--paper), 0 0 2px var(--paper);
    --xv-ai: #ff5a3c;
  }
}
:root[data-theme="dark"] {
  --paper: #0d0d0d;
  --ink: #ececec;
  --muted: #9b9b9b;
  --field: #171717;
  --invert-ground: #d8d8d4;
  --invert-ink: #0d0d0d;
  --ui-line: #2a2a2a;
  --xv-halo: 0 0 6px var(--paper), 0 0 2px var(--paper);
  --xv-ai: #ff5a3c;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

a { color: inherit; }
a, button { transition: color 150ms ease-out, background-color 150ms ease-out, opacity 150ms ease-out, transform 150ms ease-out; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

::selection { background: var(--ink); color: var(--paper); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: absolute; left: 1rem; top: 1rem; z-index: 10; background: var(--ink); color: var(--paper); padding: 0.75rem 1rem; }


/* ---------- Layout ---------- */

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

.wall {
  width: min(var(--wall), 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gutter);
}
.c12 { grid-column: 1 / 3; }
.c34 { grid-column: 3 / 5; }

.section { padding-block: var(--section); }

/* ---------- Type ---------- */

.display {
  font-size: var(--t-display);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.92;
}
.head {
  font-size: var(--t-head);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}
.statement {
  font-size: var(--t-statement);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.small { font-size: var(--t-small); line-height: 1.45; letter-spacing: normal; }
.muted { color: var(--muted); }

/* ---------- Controls ---------- */

@media (hover: hover) {
  .text-link:hover, .masthead a:hover, .masthead button:hover, .details-close:hover, .email:hover { color: var(--muted); }
}

.text-link, .masthead a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* ---------- Masthead ---------- */

.masthead {
  position: absolute; inset: 0 0 auto 0;
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 24px;
  z-index: 2;
}
.wordmark { font-weight: 600; }
.masthead .wordmark { text-decoration: none; }
.masthead nav { display: flex; gap: 1.5rem; }
.masthead button, .details-close { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.masthead .wordmark { font-weight: 600; }   /* the button reset above would otherwise drop it to regular */
.masthead nav button, .details-close { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

/* ---------- Details overlay ---------- */

.details {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--paper); color: var(--ink); overflow-y: auto;
}
.details::backdrop { background: transparent; }
.details[open] { animation: details-in 400ms var(--ease); }
@keyframes details-in { from { opacity: 0; } to { opacity: 1; } }
.details-inner { min-height: 100%; display: flex; flex-direction: column; box-sizing: border-box; padding-top: 24px; padding-bottom: 3rem; }
.details-top { display: flex; justify-content: space-between; align-items: baseline; }
.details-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: 4rem 2rem; width: min(var(--wall), 100%); }
.details-title { font-size: var(--t-small); font-weight: 500; letter-spacing: normal; color: var(--muted); }
.details-list { margin-top: 1.5rem; display: grid; gap: clamp(1rem, 2.4vw, 2rem); }
.details-list li {
  font-size: var(--t-heading); font-weight: 500; letter-spacing: -0.025em; line-height: 1.15;
}
.details[open] .details-list li { animation: details-line 600ms var(--ease) both; }
.details[open] .details-list li:nth-child(2) { animation-delay: 60ms; }
.details[open] .details-list li:nth-child(3) { animation-delay: 120ms; }
.details[open] .details-list li:nth-child(4) { animation-delay: 180ms; }
@keyframes details-line { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.details-contact { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1rem 2rem; padding-top: 1.5rem; }
.details-contact p { font-size: var(--t-statement); font-weight: 500; letter-spacing: -0.02em; }
.details-contact .email { font-size: var(--t-statement); }
html.details-open { overflow: hidden; }

/* ---------- 1. Hero ---------- */

/* Plain hero (no JS, no WebGL): headline, copy, links. The exploded view (.xv-on) and the reduced-motion still (.xv-still)
   are layered on below; everything .xv-* that isn't the headline stays hidden until then. */
.hero { position: relative; }
.xv-pin {
  max-width: var(--measure); margin-inline: auto; padding: clamp(6rem, 14vh, 9rem) var(--side) 0;
  min-height: calc(min(100svh, 62rem) - 14rem); display: flex; flex-direction: column; justify-content: flex-end;
}
.xv-canvas, .xv-callouts, .xv-count, .xv-hint, .xv-cap:not(.xv-title) { display: none; }
.xv-head { font-size: var(--t-display); font-weight: 600; letter-spacing: -0.045em; line-height: 0.92; }

/* the full stop: the brand's one colour */
.dot { display: inline-block; width: 0.15em; height: 0.15em; margin-left: 0.03em; border-radius: 50%; background: #ff5a3c; }
.line { display: block; overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.line > span { display: block; white-space: nowrap; }


/* ---- the exploded view ---- */

.xv-on, .xv-still { --xv-line: color-mix(in srgb, var(--ink) 50%, transparent); --xv-left: max(var(--side), calc((100% - var(--measure)) / 2 + var(--side))); }
.xv-on .xv-track { height: 800vh; }
.xv-on .xv-pin, .xv-still .xv-pin {
  position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 0; max-width: none; padding: 0; overflow: hidden; display: block;
}
.xv-still .xv-pin { position: relative; height: min(100svh, 62rem); }
.xv-on .xv-canvas, .xv-still .xv-canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 600ms var(--ease); }
.xv-canvas.ready { opacity: 1; }
.xv-on .xv-callouts, .xv-still .xv-callouts { display: block; position: absolute; inset: 0; pointer-events: none; }
.xv-callouts svg { position: absolute; left: 0; top: 0; overflow: visible; }
.xv-callouts path { fill: none; stroke: var(--xv-line); stroke-width: 1; }
.xv-callouts .ring { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }
.xv-callouts .ai path { stroke: #ff5a3c; }
.xv-callouts .ai .ring { stroke: #ff5a3c; fill: #ff5a3c; }
.xv-lb {
  position: absolute; left: 0; top: 0; font: 500 15px/1 var(--font-sans); letter-spacing: -0.005em; color: var(--ink); white-space: nowrap;
  opacity: 0; will-change: transform, opacity;
}
.xv-lb::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 380ms var(--ease); }
.xv-lb.gone::after { transform: scaleX(1); }
.xv-lb.ai::after { content: none; }
.xv-lb.ai { display: flex; align-items: center; gap: 0.55em; color: var(--xv-ai); font: 600 15px/1 var(--font-sans); letter-spacing: -0.005em; }
.xv-lb.ai::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ff5a3c; }

.xv-on .xv-cap { display: block; position: absolute; left: var(--xv-left); bottom: 11vh; max-width: 36rem; opacity: 0; pointer-events: none; will-change: opacity, transform; }
.xv-on .xv-cap.xv-title { max-width: 44rem; opacity: 1; } /* visible before hero.js runs; JS takes over with inline opacity */
.xv-on .xv-cap.xv-end { max-width: none; } .xv-on .xv-end .xv-head { white-space: nowrap; } /* headline always two lines, like the opening */
.xv-on .xv-head, .xv-still .xv-head { font-size: clamp(3rem, 6vw, 6.4rem); line-height: 0.92; letter-spacing: -0.052em; }
.xv-say { font-size: var(--t-heading); line-height: 1.04; letter-spacing: -0.035em; font-weight: 600; max-width: 13.5em; text-wrap: balance; }
.xv-note { margin-top: 1rem; font-size: var(--t-small); line-height: 1.5; color: var(--muted); }
.xv-on .xv-hint { opacity: 0; transition: opacity 700ms var(--ease); }   /* shown only if nobody has scrolled 3s after load (script.js) */
.xv-on .xv-hint.show { opacity: 1; }
.xv-on .xv-hint { display: flex; align-items: center; gap: 0.7rem; margin-top: 2rem; font-size: var(--t-small); line-height: 1; color: var(--muted); }
.xv-hint b { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); transform-origin: top; animation: drip 2.2s cubic-bezier(0.6, 0, 0.2, 1) infinite; }
@keyframes drip { 0% { transform: translateY(-6px); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateY(8px); opacity: 0; } }   /* a dot dropping: scroll */

.xv-on .xv-count { display: block; position: absolute; right: var(--xv-left); bottom: 11vh; width: 9.5rem; opacity: 0; text-align: right;
  font-size: var(--t-small); line-height: 1.4; color: var(--muted); }
.xv-count b { display: block; margin-top: 0.35rem; font: 600 var(--t-heading)/1 var(--font-sans); letter-spacing: -0.04em; color: var(--ink); font-variant-numeric: tabular-nums; }

/* reduced motion: one still of the rebuilt box beside the headline, nothing pinned */
.xv-still .xv-cap.xv-title { position: absolute; left: var(--xv-left); bottom: 9vh; max-width: 44rem; opacity: 1 !important; transform: none !important; }

@media (max-width: 700px) {
  .xv-on .xv-cap, .xv-still .xv-cap.xv-title { left: var(--side); right: var(--side); bottom: 6.5vh; }
  .xv-on .xv-count { right: var(--side); top: 4.6rem; bottom: auto; width: 6.5rem; }
  /* phone labels sit on the screen edge, on a backing pill, so they stay readable over the stack */
  .xv-lb { font-size: 14px; padding: 5px 9px; border-radius: 999px; background: var(--paper); }   /* a solid backing, not glass, so they read over the stack */
  .xv-lb.ai { font-size: 14px; }
  .xv-lb::after { left: 9px; right: 9px; }
}
@media (max-height: 500px) { .xv-on .xv-count { display: none; } }

.hero :focus-visible, .masthead :focus-visible { box-shadow: 0 0 0 6px var(--paper); }

/* the pen strike: drawn as a background on each line of the text, so wrapped items are struck line by line */
s {
  text-decoration: none; color: var(--muted);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M0 5.6 Q26 4.3 50 5.8 T100 4.6' fill='none' stroke='%23ff5a3c' stroke-width='2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") no-repeat 0 58% / 100% 0.32em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.strike { display: none; }

/* with JS a [data-strikes] list starts unstruck and the pen draws across, left to right, in view */
.js [data-strikes] s { color: var(--ink); background-size: 0% 0.32em; transition: color 600ms var(--ease) var(--d, 0ms), background-size 600ms cubic-bezier(0.55, 0.1, 0.35, 1) var(--d, 0ms); }
.js [data-strikes].drawn s { color: var(--muted); background-size: 100% 0.32em; }

/* ---------- 3. Engagement ---------- */

.stages { margin-top: 5rem; row-gap: 4rem; }
.stages li { display: flex; flex-direction: column; gap: 1rem; }
.engagement-intro { margin-top: 2rem; max-width: 40ch; }
.stage {
  font-size: clamp(1.75rem, 3.3vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  padding-bottom: 0.5rem;
}
.stages .small { margin-top: auto; padding-top: 0.5rem; font-size: var(--t-body); color: var(--ink); font-weight: 500; }

/* ---------- 4. Case study ---------- */

.case { background: var(--field); padding-block: clamp(5rem, 9vw, 8rem); }
.case .wall { row-gap: 2rem; }
.context { margin-top: 1.5rem; max-width: 46ch; }

.sub { font-size: var(--t-body); font-weight: 600; letter-spacing: -0.01em; margin-bottom: 1rem; }
.close { align-items: end; }

.case-body { margin-top: 4rem; align-items: start; }
.ba { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 2.5rem; }
.ba .sub .muted { font-weight: 400; }
.ba ol { font-size: var(--t-statement); font-weight: 500; letter-spacing: -0.02em; line-height: 1.3; display: grid; gap: 0.6rem; }
.case .close { margin-top: 4rem; }
.close .context { margin-top: 0; }

/* ---------- 5. People ---------- */

.sign-off { display: flex; gap: 4rem; flex-wrap: wrap; }
.signed { margin: 0; }
.mark { display: block; width: var(--w); height: 6rem; color: var(--ink); stroke-dasharray: 1 1; overflow: visible; }
.signed figcaption { margin-top: 0.75rem; font-size: var(--t-small); letter-spacing: normal; }
.role { display: block; color: var(--muted); }

.reach { margin-top: 0; }
.people.section { padding-bottom: clamp(2rem, 4vw, 3rem); }   /* contact and footer share one screen */
.lead-in { margin-bottom: 2.5rem; max-width: 18ch; }
.reach-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 3rem; }
.contact { font-style: normal; min-width: 0; }
.email {
  font: 500 var(--t-statement) / 1.2 var(--font-sans);
  letter-spacing: -0.02em;
  color: var(--ink); background: none; border: 0; padding: 0;
  text-align: left; cursor: pointer; padding-block: 0.2rem;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}
.email.swapping { opacity: 0; }

/* ---------- Footer ---------- */

/* the wordmark fills the page */
.footer { padding: clamp(2rem, 4vw, 3rem) var(--side) 0; text-align: center; overflow-x: clip; }
.bigmark { font-size: 22vw; font-weight: 600; letter-spacing: -0.055em; line-height: 0.8; overflow: hidden; padding-bottom: 0.06em; margin-inline: calc(-1 * var(--side)); }
.bigmark span { display: inline-block; white-space: nowrap; }

/* ---------- Motion ---------- */

.js .line > span { transform: translateY(105%); animation: rise var(--settle) var(--ease) forwards; animation-delay: var(--lead); }
.js .line + .line > span { animation-delay: calc(var(--lead) + 110ms); }
@keyframes rise { to { transform: translateY(0); } }
@keyframes appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 900ms var(--ease) var(--d, 0ms), transform 900ms var(--ease) var(--d, 0ms); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1199px) {
    .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c12, .c34 { grid-column: 1 / -1; }
  .close { align-items: start; }
}

@media (max-width: 640px) {
  :root { --side: 1rem; --gutter: 2rem; }
  .wall, .stages { grid-template-columns: minmax(0, 1fr); }
  .xv-pin { padding-top: 6rem; min-height: calc(100svh - 18rem); }
  .ba { grid-template-columns: minmax(0, 1fr); }
  .case-body, .case .close { margin-top: 3rem; }
  .sign-off { gap: 2rem; flex-wrap: nowrap; }
  .mark { width: calc(var(--w) * 0.75); height: 4.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .line > span, .js [data-reveal] { transform: none; opacity: 1; }
  .xv-hint b { animation: none; }
}

/* Hand-broken on wider screens; one flowing sentence on a phone keeps the heading to two lines. */
@media (max-width: 640px) {
}

/* ================= Accents and footer ================= */


.sign-row { margin-top: clamp(2rem, 4vw, 3rem); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1.5rem; }
.sign-row .fine { font-size: var(--t-small); color: var(--muted); }

/* ---------- Chapter break: into the work ---------- */
.chapter { position: relative; width: min(var(--wall), 100%); padding-top: clamp(1.5rem, 3vw, 2.5rem); margin-bottom: clamp(5rem, 10vw, 9rem); }
.chapter-title { margin-top: clamp(2rem, 4vw, 3.5rem); }
.chapter-line { margin-top: clamp(1.25rem, 2.5vw, 2rem); }
.case { padding-top: clamp(4rem, 7vw, 6rem); }
/* short screens (small laptops): contact and footer still share one screen */
@media (max-height: 820px) and (min-width: 701px) {
  .lead-in { font-size: min(var(--t-head), 8vh); margin-bottom: 1.5rem; }
  .people.section, .footer { padding-top: 2rem; }
  .people.section { padding-bottom: 2rem; }
  .sign-row { margin-top: 1.75rem; }
  .mark { height: 4.5rem; width: calc(var(--w) * 0.75); }
  }
