/* ==========================================================================
   saeedmahmud.com — design system
   1. Fonts   2. Tokens   3. Reset & base   4. Type   5. Layout
   6. Components   7. Motion   8. Utilities
   ========================================================================== */

/* @critical */
/* 1. Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-tight-var.woff2") format("woff2");
}

/* 2. Tokens --------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Palette: five values plus a border tone */
  --paper: #efefef;     /* light grey base */
  --paper-2: #e4e4e4;   /* recessed surface: slots, fields */
  --ink: #0e0e0e;       /* primary text, 16.8:1 on paper */
  --ink-2: #5c5c5c;     /* secondary text, 5.8:1 on paper */
  --accent: #c22317;    /* signal red, 5.2:1 on paper; links, marks, active */
  --rule: #d2d2d2;      /* hairlines */

  /* Families */
  --sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
  --display: var(--sans);

  /* Fluid modular scale, 360px → 1440px, no breakpoint jumps */
  --step--2: clamp(0.75rem, 0.7292rem + 0.0926vw, 0.8125rem);
  --step--1: clamp(0.875rem, 0.8542rem + 0.0926vw, 0.9375rem);
  --step-0: clamp(1.0625rem, 1.0208rem + 0.1852vw, 1.1875rem);
  --step-1: clamp(1.25rem, 1.1875rem + 0.2778vw, 1.4375rem);
  --step-2: clamp(1.5rem, 1.3542rem + 0.6481vw, 1.9375rem);
  --step-3: clamp(1.75rem, 1.4583rem + 1.2963vw, 2.625rem);
  --step-4: clamp(2.125rem, 1.6667rem + 2.037vw, 3.5rem);
  --step-5: clamp(2.5rem, 1.75rem + 3.3333vw, 4.75rem);
  --step-6: clamp(3rem, 1.75rem + 5.5556vw, 6.75rem);

  /* Space */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.5rem;
  --space-xl: clamp(3rem, 2rem + 3vw, 5rem);
  --space-section: clamp(5rem, 3rem + 6vw, 10rem);

  /* Grid */
  --margin: clamp(1.25rem, 0.25rem + 5vw, 7.5rem);
  --gutter: clamp(1rem, 0.6rem + 1.2vw, 2rem);
  --max: 100rem;
  --measure: 65ch;

  /* Lines & motion */
  --hair: 1px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --dur: 700ms;
  --stagger: 60ms;
  --header-h: 5.5rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0e0e0e;
    --paper-2: #1a1a1a;
    --ink: #efefef;
    --ink-2: #9a9a9a;
    --accent: #ff4a33;
    --rule: #2a2a2a;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0e0e0e;
  --paper-2: #1a1a1a;
  --ink: #efefef;
  --ink-2: #9a9a9a;
  --accent: #ff4a33;
  --rule: #2a2a2a;
}

/* 3. Reset & base --------------------------------------------------------- */

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

* { margin: 0; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background-color: var(--paper);
  font-feature-settings: "ss01", "cv11";
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.6;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; background: none; border: 0; padding: 0; }

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

hr {
  border: 0;
  border-top: var(--hair) solid var(--rule);
}

/* Designed focus: a hairline accent frame, offset from the element */
:focus { outline: none; }
:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 4px;
  border-radius: 1px;
}

/* 4. Type ----------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.02;
  text-wrap: balance;
  font-feature-settings: "kern", "liga", "ss01";
}

.display {
  font-family: var(--display);
  font-size: var(--step-6);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.045em;
}
h1, .h1 { font-size: var(--step-5); letter-spacing: -0.04em; line-height: 1; }
h2, .h2 { font-size: var(--step-4); letter-spacing: -0.035em; }
h3, .h3 { font-size: var(--step-2); letter-spacing: -0.025em; line-height: 1.12; }
h4, .h4 { font-size: var(--step-1); letter-spacing: -0.015em; line-height: 1.25; }

em, i, .italic { font-style: italic; }
.display em, h1 em, h2 em, h3 em { color: var(--accent); }

p, li, dd { max-width: var(--measure); text-wrap: pretty; }
:not(.grid) > p + p { margin-top: 1em; }

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink);
  max-width: 34ch;
}

.small, small { font-size: var(--step--1); line-height: 1.5; }
.muted { color: var(--ink-2); }

strong, b { font-weight: 600; }

/* Small-caps interface label: section markers, meta, indices */
.label {
  font-family: var(--sans);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums lining-nums;
}
.label .num { color: var(--accent); }

.numeral {
  font-family: var(--display);
  font-variant-numeric: lining-nums;
}

blockquote {
  font-family: var(--display);
  font-size: var(--step-3);
  line-height: 1.2;
  letter-spacing: -0.01em;
  max-width: 28ch;
}

/* Links: accent colour, underline that draws in on hover */
a { color: inherit; text-decoration: none; }

.link,
.prose a {
  color: var(--accent);
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(var(--rule), var(--rule));
  background-size: 0% 1px, 100% 1px;
  background-position: 0 100%, 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 0.1em;
  transition: background-size 450ms var(--ease);
}
.link:hover,
.prose a:hover,
.link:focus-visible { background-size: 100% 1px, 100% 1px; }

/* Quiet variant for nav and footer: ink colour, no resting rule */
.link--quiet {
  color: inherit;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
}
.link--quiet:hover,
.link--quiet:focus-visible { background-size: 100% 1px; }

/* 5. Layout --------------------------------------------------------------- */

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

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gutter);
}

/* Mobile: everything spans the full 4 columns unless told otherwise */
.grid > * { grid-column: 1 / -1; }

@media (min-width: 56em) {
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .col-1-7  { grid-column: 1 / span 7; }
  .col-1-3  { grid-column: 1 / span 3; }
  .col-1-4  { grid-column: 1 / span 4; }
  .col-4-9  { grid-column: 4 / span 9; }
  .col-5-8  { grid-column: 5 / span 8; }
  .col-5-6  { grid-column: 5 / span 6; }
  .col-6-7  { grid-column: 6 / span 7; }
  .col-8-5  { grid-column: 8 / span 5; }
  .col-9-4  { grid-column: 9 / span 4; }
  .col-1-6  { grid-column: 1 / span 6; }
  .col-7-6  { grid-column: 7 / span 6; }
  .span-4   { grid-column: auto / span 4; }
  .span-5   { grid-column: auto / span 5; }
  .span-9   { grid-column: auto / span 9; }
  /* A grid nested inside a 9-column region keeps the parent's rhythm */
  .grid--nested { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}

.section {
  padding-block: var(--space-section);
  border-top: var(--hair) solid var(--rule);
}
.section--flush { border-top: 0; }

/* Numbered section label sitting in the margin column */
.section-label {
  display: flex;
  gap: 0.6em;
  align-items: baseline;
  margin-bottom: var(--space-l);
}
.section-label .num { color: var(--accent); }
@media (min-width: 56em) {
  .section-label {
    grid-column: 1 / span 3;
    margin-bottom: 0;
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
    align-self: start;
  }
}

.stack > * + * { margin-top: var(--stack, 1.5rem); }

/* 6. Components ----------------------------------------------------------- */

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--margin);
  top: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--step--1);
  transform: translateY(-160%);
  transition: transform 200ms var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* Scroll progress: a 2px accent line across the top of the viewport */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
  pointer-events: none;
}

/* Sticky header: shrinks and gains a hairline once past the hero */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--paper);
  border-bottom: var(--hair) solid transparent;
  transition: border-color 300ms linear;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  height: var(--header-h);
  transition: height 400ms var(--ease);
}
.site-header.is-compact { border-bottom-color: var(--rule); }
.site-header.is-compact .site-header__inner { height: 3.75rem; }

.wordmark {
  font-family: var(--display);
  font-size: var(--step--1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}
.wordmark .dot { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.25rem);
  font-size: var(--step--1);
}
.nav__links { display: none; gap: clamp(1rem, 2.5vw, 2.25rem); list-style: none; padding: 0; }
@media (min-width: 56em) { .nav__links { display: flex; } }

/* Theme toggle: typographic, no icon set */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--step--2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 0.5rem 0;
}
.theme-toggle__mark {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}
.theme-toggle:hover { color: var(--ink); }

/* Buttons: rectangular, hairline; the fill sweeps in from the left on hover */
.button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  padding: 1rem 1.5rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  transition: color 350ms var(--ease);
}
.button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--paper);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 450ms var(--ease);
}
.button:hover, .button:focus-visible { color: var(--ink); }
.button:hover::before, .button:focus-visible::before { transform: scaleX(1); }
.button--ghost { background: transparent; color: var(--ink); }
.button--ghost::before { background: var(--ink); }
.button--ghost:hover, .button--ghost:focus-visible { color: var(--paper); }
.button .arrow { transition: transform 300ms var(--ease); }
.button:hover .arrow { transform: translateX(0.25em); }

/* @end-critical */

/* Placeholder slots: visible, unmistakable, easy to find and replace */
.slot {
  display: inline;
  padding: 0.05em 0.35em;
  background: var(--paper-2);
  border: 1px dashed var(--accent);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.85em;
  font-style: normal;
  letter-spacing: 0;
  line-height: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.slot-block {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.5rem;
  width: 100%;
  aspect-ratio: var(--ratio, 4 / 5);
  padding: var(--space-m);
  background:
    repeating-linear-gradient(135deg, transparent 0 11px, var(--rule) 11px 12px),
    var(--paper-2);
  border: 1px dashed var(--accent);
  color: var(--accent);
  font-size: var(--step--1);
  text-align: center;
}
.slot-block .label { color: var(--accent); }

/* Project card with figure index */
.card { display: block; }
.card__media {
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
}
.card__media img { width: 100%; transition: transform 900ms var(--ease); }
.card:hover .card__media img { transform: scale(1.025); }
.card__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-s);
  padding-top: var(--space-s);
  margin-top: var(--space-s);
  border-top: var(--hair) solid var(--rule);
}
.card__title {
  font-size: var(--step-2);
  margin-top: var(--space-xs);
}
.card__fig { color: var(--accent); }

/* Definition-style index rows: services, specs, plan rows */
.index-list { list-style: none; padding: 0; border-top: var(--hair) solid var(--rule); }
.index-list > li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: var(--space-s);
  padding-block: var(--space-m);
  border-bottom: var(--hair) solid var(--rule);
  max-width: none;
}

/* Forms */
.field { display: grid; gap: 0.5rem; }
.field__label {
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.field__label .req { color: var(--accent); }
.field__input {
  width: 100%;
  padding: 0.75rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink-2);
  border-radius: 0;
  font-size: var(--step-1);
  line-height: 1.4;
  transition: border-color 200ms linear;
  appearance: none;
}
.field__input::placeholder { color: var(--ink-2); opacity: 0.7; }
.field__input:hover { border-bottom-color: var(--ink); }
.field__input:focus-visible {
  outline: none;
  border-bottom-color: var(--accent);
  box-shadow: 0 1px 0 0 var(--accent);
}
textarea.field__input { min-height: 8rem; resize: vertical; }
select.field__input {
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(-45deg, transparent 50%, var(--ink) 50%);
  background-size: 6px 6px;
  background-position: calc(100% - 10px) 55%, calc(100% - 4px) 55%;
  background-repeat: no-repeat;
}
select.field__input option { background: var(--paper); color: var(--ink); }
.field__error {
  font-size: var(--step--1);
  color: var(--accent);
  min-height: 1.5em;
}
.field__error:empty { visibility: hidden; }
.field[data-invalid] .field__input { border-bottom-color: var(--accent); }

/* Filter control: a row of typographic toggles */
.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  padding: 0;
}
.filter button {
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--rule);
  font-size: var(--step--1);
  line-height: 1.2;
  color: var(--ink-2);
  transition: border-color 200ms linear, background-color 200ms linear, color 200ms linear;
}
.filter { gap: 0.5rem; }
.filter button sup { font-size: 0.7em; margin-left: 0.25em; color: var(--accent); }
.filter button:hover { border-color: var(--ink); color: var(--ink); }
.filter button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filter button[aria-pressed="true"] sup { color: inherit; }

/* Footer composition helpers */
.site-footer { border-top: var(--hair) solid var(--rule); padding-block: var(--space-xl) var(--space-l); }

/* @critical */
/* 7. Motion --------------------------------------------------------------- */

/* Reveal: only hidden once JS confirms it can reveal them */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 1.25rem, 0);
  transition:
    opacity var(--dur) var(--ease) calc(var(--i, 0) * var(--stagger)),
    transform var(--dur) var(--ease) calc(var(--i, 0) * var(--stagger));
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

[data-parallax] { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  [data-parallax] { transform: none !important; }
  .progress { display: none; }
}


/* 8. Utilities ------------------------------------------------------------ */

.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;
}
.nowrap { white-space: nowrap; }
.accent { color: var(--accent); }

/* 9. Header menu & hero ---------------------------------------------------- */

.menu-toggle {
  font-size: var(--step--1);
  letter-spacing: 0.02em;
  padding: 0.6rem 0;
}
.button--small { padding: 0.75rem 1.1rem; }

@media (max-width: 55.99em) {
  .nav__links {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: var(--space-m) var(--margin) var(--space-xl);
    background: var(--paper);
    border-top: var(--hair) solid var(--rule);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transition: opacity 250ms linear, visibility 0s linear 250ms;
  }
  .is-compact .nav__links { top: 3.75rem; }
  .nav[data-open] .nav__links { visibility: visible; opacity: 1; transition: opacity 250ms linear; }
  .nav__links > li { border-bottom: var(--hair) solid var(--rule); max-width: none; }
  .nav__links a:not(.button) {
    display: block;
    padding-block: 0.9rem;
    font-family: var(--display);
    font-size: var(--step-3);
    line-height: 1.1;
    background: none;
  }
  .nav__links > li:last-child { border: 0; padding-top: var(--space-l); }
  .nav__links .button { font-size: var(--step-0); }
}
@media (min-width: 56em) {
  .menu-toggle { display: none; }
  .nav__links { align-items: center; }
}

.hero { padding-block: clamp(3.5rem, 1.5rem + 8vw, 9.5rem) var(--space-section); }
.hero__title { font-size: clamp(2.75rem, 1.4rem + 4.8vw, 5.75rem); }
@media (min-width: 56em) { .hero .col-1-7 { grid-column: 1 / span 8; } }
.hero__lede { margin-top: var(--space-l); max-width: 38ch; color: var(--ink-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-s); margin-top: var(--space-xl); }
.hero__aside { display: none; }
@media (min-width: 56em) {
  .hero__aside {
    display: block;
    grid-column: 10 / span 3;
    align-self: end;
    padding-top: var(--space-s);
    border-top: var(--hair) solid var(--rule);
  }
}
/* Hero: name and portrait. The portrait sits on the right at every width. */
.me { padding-block: clamp(1.5rem, 0.5rem + 3vw, 3rem) var(--space-xl); }
.me__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-areas:
    "name  name"
    "lede  photo"
    "tags  tags";
  column-gap: var(--gutter);
  row-gap: var(--space-m);
  align-items: start;
}
.me__text { display: contents; }
.me__name { grid-area: name; }
.me__lede { grid-area: lede; }
.tags { grid-area: tags; }
.me__photo { grid-area: photo; }
.me__name {
  font-size: clamp(4.5rem, 2.5rem + 8vw, 10.5rem);
  font-weight: 500;
  line-height: 0.86;
  letter-spacing: -0.055em;
  margin-left: -0.05em;
}
.me__name span { display: block; }
.me__lede { font-size: var(--step-0); line-height: 1.45; max-width: 32ch; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; list-style: none; }
.tags li {
  max-width: none;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--rule);
  font-size: var(--step--1);
  line-height: 1.2;
  letter-spacing: 0.01em;
}
.me__photo { position: relative; overflow: hidden; aspect-ratio: 3 / 4; background: #111; }
.me__photo picture { display: block; height: 100%; }
.me__photo img { width: 100%; height: 112%; object-fit: cover; object-position: 50% 0; }

@media (min-width: 40em) {
  .me__grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-rows: 1fr auto auto auto 1fr;
    grid-template-areas:
      ".     photo"
      "name  photo"
      "lede  photo"
      "tags  photo"
      ".     photo";
    row-gap: 0;
  }
  .me__name { font-size: clamp(3.5rem, 0.5rem + 9.5vw, 10.5rem); }
  .me__lede { margin-top: var(--space-m); font-size: var(--step-1); }
  .tags { margin-top: var(--space-l); gap: 0.6rem; }
  .tags li { padding: 0.6rem 0.95rem; }
  .me__photo { aspect-ratio: 4 / 5; width: 100%; }
}
@media (min-width: 56em) {
  .me__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .me__photo { aspect-ratio: auto; height: min(calc(100svh - var(--header-h) - 3rem), 56rem); min-height: 32rem; }
}
.intro__title { font-size: var(--step-5); letter-spacing: -0.045em; line-height: 1; max-width: 18ch; }
.intro .hero__actions { margin-top: var(--space-l); }
.intro__note { margin-top: var(--space-l); padding-top: var(--space-s); border-top: var(--hair) solid var(--rule); max-width: none; }
.page-hero { padding-block: clamp(3rem, 1.5rem + 6vw, 8rem) var(--space-section); }
.page-hero__title { margin-top: var(--space-l); font-size: var(--step-6); font-weight: 500; letter-spacing: -0.05em; line-height: 0.95; max-width: 14ch; }
.page-hero__lede { margin-top: var(--space-l); max-width: 44ch; color: var(--ink-2); }
.index-hero { padding-block: clamp(3rem, 1.5rem + 6vw, 8rem) var(--space-xl); }
.index-hero__grid { display: grid; gap: var(--space-l); align-items: end; }
.index-hero__num { font-size: clamp(9rem, 4rem + 22vw, 24rem); font-weight: 500; letter-spacing: -0.08em; line-height: 0.74; margin-left: -0.06em; }
@media (min-width: 56em) { .index-hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
/* Hero intro: name rises out of a mask, portrait unveils, the rest follows */
.me__name .mask { display: block; overflow: hidden; padding-bottom: 0.04em; }
.me__name .mask > span { display: block; animation: rise-in 1.1s var(--ease) both; }
.me__name .mask + .mask > span { animation-delay: 110ms; }
.me__lede { animation: fade-up 900ms var(--ease) 380ms both; }
.tags li { animation: fade-up 800ms var(--ease) both; animation-delay: calc(520ms + var(--t, 0) * 60ms); }
.tags li:nth-child(2) { --t: 1; } .tags li:nth-child(3) { --t: 2; } .tags li:nth-child(4) { --t: 3; } .tags li:nth-child(5) { --t: 4; }
.me__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--paper);
  transform-origin: 50% 0;
  animation: unveil 1.2s cubic-bezier(0.77, 0, 0.18, 1) 120ms both;
}
.me__photo img { animation: settle 1.8s var(--ease) 120ms both; }
@keyframes rise-in { from { transform: translateY(105%); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(1rem); } }
@keyframes unveil { to { transform: scaleY(0); } }
@keyframes settle { from { transform: scale(1.14); } }
/* @end-critical */

/* 10. Homepage sections ----------------------------------------------------- */

.section-head { row-gap: var(--space-m); margin-bottom: var(--space-xl); }
.section-head h2 { max-width: 20ch; }

/* Credibility strip */
.cred { border-top: var(--hair) solid var(--rule); padding-block: var(--space-l); }
.cred__label { align-self: baseline; padding-top: 0.35em; }
.cred__countries {
  font-family: var(--display);
  font-size: var(--step-2);
  line-height: 1.3;
  letter-spacing: -0.005em;
  max-width: none;
}
.cred__countries .sep { color: var(--accent); padding-inline: 0.2em; }
.logo-row { display: flex; flex-wrap: wrap; gap: var(--space-l); align-items: center; list-style: none; padding: 0; margin-top: var(--space-l); }

/* Problem: heading narrow on the left, body down the right */
.problem h2 { font-size: var(--step-4); }
.problem__body { font-size: var(--step-1); line-height: 1.55; }
.problem__turn {
  margin-top: var(--space-l) !important;
  padding-top: var(--space-l);
  border-top: var(--hair) solid var(--rule);
  font-family: var(--display);
  font-size: var(--step-3);
  line-height: 1.15;
  letter-spacing: -0.01em;
  max-width: 24ch;
}


/* Work grid */
.work-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--space-m); }
.card__media picture, .card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media { aspect-ratio: 4 / 3; }
.card__line { margin-top: var(--space-2xs); color: var(--ink-2); }
.card__result { margin-top: var(--space-2xs); font-size: var(--step--1); }
.card__cta { margin-top: var(--space-s); font-size: var(--step--1); }
.work-note { margin-top: var(--space-xl); color: var(--ink-2); font-size: var(--step--1); }

/* Case study teasers */
.teasers { list-style: none; padding: 0; border-top: var(--hair) solid var(--rule); }
.teasers > li { max-width: none; border-bottom: var(--hair) solid var(--rule); }
.teaser {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-s);
  padding-block: var(--space-l);
  transition: background-color 300ms linear;
}
.teaser__num { font-family: var(--display); font-size: var(--step-4); line-height: 0.9; color: var(--accent); }
.teaser__title { font-size: var(--step-2); }
.teaser__go { font-size: var(--step--1); color: var(--accent); white-space: nowrap; }
.teaser__go .arrow { display: inline-block; transition: transform 300ms var(--ease); }
.teaser:hover .teaser__go .arrow { transform: translateX(0.3em); }
@media (min-width: 56em) {
  .teaser { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: baseline; }
  .teaser__num { grid-column: 1 / span 2; }
  .teaser__main { grid-column: 4 / span 6; }
  .teaser__go { grid-column: 11 / span 2; justify-self: end; }
}

/* Services */
.services > li { grid-template-columns: 2.5rem 1fr; }
.service__body { display: grid; gap: var(--space-xs); }
.service__body p { color: var(--ink-2); }
@media (min-width: 56em) {
  .services > li { grid-template-columns: 3rem 5fr 7fr; column-gap: var(--gutter); padding-block: var(--space-l); }
  .service__body { display: contents; }
}
.services .num { padding-top: 0.5em; }

/* Approach: horizontal sequence on desktop, vertical on mobile */
.stages { list-style: none; padding: 0; display: grid; gap: 0; margin-top: var(--space-xl); counter-reset: stage; }
.stage {
  position: relative;
  max-width: none;
  padding: 0 0 var(--space-l) var(--space-l);
  border-left: var(--hair) solid var(--rule);
}
.stage::before {
  content: "";
  position: absolute;
  left: -4px; top: 0.45em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.stage__name { font-family: var(--display); font-size: var(--step-3); line-height: 1.1; letter-spacing: -0.01em; margin-top: var(--space-2xs); }
.stage__arrow { display: none; }
@media (min-width: 56em) {
  .stages { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--gutter); }
  .stage { border-left: 0; border-top: var(--hair) solid var(--rule); padding: var(--space-m) var(--space-s) 0 0; }
  .stage::before { left: 0; top: -4px; }
  .stage__arrow { display: block; position: absolute; right: 0; top: -0.8em; padding-left: 0.4em; background: var(--paper); color: var(--accent); font-size: var(--step--1); }
}
.facts { margin-top: var(--space-xl); row-gap: var(--space-m); }
.fact { font-family: var(--display); font-size: var(--step-3); line-height: 1.15; letter-spacing: -0.01em; max-width: 22ch; padding-top: var(--space-s); border-top: var(--hair) solid var(--ink); }

/* About */
.about { row-gap: var(--space-l); }
.about__portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about__video { --ratio: 16 / 9; margin-top: var(--space-l); }
@media (min-width: 56em) {
  .about__media { grid-column: 1 / span 4; grid-row: 1 / span 2; }
  .about__text { grid-column: 6 / span 7; }
}

/* Enquiry */
.enquire h2 { font-size: var(--step-5); font-weight: 600; text-transform: uppercase; letter-spacing: -0.045em; line-height: 0.95; max-width: 14ch; }
.form { row-gap: var(--space-s); margin-top: var(--space-xl); }
.form__legend { font-size: var(--step--1); color: var(--ink-2); }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-m) var(--space-l); margin-top: var(--space-m); }
.form__foot p { font-size: var(--step--1); color: var(--ink-2); max-width: 36ch; }
.form__status { font-size: var(--step--1); color: var(--accent); }
.form-success { padding-top: var(--space-l); border-top: var(--hair) solid var(--ink); margin-top: var(--space-xl); }
.form-success h3 { font-size: var(--step-4); }
.form-success:focus-visible { outline-offset: 8px; }
@media (min-width: 56em) {
  .form, .form-success { grid-column: 4 / span 9; }
  .form .half { grid-column: auto / span 4; }
  .form .full { grid-column: 1 / -1; }
  .form { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
.button[disabled] { opacity: 0.6; cursor: progress; }

/* Footer composition */
.site-footer { padding-block: var(--space-section) var(--space-l); }
.footer__mark {
  font-family: var(--display);
  font-size: clamp(2.6rem, 0.4rem + 10.2vw, 11.5rem);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 0.85;
  letter-spacing: -0.05em;
  margin-bottom: var(--space-xl);
  white-space: nowrap;
}
.footer__mark .dot { color: var(--accent); }
.footer__grid { row-gap: var(--space-l); padding-top: var(--space-l); border-top: var(--hair) solid var(--rule); }
.footer__grid ul { list-style: none; padding: 0; display: grid; gap: 0.35rem; }
.footer__contact { font-family: var(--display); font-size: var(--step-3); line-height: 1.15; }
.footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-s); margin-top: var(--space-xl); }
@media (min-width: 56em) {
  .footer__col-a { grid-column: 1 / span 5; }
  .footer__col-b { grid-column: 7 / span 3; }
  .footer__col-c { grid-column: 10 / span 3; }
}

.label .slot, .slot { text-transform: none; letter-spacing: 0; }

/* 11. Inverted sections: near-black blocks, as in the reference ----------- */

.invert {
  --paper: #0e0e0e;
  --paper-2: #1a1a1a;
  --ink: #efefef;
  --ink-2: #9a9a9a;
  --accent: #ff4a33;
  --rule: #2a2a2a;
  background-color: var(--paper);
  color: var(--ink);
  border-top-color: var(--paper);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .invert { --paper: #161616; --paper-2: #202020; }
}
:root[data-theme="dark"] .invert { --paper: #161616; --paper-2: #202020; }

/* 12. Inner pages: page hero and retainer plans ---------------------------- */


.plans {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: var(--hair) solid var(--ink);
}
.plan {
  position: relative;
  padding-block: var(--space-l) var(--space-xl);
  border-bottom: var(--hair) solid var(--rule);
}
/* The common choice: a heavier accent rule and a small-caps note, nothing louder */
.plan--common::before {
  content: "";
  position: absolute;
  inset: -1px 0 auto 0;
  height: 3px;
  background: var(--accent);
}
.plan__mark { color: var(--accent); margin-bottom: var(--space-s); }
.plan__name { font-size: var(--step-3); letter-spacing: -0.03em; }
.plan__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; margin-top: var(--space-m); }
.plan__amount {
  font-size: clamp(3.25rem, 2rem + 4vw, 5.5rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums lining-nums;
}
.plan__per { font-size: var(--step--1); color: var(--ink-2); }
.plan__for { margin-top: var(--space-m); color: var(--ink-2); max-width: 30ch; min-height: 3em; }
.plan__list { list-style: none; padding: 0; margin-top: var(--space-l); border-top: var(--hair) solid var(--rule); }
.plan__list li {
  max-width: none;
  padding-block: 0.8rem;
  border-bottom: var(--hair) solid var(--rule);
  font-size: var(--step--1);
  line-height: 1.45;
}
.plan__list li:first-child:where(:not(:only-child)) { font-weight: 500; }
.plan:first-child .plan__list li:first-child { font-weight: 400; }
.plan-note { margin-top: var(--space-l); font-size: var(--step-1); letter-spacing: -0.01em; }
@media (min-width: 56em) {
  .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 0; }
  .plan { padding-inline: var(--gutter); border-bottom: 0; }
  .plan:first-child { padding-left: 0; }
  .plan:last-child { padding-right: 0; }
  .plan + .plan { border-left: var(--hair) solid var(--rule); }
  .plan__mark { position: absolute; top: var(--space-s); margin: 0; }
  .plan { padding-top: calc(var(--space-l) + 1.5rem); }
}

/* 13. Client reviews --------------------------------------------------------- */

.reviews {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: var(--hair) solid var(--ink);
}
.review { max-width: none; border-bottom: var(--hair) solid var(--rule); }
.review figure { display: flex; flex-direction: column; height: 100%; padding-block: var(--space-l); }
.review__quote { font-family: var(--sans); font-size: var(--step-1); line-height: 1.45; letter-spacing: -0.01em; max-width: none; }
.review__quote p { max-width: 36ch; text-indent: -0.42em; }
.review__quote p::before { content: "\201C"; }
.review__quote p::after { content: "\201D"; }
.review__by { display: grid; gap: 0.15rem; margin-top: auto; padding-top: var(--space-l); font-size: var(--step--1); }
.review__name { font-weight: 600; font-size: var(--step-0); }
.review__meta { color: var(--ink-2); }
.review__project { color: var(--accent); }
@media (min-width: 40em) {
  .reviews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review { padding-right: var(--gutter); }
  .review:nth-child(2n) { padding-left: var(--gutter); padding-right: 0; border-left: var(--hair) solid var(--rule); }
}
@media (min-width: 64em) {
  .reviews { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .review, .review:nth-child(2n) { padding-inline: var(--gutter); border-left: var(--hair) solid var(--rule); }
  .review:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
  .review:nth-child(3n) { padding-right: 0; }
}

/* 14. Live sites: homepage teaser and index page ------------------------------ */

/* Homepage teaser: one ruled row that points to the index page */
.index-teaser {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: var(--space-s) var(--space-l);
  margin-top: var(--space-section);
  padding-block: var(--space-l);
  border-block: var(--hair) solid var(--ink);
}
.index-teaser__num {
  grid-row: span 2;
  font-size: clamp(4.5rem, 2rem + 8vw, 10rem);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 0.8;
  transition: color 300ms linear;
}
.index-teaser__text { display: grid; gap: 0.35rem; }
.index-teaser__title { font-size: var(--step-3); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.index-teaser__meta { color: var(--ink-2); font-size: var(--step--1); }
.index-teaser__go { font-size: var(--step--1); color: var(--accent); white-space: nowrap; }
.index-teaser__go .arrow { display: inline-block; transition: transform 300ms var(--ease); }
.index-teaser:hover .index-teaser__num { color: var(--accent); }
.index-teaser:hover .index-teaser__go .arrow { transform: translateX(0.3em); }
@media (min-width: 56em) {
  .index-teaser { grid-template-columns: auto minmax(0, 1fr) auto; }
  .index-teaser__num { grid-row: auto; }
}

/* Index page hero: title left, one very large figure right */
.index-hero { padding-block: clamp(3rem, 1.5rem + 6vw, 8rem) var(--space-xl); }
.index-hero__grid { display: grid; gap: var(--space-l); align-items: end; }
.index-hero__figure { display: grid; justify-items: start; max-width: none; }
.index-hero__num {
  font-size: clamp(9rem, 4rem + 22vw, 24rem);
  font-weight: 500;
  letter-spacing: -0.08em;
  line-height: 0.74;
  margin-left: -0.06em;
}
.index-hero__caption { margin-top: var(--space-m); padding-top: var(--space-2xs); border-top: 3px solid var(--accent); }
@media (min-width: 56em) {
  .index-hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .index-hero__figure { justify-items: end; text-align: right; }
  .index-hero__num { margin-left: 0; padding-right: 0.07em; }
}

/* Contents: a monograph table of contents with dotted leaders */
.toc { list-style: none; padding: 0; columns: 1; column-gap: var(--gutter); }
@media (min-width: 40em) { .toc { columns: 2; } }
.toc li { max-width: none; break-inside: avoid; }
.toc a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding-block: 0.55rem;
  border-bottom: var(--hair) solid var(--rule);
}
.toc__n, .toc__count { font-size: var(--step--2); letter-spacing: 0.12em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.toc__n { color: var(--accent); }
.toc__name { font-size: var(--step-0); transition: transform 300ms var(--ease); }
.toc__dots { flex: 1; min-width: 1rem; border-bottom: 1px dotted var(--ink-2); opacity: 0.5; transform: translateY(-0.25em); }
.toc a:hover .toc__name { transform: translateX(0.3rem); }

/* Chapters: industry heading stays put on the left while its rows scroll */
.chapters { padding-bottom: var(--space-section); }
.chapter {
  display: grid;
  gap: var(--space-s) var(--gutter);
  padding-top: var(--space-xl);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.chapter__head { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; border-bottom: var(--hair) solid var(--ink); padding-bottom: var(--space-2xs); }
.chapter__n { color: var(--accent); }
.chapter__title { font-size: var(--step-2); letter-spacing: -0.03em; }
.chapter__count { margin-left: auto; }
@media (min-width: 56em) {
  .chapter { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .chapter__head {
    grid-column: 1 / span 3;
    align-self: start;
    position: sticky;
    top: calc(3.75rem + var(--space-m));
    display: grid;
    gap: 0.35rem;
    border-bottom: 0;
    border-top: var(--hair) solid var(--ink);
    padding-top: var(--space-s);
  }
  .chapter__count { margin-left: 0; }
  .rows { grid-column: 4 / span 9; }
}

/* Rows: very large names; hover sweeps a solid ink band in from the left */
.rows { list-style: none; padding: 0; border-top: var(--hair) solid var(--ink); }
.row { max-width: none; border-bottom: var(--hair) solid var(--rule); }
.row a {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  grid-template-areas: "n name arrow" ". domain domain";
  align-items: baseline;
  gap: 0.15rem var(--space-s);
  padding: var(--space-s) 0.25rem;
  transition: color 350ms var(--ease);
}
.row a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 550ms var(--ease);
}
.row__n { grid-area: n; font-size: var(--step--2); letter-spacing: 0.12em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.row__name {
  grid-area: name;
  font-size: clamp(1.6rem, 1rem + 2.6vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
  transition: transform 550ms var(--ease);
}
.row__domain { grid-area: domain; font-size: var(--step--1); color: var(--ink-2); }
.row__arrow { grid-area: arrow; color: var(--accent); font-size: var(--step-2); line-height: 1; transition: transform 450ms var(--ease); }
.row a:hover, .row a:focus-visible { color: var(--paper); }
.row a:hover::before, .row a:focus-visible::before { transform: scaleX(1); }
.row a:hover .row__name, .row a:focus-visible .row__name { transform: translateX(0.75rem); }
.row a:hover .row__n, .row a:hover .row__domain,
.row a:focus-visible .row__n, .row a:focus-visible .row__domain { color: inherit; opacity: 0.75; }
.row a:hover .row__arrow, .row a:focus-visible .row__arrow { transform: translate(0.2em, -0.2em); }
.row a:focus-visible { outline-offset: 2px; }
@media (min-width: 56em) {
  .row a {
    grid-template-columns: 3rem minmax(0, 1fr) auto 2rem;
    grid-template-areas: "n name domain arrow";
    padding-block: var(--space-m);
  }
  .row__domain { text-align: right; }
}

/* 15. Motion layer ------------------------------------------------------------- */

/* Services ticker */
.ticker { overflow: hidden; border-block: var(--hair) solid var(--rule); padding-block: var(--space-m); }
.ticker__track { display: flex; align-items: center; width: max-content; animation: ticker 48s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item { font-size: var(--step-3); font-weight: 500; letter-spacing: -0.035em; white-space: nowrap; padding-inline: var(--space-m); }
.ticker__sep { width: 0.55rem; height: 0.55rem; background: var(--accent); flex: none; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Headings: each word rises out of its own mask */
.js [data-split][data-reveal] { opacity: 1; transform: none; }
[data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.14em; margin-bottom: -0.14em; }
[data-split] .w > span { display: inline-block; transform: translateY(110%); transition: transform 900ms var(--ease); transition-delay: calc(var(--wi, 0) * 45ms); }
[data-split].is-in .w > span { transform: none; }

/* Scroll-lit text: words brighten as the paragraph moves up the screen */
[data-lit] .lw { color: var(--ink-2); transition: color 350ms linear; }
[data-lit] .lw.on { color: var(--ink); }

/* Footer mark: letters rise one by one */
.js [data-chars][data-reveal] { opacity: 1; transform: none; }
[data-chars] .ch { display: inline-block; transform: translateY(40%); opacity: 0; transition: transform 900ms var(--ease), opacity 600ms linear; transition-delay: calc(var(--ci, 0) * 35ms); }
[data-chars].is-in .ch { transform: none; opacity: 1; }
[data-chars] .ch--space { width: 0.25em; }

/* Services: row hover draws an accent rule and nudges the title */
.services > li { position: relative; }
.services > li::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 600ms var(--ease);
}
.services > li:hover::after { transform: scaleX(1); }
.services h3 { transition: transform 500ms var(--ease), color 250ms linear; }
.services > li:hover h3 { transform: translateX(0.5rem); color: var(--accent); }

/* Approach: the timeline draws itself, stage by stage */
@media (min-width: 56em) {
  .js .stage { border-top-color: transparent; }
  .js .stage::after {
    content: "";
    position: absolute;
    left: 0; right: 0; top: -1px;
    height: 1px;
    background: var(--rule);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 900ms var(--ease) calc(var(--i, 0) * 180ms + 150ms);
  }
  .js .stage.is-in::after { transform: none; }
}
.js .stage::before { transform: scale(0); transition: transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--i, 0) * 180ms + 100ms); }
.js .stage.is-in::before { transform: none; }

/* Reviews: a rule draws across the top of each quote */
.review { position: relative; }
.js .review::before {
  content: "";
  position: absolute;
  left: 0; top: -1px;
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 800ms var(--ease) calc(var(--i, 0) * var(--stagger) + 200ms);
}
.js .review.is-in::before { transform: none; }
@media (min-width: 40em) { .js .review:nth-child(2n)::before { left: var(--gutter); } }
@media (min-width: 64em) {
  .js .review:nth-child(n)::before { left: var(--gutter); }
  .js .review:nth-child(3n + 1)::before { left: 0; }
}

/* Plans: the price column lifts slightly on hover */
.plan { transition: background-color 400ms linear; }
.plan:hover { background-color: color-mix(in srgb, var(--paper-2) 55%, transparent); }

/* Cross-page transitions (supporting browsers only) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 280ms var(--ease) both; }
::view-transition-new(root) { animation: vt-in 520ms var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }

/* Theme switch: the new theme spreads in a circle from the toggle */
.vt-theme::view-transition-old(root) { animation: none; }
.vt-theme::view-transition-new(root) { animation: theme-circle 700ms cubic-bezier(0.77, 0, 0.18, 1) both; }
@keyframes theme-circle { from { clip-path: circle(0 at var(--vx, 90%) var(--vy, 5%)); } to { clip-path: circle(150vmax at var(--vx, 90%) var(--vy, 5%)); } }

@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
  [data-split] .w > span, [data-chars] .ch { transform: none; opacity: 1; }
  .me__photo::after { display: none; }
  .me__photo img { transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* 17. Section-specific motion -------------------------------------------------- */

/* Problem headline: a left-to-right wipe, like a marker pass */
.js [data-wipe][data-reveal] { opacity: 1; transform: none; clip-path: inset(-0.25em 100% -0.25em 0); transition: clip-path 1.3s cubic-bezier(0.77, 0, 0.18, 1); }
.js [data-wipe].is-in { clip-path: inset(-0.25em 0 -0.25em 0); }

/* Enquiry headline: words tip up into place */
[data-split="tilt"] .w > span { transform: translateY(110%) rotate(8deg); transform-origin: 0 100%; }

/* Dark sections open outwards from a narrow band as they scroll in */
.js .invert { clip-path: inset(0 calc(var(--x, 0) * 1%) round calc(var(--x, 0) * 0.3rem)); }

/* Approach: a red line tracks your progress through the four stages */
.stages { position: relative; }
.stages::after {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 2px;
  height: calc(var(--prog, 0) * 100%);
  background: var(--accent);
}
.js .stage::before { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--ink-2); transition: transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1), background-color 300ms linear, box-shadow 300ms linear; }
.js .stage.passed::before { background: var(--accent); box-shadow: none; }
.js .stage .stage__name { color: var(--ink-2); transition: color 500ms var(--ease); }
.js .stage.passed .stage__name { color: var(--ink); }
@media (min-width: 56em) {
  .stages::after { top: -1px; width: calc(var(--prog, 0) * 100%); height: 2px; }
}

/* About: the portrait opens like an iris */
.js .about__media .about__portrait img { clip-path: circle(0% at 50% 38%); transition: clip-path 1.6s cubic-bezier(0.77, 0, 0.18, 1) 150ms; }
.js .about__media.is-in .about__portrait img { clip-path: circle(75% at 50% 38%); }

/* Footer name: letters lift towards the pointer */
.footer__mark .ch {
  transition: transform 900ms var(--ease) calc(var(--ci, 0) * 35ms), opacity 600ms linear calc(var(--ci, 0) * 35ms), translate 350ms var(--ease), color 200ms linear;
}
.footer__mark .ch:hover { translate: 0 -0.12em; color: var(--accent); }

/* Form: the underline draws across on focus */
.field__input:not(select) {
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 100% / 0% 2px;
  transition: background-size 550ms var(--ease), border-color 200ms linear;
}
.field__input:not(select):focus-visible { background-size: 100% 2px; box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-wipe][data-reveal] { clip-path: none; }
  .js .invert { clip-path: none; }
  .js .about__media .about__portrait img { clip-path: none; }
}

/* 18. Reviews as a stacked pile ---------------------------------------------------
   Without JS, or with reduced motion, the reviews stay a grid. With JS the section
   pins and each card flies in from its own side to land on a loose pile. */

.stack__count { display: none; }
.is-stacked .stack { position: relative; height: calc((var(--cards, 6) - 1) * 140vh + 100vh); }
.is-stacked .stack__pin {
  position: sticky;
  top: 3.75rem;
  height: calc(100vh - 3.75rem);
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: clip;
}
.is-stacked .stack__head {
  position: absolute;
  z-index: 20;
  left: var(--margin);
  right: var(--margin);
  top: var(--space-l);
  display: block;
  margin: 0;
  pointer-events: none;
}
.is-stacked .stack__head .section-label { position: static; margin-bottom: var(--space-s); }
.is-stacked .stack__head h2 { font-size: var(--step-3); }
.is-stacked .stack__count { display: block; margin-top: var(--space-s); font-size: var(--step-0); color: var(--ink); }
@media (min-width: 56em) {
  .is-stacked .stack__head { top: 50%; right: auto; width: calc((100vw - 2 * var(--margin)) * 0.28); transform: translateY(-50%); }
  .is-stacked .stack__head h2 { font-size: var(--step-4); }
  .is-stacked .stack__count { margin-top: var(--space-l); }
}
.is-stacked .stack__count span { color: var(--accent); }
.is-stacked .reviews { display: block; position: relative; height: 100%; border: 0; }
.is-stacked .review,
.is-stacked .review:nth-child(n) {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(36rem, calc(100vw - 2 * var(--margin)));
  padding: var(--space-l);
  border: var(--hair) solid var(--ink);
  background: var(--paper);
  box-shadow: 6px 6px 0 0 var(--ink);
  opacity: 1;
  transition: none;
  will-change: transform;
}
/* Desktop: the pile is centred in the space right of the pinned heading, with a clear gap. */
@media (min-width: 56em) {
  .is-stacked .stack__pin { --head-w: calc((100vw - 2 * var(--margin)) * 0.28); --gap: max(4rem, 7vw); }
  .is-stacked .review, .is-stacked .review:nth-child(n) {
    left: calc(var(--margin) + var(--head-w) + var(--gap) + (100vw - 2 * var(--margin) - var(--head-w) - var(--gap)) / 2);
    width: min(36rem, calc(100vw - 2 * var(--margin) - var(--head-w) - var(--gap) - 3rem));
  }
}
@media (max-width: 55.99em) {
  .is-stacked .review, .is-stacked .review:nth-child(n) { top: 58%; }
}
.is-stacked .review figure { padding: 0; }
.is-stacked .review::before,
.is-stacked .review:nth-child(n)::before { left: var(--space-l); top: -1px; transform: none; }
.is-stacked .review__by { padding-top: var(--space-m); }
@media (min-width: 56em) {
  .is-stacked .review__quote { font-size: var(--step-2); line-height: 1.3; }
}

/* 19. The problem: a four-question check of the visitor's own website -----------
   The headline states the problem; the visitor answers four questions about their
   own site. The dial fills with each Yes, a No strikes the question through, and
   once all four are in, a gap strikes "look fine". Without JS it reads as a list. */

.chk {
  display: grid;
  gap: var(--space-l);
  margin-top: var(--space-l);
  grid-template-areas: "head" "list" "meter" "foot";
}
.chk__head { grid-area: head; }
.chk__listwrap { grid-area: list; }
.chk__meter { grid-area: meter; }
.chk__foot { grid-area: foot; }
@media (min-width: 56em) {
  .chk {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-areas: "head list" "meter list" "meter foot";
    column-gap: var(--space-xl);
    row-gap: var(--space-xl);
    align-items: start;
  }
}
.chk__title { display: grid; font-weight: 500; }
.chk__lead { font-size: var(--step-2); color: var(--ink-2); letter-spacing: -0.02em; margin-bottom: 0.3em; }
.chk__fine, .chk__nothing { position: relative; display: block; width: max-content; max-width: 100%; font-size: clamp(2.75rem, 0.5rem + 5.4vw, 6.25rem); line-height: 0.95; letter-spacing: -0.055em; }
.chk__fine::after {
  content: "";
  position: absolute;
  left: -2%; right: -2%;
  top: 56%;
  height: 0.07em;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 800ms var(--ease);
}
.chk.is-done:not(.is-perfect) .chk__fine::after { transform: none; }
.chk__intro { margin-top: var(--space-m); max-width: 34ch; color: var(--ink-2); font-size: var(--step-1); line-height: 1.4; }

.chk__listlabel { margin-bottom: var(--space-s); }
.chk__list { padding: 0; list-style: none; border-top: var(--hair) solid var(--ink); }
.chk__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-s) var(--space-m);
  max-width: none;
  padding-block: var(--space-m);
  border-bottom: var(--hair) solid var(--rule);
}
.chk__q { font-size: var(--step-2); letter-spacing: -0.025em; line-height: 1.15; transition: color 400ms linear; }
/* The strike is drawn per line, so wrapped questions are struck on every line */
.chk__q span {
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 58% / 0% 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size 700ms var(--ease);
}
.chk__item[data-answer="no"] .chk__q { color: var(--ink-2); }
.chk__item[data-answer="no"] .chk__q span { background-size: 100% 2px; }
.chk__btns { display: flex; gap: 0.4rem; }
.chk__btns button {
  min-width: 3.6rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 500;
  transition: background-color 250ms linear, color 250ms linear, border-color 250ms linear, transform 200ms var(--ease);
}
.chk__btns button:hover { border-color: var(--ink); }
.chk__btns button:active { transform: scale(0.94); }
.chk__btns [data-a="yes"][aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chk__btns [data-a="no"][aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.chk__meter { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-m); }
.chk__dial { position: relative; width: clamp(8.5rem, 5rem + 7vw, 11rem); aspect-ratio: 1; }
.chk__ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.chk__track { fill: none; stroke: var(--rule); stroke-width: 5; }
.chk__arc {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: calc(327 * (1 - var(--score, 0)));
  transition: stroke-dashoffset 900ms var(--ease), stroke 300ms linear;
}
.chk:not(.is-started) .chk__arc { stroke-dashoffset: 327; }
.chk.is-perfect .chk__arc { stroke: var(--ink); }
.chk__score {
  position: absolute; inset: 0;
  display: flex; align-items: baseline; justify-content: center; padding-top: 30%;
  font-size: clamp(2.75rem, 1.5rem + 3vw, 4.5rem); font-weight: 500; letter-spacing: -0.05em; line-height: 1;
}
.chk__score small { font-size: 0.4em; color: var(--ink-2); letter-spacing: 0; margin-left: 0.1em; }
.chk__verdict { max-width: 20ch; font-size: var(--step-2); letter-spacing: -0.025em; line-height: 1.2; }
.chk.is-done:not(.is-perfect) .chk__verdict { color: var(--accent); }
.chk__turn { max-width: 46ch; color: var(--ink-2); }
.chk__cta { margin-top: var(--space-m); }
html:not(.js) .chk__btns, html:not(.js) .chk__meter { display: none; }
@media (max-width: 40em) {
  .chk__item { grid-template-columns: minmax(0, 1fr); }
  .chk__q { font-size: var(--step-1); }
}
/* Phones: a compact dial stays pinned to the bottom of the screen while answering */
@media (max-width: 55.99em) {
  .chk__meter {
    position: sticky;
    bottom: 0;
    z-index: 5;
    gap: var(--space-s);
    margin-inline: calc(-1 * var(--margin));
    padding: 0.7rem var(--margin);
    background: var(--paper);
    border-top: var(--hair) solid var(--rule);
  }
  .chk__dial { width: 4.25rem; }
  .chk__score { padding-top: 0; align-items: center; font-size: 1.5rem; }
  .chk__verdict { font-size: var(--step-0); max-width: none; }
}

/* 20. Questions: numbered rows that open in place ---------------------------------
   Native <details>, one open at a time. The number turns red, a red rule draws
   across, the plus turns into a minus, and the answer opens smoothly where the
   browser can animate to auto height. */

.faq__list { margin-top: var(--space-xl); border-top: var(--hair) solid var(--ink); interpolate-size: allow-keywords; }
.faq__item { position: relative; border-bottom: var(--hair) solid var(--rule); }
.faq__item::before {
  content: "";
  position: absolute;
  left: 0; top: -1px;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 800ms var(--ease);
}
.faq__item[open]::before { transform: none; }
.faq__item summary {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) 1.25rem;
  align-items: baseline;
  gap: var(--gutter);
  padding-block: var(--space-m);
  cursor: pointer;
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__n { color: var(--ink-2); transition: color 300ms linear; }
.faq__q { font-size: var(--step-2); font-weight: 500; letter-spacing: -0.025em; line-height: 1.2; transition: translate 600ms var(--ease), color 300ms linear; }
.faq__item summary:hover .faq__q { translate: 0.35em 0; }
.faq__item[open] .faq__n { color: var(--accent); }
.faq__icon { position: relative; align-self: center; width: 1.25rem; height: 1.25rem; transition: rotate 600ms var(--ease); }
.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 100%; height: 1.5px;
  margin-top: -0.75px;
  background: currentColor;
  transition: rotate 600ms var(--ease);
}
.faq__icon::after { rotate: 90deg; }
.faq__item[open] .faq__icon { rotate: 180deg; }
.faq__item[open] .faq__icon::after { rotate: 0deg; }
.faq__item summary:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 4px; }
.faq__a { padding: 0 0 var(--space-l) calc(2.5rem + var(--gutter)); color: var(--ink-2); max-width: calc(2.5rem + var(--gutter) + 62ch); }
.faq__a p + p { margin-top: var(--space-s); }
.faq__a > * { opacity: 0; translate: 0 -0.5rem; transition: opacity 500ms linear, translate 700ms var(--ease); }
.faq__item[open] .faq__a > * { opacity: 1; translate: none; transition-delay: 120ms; }
.faq__item[open] .faq__a > * + * { transition-delay: 220ms; }
.faq__item::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size 600ms var(--ease), content-visibility 600ms allow-discrete;
}
.faq__item[open]::details-content { block-size: auto; }
@media (max-width: 55.99em) {
  .faq__item summary { grid-template-columns: 2rem minmax(0, 1fr) 1rem; }
  .faq__a { padding-left: calc(2rem + var(--gutter)); }
}
@media (prefers-reduced-motion: reduce) {
  .faq__item::before, .faq__q, .faq__icon, .faq__icon::before, .faq__icon::after, .faq__a > *, .faq__item::details-content { transition: none; }
}

/* 21. For agencies ------------------------------------------------------------
   Hero: two lines rise out of a mask; the second starts as an outline and fills
   in, the way a signature finishes the work. */

/* @critical */
.ag-hero__title { display: grid; margin-block: var(--space-m) var(--space-l); font-size: clamp(2.75rem, 1.2rem + 6.4vw, 8rem); font-weight: 500; line-height: 0.95; letter-spacing: -0.05em; }
.ag-line { display: block; overflow: clip; padding-bottom: 0.06em; }
.ag-line > span { display: inline-block; }
.ag-line--sign > span { color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .ag-line > span { animation: ag-rise 1.1s cubic-bezier(0.2, 0.8, 0.1, 1) both; }
  .ag-line--sign > span { animation: ag-rise 1.1s cubic-bezier(0.2, 0.8, 0.1, 1) 0.15s both, ag-sign 1.4s var(--ease) 1.1s both; }
}
@keyframes ag-rise { from { transform: translateY(105%); } }
@keyframes ag-sign { from { color: transparent; -webkit-text-stroke: 1px var(--ink); } to { color: var(--ink); -webkit-text-stroke: 1px transparent; } }
/* @end-critical */

.index-list__note { margin-top: 0.35rem; color: var(--ink-2); max-width: 56ch; }
.ag-list > li { transition: padding-left 500ms var(--ease); }
.ag-list > li:hover { padding-left: 0.5rem; }
.ag-list > li:hover .num { color: var(--accent); }

.ag-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-l) var(--gutter); margin-top: var(--space-l); }
.ag-figs > div { padding-top: var(--space-s); border-top: var(--hair) solid var(--ink); }
.ag-figs dd { margin: var(--space-2xs) 0 0; font-size: clamp(3rem, 1.75rem + 3.6vw, 5rem); font-weight: 500; line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.ag-figs dd.ag-figs__zones { font-size: var(--step-3); letter-spacing: -0.03em; line-height: 1.1; padding-top: 0.4em; }
@media (min-width: 56em) { .ag-figs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ag-hero .page-hero__lede { margin-top: 0; }

/* 22. Contact tab: a vertical tab fixed to the right edge ------------------------
   Reads bottom to top. Steps aside once the contact form or the footer is on
   screen. Sits under the mobile menu. */

.contact-tab {
  position: fixed;
  right: 0;
  top: 50%;
  z-index: 39;
  writing-mode: vertical-rl;
  transform: translateY(-50%) rotate(180deg);
  padding: 1.25rem 0.7rem;
  background: var(--accent);
  color: var(--paper);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  transition: translate 450ms var(--ease), padding 450ms var(--ease), background-color 250ms linear, color 250ms linear, opacity 300ms linear, visibility 0s;
}
.contact-tab:hover,
.contact-tab:focus-visible { padding-bottom: 1.75rem; background: var(--ink); color: var(--paper); }
.contact-tab:focus-visible { outline-offset: 3px; }
.contact-tab.is-away { translate: 100% 0; opacity: 0; visibility: hidden; transition: translate 450ms var(--ease), opacity 300ms linear, visibility 0s 450ms; }
@media (max-width: 55.99em) {
  .contact-tab { padding: 0.95rem 0.5rem; font-size: 0.6875rem; }
}

/* 23. Skills: hover a skill, see the work ------------------------------------------
   No JS: every skill's projects are listed under the skill list.
   With JS (.sk-js): a panel opens from the word in a circular reveal, with a disc
   that turns to the next project. Fine pointers get a floating panel; touch gets a
   bottom sheet. */

.sk-list {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.05em 0.3em;
  padding: 0;
  list-style: none;
  font-size: clamp(2.5rem, 1rem + 6vw, 7rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.05em;
}
.sk-list li { max-width: none; }
.sk-list li:not(:last-child)::after { content: "/"; margin-left: 0.3em; color: var(--rule); font-weight: 300; }
.sk { font: inherit; letter-spacing: inherit; line-height: inherit; color: var(--ink); transition: color 300ms linear, opacity 400ms linear; }
.sk sup { position: relative; top: -1.6em; margin-left: 0.2em; font-size: 0.2em; letter-spacing: 0.08em; color: var(--accent); }
.sk:hover, .sk.is-open { color: var(--accent); }
.has-open .sk:not(.is-open) { opacity: 0.25; }

.sk-panels { display: grid; gap: var(--space-xl); margin-top: var(--space-section); }
.sk-panel__title { margin-bottom: var(--space-m); color: var(--accent); }
.sk-slides { display: grid; gap: var(--space-l); padding: 0; list-style: none; }
.sk-slide { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: var(--gutter); align-items: center; max-width: none; }
.sk-slide__name { font-size: var(--step-3); letter-spacing: -0.03em; }
.sk-slide__line { margin-top: var(--space-2xs); color: var(--ink-2); max-width: 46ch; }
.sk-slide__cta { margin-top: var(--space-s); font-size: var(--step--1); }
.sk-close, .sk-next { display: none; }

/* The disc: the project inside, the skill name turning around it */
.sk-disc { position: relative; aspect-ratio: 1; }
.sk-disc__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: currentColor; font-size: 11px; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; animation: sk-spin 22s linear infinite; }
.sk-disc__face { position: absolute; inset: 15%; overflow: hidden; border-radius: 50%; background: var(--accent); }
.sk-disc__face picture, .sk-disc__face img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 20% 0; }
.sk-disc__type { display: grid; place-items: center; height: 100%; color: #fff; font-size: 7rem; line-height: 1; padding-top: 0.35em; }
@keyframes sk-spin { to { rotate: 360deg; } }

.sk-js .sk-panels { display: block; margin: 0; }
.sk-js .sk-panel {
  --paper: #0e0e0e; --paper-2: #1a1a1a; --ink: #efefef; --ink-2: #a3a3a3; --accent: #ff4a33; --rule: #2a2a2a;
  position: fixed;
  z-index: 44;
  width: min(48rem, calc(100vw - 2rem));
  padding: var(--space-l);
  background: var(--paper);
  color: var(--ink);
  visibility: hidden;
  clip-path: circle(0 at var(--ox, 50%) var(--oy, 0));
  transition: clip-path 750ms cubic-bezier(0.77, 0, 0.18, 1), visibility 0s 750ms;
  outline: none;
}
.sk-js .sk-panel.is-open { visibility: visible; clip-path: circle(calc(100vw + 100vh) at var(--ox, 50%) var(--oy, 0)); transition-delay: 0s; }
.sk-js .sk-panel__title { margin-bottom: var(--space-s); }
.sk-js .sk-slides { display: grid; gap: 0; }
.sk-js .sk-slide { grid-area: 1 / 1; grid-template-columns: 15rem minmax(0, 1fr); gap: var(--space-l); visibility: hidden; transition: visibility 0s 900ms; }
.sk-js .sk-slide.is-on, .sk-js .sk-slide.was-on { visibility: visible; transition-delay: 0s; }
.sk-js .sk-slide.is-on { z-index: 1; }
.sk-js .sk-disc { cursor: pointer; opacity: 0; transform: rotate(140deg) scale(0.35); transition: transform 950ms cubic-bezier(0.2, 0.8, 0.1, 1), opacity 450ms linear; }
.sk-js .is-on .sk-disc { opacity: 1; transform: none; }
.sk-js .was-on .sk-disc { opacity: 0; transform: translateX(-35%) rotate(-140deg) scale(0.35); }
.sk-js .sk-slide__meta { opacity: 0; translate: 1.5rem 0; transition: opacity 300ms linear, translate 600ms var(--ease); }
.sk-js .is-on .sk-slide__meta { opacity: 1; translate: none; transition-delay: 250ms; }
.sk-js .was-on .sk-slide__meta { translate: -1.5rem 0; }
.sk-js .sk-slide__name { font-size: var(--step-3); }
.sk-js .sk-next {
  display: inline-flex; gap: 0.5em; margin-top: var(--space-m);
  font-size: var(--step--1); font-weight: 500; color: var(--accent);
}
.sk-js .sk-next span { transition: translate 300ms var(--ease); }
.sk-js .sk-next:hover span { translate: 0.3em 0; }
.sk-js .sk-close { display: block; position: absolute; top: var(--space-s); right: var(--space-s); font-size: var(--step--2); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.sk-js .sk-close:hover { color: var(--ink); }

/* Touch or narrow screens: a bottom sheet */
.sk-js .sk-panel[data-mode="sheet"] {
  left: 0; right: 0; bottom: 0; top: auto;
  width: auto;
  max-height: 88vh;
  overflow-y: auto;
  padding: var(--space-l) var(--margin) var(--space-xl);
  clip-path: inset(100% 0 0 0);
  transition: clip-path 600ms cubic-bezier(0.77, 0, 0.18, 1), visibility 0s 600ms;
}
.sk-js .sk-panel[data-mode="sheet"].is-open { clip-path: inset(0); }
.sk-js [data-mode="sheet"] .sk-slide { grid-template-columns: minmax(0, 1fr); gap: var(--space-m); }
.sk-js [data-mode="sheet"] .sk-disc { width: min(15rem, 70vw); }

@media (max-width: 40em) {
  .sk-slide { grid-template-columns: 6rem minmax(0, 1fr); }
}

/* 24. Selected work as stacked cards --------------------
   Pure CSS. Each card sticks a step lower than the one before, so as you scroll
   the next card slides over it and the earlier cards leave their label strip
   showing, like a stack of index cards. */

.cases { --step: 3.25rem; --top: 4.75rem; display: grid; gap: var(--space-l); margin-block: var(--space-l); }
.case {
  --bg: #dcdcdc; --fg: #0e0e0e; --fg-2: #4d4d4d; --line: rgba(14, 14, 14, 0.14);
  position: sticky;
  top: calc(var(--top) + var(--i, 0) * var(--step));
  overflow: hidden;
  display: grid;
  gap: var(--space-m);
  padding: 1.1rem var(--space-m) var(--space-m);
  border-radius: 1.25rem;
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 -0.5rem 1.5rem -1rem rgba(0, 0, 0, 0.35);
}
.case:nth-child(4n + 2) { --bg: #0e0e0e; --fg: #efefef; --fg-2: #a3a3a3; --line: rgba(239, 239, 239, 0.16); }
.case:nth-child(4n + 3) { --bg: #c22317; --fg: #ffffff; --fg-2: #f6d5d1; --line: rgba(255, 255, 255, 0.22); }
.case:nth-child(4n + 4) { --bg: #f7f7f7; --fg: #0e0e0e; --fg-2: #4d4d4d; }
.case__text { display: flex; flex-direction: column; min-width: 0; }
.case__kind { font-size: var(--step--1); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.1rem; }
.case__kind span { opacity: 0.6; font-weight: 500; }
.case__title { margin-top: var(--space-m); font-size: clamp(1.75rem, 1rem + 1.9vw, 2.9rem); letter-spacing: -0.04em; line-height: 1.02; }
.case__line { margin-top: var(--space-s); color: var(--fg-2); max-width: 46ch; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.case__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-m); margin: var(--space-m) 0 0; padding-top: var(--space-s); border-top: 1px solid var(--line); }
.case__facts dt { font-size: var(--step--1); color: var(--fg-2); }
.case__facts dd { margin: 0.25rem 0 0; font-size: var(--step-1); font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.case__pill {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-s);
  margin-top: var(--space-l);
  padding: 0.95rem 1.1rem;
  border-radius: 0.75rem;
  background: #fff;
  color: #0e0e0e;
  font-size: var(--step--1);
  font-weight: 500;
}
.case__pill .arrow { color: #c22317; transition: translate 300ms var(--ease); }
a.case__pill:hover .arrow { translate: 0.3em 0; }
.case__pill small { display: block; color: #5c5c5c; font-weight: 400; font-size: 1em; }
.case__media { margin: 0; overflow: hidden; border-radius: 0.85rem; background: rgba(0, 0, 0, 0.12); aspect-ratio: 16 / 10; }
.case__media picture, .case__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.case__media img { transition: transform 1.2s var(--ease); }
.case:hover .case__media img { transform: scale(1.03); }

@media (min-width: 56em) {
  .case {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: var(--space-xl);
    height: clamp(27rem, calc(100vh - var(--top) - 6 * var(--step) - 1rem), 38rem);
    padding: 1.1rem 1.75rem 1.75rem;
  }
  .cases { gap: 30vh; }
  .case__text { padding-top: 0; }
  .case__pill { margin-top: auto; }
  .case__media { aspect-ratio: auto; height: 100%; }
}
/* Short desktop screens: a tighter stack and tighter cards */
@media (min-width: 56em) and (max-height: 50em) {
  .cases { --step: 2.75rem; }
  .case { gap: var(--space-l); }
  .case__title { margin-top: var(--space-s); font-size: clamp(1.6rem, 0.9rem + 1.6vw, 2.4rem); }
  .case__line { -webkit-line-clamp: 2; line-clamp: 2; font-size: var(--step--1); }
  .case__facts { margin-top: var(--space-s); gap: var(--space-s); }
  .case__facts dd { font-size: var(--step-0); }
  .case__pill { padding: 0.75rem 1rem; }
}
@media (max-width: 55.99em) {
  .cases { --step: 1.6rem; --top: 4.5rem; }
  .case__title { font-size: var(--step-3); margin-top: var(--space-s); }
  .case__media { order: 2; }
  .case__line { font-size: var(--step--1); }
  .case__facts { margin-top: var(--space-m); }
  .case__facts dd { font-size: var(--step-0); }
  .case__pill { margin-top: var(--space-m); }
}

/* Dark theme: the ink card and the skills panel would vanish into the page */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .case:nth-child(4n + 2) { --bg: #242424; --line: rgba(239, 239, 239, 0.14); }
  :root.sk-js:not([data-theme="light"]) .sk-panel { --paper: #1c1c1c; box-shadow: 0 0 0 1px #333; }
}
:root[data-theme="dark"] .case:nth-child(4n + 2) { --bg: #242424; --line: rgba(239, 239, 239, 0.14); }
:root.sk-js[data-theme="dark"] .sk-panel { --paper: #1c1c1c; box-shadow: 0 0 0 1px #333; }

/* Phones: compact cards sized to the screen, so they stack on any phone.
   The screenshot fills whatever height is left; scope and sector are dropped. */
@media (max-width: 55.99em) {
  .cases { --step: 1.75rem; --top: 4.4rem; gap: 14vh; }
  .case {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    height: min(34rem, calc(100svh - var(--top) - 6 * var(--step) - 0.75rem));
    padding: 0.6rem 1rem 1rem;
  }
  .case__text { display: contents; }
  .case__kind { line-height: 1rem; }
  .case__title { margin-top: 0.2rem; font-size: clamp(1.5rem, 1rem + 2.4vw, 2rem); }
  .case__line { margin-top: 0; -webkit-line-clamp: 2; line-clamp: 2; }
  .case__facts { display: none; }
  .case__media { order: 2; flex: 1 1 auto; min-height: 5rem; aspect-ratio: auto; }
  .case__pill { order: 3; margin-top: 0; padding: 0.75rem 0.9rem; }
}
