/* Zubair Shahzad: portfolio
   Monochrome system. Every colour below is a grey; the only exception is the
   form error tone, which is functional and always paired with text. */

@layer reset, base, layout, components, utilities;

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --ink: #0a0a0b;
  --carbon: #141416;
  --iron: #2a2a2d;
  --steel: #6b6b70;
  --ash: #9a9aa0;
  --smoke: #4a4a4f;
  --fog: #d4d5d7;
  --mist: #ececee;
  --paper: #f5f5f6;
  --error: #ff9b8f;
  --error-on-light: #a3261b;

  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --fs-mono: 0.8125rem;
  --fs-small: 0.9375rem;
  --fs-body: 1.0625rem;
  --fs-lead: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --fs-title: clamp(2.5rem, 1.5rem + 4vw, 5.5rem);
  --fs-display: clamp(5.5rem, 2.5rem + 16vw, 19rem);

  --gutter: clamp(1rem, 4vw, 3rem);
  --space-section: clamp(4.5rem, 3rem + 7vw, 9rem);
  --radius-panel: clamp(1.5rem, 1rem + 2vw, 2.75rem);
  --radius: 14px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --dur-fast: 180ms;
  --dur: 320ms;
  --dur-slow: 800ms;

  --header-h: 4.75rem;
  color-scheme: light dark;
}

/* Section themes: components read --bg / --fg / --muted / --line. */
[data-theme="light"] {
  --bg: var(--fog);
  --fg: var(--ink);
  --muted: var(--smoke);
  --line: rgb(10 10 11 / 0.16);
  --focus: var(--ink);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: var(--ink);
  --fg: var(--paper);
  --muted: var(--ash);
  --line: var(--iron);
  --focus: var(--paper);
  color-scheme: dark;
}
/* Per-section surface tweaks: unlayered so they beat the theme defaults above. */
.work { --bg: var(--mist); }
.process { --bg: var(--carbon); }

/* ---------- Reset ---------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, picture, svg, video { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { background: none; border: 0; padding: 0; cursor: pointer; }
  ul, ol { padding: 0; }
  p, h1, h2, h3 { overflow-wrap: break-word; }
  [hidden] { display: none !important; }
}

/* ---------- Base ---------- */
@layer base {
  html {
    scroll-padding-top: calc(var(--header-h) + 1.5rem);
    background: var(--ink);
  }
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }
  body {
    min-height: 100dvh;
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: 1.6;
    color: var(--paper);
    background: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  h1, h2, h3 { line-height: 1.1; font-weight: 600; text-wrap: balance; }
  p { text-wrap: pretty; }
  a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
  a:hover { text-decoration-thickness: 2px; }
  :focus-visible {
    outline: 2px solid var(--focus, var(--paper));
    outline-offset: 3px;
    border-radius: 4px;
  }
  ::selection { background: var(--ink); color: var(--paper); }
  [data-theme="dark"] ::selection { background: var(--paper); color: var(--ink); }
}

/* ---------- Layout ---------- */
@layer layout {
  .container {
    width: min(100% - 2 * var(--gutter), 1440px);
    margin-inline: auto;
  }

  /* Sections stack like cards: each one overlaps the previous by its radius. */
  .panel {
    position: relative;
    background: var(--bg);
    color: var(--fg);
    border-radius: var(--radius-panel) var(--radius-panel) 0 0;
    margin-top: calc(-1 * var(--radius-panel));
    padding-block: calc(var(--space-section) + var(--radius-panel) * 0.5) var(--space-section);
  }

  .section-head {
    display: grid;
    gap: 1rem;
    margin-bottom: clamp(2rem, 1rem + 3vw, 4rem);
  }
  .section-head__title {
    font-family: var(--font-display);
    font-stretch: 75%;
    font-weight: 700;
    font-size: var(--fs-title);
    line-height: 0.95;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    max-width: 18ch;
  }
  .section-head__lede {
    max-width: 52ch;
    color: var(--muted);
    font-size: var(--fs-lead);
    line-height: 1.5;
  }
}

/* ---------- Components ---------- */
@layer components {
  /* Utility type */
  .mono {
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }
  .eyebrow { color: var(--muted); }
  .display {
    font-family: var(--font-display);
    font-stretch: 62%;
    font-weight: 800;
    font-size: var(--fs-display);
    line-height: 0.78;
    letter-spacing: -0.015em;
    text-transform: uppercase;
  }
  .display--md { font-size: clamp(3.75rem, 2rem + 9vw, 11rem); line-height: 0.82; }

  /* Skip link */
  .skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 100;
    padding: 0.75rem 1rem;
    background: var(--paper);
    color: var(--ink);
    border-radius: 8px;
    font-weight: 600;
    transform: translateY(-200%);
  }
  .skip-link:focus { transform: none; outline: 2px solid var(--ink); outline-offset: 2px; }

  /* Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 3rem;
    padding: 0 1.4rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 600;
    font-size: var(--fs-small);
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
  }
  .btn:active { transform: scale(0.97); }
  .btn--outline { border-color: currentColor; }
  .btn--outline:hover { background: var(--nav-fg); color: var(--nav-bg); }
  .btn--light { background: var(--paper); color: var(--ink); }
  .btn--light:hover { background: var(--fog); }
  .btn--light:focus-visible { outline-color: var(--paper); }
  .btn--outline-dark { border-color: rgb(10 10 11 / 0.25); color: var(--ink); }
  .btn--outline-dark:hover { border-color: var(--ink); }
  .btn[disabled] { opacity: 0.5; cursor: progress; }

  .link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 0.2rem;
  }
  .link-arrow::after { content: "\2197"; font-weight: 400; }

  /* ---------- Header / nav ---------- */
  .site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    padding: 0.75rem var(--gutter) 0;
    pointer-events: none;
    transition: transform var(--dur) var(--ease-out);
  }
  .site-header.is-hidden { transform: translateY(-130%); }
  .site-header.is-menu-open { transform: none; }

  .nav {
    --nav-bg: var(--paper);
    --nav-fg: var(--ink);
    --nav-muted: var(--smoke);
    --focus: var(--ink);
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1440px;
    min-height: 4rem;
    margin-inline: auto;
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
    background: var(--nav-bg);
    color: var(--nav-fg);
    border: 1px solid rgb(10 10 11 / 0.08);
    border-radius: 1rem;
    transition: background-color var(--dur), color var(--dur), border-color var(--dur);
  }
  .site-header[data-nav-theme="dark"] .nav {
    --nav-bg: var(--carbon);
    --nav-fg: var(--paper);
    --nav-muted: var(--ash);
    --focus: var(--paper);
    border-color: var(--iron);
  }

  .nav__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    margin-right: auto;
    min-height: 2.75rem;
  }
  .nav__mark {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.6rem;
    background: var(--nav-fg);
    color: var(--nav-bg);
    font-family: var(--font-display);
    font-stretch: 62%;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
  }
  .nav__wordmark {
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .nav__wordmark strong { font-weight: 500; }

  .nav__links {
    display: none;
    list-style: none;
    align-items: center;
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .nav__links li { display: flex; align-items: center; }
  .nav__links li + li::before {
    content: "/";
    color: var(--nav-muted);
    margin-inline: 0.85rem;
  }
  .nav__links a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    color: var(--nav-muted);
    text-decoration: none;
    transition: color var(--dur-fast);
  }
  .nav__links a:hover,
  .nav__links a[aria-current="true"] { color: var(--nav-fg); }
  .nav__cta { display: none; min-height: 2.75rem; }

  .nav__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0 1rem;
    border-radius: 0.7rem;
    background: var(--nav-fg);
    color: var(--nav-bg);
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .nav__toggle-icon,
  .nav__toggle-icon::before {
    display: block;
    width: 1rem;
    height: 1.5px;
    background: currentColor;
    transition: transform var(--dur) var(--ease-out);
  }
  .nav__toggle-icon { position: relative; transform: translateY(-3px); }
  .nav__toggle-icon::before { content: ""; position: absolute; top: 6px; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-icon { transform: rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .nav__toggle-icon::before { transform: translateY(-6px) rotate(-90deg); }

  .mobile-menu {
    pointer-events: auto;
    position: fixed;
    inset: 0;
    z-index: -1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: calc(var(--header-h) + 2.5rem) var(--gutter) 2rem;
    background: var(--ink);
    color: var(--paper);
    --focus: var(--paper);
  }
  .mobile-menu__links { list-style: none; }
  .mobile-menu__links a {
    display: block;
    padding-block: 0.15rem;
    font-family: var(--font-display);
    font-stretch: 62%;
    font-weight: 800;
    font-size: clamp(3rem, 14vw, 5.5rem);
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;
  }
  .mobile-menu__note { color: var(--ash); }

  @media (min-width: 1024px) {
    .nav { padding-left: 0.5rem; }
    .nav__links { display: flex; }
    .nav__cta { display: inline-flex; }
    .nav__toggle, .mobile-menu { display: none !important; }
  }

  /* ---------- Hero ---------- */
  .hero {
    position: relative;
    min-height: max(100svh, 40rem);
    background: var(--bg);
    color: var(--fg);
    overflow: clip;
    isolation: isolate;
  }
  .hero__orbits {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: var(--line);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
    z-index: -1;
  }
  .hero__orbits circle { vector-effect: non-scaling-stroke; }

  .marquee {
    position: absolute;
    left: 0;
    right: 0;
    top: 58%;
    transform: translateY(-50%);
    overflow: hidden;
    pointer-events: none;
  }
  .marquee__track {
    display: flex;
    width: max-content;
    will-change: transform;
  }
  .marquee__text {
    display: block;
    flex: none;
    font-family: var(--font-display);
    font-weight: 800;
    font-stretch: 62%;
    font-size: clamp(7.5rem, 40svh, 30rem);
    line-height: 0.8;
    letter-spacing: -0.012em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--ink);
  }
  .marquee__dash { margin-inline: 0.12em; }

  .hero__portrait {
    position: absolute;
    left: 50%;
    bottom: 0;
    z-index: 1;
    translate: -50% 0;
    transform-origin: 50% 100%;
    will-change: transform;
  }
  .hero__portrait img {
    height: min(86svh, 60rem);
    width: auto;
    max-width: none;
    filter: contrast(1.04);
  }

  .hero__intro {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem 2rem;
    padding-top: calc(var(--header-h) + clamp(1.5rem, 1rem + 2vw, 3rem));
  }
  .hero__title {
    display: grid;
    gap: 0.35rem;
    max-width: 17rem;
    font-weight: 500;
  }
  .hero__name {
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .hero__role {
    font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3rem);
    line-height: 1.3;
  }
  .hero__status {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--fog);
  }
  .status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--ink);
    box-shadow: 0 0 0 0 rgb(10 10 11 / 0.45);
  }
  @media (prefers-reduced-motion: no-preference) {
    .status-dot { animation: pulse 2.4s var(--ease-out) infinite; }
    .motion-paused .status-dot { animation: none; }
  }
  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgb(10 10 11 / 0.45); }
    70%, 100% { box-shadow: 0 0 0 0.6rem rgb(10 10 11 / 0); }
  }

  .hero__foot {
    position: absolute;
    left: 0;
    right: 0;
    /* Clear the next panel's rounded overlap. */
    bottom: calc(var(--radius-panel) + clamp(0.75rem, 0.5rem + 1vw, 1.5rem));
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
  }
  .hero__disciplines { display: none; color: var(--muted); }
  .motion-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.75rem;
    padding: 0 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--fog);
    color: var(--ink);
  }
  .motion-toggle__icon {
    position: relative;
    width: 0.65rem;
    height: 0.75rem;
    border-inline: 2px solid currentColor;
  }
  .motion-toggle[data-paused="true"] .motion-toggle__icon {
    border: 0;
    width: 0;
    height: 0;
    border-block: 0.4rem solid transparent;
    border-left: 0.65rem solid currentColor;
  }
  .hero__scroll {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    background: var(--fog);
    font-size: var(--fs-small);
    font-weight: 500;
    text-decoration: none;
  }
  .hero__scroll svg { fill: none; stroke: currentColor; stroke-width: 1.5; }
  @media (prefers-reduced-motion: no-preference) {
    .hero__scroll svg { animation: nudge 2.2s var(--ease-out) infinite; }
    .motion-paused .hero__scroll svg { animation: none; }
  }
  @keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

  @media (max-width: 639px) {
    .marquee { top: 46%; }
    .marquee__text { font-size: clamp(6.5rem, 2rem + 30vw, 11rem); }
    .hero__portrait img { height: auto; width: min(100vw, 30rem); }
    .hero__scroll span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .hero__scroll { padding: 0.6rem; }
  }
  @media (min-width: 1024px) {
    .hero__foot { align-items: center; justify-content: flex-start; gap: 1.5rem; }
    .hero__disciplines { display: block; }
    .hero__scroll { margin-left: auto; background: none; padding: 0; }
  }

  /* ---------- About ---------- */
  .about__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: clamp(2.5rem, 1.5rem + 4vw, 5rem);
  }
  .about__arrow {
    width: clamp(4rem, 2rem + 10vw, 11rem);
    height: auto;
    fill: none;
    stroke: var(--steel);
    stroke-width: 9;
    flex: none;
    margin-bottom: 0.5rem;
  }
  .statement {
    font-family: var(--font-display);
    font-stretch: 82%;
    font-weight: 500;
    font-size: clamp(1.75rem, 1rem + 3.2vw, 4rem);
    line-height: 1.06;
    letter-spacing: -0.01em;
    max-width: 24ch;
    margin-bottom: clamp(2.5rem, 1.5rem + 4vw, 5rem);
    text-wrap: balance;
  }
  .about__grid {
    display: grid;
    gap: 3rem;
  }
  .about__copy { display: grid; gap: 1.1rem; max-width: 62ch; color: var(--muted); }
  .about__copy p:first-child { color: var(--fg); font-size: var(--fs-lead); line-height: 1.5; }
  .about__copy a { color: var(--fg); }

  .facts { border-top: 1px solid var(--line); }
  .facts__row {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 1rem;
    padding-block: 1rem;
    border-bottom: 1px solid var(--line);
  }
  .facts dt { color: var(--muted); padding-top: 0.2rem; }
  .facts dd a { text-decoration-color: var(--steel); }

  @media (min-width: 900px) {
    .about__grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(3rem, 6vw, 7rem); }
  }

  /* ---------- Work ---------- */
  .filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
  }
  .chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0 1.05rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: var(--fs-small);
    font-weight: 500;
    transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
  }
  .chip:hover { border-color: var(--ink); }
  .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
  .chip__count { font-family: var(--font-mono); font-size: 0.75rem; opacity: 0.7; }
  .chip[aria-pressed="true"]:focus-visible { outline-color: var(--ink); }

  .work-list { list-style: none; border-top: 1px solid var(--line); }
  .work-item { position: relative; border-bottom: 1px solid var(--line); view-transition-class: work-item; }
  .work-item__inner {
    display: grid;
    gap: 0.9rem;
    padding-block: 1.5rem;
  }
  .work-item__thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 808 / 632;
    object-fit: cover;
    border-radius: 12px;
    background: var(--fog);
    filter: grayscale(1) contrast(1.05);
    transition: filter var(--dur-slow) var(--ease-out);
  }
  .work-item:hover .work-item__thumb,
  .work-item:focus-within .work-item__thumb { filter: none; }

  .work-item__title {
    font-family: var(--font-display);
    font-stretch: 62%;
    font-weight: 800;
    font-size: clamp(2.6rem, 1.4rem + 4.4vw, 6.25rem);
    line-height: 0.9;
    letter-spacing: -0.01em;
    text-transform: uppercase;
  }
  .work-item__open {
    text-align: left;
    text-transform: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    font-stretch: inherit;
    transition: transform var(--dur) var(--ease-out), color var(--dur);
  }
  /* The whole row opens the case note; links inside stay clickable above it. */
  .work-item__open::after { content: ""; position: absolute; inset: 0; z-index: 1; }
  .work-item__open:focus-visible { outline: none; }
  .work-item__open:focus-visible::after { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 6px; }

  .work-item__summary { color: var(--muted); max-width: 48ch; font-size: var(--fs-small); line-height: 1.55; }
  .work-item__meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; color: var(--muted); }
  .work-item__links { list-style: none; position: relative; z-index: 2; display: flex; gap: 1rem; font-size: var(--fs-small); font-weight: 500; }
  .work-item__links a { display: inline-flex; align-items: center; min-height: 2.75rem; }
  .work-item__links a::after { content: "\2197"; margin-left: 0.35rem; }

  .work__more { margin-top: 2.5rem; }

  /* Desktop with a mouse: big list rows, cursor-follow preview instead of thumbs. */
  @media (min-width: 900px) {
    .work-item__inner {
      grid-template-columns: minmax(0, 7fr) minmax(0, 5fr) minmax(0, 3fr);
      grid-template-areas:
        "title summary meta"
        "title links   meta";
      align-items: start;
      column-gap: clamp(1.5rem, 3vw, 3.5rem);
      row-gap: 0.5rem;
      padding-block: clamp(1.4rem, 1rem + 1vw, 2.25rem);
    }
    .work-item__thumb { display: none; }
    .work-item__title { grid-area: title; }
    .work-item__summary { grid-area: summary; padding-top: 0.4rem; }
    .work-item__links { grid-area: links; }
    .work-item__meta { grid-area: meta; flex-direction: column; align-items: flex-end; text-align: right; padding-top: 0.55rem; }
    .work-item__meta div:last-child { order: -1; color: var(--fg); }

    .work-list:hover .work-item:not(:hover) .work-item__title { color: var(--steel); }
    .work-item:hover .work-item__open { transform: translateX(0.75rem); }
  }

  .work-preview {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 20;
    width: clamp(15rem, 10rem + 12vw, 23rem);
    aspect-ratio: 808 / 632;
    border-radius: var(--radius);
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    scale: 0.85;
    box-shadow: 0 30px 60px -20px rgb(10 10 11 / 0.45);
    transition: opacity var(--dur) var(--ease-out), scale var(--dur) var(--ease-out);
    display: none;
  }
  .work-preview img { width: 100%; height: 100%; object-fit: cover; }
  .work-preview.is-visible { opacity: 1; scale: 1; }
  @media (hover: hover) and (pointer: fine) and (min-width: 900px) {
    .work-preview { display: block; }
  }

  ::view-transition-group(*.work-item) { animation-duration: 380ms; animation-timing-function: var(--ease-out); }

  /* ---------- Services ---------- */
  .service-list { list-style: none; border-top: 1px solid var(--line); }
  .service { border-bottom: 1px solid var(--line); }
  .service__heading { font-size: inherit; }
  .service__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
    padding-block: clamp(0.6rem, 0.3rem + 1vw, 1.25rem);
    text-align: left;
    color: var(--steel);
    transition: color var(--dur);
  }
  .service__name {
    font-family: var(--font-display);
    font-stretch: 62%;
    font-weight: 800;
    font-size: clamp(3rem, 1.4rem + 7.5vw, 10rem);
    line-height: 0.92;
    letter-spacing: -0.012em;
    text-transform: uppercase;
  }
  .service__toggle:hover,
  .service__toggle:focus-visible,
  .service__toggle[aria-expanded="true"] { color: var(--paper); }
  .service__icon {
    position: relative;
    flex: none;
    width: clamp(1.75rem, 1rem + 2vw, 3.25rem);
    aspect-ratio: 1;
  }
  .service__icon::before,
  .service__icon::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 3px;
    margin-top: -1.5px;
    background: currentColor;
    transition: transform var(--dur) var(--ease-out);
  }
  .service__icon::after { transform: rotate(90deg); }
  .service__toggle[aria-expanded="true"] .service__icon::after { transform: rotate(0deg); }
  .service__panel {
    display: grid;
    gap: 1rem;
    max-width: 62ch;
    padding-bottom: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
    color: var(--muted);
    font-size: var(--fs-lead);
    line-height: 1.5;
  }
  .service__deliverables { color: var(--fg); line-height: 1.8; }
  @media (prefers-reduced-motion: no-preference) {
    .service__panel:not([hidden]) { animation: rise var(--dur-slow) var(--ease-out); }
  }
  @keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

  /* ---------- Process ---------- */
  .steps {
    list-style: none;
    counter-reset: step;
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
  }
  .step {
    counter-increment: step;
    display: grid;
    gap: 0.75rem;
    align-content: start;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
  }
  .step::before {
    content: counter(step);
    font-family: var(--font-display);
    font-stretch: 62%;
    font-weight: 800;
    font-size: clamp(3.5rem, 2.5rem + 3vw, 6rem);
    line-height: 0.85;
    color: var(--steel);
  }
  .step__title { color: var(--fg); font-size: 1.375rem; font-weight: 600; }
  @media (min-width: 720px) {
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
  }
  @media (min-width: 1100px) {
    .steps { grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 0; border-bottom: 1px solid var(--line); }
    .step { padding: 2rem 1.5rem 2.5rem; border-bottom: 0; border-left: 1px solid var(--line); min-height: 20rem; }
    .step:first-child { border-left: 0; padding-left: 0; }
  }

  .promise {
    display: grid;
    gap: 1rem;
    margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
    padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .promise__title { color: var(--muted); }
  .promise__text {
    font-family: var(--font-display);
    font-stretch: 82%;
    font-weight: 500;
    font-size: clamp(1.4rem, 1rem + 1.6vw, 2.4rem);
    line-height: 1.12;
    max-width: 36ch;
  }
  @media (min-width: 900px) {
    .promise { grid-template-columns: 14rem 1fr; align-items: baseline; }
  }

  /* ---------- FAQ ---------- */
  .faq__layout { display: grid; gap: 1rem; }
  @media (min-width: 1000px) {
    .faq__layout { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(3rem, 6vw, 7rem); }
    .faq .section-head { align-self: start; position: sticky; top: calc(var(--header-h) + 2rem); }
  }
  .faq__list { border-top: 1px solid var(--line); }
  .qa { border-bottom: 1px solid var(--line); }
  .qa__q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 3rem;
    padding-block: 1.25rem;
    font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    list-style: none;
  }
  .qa__q::-webkit-details-marker { display: none; }
  .qa__q::after {
    content: "+";
    flex: none;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    line-height: 1;
    transition: transform var(--dur) var(--ease-out);
  }
  .qa[open] .qa__q::after { transform: rotate(45deg); }
  .qa__a { padding-bottom: 1.5rem; color: var(--muted); max-width: 60ch; }
  @media (prefers-reduced-motion: no-preference) {
    .qa[open] .qa__a { animation: rise 500ms var(--ease-out); }
  }

  /* ---------- Contact ---------- */
  .contact { overflow: clip; }
  .contact__marquee {
    overflow: hidden;
    margin-bottom: clamp(2.5rem, 2rem + 3vw, 5rem);
    pointer-events: none;
  }
  .contact__track {
    display: flex;
    width: max-content;
    font-family: var(--font-display);
    font-stretch: 62%;
    font-weight: 800;
    font-size: clamp(5rem, 2.5rem + 13vw, 16rem);
    line-height: 0.85;
    text-transform: uppercase;
    white-space: nowrap;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--steel);
  }
  @media (prefers-reduced-motion: no-preference) {
    .contact__track { animation: slide 38s linear infinite; }
    .motion-paused .contact__track { animation-play-state: paused; }
  }
  @keyframes slide { to { transform: translateX(-50%); } }

  .contact__grid { display: grid; gap: 3rem; }
  .contact__intro { display: grid; gap: 1.25rem; align-content: start; }
  .contact__intro > p { color: var(--muted); font-size: var(--fs-lead); line-height: 1.5; max-width: 40ch; }
  .contact__direct { list-style: none; border-top: 1px solid var(--line); margin-top: 1rem; }
  .contact__direct li {
    display: grid;
    grid-template-columns: 7rem 1fr;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
  }
  .contact__direct .mono { color: var(--muted); }
  .contact__direct a { display: inline-flex; align-items: center; min-height: 3rem; overflow-wrap: anywhere; }
  @media (min-width: 960px) {
    .contact__grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(3rem, 6vw, 7rem); }
  }

  /* Form */
  .form { display: grid; gap: 1.25rem; }
  .field { display: grid; gap: 0.5rem; }
  .field label { font-weight: 500; font-size: var(--fs-small); }
  .field__req { color: var(--ash); }
  .field input,
  .field select,
  .field textarea {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--iron);
    border-radius: 12px;
    background: var(--carbon);
    color: var(--paper);
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color var(--dur-fast), background-color var(--dur-fast);
  }
  .field textarea { resize: vertical; min-height: 9rem; }
  .field select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--ash) 50%), linear-gradient(135deg, var(--ash) 50%, transparent 50%);
    background-position: calc(100% - 1.4rem) 55%, calc(100% - 1rem) 55%;
    background-size: 0.4rem 0.4rem;
    background-repeat: no-repeat;
    padding-right: 2.5rem;
  }
  .field input:hover, .field select:hover, .field textarea:hover { border-color: var(--steel); }
  .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
    outline: 2px solid var(--paper);
    outline-offset: 2px;
    border-color: var(--paper);
  }
  .field [aria-invalid="true"] { border-color: var(--error); }
  .field__hint { color: var(--ash); font-size: var(--fs-small); }
  .field__error { color: var(--error); font-size: var(--fs-small); font-weight: 500; }
  .field__error::before { content: "Error: "; }
  .field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

  .form__error-summary {
    padding: 1rem 1.25rem;
    border: 1px solid var(--error);
    border-radius: 12px;
  }
  .form__error-title { font-size: 1rem; margin-bottom: 0.5rem; }
  .form__error-summary ul { padding-left: 1.1rem; }
  .form__error-summary a { color: var(--error); }

  .form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 0.5rem; }
  .form__note { color: var(--ash); font-size: var(--fs-small); }
  .form__status:empty { display: none; }
  .form__status {
    padding: 1rem 1.25rem;
    border: 1px solid var(--iron);
    border-radius: 12px;
    background: var(--carbon);
  }
  .form__status[data-state="error"] { border-color: var(--error); }
  .form__status a { font-weight: 600; }

  /* ---------- Footer ---------- */
  .site-footer {
    background: var(--ink);
    color: var(--ash);
    border-top: 1px solid var(--iron);
    padding-block: 2rem 2.5rem;
  }
  .site-footer__inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
  .site-footer__links { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
  .site-footer a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--paper); }

  /* ---------- Case note dialog ---------- */
  .case {
    --focus: var(--ink);
    width: min(60rem, 100% - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: var(--paper);
    color: var(--ink);
    overflow: auto;
    overscroll-behavior: contain;
  }
  .case::backdrop { background: rgb(10 10 11 / 0.78); }
  @media (prefers-reduced-motion: no-preference) {
    .case[open] { animation: case-in 420ms var(--ease-out); }
    .case[open]::backdrop { animation: fade-in 300ms ease-out; }
  }
  @keyframes case-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
  @keyframes fade-in { from { opacity: 0; } }

  .case__inner { display: grid; }
  .case__bar {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.75rem 0.75rem 1.25rem;
    background: var(--paper);
    border-bottom: 1px solid rgb(10 10 11 / 0.1);
  }
  .case__count { color: var(--smoke); }
  .case__close {
    min-height: 2.75rem;
    padding: 0 1.1rem;
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    font-weight: 600;
    font-size: var(--fs-small);
  }
  .case__close:focus-visible { outline-color: var(--ink); }
  .case__cover { width: 100%; height: auto; aspect-ratio: 808 / 632; object-fit: cover; background: var(--fog); }
  .case__body { display: grid; gap: 1rem; padding: clamp(1.25rem, 1rem + 2vw, 2.5rem); }
  .case__title {
    font-family: var(--font-display);
    font-stretch: 62%;
    font-weight: 800;
    font-size: clamp(2.75rem, 2rem + 4vw, 5rem);
    line-height: 0.9;
    text-transform: uppercase;
  }
  .case__summary { font-size: var(--fs-lead); line-height: 1.55; max-width: 60ch; }
  .case__meta { color: var(--smoke); }
  .case__links { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-weight: 600; }
  .case__links a { display: inline-flex; align-items: center; min-height: 2.75rem; }
  .case__links a::after { content: "\2197"; margin-left: 0.35rem; font-weight: 400; }
  .case__nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 clamp(1.25rem, 1rem + 2vw, 2.5rem) clamp(1.25rem, 1rem + 2vw, 2.5rem);
  }

  /* ---------- Simple document pages (privacy, thanks, 404) ---------- */
  .doc {
    min-height: 100dvh;
    width: min(100% - 2 * var(--gutter), 46rem);
    margin-inline: auto;
    padding-block: clamp(2.5rem, 2rem + 4vw, 6rem);
    display: grid;
    align-content: start;
    gap: 1rem;
    background: var(--bg);
    color: var(--fg);
  }
  .doc h1 { margin-block: 1rem 0.25rem; }
  .doc h2 { font-size: 1.25rem; margin-top: 1.5rem; }
  .doc p { color: var(--muted); max-width: 65ch; }
  .doc a { color: var(--fg); }
  .doc--center { align-content: center; justify-items: start; }
  .doc__lede { font-size: var(--fs-lead); }
  .doc .btn--light { color: var(--ink); }

  /* ---------- Scroll reveal (only when JS is running) ---------- */
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}

/* ---------- Utilities ---------- */
@layer utilities {
  .sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}

/* Reduced motion: everything readable in its final state. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}

@media print {
  .site-header, .work-preview, .marquee, .contact__marquee, .motion-toggle, .hero__scroll, .form { display: none !important; }
  .panel, .hero { background: #fff; color: #000; margin: 0; border-radius: 0; }
}
