:root {
  --bg: #eeeff0; /* plain, slightly cool off-white: white and warm off-white images both stand out on it */
  --fg: #0d0d0d;
  --muted: #5c5c5c;
  --surface: #e3e4e6; /* grey panels: the nav bar, arrow buttons, image placeholders */
  --line: var(--surface);
  --accent: #a9d4f5;
  --radius: 6px;
  --gutter: clamp(20px, 5vw, 80px);
  --max: 1320px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --serif: "Crimson Pro", "Crimson Pro Fallback", Georgia, "Times New Roman", serif;
  --blue: var(--accent);
  --navy: #102440;
  --peach: #ffd8c6;
  --paper-bar: var(--surface);
  --fold: #dcdee2; /* the back of white paper, seen in a folded corner */
  --orange: #f05a28;
  --rust: #e2461c;
  --text-lead: clamp(19px, 1.7vw, 23px); /* intros and quotes */
  --text-display: clamp(30px, 3vw, 40px); /* serif titles: project names */
  --section-gap: 160px; /* space above every section */
  --content: 1120px; /* the inner width of reviews, backers, About and the calendar */
  /* One file folder, used by the hero and the testimonials. */
  --folder-front: var(--blue);
  --folder-back: #8dbfe9;
  --folder-lift: 26px; /* how far the back panel rises above the front */
  --folder-tab-w: 28%;
  --folder-tab-h: 16px;
  --folder-tab-radius: 6px 0 0 0;
  --folder-tab-clip: polygon(0 100%, 0 0, 86% 0, 100% 100%);
  --folder-back-radius: 3px 6px 6px 6px;
  --folder-front-radius: 4px 4px 6px 6px;
  --folder-pad: 36px 28px;
  --folder-tilt: -2deg;
}

/* ---------- fonts ---------- */

/* Served from this site, so the page doesn't wait on another server. The fallbacks are system fonts resized to
   the same proportions, so text doesn't jump when the real fonts arrive.
   The serif headings wait for Crimson Pro (font-display: block) because Times showing first is an obvious switch. */
@font-face {
  font-family: "DM Sans";
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/dm-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Crimson Pro";
  font-weight: 400 500;
  font-display: block;
  src: url("fonts/crimson-pro-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Crimson Pro";
  font-weight: 400 500;
  font-display: block;
  src: url("fonts/crimson-pro-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* The range leaves out the arrows (← → ↗), which DM Sans doesn't have, so they always come from the system font. */
@font-face {
  font-family: "DM Sans Fallback";
  src: local("Arial");
  size-adjust: 104.53%;
  ascent-override: 94.9%;
  descent-override: 29.66%;
  line-gap-override: 0%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "Crimson Pro Fallback";
  src: local("Times New Roman");
  size-adjust: 98.56%;
  ascent-override: 90.96%;
  descent-override: 21.8%;
  line-gap-override: 0%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}

/* ---------- page transitions ---------- */

/* Same-origin page loads crossfade instead of hard-cutting (Chrome, Edge, Safari 18.2+;
   other browsers just navigate as before). The header stays put; the page underneath
   fades out, and the new one fades in with a small rise. */
@view-transition { navigation: auto; }

.nav { view-transition-name: site-header; }

::view-transition-group(site-header) { animation-duration: 240ms; animation-timing-function: var(--ease-out); }
::view-transition-old(root) { animation: page-out 160ms var(--ease-out) both; }
::view-transition-new(root) { animation: page-in 280ms var(--ease-out) 60ms both; }

@keyframes page-out {
  to { opacity: 0; }
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(12px); }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "DM Sans", "DM Sans Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}

img { display: block; width: 100%; height: auto; }
picture { display: contents; } /* lays out as if only the img were there */
a { color: inherit; text-decoration: none; }
h1, h2, p, figure, dl, dd { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* One focus ring for everything you can tab to. */
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 2px; }

/* The small label over a section: the logo row, the reviews and About all use it. */
.label {
  margin-bottom: 32px;
  font-size: 13px;
  font-weight: 500;
}

.lead {
  font-size: var(--text-lead);
  line-height: 1.35;
  letter-spacing: -0.02em;
  font-weight: 500;
}

/* Hidden on screen but still read by screen readers and crawlers. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- nav: a paper-coloured bar floating across the page content ---------- */

.nav {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(var(--max) - 2 * var(--gutter));
  /* Line up with the page content, which stops growing at --max. */
  margin: 12px max(var(--gutter), (100% - var(--max)) / 2 + var(--gutter)) 0;
  padding: 6px;
  border-radius: 14px;
  background: var(--paper-bar);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
}
.mark {
  display: block;
  width: 33px;
  height: 26px;
  margin-left: 6px; /* clear of the bar's rounded corner */
  overflow: visible; /* room for the specs to drop */
}
.mark-hair, .mark-specs { transition: transform 0.3s var(--ease-out); }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
}
/* Inside the bar the note sits straight and fits within the padding; the letters still roll on hover. */
.nav .btn { height: 36px; margin-left: 4px; rotate: 0deg; }
.nav .btn-paper { border-radius: 8px; }
@media (hover: hover) and (pointer: fine) {
  /* Hair and specs part (in the mark's own units, 788 tall). The specs' top bar sits 68 under the hair, so
     moving 70 up and 130 down leaves a gap of 132, about 4px. */
  .nav-brand:hover .mark-hair { transform: translateY(-70px); }
  .nav-brand:hover .mark-specs { transform: translateY(130px); }
  /* Work / About roll their letters up like Book a call; the plain label is there for screen readers. */
  .nav-links a:hover .btn-row > span { translate: 0 -100%; }
  .nav .btn:hover { rotate: 0deg; translate: 0 0; }
}

/* ---------- Book a call button: a blue sticky note whose label rolls up letter by letter ---------- */

.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 22px 0 16px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  rotate: -2deg;
  transition: rotate 0.3s var(--ease-out), translate 0.3s var(--ease-out), scale 0.14s var(--ease-out);
}
.btn:active { scale: 0.97; }

/* The paper: bottom-right corner cut off, with the folded-over flap drawn on top. */
.btn-paper {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 2px;
  background: linear-gradient(315deg, transparent 9px, var(--note, var(--blue)) 9px);
}
.btn-paper::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 13px;
  height: 13px;
  background: linear-gradient(315deg, transparent 50%, var(--note-fold, #6aa6dc) 50%);
}

/* Label: two rows of letters, the second waits underneath. Each letter starts a beat after the last. */
.btn-label { position: relative; display: inline-block; overflow: hidden; line-height: 1.25; }
.btn-row { display: block; }
.btn-row + .btn-row { position: absolute; top: 100%; left: 0; }
.btn-row > span {
  display: inline-block;
  transition: translate 0.45s var(--ease-out);
  transition-delay: calc(var(--i) * 18ms);
}
.btn-icon { display: grid; place-items: center; width: 12px; height: 12px; font-size: 13px; line-height: 1; transition: translate 0.3s var(--ease-out); }
.btn-icon::before { content: "\2197"; }

@media (hover: hover) and (pointer: fine) {
  /* The note straightens and lifts a touch, the letters roll up, the arrow nudges toward its corner. */
  .btn:hover { rotate: 0deg; translate: 0 -2px; }
  .btn:hover .btn-row > span { translate: 0 -100%; }
  .btn:hover .btn-icon { translate: 2px -2px; }
}

/* ---------- hero ---------- */

.hero {
  min-height: 72vh;
  min-height: 72svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  padding: 24px var(--gutter) 80px;
  overflow-x: clip;
}

/* Proof line above the folder: the YC mark and one line of text. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  animation: note-in 0.9s var(--ease-out) backwards;
}
.badge svg { width: 18px; height: 18px; flex: none; }

/* ---------- hero folder ---------- */

.desk {
  display: grid;
  justify-items: center;
  width: min(100%, 460px);
  padding: 36px 0 52px;
  text-align: left;
}
/* The folder and the name tag share one grid cell, so the tag sits on top of the folder. */
.desk > * { grid-area: 1 / 1; }

.note {
  position: relative;
  rotate: var(--r, 0deg);
  transition: scale 0.3s var(--ease-out), rotate 0.3s var(--ease-out);
  animation: note-in 0.9s var(--ease-out) var(--d, 0s) backwards;
}

/* Flat paper — colour and overlap do the work, no shadows. */
.paper {
  position: relative;
  display: block;
  background: var(--paper);
  color: var(--ink);
  border-radius: 2px;
}

.desk h1 {
  position: relative;
  font-family: var(--serif);
  font-size: clamp(22px, 6vw, 26px);
  line-height: 1.28;
  font-weight: 400;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}
/* A soft marker stroke across the lower half of the word, with ragged ends: the hero headline
   and the services in my About sentence (*asterisks* in content.js). */
.desk mark,
.about mark {
  color: inherit;
  padding: 0 0.08em;
  margin: 0 -0.08em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'%3E%3Cpath d='M2.4 5.6C18 3.4 44 4.6 70 3.2 81 2.6 90 3 97.2 2.4l1.6 4.4-1.2 4 1.4 4.6-2.2 3.4C78 17.6 52 19.2 28 18.2 18 17.8 9 18.6 2.8 19l-1.6-4 1.2-4.4L1 7.8Z' fill='%23ffe680'/%3E%3C/svg%3E") 0 92% / 100% 50% no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.desk mark { animation: marker 0.55s cubic-bezier(.65,0,.35,1) 0.6s backwards; }
.desk mark + mark { animation-delay: 0.8s; }

/* File folder: back panel with a tab, call-to-action tabs tucked between the panels. */
.folder {
  --ink: var(--navy);
  width: min(380px, 88%);
  margin-top: 52px;
}
.folder-back {
  position: absolute;
  inset: calc(-1 * var(--folder-lift)) 0 0;
  background: var(--folder-back);
  border-radius: var(--folder-back-radius);
}
.folder-back::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: calc(100% - 1px);
  width: var(--folder-tab-w);
  height: var(--folder-tab-h);
  background: var(--folder-back);
  border-radius: var(--folder-tab-radius);
  clip-path: var(--folder-tab-clip);
}
.folder-front {
  --paper: var(--folder-front);
  z-index: 2;
  padding: var(--folder-pad);
  padding-bottom: 52px; /* room for the name tag */
  border-radius: var(--folder-front-radius);
}

/* The tabs lift when you point at them or tab to them. */
.folder-tabs {
  position: absolute;
  z-index: 1;
  top: -40px;
  left: calc(28% + 10px);
  display: flex;
  align-items: start;
  gap: 6px;
}
.folder-tabs a {
  padding: 8px 14px 34px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 4px 4px 0 0;
  transition: translate 0.3s var(--ease-out), scale 0.14s var(--ease-out);
}
.folder-tabs a span { display: inline-block; margin-left: 4px; }
.folder-tabs a:nth-child(1) { background: var(--orange); color: #fff; rotate: -2.5deg; }
.folder-tabs a:nth-child(2) { background: var(--peach); color: var(--rust); rotate: 1.5deg; margin-top: 3px; }
.folder-tabs a:focus-visible { translate: 0 -12px; }
.folder-tabs a:active { scale: 0.97; }
@media (hover: hover) and (pointer: fine) {
  .folder-tabs a:hover { translate: 0 -12px; }
}

/* Name tag with a folded corner, stuck over the folder's bottom corner. */
.name-tag {
  --paper: var(--peach);
  --ink: var(--rust);
  align-self: end;
  justify-self: end;
  margin-bottom: -18px;
}
.name-tag .paper {
  padding: 10px 28px 12px 14px;
  background: linear-gradient(315deg, transparent 13px, var(--paper) 13px);
  font-size: 13px;
  line-height: 1.4;
}
.name-tag strong { font-weight: 600; }
.name-tag .paper::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  background: linear-gradient(315deg, transparent 50%, #f0612f 50%);
}

/* Picking the name tag up. */
.js .note[data-drag] { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
@media (hover: hover) and (pointer: fine) {
  .js .note[data-drag]:hover { scale: 1.03; }
}
.js .note.is-dragging { cursor: grabbing; scale: 1.06; rotate: calc(var(--r) + 3deg); }

/* Phones: tabs sit right and show more of themselves, so they are easy to tap. */
@media (max-width: 760px) {
  .folder { margin-top: 60px; }
  .folder-tabs { top: -46px; left: auto; right: 10px; }
  .folder-tabs a { padding-top: 13px; }
}

@keyframes note-in {
  from { opacity: 0; translate: 0 10px; }
}
@keyframes marker {
  from { background-size: 0% 50%; }
}

/* ---------- work grid ---------- */

.work {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px 24px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  scroll-margin-top: 24px;
}

.thumb {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  aspect-ratio: 16 / 9;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out);
}
/* Hover zoom only where hover is real — on touch it would fire on tap and stick. */
@media (hover: hover) and (pointer: fine) {
  .card:hover .thumb img,
  .next:hover .thumb img { transform: scale(1.035); }
}
/* Press feedback, so the click registers before the page changes. */
.card .thumb,
.next .thumb { transition: transform 140ms var(--ease-out); }
.card:active .thumb,
.next:active .thumb { transform: scale(0.98); }

/* Two small lines under each project: name, then services. */
.caption { display: grid; gap: 2px; margin-top: 14px; font-size: 13px; line-height: 1.45; }
.caption h3 { margin: 0; font-size: inherit; font-weight: 600; }
.caption p { color: var(--muted); }

/* ---------- client logos: one line drifting slowly sideways, paused while you point at it ---------- */

.clients {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(80px, 10vw, 128px);
  text-align: center;
}
/* Same as the YC line at the top of the page. */
.clients-track {
  display: flex;
  width: max-content;
  animation: clients-marquee 60s linear infinite;
}
/* Logos fade in and out at both ends instead of being cut off. */
.clients { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.clients-list { display: flex; align-items: center; gap: 48px; margin: 0; padding: 0 48px 0 0; list-style: none; }
/* Every logo in solid black, then turned down, so they all read as one tone. */
.clients img { display: block; width: auto; height: var(--h); filter: brightness(0); opacity: 0.2; }
@keyframes clients-marquee { to { translate: -50% 0; } }
@media (hover: hover) and (pointer: fine) {
  .clients:hover .clients-track { animation-play-state: paused; }
}
@media (max-width: 760px) {
  .clients img { height: calc(var(--h) * 0.8); }
  .clients-list { gap: 40px; padding-right: 40px; }
}

/* A Book a call note on its own line, after the reviews and in About. */
.book-row { margin-top: 40px; text-align: center; }
.reviews > .book-row { margin-top: 20px; } /* plus the 20px under the cards */

/* ---------- about ---------- */

.about {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--section-gap) var(--gutter) 40px;
  text-align: center;
}
/* My photo on the left as a print with my name along its white bottom edge, taped to the page and tilted
   like the folder; the text beside it. On phones they stack: photo, then text. The white paper is drawn
   by ::after so anything tucked behind the print (z-index -2) stays under it. */
.about-photo {
  position: relative;
  isolation: isolate;
  width: 200px;
  margin: 0 auto 44px;
  padding: 10px 10px 0;
  rotate: var(--folder-tilt);
}
.about-photo::after { content: ""; position: absolute; inset: 0; z-index: -1; background: #fff; border-radius: 2px; }
.about-photo img { display: block; width: 100%; height: auto; border-radius: 1px; }
.about-cap { padding: 12px 2px 14px; font-size: 13px; font-weight: 500; }
.tape {
  --tape: 255 214 192;
  position: absolute;
  z-index: 1;
  top: -12px;
  left: 50%;
  width: 84px;
  height: 24px;
  translate: -50% 0;
  rotate: 3deg;
  background: repeating-linear-gradient(-45deg, rgb(var(--tape) / .85) 0 7px, rgb(var(--tape) / .7) 7px 14px);
  clip-path: polygon(2% 0, 98% 0, 100% 18%, 97% 36%, 100% 54%, 97% 72%, 100% 90%, 98% 100%, 2% 100%, 0 82%, 3% 64%, 0 46%, 3% 28%, 0 10%);
}
@media (min-width: 761px) {
  .about {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: 1fr auto auto 1fr;
    grid-template-areas: "photo ." "photo label" "photo body" "photo .";
    column-gap: clamp(72px, 9vw, 128px);
    max-width: var(--content);
    text-align: left;
  }
  .about > .label { grid-area: label; }
  .about-photo { grid-area: photo; width: auto; margin: 0; }
  .about-body { grid-area: body; }
  .about .book-row { text-align: left; }
}

/* ---------- case study ---------- */

.case {
  --p: var(--blue);
  --i: var(--navy);
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* A small label in the site's blue. */
.chip {
  display: inline-flex;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--blue);
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
}
.chip span { opacity: 0.6; font-variant-numeric: tabular-nums; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}
.back-link span { transition: translate 0.3s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .back-link:hover span { translate: -3px 0; }
}

/* Intro: three quiet columns (name, facts, paragraph) with plenty of air around them. */
.case-intro { padding: clamp(40px, 5vw, 64px) 0 clamp(72px, 9vw, 120px); }
.case-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 28em) minmax(0, 1fr);
  grid-template-areas: "name lead facts";
  gap: 32px clamp(32px, 4vw, 64px);
  margin-top: clamp(56px, 8vw, 104px);
}
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); }
.case-intro h1 {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: var(--text-display);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.case-grid > :first-child { grid-area: name; }
.case-grid > :nth-child(2) { grid-area: lead; }
/* Facts sit flush with the right edge, lined up with the images below. */
.case-facts { grid-area: facts; justify-self: end; width: max-content; max-width: 100%; }
.case-facts dl { display: grid; gap: 24px; }
/* Invisible: only sets the block's width (see factsSizer in build.mjs). */
.facts-sizer { display: block; height: 0; overflow: hidden; visibility: hidden; font-size: 15px; }
.facts-sizer span { display: block; }
.case-facts dt { margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.case-facts dd { margin: 0; font-size: 15px; line-height: 1.55; }
.case-lead {
  max-width: 34em;
  font-size: 15px;
  line-height: 1.6;
  text-wrap: pretty;
}

/* View website: the same sticky note as Book a call. */
.case-intro .btn-site { margin-top: 24px; }

/* "Backed by Y Combinator" under the name, styled like the YC line on the homepage. */
.backed { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; font-weight: 500; }
.backed svg { width: 16px; height: 16px; flex: none; }

.shot {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}
/* The original's exact shape, so a resized copy can't round the height differently (--ar comes from build.mjs). */
.shot img { aspect-ratio: var(--ar, auto); }

/* Rhythm after the full-width cover: a pair side by side, then one full width. */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.gallery > :nth-child(3n),
.gallery > :last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
.gallery > :not(:nth-child(3n)) img { aspect-ratio: 16 / 9; object-fit: cover; }

/* ---------- reviews: a white card per review, every review visible at once ----------
   Who said it (photo, name, role), then the quote. What I did for them sticks up from the top as
   peach folder tabs tucked behind the paper, the bottom corner is folded to show the back of the
   same paper, and the cards sit a little crooked like the hero's papers. */
.reviews { max-width: var(--max); margin: 0 auto; padding: var(--section-gap) var(--gutter) 0; }
.reviews-single { padding: var(--section-gap) 0 0; }
/* The label keeps the usual 32px to the tops of the tabs, which rise 13px into the row's padding. */
.reviews-title { margin-bottom: 19px; text-align: center; }
/* Three cards in a row; the row scrolls sideways when there are more. The padding leaves room
   for the tabs and the tilt, which the scrolling would otherwise clip. */
.rv-carousel { max-width: var(--content); margin: 0 auto; }
.rv-list {
  --gap: 24px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * var(--gap)) / 3);
  align-items: start; /* each card as tall as its quote */
  gap: var(--gap);
  margin: 0 -20px;
  padding: 40px 20px 20px;
  list-style: none;
  color: var(--navy);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 20px;
  scrollbar-width: none;
}
.rv-list::-webkit-scrollbar { display: none; }
.rv-list > li { scroll-snap-align: start; }
.rv-list:focus-visible { outline: 2px solid var(--navy); outline-offset: -2px; border-radius: 8px; }
.reviews-single .rv-carousel { max-width: 460px; }
.reviews-single .rv-list { grid-auto-columns: 100%; }
@media (max-width: 1000px) { .rv-list { grid-auto-columns: calc((100% - var(--gap)) / 2); } }
@media (max-width: 640px) { .rv-list { --gap: 16px; grid-auto-columns: 86%; } }
.rv-list > li:nth-child(3n + 1) { rotate: -1deg; }
.rv-list > li:nth-child(3n + 2) { rotate: 0.8deg; }
.rv-list > li:nth-child(3n) { rotate: -0.6deg; }

/* Previous and next, under the row. They only show when there are more reviews than fit. */
.rv-nav { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.rv-nav[hidden] { display: none; }
.rv-nav button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--paper-bar);
  color: var(--navy);
  font: 500 16px/1 "DM Sans", system-ui, sans-serif;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease, scale 0.14s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.rv-nav button:not(:disabled):active { scale: 0.97; }
/* A press turns it blue straight away, the phone version of the hover below (reviews.js sets the class). */
.rv-nav button.is-pressed:not(:disabled) { background: var(--blue); transition-duration: 0s, 0.2s, 0.14s; }
.rv-nav button:disabled { opacity: 0.35; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .rv-nav button:not(:disabled):hover { background: var(--blue); }
}
.rv-item {
  --cut: 14px; /* the folded corner; its triangle is --cut × √2 */
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0;
  padding: 28px 28px 32px;
  background: linear-gradient(315deg, transparent var(--cut), #fff var(--cut));
  border-radius: 4px;
}
/* The folded corner on white paper (review cards and backer tiles): its triangle is --cut × √2. */
.rv-item::after,
.bk-logos li::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: calc(var(--cut) * 1.4142);
  height: calc(var(--cut) * 1.4142);
  background: linear-gradient(315deg, transparent 50%, var(--fold) 50%);
}
/* Every card is as tall as the tallest one (the script sets --card-h). A long quote shows eight
   lines, fading out under the last ones, and Read full review glides the card open (reviews.js
   animates the height). Without the script the whole quote shows. */
.js .rv-item { min-height: var(--card-h, auto); }
.rv-item.is-long blockquote { position: relative; height: calc(1.6em * 8); overflow: hidden; }
.rv-item.is-long.is-open blockquote { height: auto; }
.rv-item.is-long blockquote::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3.2em;
  background: linear-gradient(rgb(255 255 255 / 0), #fff 85%);
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.rv-item.is-long.is-open blockquote::after { opacity: 0; }
.rv-more {
  align-self: start;
  margin-top: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--rust);
  font: 500 13px/1.4 "DM Sans", system-ui, sans-serif;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.rv-more[hidden] { display: none; }
.rv-item blockquote { margin: 0; font-size: 15px; line-height: 1.6; }
.rv-item blockquote p { font-size: 15px; font-weight: 500; line-height: 1.6; text-wrap: pretty; }
.rv-item blockquote p::before { content: "\201C"; }
.rv-item blockquote p::after { content: "\201D"; }
/* A screenshot of the original message, taped onto the card under the quote, a little crooked against it. */
.rv-proof { position: relative; margin-top: 8px; rotate: 1.5deg; }
.rv-proof img { border-radius: 3px; }

/* Who said it: photo, name, title and company. */
.rv-person { order: -1; display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; align-items: center; margin: 0; font-size: 14px; line-height: 1.35; }
.rv-photo { display: block; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
/* No photo yet: their initials on the folder blue. */
.rv-initials { display: grid; place-items: center; background: var(--blue); color: var(--navy); font-size: 14px; font-weight: 600; }
.rv-who { display: flex; flex-direction: column; }
.rv-name { font-weight: 600; }
.rv-role { color: color-mix(in srgb, var(--navy) 62%, #fff); }
/* What I did, as tabs. The card isn't its own stacking layer, so z-index -1 puts them behind it. */
.rv-scope { position: absolute; z-index: -1; top: -27px; left: 20px; display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.rv-scope li { padding: 5px 10px 20px; background: var(--peach); color: var(--rust); font-size: 13px; font-weight: 500; border-radius: 4px 4px 0 0; }
.rv-scope li:nth-child(odd) { rotate: -2deg; }
.rv-scope li:nth-child(even) { rotate: 1.5deg; }

/* ---------- who backs the clients ---------- */
.backers { max-width: var(--max); margin: 0 auto; padding: var(--section-gap) var(--gutter) 0; text-align: center; }

/* A white tile per fund, with the folded corner from the review cards. The logo is solid black turned down,
   and fades to the fund's own colours while the pointer is on it. */
.bk-logos {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.bk-logos li {
  --cut: 10px;
  position: relative;
  display: grid;
  place-items: center;
  height: 88px;
  padding: 0 16px;
  background: linear-gradient(315deg, transparent var(--cut), #fff var(--cut));
  border-radius: 4px;
}
.bk-logos img {
  grid-area: 1 / 1;
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(var(--h) * 1.05);
  transition: opacity 0.2s ease;
}
.bk-mono { filter: brightness(0); opacity: 0.55; }
.bk-color { opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .bk-logos li:hover .bk-mono { opacity: 0; }
  .bk-logos li:hover .bk-color { opacity: 1; }
}
.bk-rest { color: var(--muted); font-size: 13px; font-weight: 500; }
@media (max-width: 900px) { .bk-logos { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) {
  .bk-logos { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .bk-logos li { height: 64px; padding: 0 10px; }
  .bk-logos img { max-height: calc(var(--h) * 0.8); }
}

/* Next project: text on the left, its cover on the right. */
.case-sub { margin-top: 8px; font-size: 15px; font-weight: 500; color: var(--muted); }
.next {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  margin-top: var(--section-gap);
}
.next h2 {
  margin-top: 18px;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  font-size: var(--text-display);
  line-height: 1.05;
}
.next .btn { margin-top: 24px; }

/* ---------- 404: the mark with its specs fallen off; hovering it puts them back on ---------- */

.lost { display: grid; justify-items: center; max-width: var(--max); margin: 0 auto; padding: 96px var(--gutter) var(--section-gap); text-align: center; }
.lost-mark { width: 180px; height: auto; margin-bottom: 48px; overflow: visible; color: var(--fg); }
/* In the mark's own units: dropped 380 below the hair, nudged right and tipped over. */
.lost-specs { transform-box: fill-box; transform-origin: center; transform: translate(70px, 380px) rotate(-14deg); transition: transform 0.3s var(--ease-out); }
.lost-label { margin-bottom: 12px; color: var(--muted); }
.lost-title { font-family: var(--serif); font-size: var(--text-display); font-weight: 500; line-height: 1.1; letter-spacing: -0.015em; }
.lost-text { margin: 16px 0 32px; color: var(--muted); font-size: 15px; text-wrap: balance; }
@media (hover: hover) and (pointer: fine) {
  .lost-mark:hover .lost-specs { transform: none; }
}

/* ---------- footer ---------- */

/* The footer runs edge to edge so the folder at its end can; the booking section keeps to the page width. */
.footer { padding-top: var(--section-gap); }
.cta {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
  padding: 0 var(--gutter) 120px;
  scroll-margin-top: 88px; /* clear the sticky nav when a Book a call link jumps here */
}
.cta h2 {
  max-width: 20ch;
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.cta-sub { margin-top: -12px; color: var(--muted); font-size: 15px; }
/* Booking calendar: room is reserved so the page doesn't jump when it loads. */
.cal { width: 100%; max-width: var(--content); min-height: 640px; margin-top: 8px; }
.cal-fallback { color: var(--muted); font-size: 13px; }
.cal-fallback a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
/* The hero's file folder, scaled up, across the whole page and down to its end, in three layers of its own
   (isolation keeps them inside the folder, so nothing outside it can sit on top and swallow clicks):
   the back panel and its tab, whatever is tucked between the panels, then the front panel with the content.
   The back rises above the front and its tab starts at the page's left edge, so tab, back and front share
   one edge. The same space (--pad) sits above the columns and between them and the © line. */
.foot {
  --lift: 46px; /* how far the back panel rises above the front */
  --tab-h: 26px;
  --pad: 72px;
  position: relative;
  isolation: isolate;
  margin-top: calc(var(--lift) + var(--tab-h) + 24px);
  color: var(--navy);
}
.foot::before,
.foot::after { content: ""; position: absolute; left: 0; background: var(--folder-back); }
/* The back panel runs down behind the front, so it shows in the front's rounded top corners. */
.foot::before { right: 0; top: calc(-1 * var(--lift)); height: calc(var(--lift) + 24px); border-radius: 0 10px 0 0; }
/* The tab: rounded at the top left, its right side sloping down at 45° like the hero folder's. */
.foot::after {
  bottom: calc(100% + var(--lift) - 1px);
  width: clamp(160px, 24%, 320px);
  height: var(--tab-h);
  border-radius: 10px 0 0 0;
  clip-path: polygon(0 100%, 0 0, calc(100% - var(--tab-h)) 0, 100% 100%);
}
/* Between the panels: a strip as wide as the page content, at the front panel's top edge. What's tucked in
   hangs from it and the front panel covers the bottom. */
.foot-tuck { position: absolute; z-index: 1; top: 0; left: 0; right: 0; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.foot-front { position: relative; z-index: 2; padding: var(--pad) 0 40px; background: var(--folder-front); border-radius: 6px 6px 0 0; }

/* A few project covers tucked in, each a white print (a --fw border) tilted and showing its top border and 60%
   of the picture. Hover or focus pulls one up and straightens it, leaving --keep tucked in. --ih is the
   picture's height. */
.foot-shots {
  --w: clamp(120px, 13vw, 200px);
  --fw: 6px;
  --ih: calc((var(--w) - 2 * var(--fw)) * 0.625);
  --peek: calc(var(--fw) + var(--ih) * 0.6);
  --keep: calc(var(--ih) * 0.08);
  position: absolute;
  top: calc(-1 * var(--peek));
  right: var(--gutter);
  display: flex;
  align-items: start;
  gap: 14px;
}
.foot-shots a {
  position: relative;
  display: block;
  width: var(--w);
  padding: var(--fw);
  background: #fff;
  border-radius: 4px;
  rotate: var(--r);
  transition: translate 0.3s var(--ease-out), rotate 0.3s var(--ease-out), scale 0.14s var(--ease-out);
}
.foot-shots img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 2px; background: var(--surface); }
.foot-shots a:nth-child(1) { --r: -3deg; }
.foot-shots a:nth-child(2) { --r: 2deg; }
.foot-shots a:nth-child(3) { --r: -1.5deg; }
.foot-shots a:nth-child(4) { --r: 2.5deg; }
.foot-shots a:focus-visible { translate: 0 calc(var(--peek) + var(--keep) - 100%); rotate: 0deg; }
.foot-shots a:active { scale: 0.97; }
@media (hover: hover) and (pointer: fine) {
  .foot-shots a:hover { translate: 0 calc(var(--peek) + var(--keep) - 100%); rotate: 0deg; }
}

/* Six equal columns: my name and line take two, the case studies two (one per list column, so every
   column of links is the same distance from the next), pages and contact one each. */
.foot-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 40px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.foot-brand,
.foot-work { grid-column: span 2; }
.foot-name { font-family: var(--serif); font-size: var(--text-display); font-weight: 500; line-height: 1.05; letter-spacing: -0.015em; }
.foot-about { max-width: 30ch; margin-top: 14px; font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.foot-label { margin-bottom: 14px; color: color-mix(in srgb, var(--navy) 62%, transparent); font-size: 13px; font-weight: 500; }
.foot-col ul { display: grid; gap: 8px; font-size: 14px; font-weight: 500; }
.foot-work ul { display: block; columns: 2; column-gap: 40px; }
.foot-work li { margin-bottom: 8px; break-inside: avoid; }
.foot-front a { text-decoration: underline transparent; text-underline-offset: 3px; transition: text-decoration-color 0.2s ease; }
@media (hover: hover) and (pointer: fine) {
  .foot-front a:hover { text-decoration-color: currentColor; }
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--max);
  margin: var(--pad) auto 0;
  padding: 0 var(--gutter);
  color: color-mix(in srgb, var(--navy) 62%, transparent);
  font-size: 13px;
  font-weight: 500;
}

/* ---------- reveal on scroll ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s ease, transform 0.8s var(--ease-out);
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .thumb img, .mark-hair, .mark-specs, .lost-specs, .back-link span, .foot a { transition: none; }
  .note, .desk mark, .badge { animation: none; }
  .folder-tabs a { transition: none; }
  .btn, .btn-row > span, .btn-icon { transition: none; }
  .card .thumb, .next .thumb { transition: none; }
  /* Logos stand still as a centred row. */
  .clients-track { width: auto; animation: none; }
  .clients-list { flex-wrap: wrap; justify-content: center; gap: 28px 48px; padding: 0; }
  .clients-copy { display: none; }
  .clients { mask-image: none; }
  .rv-item.is-long blockquote::after { transition: none; }
  .card:active .thumb, .next:active .thumb { transform: none; }
  /* Pages still crossfade, but nothing moves. */
  ::view-transition-new(root) { animation-name: page-fade-in; }
}
@keyframes page-fade-in {
  from { opacity: 0; }
}

/* ---------- small screens ---------- */

@media (max-width: 1000px) {
  .case-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "name facts" "lead lead"; }
  .case-facts { justify-self: stretch; width: auto; }
}

@media (max-width: 760px) {
  .work { grid-template-columns: 1fr; gap: 40px; }
  .nav-links .nav-about { display: none; }

  .case-grid { grid-template-columns: 1fr; grid-template-areas: "name" "lead" "facts"; gap: 32px; margin-top: 40px; }
  .case-facts { grid-template-columns: 1fr 1fr; }
  .next { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
  :root { --section-gap: 112px; }
  .cta { padding-bottom: 80px; }
  .foot { --lift: 34px; --tab-h: 22px; --pad: 56px; }
  .foot-shots { --w: 104px; --fw: 4px; gap: 10px; }
  .foot-shots a:nth-child(n + 3) { display: none; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; }
  .foot-brand,
  .foot-work { grid-column: 1 / -1; }
  .foot-work ul { column-gap: 24px; }
  :root { --radius: 4px; }
}
