/* ═══════════════════════════════════════════════════════════
   Built by Al
   ═══════════════════════════════════════════════════════════ */

/* Mona Sans (OFL), subset to Latin and renamed — see README */
@font-face {
  font-family: "Built Sans";
  src: url("fonts/BuiltSans-latin.woff2") format("woff2");
  font-weight: 200 700;
  font-stretch: 100% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #141413;
  --ink-2: #52504b;
  --ink-3: #6c6963;
  --rule: rgba(20, 20, 19, 0.1);
  --rule-2: rgba(20, 20, 19, 0.2);
  --night: #151514;
  --night-ink: #f1efe9;
  --night-2: rgba(241, 239, 233, 0.64);
  --night-rule: rgba(241, 239, 233, 0.2);
  --flag: #f0a58a;

  --sans: "Built Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wide: 112%;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --r: 8px;
  --header: 76px;
  --gutter: clamp(20px, 4vw, 56px);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + env(safe-area-inset-top, 0px));
}
/* while a sheet is open the page stays put; padding stands in for the scrollbar */
html.locked { overflow: hidden; padding-right: var(--sbw, 0px); }
html.locked .header { padding-right: var(--sbw, 0px); }

body {
  margin: 0;
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, p { margin: 0; }
img { max-width: 100%; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.label {
  font-size: 11.5px;
  line-height: 1.4;
  font-weight: 500;
  font-stretch: 108%;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* the name, set in mixed case: Mona Sans's tailed l keeps "Al" from reading as "AI" */
.brand { font-feature-settings: "ss03" 1; }

.ul {
  color: inherit;
  text-decoration: none;
  padding-bottom: 2px;
  background: linear-gradient(currentColor, currentColor) no-repeat 100% 100% / 0 1px;
  transition: background-size 0.6s var(--ease);
}
.ul:hover, .ul:focus-visible { background-position: 0 100%; background-size: 100% 1px; }

.i { width: 1.15em; height: 1.15em; flex: none; display: block; }
[data-icon] { display: inline-flex; }

.skip {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 2000;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease);
}
.skip:focus { transform: none; }

/* ── Header ─────────────────────────────────────────── */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: calc(var(--header) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  transition: transform 0.6s var(--ease), background-color 0.4s, box-shadow 0.4s, opacity 1s ease 0.3s;
}
.js:not(.ready) .header { opacity: 0; }
.header.solid {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 var(--rule);
}
.header-in {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 13px;
  font-weight: 600;
  font-stretch: var(--wide);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
/* the mark: a drafting compass that doubles as an A — its arc is the crossbar */
.logo-mark { width: 25px; height: 25px; flex: none; margin: -3px 0 0 -2px; overflow: visible; }
.logo-arc { stroke-dasharray: 1 1.2; stroke-dashoffset: 0; }
.js:not(.ready) .header .logo-arc { stroke-dashoffset: 1.1; }
.js.ready .header .logo-arc { transition: stroke-dashoffset 1.2s var(--ease-io) 0.7s; }
@keyframes draw { from { stroke-dashoffset: 1.1; } }
@media (hover: hover) and (pointer: fine) {
  .logo:hover .logo-arc { animation: draw 0.9s var(--ease-io); }
}
.menu { --gap: clamp(22px, 3vw, 40px); display: flex; align-items: center; gap: var(--gap); }
.menu .ul { font-size: 14px; font-weight: 500; }

/* back to top: slides in beside Contact once you're past the hero */
.top {
  display: grid;
  place-items: center;
  width: 0;
  height: 38px;
  margin-left: calc(-1 * var(--gap));
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--rule-2);
  color: inherit;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: width 0.6s var(--ease), margin 0.6s var(--ease), opacity 0.25s, visibility 0s linear 0.6s,
    background-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.header.past .top {
  width: 38px;
  margin-left: 0;
  opacity: 1;
  visibility: visible;
  transition: width 0.6s var(--ease), margin 0.6s var(--ease), opacity 0.4s ease 0.15s, visibility 0s,
    background-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.top .i { width: 16px; height: 16px; transition: transform 0.5s var(--ease); }
.top:hover { background: var(--ink); color: var(--paper); box-shadow: none; }
.top:hover .i { transform: translateY(-2px); }

/* ── Hero ───────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header) + clamp(32px, 9vh, 104px)) 0 clamp(8px, 4vh, 40px);
}
.deal .hero {
  min-height: max(640px, min(100svh, 64vw + 360px));
  padding-top: calc(var(--header) + clamp(20px, 6vh, 72px));
}
.hero-in { text-align: center; }
.hero-title {
  font-weight: 300;
  font-stretch: var(--wide);
  font-size: clamp(36px, 5.3vw, 90px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.hero-title .line {
  display: block;
  overflow: hidden;
  padding: 0.02em 0.1em 0.1em;
  margin: -0.02em -0.1em -0.1em;
}
.hero-title .line > span { display: inline-block; text-wrap: balance; }
.js .hero-title .line > span { transform: translateY(106%); }
.js.ready .hero-title .line > span { transform: none; transition: transform 1.5s var(--ease); }
.js.ready .hero-title .line + .line > span { transition-delay: 0.09s; }
.hero-sub { margin-top: clamp(16px, 2.6vh, 28px); }
.js .hero-sub, .js .hint { opacity: 0; translate: 0 8px; }
.js.ready .hero-sub, .js.ready .hint {
  opacity: 1;
  translate: none;
  transition: opacity 1s ease 0.6s, translate 1.2s var(--ease) 0.6s;
}

/* The deck: an empty stage the work cards are fanned across (desktop) */
.deck { display: none; }
.deal .deck {
  display: block;
  flex: 1;
  min-height: 260px;
  margin-top: clamp(8px, 2vh, 24px);
}
.hint { display: none; }
.deal .hint {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(14px, 2.6vh, 26px);
  text-align: center;
  font-size: 10.5px;
}

/* ── Work ───────────────────────────────────────────── */
.work { padding: clamp(40px, 7vh, 96px) 0 clamp(72px, 11vh, 140px); }
/* while the cards are still fanned out in the hero, the empty grid's heading waits */
.deal-fan .work-head { opacity: 0; }
.work-head {
  transition: opacity 0.8s ease;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: clamp(24px, 3.4vw, 44px);
  border-bottom: 1px solid var(--rule);
}
.grid {
  --stagger: clamp(56px, 9vw, 150px);
  --col-gap: clamp(20px, 3.4vw, 56px);
  list-style: none;
  margin: 0;
  padding: 0 0 var(--stagger);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: clamp(44px, 6vw, 96px);
}
.slot { position: relative; min-width: 0; }
.slot:nth-child(even) { translate: 0 var(--stagger); }
/* with an odd number of cards, the last one (the invitation) closes the grid, centred */
@media (min-width: 760px) {
  .grid:has(> .slot:last-child:nth-child(odd)) { padding-bottom: 0; }
  .slot:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - var(--col-gap) / 2);
    margin-top: var(--stagger);
  }
}

.card {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.card:focus-visible { outline: none; }
.card:focus-visible .cover { outline: 2px solid var(--ink); outline-offset: 4px; }
.deal .card { will-change: transform; }

.card-in {
  position: relative;
  display: block;
  transition: transform 0.7s var(--ease), translate 1.4s var(--ease), opacity 1s ease;
}
.deal .card-in { transition-delay: 0s, var(--delay, 0s), var(--delay, 0s); }
.js.deal .card-in { opacity: 0; translate: 0 48px; }
.js.ready.deal .card-in { opacity: 1; translate: none; }

/* a soft shadow while the cards are fanned out, gone once they land */
.card-in::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  aspect-ratio: 4 / 3;
  border-radius: var(--r);
  box-shadow: 0 46px 80px -30px rgba(24, 20, 14, 0.5), 0 6px 16px -6px rgba(24, 20, 14, 0.18);
  opacity: calc(1 - var(--e, 1));
  pointer-events: none;
}

.cap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-top: 16px;
  opacity: calc((var(--e, 1) - 0.65) * 2.86);
}
.cap-title {
  font-size: 17px;
  font-weight: 500;
  font-stretch: 104%;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.cap-title::after {
  content: "→";
  display: inline-block;
  margin-left: 0.4em;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.4s, transform 0.6s var(--ease);
}
.cap-meta { font-size: 13px; color: var(--ink-3); white-space: nowrap; }

@media (hover: hover) and (pointer: fine) {
  .card:hover .cap-title::after { opacity: 1; transform: none; }
}
/* Fanned out, only the pictures answer the pointer (not the hidden captions),
   and the card you're on comes forward. It grows from its centre, so it never
   slips out from under the pointer. */
.deal-fan .card { pointer-events: none; }
.deal-fan .cover { pointer-events: auto; }
.deal-fan .card.lift .cover { transform: scale(1.045); }
.deal-fan .card.lift .card-in::before {
  box-shadow: 0 60px 90px -28px rgba(24, 20, 14, 0.55), 0 10px 22px -8px rgba(24, 20, 14, 0.22);
}

/* ── Covers ─────────────────────────────────────────── */
.cover {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--grain) var(--tone, #d8d4cb);
  color: var(--tone-ink, var(--ink));
  container-type: inline-size;
  isolation: isolate;
  transition: transform 0.5s var(--ease);
}

/* website: the screenshot sits on the card like a printed page */
.cover.web .shot {
  position: absolute;
  left: 9%;
  right: 9%;
  top: 9%;
  height: 100%;
  overflow: hidden;
  border-radius: 0.6cqw 0.6cqw 0 0;
  background: #fff;
  box-shadow: 0 2.6cqw 5cqw -1.6cqw rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.04);
  container-type: size;
  transition: transform 0.9s var(--ease);
}
.cover.web .shot img {
  display: block;
  width: 100%;
  height: auto;
  transition: translate 1.4s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .card:hover .cover.web .shot { transform: translateY(-2.5%); }
  .card:hover .cover.web .shot img,
  .case-cover .cover.web:hover .shot img {
    translate: 0 min(0px, calc(-100% + 100cqh));
    transition: translate 7s cubic-bezier(0.45, 0, 0.25, 1) 0.2s;
  }
  /* while fanned out, a card only rises; the page preview waits for the grid */
  .deal-fan .card:hover .cover.web .shot { transform: none; }
  .deal-fan .card:hover .cover.web .shot img { translate: none; transition-duration: 0.8s; }
  .deal-fan .card:hover .cap-title::after { opacity: 0; }
}

/* website without a screenshot yet: a typeset card */
/* (padding is in % because a container's own cq units measure its parent) */
.cover.type { display: flex; flex-direction: column; justify-content: flex-end; padding: 7%; }
.type-title { font-size: 9cqw; font-weight: 300; font-stretch: var(--wide); letter-spacing: -0.04em; line-height: 1; }
.type-foot { margin-top: 2.4cqw; font-size: 2.4cqw; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.7; }

/* the last card: an invitation */
.cover.ask {
  --tone: var(--night);
  --tone-ink: var(--night-ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6.5%;
}
.ask-top { display: flex; justify-content: space-between; align-items: flex-start; }
.ask-label { font-size: 2.3cqw; font-weight: 500; font-stretch: 108%; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.6; }
.ask-go {
  display: grid;
  place-items: center;
  width: 11cqw;
  height: 11cqw;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--night-rule);
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease), box-shadow 0.5s;
}
.ask-go .i { width: 4.4cqw; height: 4.4cqw; transition: transform 0.6s var(--ease); }
.ask-label, .ask-title { opacity: calc((var(--e, 1) - 0.5) * 2); transition: opacity 0.4s ease; }
.deal-fan .card.lift .ask-label, .deal-fan .card.lift .ask-title { opacity: 1; }
.ask-title { font-size: 10cqw; font-weight: 300; font-stretch: var(--wide); letter-spacing: -0.045em; line-height: 0.98; }
@media (hover: hover) and (pointer: fine) {
  .card:hover .ask-go { background: var(--night-ink); color: var(--night); box-shadow: none; }
  .card:hover .ask-go .i { transform: rotate(45deg); }
}

/* automation: a small machine that tidies up after itself, on a loop */
.flow { position: absolute; inset: 0; container-type: size; color: var(--a0); }
.tile {
  --w: 16cqw;
  --h: 5.4cqw;
  --det: color-mix(in srgb, var(--tone) 72%, transparent);
  position: absolute;
  left: 0;
  top: 0;
  width: var(--w);
  height: var(--h);
  border-radius: 0.9cqw;
  background:
    radial-gradient(circle at calc(var(--h) / 2) 50%, var(--det) 0 1cqw, transparent calc(1cqw + 0.5px)),
    linear-gradient(var(--det), var(--det)) calc(var(--h) - 0.2cqw) 32% / 46% 0.7cqw no-repeat,
    linear-gradient(var(--det), var(--det)) calc(var(--h) - 0.2cqw) 68% / 26% 0.7cqw no-repeat,
    var(--c, var(--a0));
  opacity: 0;
  transform: translate(calc(var(--cx, 50) * 1cqw - 50%), calc(var(--cy, 50) * 1cqh - 50%)) rotate(calc(var(--cr, 0) * 1deg)) scale(0.86);
  transition: transform 1.3s var(--ease-io) var(--d, 0s), opacity 0.55s ease var(--d, 0s);
}
.flow.in .tile {
  opacity: 1;
  transform: translate(calc(var(--cx, 50) * 1cqw - 50%), calc(var(--cy, 50) * 1cqh - 50%)) rotate(calc(var(--cr, 0) * 1deg));
}
.flow.order .tile {
  opacity: 1;
  transform: translate(calc(var(--ox) * 1cqw - 50%), calc(var(--oy) * 1cqh - 50%)) rotate(calc(var(--or, 0) * 1deg));
}
.flow.out .tile {
  opacity: 0;
  transform: translate(calc(var(--ox) * 1cqw - 50% + 7cqw), calc(var(--oy) * 1cqh - 50%)) rotate(calc(var(--or, 0) * 1deg));
  transition-duration: 0.8s, 0.6s;
}
.flow.reset *, .flow.reset *::after { transition: none !important; }

/* route: work sorted into lanes */
.lane { position: absolute; left: calc(var(--x) * 1cqw); top: 14cqh; bottom: 9cqh; width: 0; }
.lane::before {
  content: "";
  position: absolute;
  left: -0.5px;
  top: 6.6cqw;
  bottom: 0;
  width: 1px;
  background: currentColor;
  opacity: 0.16;
}
.lane-head {
  position: absolute;
  left: 0;
  top: 0;
  width: 5cqw;
  height: 5cqw;
  translate: -50% 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--c);
}
.lane-head::after {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background: var(--c);
  transform: scale(0);
  transition: transform 0.7s var(--ease) var(--d, 0s);
}
.flow.done .lane-head::after { transform: scale(1); }
.flow.out .lane-head::after { transform: scale(0); transition-delay: 0s; }

/* match: pairs line up; the one that doesn't is set aside */
.match .tile { --w: 21cqw; --h: 6.2cqw; }
.match .tile.pay { --c: transparent; --det: color-mix(in srgb, var(--a0) 70%, transparent); box-shadow: inset 0 0 0 1px var(--a0); }
.match .tile.pay.odd { --det: color-mix(in srgb, var(--a2) 85%, transparent); box-shadow: inset 0 0 0 1px var(--a2); }
.flow.done .tile.odd { animation: flag 1.8s var(--ease-io) infinite; }
@keyframes flag {
  50% { box-shadow: inset 0 0 0 1px var(--a2), 0 0 0 1.4cqw color-mix(in srgb, var(--a2) 20%, transparent); }
}
.link {
  position: absolute;
  left: 0;
  top: 0;
  width: 9cqw;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
  transform-origin: 0 50%;
  transform: translate(45.5cqw, calc(var(--oy) * 1cqh)) scaleX(0);
  transition: transform 0.7s var(--ease) var(--d, 0s), opacity 0.4s;
}
.flow.done .link { transform: translate(45.5cqw, calc(var(--oy) * 1cqh)) scaleX(1); }
.flow.out .link { opacity: 0; }

/* ── Pointer label ──────────────────────────────────── */
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: -46px 0 0 -46px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 14px 34px -14px rgba(20, 18, 14, 0.5);
  pointer-events: none;
  transform: scale(0);
  will-change: transform;
}
.cursor span {
  font-size: 10.5px;
  font-weight: 600;
  font-stretch: var(--wide);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: -0.14em;
}
.has-cursor .card { cursor: none; }

/* ── Footer ─────────────────────────────────────────── */
.footer { border-top: 1px solid var(--rule); }
.footer-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 32px;
  padding-block: 26px 30px;
  font-size: 14px;
}
.to-top { display: inline-flex; align-items: center; gap: 6px; }

/* ── Sheets (case study + contact) ──────────────────── */
.sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
}
.sheet::backdrop { background: transparent; }
.sheet-bg {
  position: absolute;
  inset: 0;
  background: var(--paper);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.sheet.on .sheet-bg { opacity: 1; }
.sheet.off .sheet-bg { opacity: 0; transition: opacity 0.6s var(--ease-io) 0.1s; }
.sheet-scroll {
  position: absolute;
  inset: 0;
  padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px);
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: opacity 0.25s ease;
}
.sheet-scroll.leaving { opacity: 0; }
.sheet-bar {
  height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.x {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -4px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--rule-2);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.35s, color 0.35s, box-shadow 0.35s;
}
.x .i { width: 18px; height: 18px; }
.x:hover { background: var(--ink); color: var(--paper); box-shadow: none; }

/* everything but the cover rises in once the sheet is open */
@keyframes rise { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: none; } }
@keyframes drop { to { opacity: 0; } }
.sheet [style*="--a"] { opacity: 0; }
.sheet.on [style*="--a"] { animation: rise 0.9s var(--ease) both; animation-delay: calc(0.3s + var(--a) * 0.055s); }
.sheet.on.swapped [style*="--a"] { animation-delay: calc(var(--a) * 0.045s); }
/* the contact panel's words wait until the panel has (nearly) finished opening */
.contact-sheet.on [style*="--a"] { animation-delay: calc(0.55s + var(--a) * 0.06s); }
.sheet.off [style*="--a"] { opacity: 1; animation: drop 0.25s ease both; }
/* the footer only fades, so it never pokes below the fold mid-rise */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet.on .case-foot { animation-name: fade; }
@keyframes swap-in { from { opacity: 0; transform: scale(0.97); } }
.sheet.swapped .case-cover .cover { animation: swap-in 0.8s var(--ease) both; }
/* the old print slides out to its corner once the new one has landed */
@keyframes tuck { from { opacity: 0; translate: -16% -12%; } }
.sheet .before { opacity: 0; }
.sheet.on .before { opacity: 1; animation: tuck 1s var(--ease) 0.75s both; }
.sheet.on.swapped .before { animation-delay: 0.25s; }
.sheet.off .before { opacity: 1; animation: drop 0.2s ease both; }
.sheet .phones { opacity: 0; }
.sheet.on .phones { opacity: 1; animation: tuck 1s var(--ease) 0.75s both; }
.sheet.on.swapped .phones { animation-delay: 0.25s; }
.sheet.off .phones { opacity: 1; animation: drop 0.2s ease both; }

/* case study */
.case-body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: center;
  min-height: calc(100svh - var(--header) - 88px);
  padding-block: 8px 24px;
}
.case-cover {
  grid-column: 1 / span 7;
  position: relative;
  width: min(100%, calc((100svh - var(--header) - 140px) * 4 / 3));
  margin: 0;
}
.case-cover .cover { box-shadow: 0 40px 80px -48px rgba(24, 20, 14, 0.55); }

/* a redesign: the site it replaced, tucked in at the corner like an older print */
.before {
  position: absolute;
  right: -6%;
  bottom: -6%;
  width: 36%;
  margin: 0;
  padding: 4px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  font: inherit;
  cursor: zoom-in;
  box-shadow: 0 30px 50px -24px rgba(24, 20, 14, 0.55), 0 2px 8px -2px rgba(24, 20, 14, 0.16);
  transform: rotate(4deg);
  transform-origin: 100% 100%;
  transition: transform 0.7s var(--ease), box-shadow 0.7s var(--ease);
}
/* clicked: the old site laid over the new one at full size (main.js works out the move).
   Everything inside scales with it, so the shadow is drawn smaller to match. */
.before.big {
  z-index: 1;
  cursor: zoom-out;
  transform: var(--big);
  box-shadow: 0 14px 26px -12px rgba(24, 20, 14, 0.55), 0 1px 3px rgba(24, 20, 14, 0.12);
}
.before.big .before-tag { scale: calc(1 / var(--s, 1)); }
.before img { display: block; width: 100%; height: auto; border-radius: 2px; }
/* bottom left, over the old background, so it never hides the old site itself */
.before-tag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 8px 3px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  font-size: 10px;
  font-weight: 600;
  font-stretch: 108%;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
  transform-origin: 0 100%;
  transition: scale 0.7s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .before:not(.big):hover { transform: rotate(0deg) scale(1.7); }
  /* the tag keeps its size while the print grows */
  .before:not(.big):hover .before-tag { scale: 0.6; }
}
/* an app: two of its screens, stood at the corner. The front one leans right, the other peeks out behind it. */
.phones {
  position: absolute;
  right: -7%;
  bottom: -17%;
  width: 32%;
  aspect-ratio: 1 / 1.18;
  pointer-events: none;
}
.phone {
  position: absolute;
  bottom: 0;
  width: 52%;
  padding: 2.6%;
  border-radius: 16% / 7.4%;
  background: #121214;
  box-shadow: 0 30px 50px -24px rgba(24, 20, 14, 0.6), 0 2px 8px -2px rgba(24, 20, 14, 0.2);
  transform-origin: 50% 100%;
  transition: transform 0.7s var(--ease);
}
.phone img { display: block; width: 100%; height: auto; }
.phone:first-child { right: 40%; bottom: 5%; transform: rotate(-5deg); }
.phone:last-child { right: 0; transform: rotate(4deg); }
.phone:only-child { right: 0; bottom: 0; }
@media (hover: hover) and (pointer: fine) {
  .phones { pointer-events: auto; }
  .phones:hover .phone:first-child { transform: translate(-10%, -4%) rotate(-8deg); }
  .phones:hover .phone:last-child { transform: translate(4%, -2%) rotate(6deg); }
}
.case-info { grid-column: 9 / span 4; }
.case-title {
  margin-top: 14px;
  font-size: clamp(32px, 3.3vw, 54px);
  font-weight: 300;
  font-stretch: var(--wide);
  letter-spacing: -0.04em;
  line-height: 1.02;
}
.case-outcome { margin-top: 18px; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.4; text-wrap: balance; }
.case-desc { margin-top: 12px; color: var(--ink-2); max-width: 46ch; }
.case-steps {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  counter-reset: s;
  border-top: 1px solid var(--rule);
  font-size: 14.5px;
}
.case-steps li {
  counter-increment: s;
  display: flex;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}
.case-steps li::before {
  content: counter(s, decimal-leading-zero);
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}
.case-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 22px;
  margin: 22px 0 0;
  font-size: 14px;
}
.case-meta dt { color: var(--ink-3); }
.case-meta dd { margin: 0; }
.case-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; color: inherit; text-decoration: none; }
.case-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 88px;
  border-top: 1px solid var(--rule);
}
.step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.step b { font-weight: 500; }
.step .i { transition: transform 0.5s var(--ease); }
.step[data-dir="prev"]:hover .i { transform: translateX(-4px); }
.step[data-dir="next"]:hover .i { transform: translateX(4px); }

/* contact */
.contact-sheet { color: var(--night-ink); }
.contact-panel {
  position: absolute;
  inset: 0;
  padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--night);
}
.contact-panel .x { box-shadow: inset 0 0 0 1px var(--night-rule); }
.contact-panel .x:hover { background: var(--night-ink); color: var(--night); }
.contact-body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 48px;
  align-items: start;
  padding-top: clamp(24px, 9vh, 112px);
  padding-bottom: 72px;
}
.contact-intro { grid-column: 1 / span 5; }
.contact-title {
  font-size: clamp(44px, 5.4vw, 88px);
  font-weight: 300;
  font-stretch: var(--wide);
  letter-spacing: -0.045em;
  line-height: 0.98;
}
.contact-intro p { margin: 26px 0 18px; max-width: 34ch; font-size: 17px; color: var(--night-2); }
.contact-intro .email { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font-size: 17px; color: var(--night-ink); }
.copy {
  padding: 3px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  font-stretch: 108%;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.25s;
}
.copy:hover, .copy:focus-visible { opacity: 1; }
.form-status .addr { color: var(--night-ink); }
.form-status .copy { margin-left: 8px; }

.form { grid-column: 7 / span 6; }
.need { border: 0; margin: 0; padding: 0; min-width: 0; }
.need legend { padding: 0; margin-bottom: 14px; color: var(--night-2); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 20px;
  border-radius: var(--r);
  box-shadow: inset 0 0 0 1px var(--night-rule);
  font-size: 15px;
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.chip:hover span { box-shadow: inset 0 0 0 1px var(--night-2); }
.chip input:checked + span { background: var(--night-ink); color: var(--night); box-shadow: none; }
.chip input:focus-visible + span { outline: 2px solid var(--night-ink); outline-offset: 3px; }
.field { margin-top: 30px; }
.field .label { display: block; color: var(--night-2); }
.field .label i { font-style: normal; text-transform: none; letter-spacing: 0; opacity: 0.7; }
.field input, .field textarea {
  display: block;
  width: 100%;
  margin: 6px 0 0;
  padding: 8px 0 12px;
  border: 0;
  border-bottom: 1px solid var(--night-rule);
  border-radius: 0;
  background: transparent;
  color: var(--night-ink);
  font: inherit;
  font-size: clamp(20px, 1.7vw, 25px);
  font-weight: 300;
  font-stretch: 104%;
  line-height: 1.35;
  outline: none;
  resize: none;
  transition: border-color 0.3s;
}
.field textarea { min-height: 3em; overflow: hidden; }
.field input:focus, .field textarea:focus { border-bottom-color: var(--night-ink); }
.field input[aria-invalid="true"] { border-bottom-color: var(--flag); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 38px; }
.send {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 26px;
  border: 0;
  border-radius: var(--r);
  background: var(--night-ink);
  color: var(--night);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s;
}
.send:hover { background: #fff; }
.send .i { transition: transform 0.5s var(--ease); }
.send:hover .i { transform: translateX(4px); }
.send:disabled { opacity: 0.6; cursor: progress; }
.send:focus-visible { outline-color: var(--night-ink); }
.form-status { font-size: 14px; color: var(--night-2); }
.form-status.err { color: var(--flag); }
.form-status a { color: inherit; }
.sent { outline: none; }
.sent-title {
  font-size: clamp(34px, 3.4vw, 54px);
  font-weight: 300;
  font-stretch: var(--wide);
  letter-spacing: -0.04em;
  line-height: 1.04;
  margin-bottom: 14px;
}
.sent p:not(.sent-title) { color: var(--night-2); font-size: 17px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1100px) {
  .case-cover { grid-column: 1 / span 7; }
  .case-info { grid-column: 8 / span 5; }
  .before { right: 3%; }
  .phones { right: 2%; }
  .contact-intro { grid-column: 1 / span 6; }
  .form { grid-column: 7 / span 6; }
}

@media (max-width: 860px) {
  .case-body { grid-template-columns: 1fr; row-gap: 32px; min-height: 0; padding-block: 4px 40px; }
  .case-cover, .case-info { grid-column: 1; }
  .case-cover { width: 100%; }
  .case-cover.has-before { margin-bottom: 7%; }
  .case-cover.has-phones { margin-bottom: 16%; }
  .phones { right: 2%; bottom: -20%; width: 38%; }
  .before { right: 4%; bottom: -8%; width: 42%; padding: 3px; }
  .before-tag { left: 8px; bottom: 8px; font-size: 9px; }
  .contact-body { grid-template-columns: 1fr; padding-top: 16px; }
  .contact-intro, .form { grid-column: 1; }
  .contact-intro p { margin: 20px 0 14px; }
}

@media (max-width: 759px) {
  .grid { grid-template-columns: minmax(0, 1fr); padding-bottom: 0; row-gap: 32px; }
  .slot:nth-child(even) { translate: none; }
  /* small screens: the cards stack up like a deck as you scroll */
  .slot { position: sticky; top: calc(var(--header) + env(safe-area-inset-top, 0px) + 10px + var(--i, 0) * 9px); }
  .card-in { background: var(--paper); padding-bottom: 6px; }
  .hero { padding-bottom: 8px; }
  .hero-sub { font-size: 10.5px; letter-spacing: 0.12em; }
  .footer-in { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 520px) {
  :root { --header: 64px; }
  .logo { font-size: 12px; letter-spacing: 0.22em; gap: 9px; }
  .logo-mark { width: 23px; height: 23px; }
  .menu { --gap: 18px; }
  .top { height: 34px; }
  .header.past .top { width: 34px; }
  .hero-title { font-size: clamp(32px, 10.4vw, 44px); }
  .cap { padding-top: 12px; }
  .cap-title { font-size: 16px; }
  .step b { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .js .hero-title .line > span { transform: none; }
  .js.deal .card-in { opacity: 1; translate: none; }
}
