/* ============================================================
   BUCKWALTER — UX Design & Strategy
   Implements the BDS > Homepage Figma mockups (Jul 2026)
   Fonts:  Mallory MP (display/body) · DM Mono (technical labels)
           Geist (about bio, micro-labels)
   Type ramp (desktop): Display 96/120 Light · Title 48/64 Light
           H1 32/48 Bold · H2 24/32 Bold · Body-L 24/36 Book
           Body 16/28 Book · Small 12/24 Book · Mono 14
   Palette: BDS primary/secondary/tertiary + slate chrome
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Mallory';
  src: url('../assets/fonts/MalloryMP-Light.woff2') format('woff2'),
       url('../assets/fonts/MalloryMP-Light.woff') format('woff');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Mallory';
  src: url('../assets/fonts/MalloryMP-LightItalic.woff2') format('woff2'),
       url('../assets/fonts/MalloryMP-LightItalic.woff') format('woff');
  font-weight: 300; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Mallory';
  src: url('../assets/fonts/MalloryMP-Book.woff2') format('woff2'),
       url('../assets/fonts/MalloryMP-Book.woff') format('woff');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Mallory';
  src: url('../assets/fonts/MalloryMP-BookItalic.woff2') format('woff2'),
       url('../assets/fonts/MalloryMP-BookItalic.woff') format('woff');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Mallory';
  src: url('../assets/fonts/MalloryMP-Medium.woff2') format('woff2'),
       url('../assets/fonts/MalloryMP-Medium.woff') format('woff');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Mallory';
  src: url('../assets/fonts/MalloryMP-Bold.woff2') format('woff2'),
       url('../assets/fonts/MalloryMP-Bold.woff') format('woff');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Mallory';
  src: url('../assets/fonts/MalloryMP-Black.woff2') format('woff2'),
       url('../assets/fonts/MalloryMP-Black.woff') format('woff');
  font-weight: 800; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* BDS primary (teal) */
  --primary-100: #EEF9F8;
  --primary-250: #A9DFDA;
  --primary-400: #71D5CB;
  --primary-500: #54BFB5;
  --primary-600: #30A69B;
  --primary-750: #264F5E;
  --primary-999: #172941;
  /* BDS secondary (pink/berry) */
  --secondary-100: #FCEBEF;
  --secondary-250: #EF99B0;
  --secondary-500: #E24771;
  --secondary-800: #73022D;
  --secondary-999: #32051A;
  /* BDS tertiary (blue) */
  --tertiary-100: #F7F9FF;
  --tertiary-300: #CADAF2;
  --tertiary-500: #7C97C0;
  --tertiary-600: #59749D;
  --tertiary-700: #41587C;
  --tertiary-800: #2B3E5D;
  --tertiary-900: #1B293F;
  /* BDS grey */
  --grey-100: #FAF8F8;
  --grey-250: #E9E3E3;
  --grey-400: #BEB6B6;
  --grey-500: #908787;
  --grey-900: #282526;
  /* slate chrome (technical surfaces, from mockups) */
  --slate-950: #020617;
  --slate-900: #0F172A;
  --slate-800: #1E293B;
  --slate-600: #475569;
  --slate-500: #64748B;
  --slate-400: #94A3B8;
  --slate-300: #CBD5E1;
  --slate-200: #E2E8F0;
  /* accent teals (labels/stats, from mockups) */
  --teal-500: #14B8A6;
  --teal-400: #2DD4BF;
  --teal-300: #5EEAD4;
  --badge-ink: #006A63;

  /* type */
  --font: 'Mallory', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-geist: 'Geist', 'Inter', system-ui, sans-serif;

  --t-display: clamp(2.5rem, 6.7vw, 6rem);      /* 96/120 */
  --t-title:   clamp(2rem, 3.4vw, 3rem);        /* 48/64  */
  --t-h1:      clamp(1.5rem, 2.3vw, 2rem);      /* 32/48  */
  --t-h2:      1.5rem;                          /* 24/32  */
  --t-body-lg: clamp(1.125rem, 1.7vw, 1.5rem);  /* 24/36  */
  --t-body-md: clamp(1rem, 1.4vw, 1.25rem);     /* 20/30  */

  --pad: clamp(1.5rem, 5.6vw, 5rem);            /* 80px at 1440 */
  --content-w: 1280px;
  /* inline padding that lands a full-bleed section's content on the same
     column as .wrap — use instead of --pad on any edge-to-edge band */
  --edge: max(var(--pad), calc(50% - var(--content-w) / 2 + var(--pad)));
  --card-gap: 32px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.75; /* 16/28 */
  background: var(--slate-950);
  color: var(--grey-100);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* film grain — every page is dark now.
   The viewBox and background-size are both load-bearing: without them
   WebKit rasterises the feTurbulence tile at its own scale and paints one
   opaque grey block over the header instead of repeating a 160px tile.
   inset:0 (not -50%) keeps the composited layer to one viewport rather
   than four. */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  background-repeat: repeat;
}
/* a full-viewport filtered layer is memory WebKit would rather spend on
   the page's actual images — and on a phone the texture is imperceptible */
@media (pointer: coarse), (max-width: 820px) {
  body::after { display: none; }
}

::selection { background: var(--secondary-500); color: var(--primary-999); }

a { color: inherit; text-decoration: none; }
/* ramp anchor scrolls where Lenis doesn't run (touch devices) */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
ul, ol { list-style: none; }
em { font-style: italic; }
img, svg, canvas, video { display: block; max-width: 100%; }

.wrap { max-width: var(--content-w); margin-inline: auto; padding-inline: var(--pad); }

/* ---------- WebGL paint field (home hero) ---------- */
.bg-canvas { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; }
main, .nav, .menu { position: relative; }
main { z-index: 1; }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--slate-950);
  display: grid; place-content: center; gap: 1.5rem;
  transition: opacity 0.7s var(--ease-out), visibility 0.7s;
}
.preloader__mark {
  width: clamp(64px, 10vw, 96px); aspect-ratio: 99 / 84;
  background: var(--primary-500);
  -webkit-mask: url('../assets/img/buckwalter_icon.svg') no-repeat center / contain;
          mask: url('../assets/img/buckwalter_icon.svg') no-repeat center / contain;
  margin-inline: auto;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.45; transform: scale(0.96); } }
.preloader__bar {
  width: clamp(140px, 22vw, 220px); height: 2px;
  background: rgba(250, 248, 248, 0.16); overflow: hidden; border-radius: 2px;
}
.preloader__bar span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--primary-500), var(--secondary-500));
}
body:not([data-loading]) .preloader { opacity: 0; visibility: hidden; }

/* ---------- Cursor ---------- */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; position: fixed; top: 0; left: 0; z-index: 150; pointer-events: none; }
  .cursor__dot {
    position: absolute; width: 6px; height: 6px; border-radius: 50%;
    background: var(--secondary-500); translate: -50% -50%;
  }
  .cursor__ring {
    position: absolute; width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid rgba(84, 191, 181, 0.8); translate: -50% -50%;
    transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out), opacity 0.25s;
  }
  .cursor.is-hover .cursor__ring { width: 56px; height: 56px; opacity: 0.5; }
}

/* ---------- Buttons (BDS) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font);
  background: var(--primary-500); color: var(--tertiary-900);
  border-radius: 12px; border: 0; cursor: pointer;
  font-weight: 800; font-size: 1rem; line-height: 1.75; /* Mallory Black 16/28 */
  padding: 20px 24px;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.btn--sm {
  font-weight: 700; font-size: 0.75rem; line-height: 2; /* Bold 12/24 */
  padding: 12px 16px;
}
.btn:hover {
  background: var(--primary-750); color: #fff;
  box-shadow: 0 0 0 2px rgba(48, 166, 155, 0.5);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  background: var(--primary-100); color: var(--badge-ink);
  font-size: 0.75rem; line-height: 2; font-weight: 400;
  text-transform: uppercase;
  padding: 4px 12px; border-radius: 9999px;
  white-space: nowrap;
}
.badge--blue { background: var(--tertiary-300); color: var(--tertiary-900); }

/* ---------- Section header (divider + mono eyebrow) ---------- */
.sec-head { display: flex; flex-direction: column; gap: 16px; }
.sec-head__rule { border-top: 1px solid var(--primary-400); }
.sec-head__row {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.875rem; line-height: normal;
  color: var(--primary-400);
}
.sec-head__num { text-transform: uppercase; }
.sec-head__note { margin-left: auto; }
.sec-head--muted .sec-head__rule { border-top-color: var(--grey-500); }
.sec-head--muted .sec-head__row { color: var(--grey-500); }

/* ---------- Orbit CTA (ring badge) ---------- */
.orbit {
  position: relative;
  width: 200px; height: 200px; flex-shrink: 0;
  display: grid; place-content: center; justify-items: center;
  gap: 10px; text-align: center;
}
.orbit__outer {
  position: absolute; inset: 9px; border-radius: 50%;
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid var(--primary-400);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: background 0.4s;
}
.orbit__middle {
  position: absolute; inset: 0; border-radius: 50%;
  border: 0.6px solid var(--primary-400);
  animation: orbit-spin 22s linear infinite;
}
.orbit__middle::before {
  content: ''; position: absolute; top: 50%; right: -5px;
  width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  background: var(--secondary-500);
}
@keyframes orbit-spin { to { transform: rotate(360deg); } }
.orbit__label {
  position: relative;
  font-weight: 700; font-size: 1rem; line-height: 1.5;
  text-transform: uppercase; color: #fff;
}
.orbit__icon {
  position: relative;
  width: 20px; height: 20px;
  background: var(--grey-100);
  transition: transform 0.4s var(--ease-out);
}
.orbit__icon--down {
  -webkit-mask: url('../assets/img/arrow-down.svg') no-repeat center / contain;
          mask: url('../assets/img/arrow-down.svg') no-repeat center / contain;
}
.orbit__icon--phone {
  -webkit-mask: url('../assets/img/phone.svg') no-repeat center / contain;
          mask: url('../assets/img/phone.svg') no-repeat center / contain;
}
.orbit:hover .orbit__outer { background: rgba(48, 166, 155, 0.65); }
.orbit:hover .orbit__icon--down { transform: translateY(4px); }
@media (max-width: 720px) {
  .orbit { width: 140px; height: 140px; }
  .orbit__outer { inset: 6px; }
  .orbit__label { font-size: 0.8125rem; line-height: 1.4; }
  /* section header: drop the note onto its own line instead of holding
     a second column (num + label on line 1, note wraps below, left-aligned) */
  .sec-head__row { flex-wrap: wrap; }
  .sec-head__note { flex-basis: 100%; margin-left: 0; }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 24px;
  /* inline padding tracks the .wrap container so nav content aligns with page content */
  padding: 24px max(var(--pad), calc(50% - var(--content-w) / 2 + var(--pad)));
  transition: background 0.4s, backdrop-filter 0.4s, box-shadow 0.4s, padding 0.4s;
}
.nav.is-scrolled {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding-block: 14px;
  box-shadow: 0 1px 0 rgba(113, 213, 203, 0.25);
}
.nav__logo {
  display: block; height: 39px; aspect-ratio: 454.7 / 95.75;
  background: var(--grey-100);
  -webkit-mask: url('../assets/img/buckwalter-01.svg') no-repeat left center / contain;
          mask: url('../assets/img/buckwalter-01.svg') no-repeat left center / contain;
  transition: background 0.3s;
}
.nav__brand { margin-right: auto; }
.nav__brand:hover .nav__logo { background: var(--primary-500); }
.nav__links { display: flex; align-items: center; gap: 24px; }
.nav__link {
  font-size: 1rem; line-height: 1.75; font-weight: 400;
  color: #fff;
  position: relative;
  transition: color 0.3s;
}
.nav__link::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--primary-400);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.nav__link:hover::after,
.nav__link[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav__burger { display: none; }

/* ---------- Mobile menu ---------- */
.menu {
  position: fixed; inset: 0; z-index: 95;
  background: linear-gradient(160deg, var(--secondary-999), var(--slate-950) 70%);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--pad);
  clip-path: circle(0% at calc(100% - 3rem) 2.5rem);
  transition: clip-path 0.7s var(--ease-out);
  visibility: hidden;
}
.menu.is-open { clip-path: circle(150% at calc(100% - 3rem) 2.5rem); visibility: visible; }
.menu__links { display: flex; flex-direction: column; gap: 0.5rem; }
.menu__link {
  font-size: clamp(2.4rem, 10vw, 3.6rem); font-weight: 300;
  line-height: 1.25; color: var(--grey-100);
}
.menu__link:nth-child(2n) { color: var(--primary-250); }
.menu__foot {
  margin-top: 3rem; color: var(--slate-400);
  font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase;
}

/* ============================================================
   HOME — HERO
   ============================================================ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden;
  padding: 120px var(--edge) 80px;
}
/* corner-darkening over the painting (218deg slate) + top strip for nav */
.hero__vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(rgba(15, 23, 42, 0.6), transparent 215px),
    linear-gradient(180deg, rgba(15, 23, 42, 0.65) 0%, rgba(15, 23, 42, 0.00) 29%, rgba(15, 23, 42, 0.65) 100%)
}
.hero__inner { position: relative; z-index: 2; }
.hero__title {
  font-size: var(--t-display);
  font-weight: 300; line-height: 1.333;
  color: var(--grey-100);
}
.hero__line { display: inline; }
/* berry highlight bars behind each line */
.hero__hl__top {
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
  background: rgba(115, 2, 45, 0.73);
  padding: 0.06em 0.3em 0em 0.16em;
  margin-left: -0.16em;
}
.hero__hl__bottom {
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
  background: rgba(115, 2, 45, 0.73);
  padding: 0em 0.22em 0.1em 0.16em;
  margin-left: -0.16em;
}
.hero__hl em { font-style: italic; }
.hero__bottom {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 2rem;
  margin-top: clamp(2rem, 2vh, 4.5rem);
}
.hero__sub {
  max-width: 30em;
  font-size: var(--t-body-lg); line-height: 1.6;
  color: #fff;
}
.hero__orbit {
    margin-top: -3rem;
    margin-right: clamp(0px, 2vw, 24px);
}

/* ============================================================
   MANIFESTO STRIP
   ============================================================ */
.manifesto {
  background: var(--slate-900);
  border-block: 1px solid var(--slate-800);
  padding: 60px var(--edge);
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  min-height: 240px;
  position: relative; z-index: 1;
}
.manifesto--textured {
  background: var(--slate-950) url('../assets/img/space-swirls.webp') center / cover no-repeat;
}
.manifesto__side {
  font-family: var(--font-geist); font-weight: 500;
  font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--slate-600);
  writing-mode: vertical-rl; rotate: 180deg;
  flex-shrink: 0;
}
.manifesto__quote {
  font-size: var(--t-body-lg); line-height: 1.5;
  color: #fff; text-align: center;
  max-width: 894px; margin-inline: auto;
}
.manifesto__attr {
  font-family: var(--font-geist); font-weight: 500;
  font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--teal-500);
  flex-shrink: 0;
}

/* ============================================================
   PROCESS (01. Approach)
   ============================================================ */
.process {
  position: relative;
  background: var(--slate-950) url('../assets/img/space-swirls.webp') center / cover no-repeat;
  padding: 132px 0;
  overflow: hidden;
}
.process__star {
  position: absolute; right: -4px; top: 67px;
  width: clamp(260px, 40vw, 578px);
  pointer-events: none;
  z-index: 0;
}
/* Baseline motion: a slow breathe, no rotation — spinning the burst
   swings its rectangular edge into view. Transforms live on the inner
   img so they never fight the GSAP scroll parallax (y) on the wrapper.
   js/star.js upgrades this to shader-driven flow wobble where WebGL is
   available. */
.process__star-img {
  display: block; width: 100%; height: auto;
  transform-origin: 63.5% 52%; /* the star's painted core */
  animation: star-breathe 7s ease-in-out infinite alternate;
}
@keyframes star-breathe { from { scale: 1; } to { scale: 1.04; } }
@media (prefers-reduced-motion: reduce) {
  .process__star-img { animation: none; }
}
/* --- WebGL upgrade (js/star.js) ---
   Sits exactly over the <img> it replaces: the shader maps the texture
   1:1 onto the canvas, so the bitmap's edge never comes into view. */
.process__star-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.process__star.is-live .process__star-img { visibility: hidden; animation: none; }
.process__inner { position: relative; z-index: 1; }
.process__statement {
  margin-top: 16px;
  font-size: var(--t-title); font-weight: 300; line-height: 1.34;
  color: #fff;
  max-width: 18em;
}
.process__statement em { font-style: normal; color: var(--secondary-500); }
.process__steps {
  margin-top: 96px;
  display: flex; flex-direction: column; gap: 64px;
  max-width: 776px;
}
.step { display: flex; gap: 48px; align-items: flex-start; }
.step__icon { width: 66px; height: 66px; flex-shrink: 0; margin-top: 4px; }
.step__fig {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.875rem; color: var(--primary-400);
}
.step__name {
  font-size: var(--t-h1); font-weight: 700; line-height: 1.5;
  color: #fff;
}
.step__desc {
  margin-top: 16px;
  font-size: 1rem; line-height: 1.75;
  color: var(--slate-400);
  max-width: 42em;
}
.process__orbit {
  position: absolute; right: var(--pad); bottom: 96px; z-index: 1;
}

/* ============================================================
   WORK GRID (02. Selected Work)
   ============================================================ */
.work {
  background: var(--slate-950);
  padding: 48px 0;
  position: relative; z-index: 1;
}
.work__grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--card-gap);
}
.work__more { margin-top: 48px; display: flex; justify-content: center; }

/* ---------- Portfolio card ---------- */
.pcard {
  position: relative;
  display: flex; flex-direction: column; justify-content: flex-end;
  border-radius: 8px; overflow: hidden;
  padding: 32px;
  grid-column: span 2;
  aspect-ratio: 624 / 408;
  isolation: isolate;
}
.pcard--tall { grid-row: span 2; aspect-ratio: 624 / 848; }
.pcard--wide { grid-column: span 4; aspect-ratio: 1280 / 578; }
.pcard__img {
  position: absolute; inset: 0; z-index: -3;
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  transform: scale(1.0);
  transition: transform 0.9s var(--ease-out);
}
.pcard:hover .pcard__img { transform: scale(1.03); }
/* default scrim — a tight foot so title + eyebrow read without shading
   the whole image (transparent through the top ~half, dark at the base) */
.pcard__scrim {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(2, 6, 23, 0) 42%,
    rgba(2, 6, 23, 0.5) 70%,
    rgba(2, 6, 23, 0.9) 100%);
}
/* hover overlay — expands the darkening upward as the meta reveals */
.pcard__overlay {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(2, 6, 23, 0) 8%,
    rgba(2, 6, 23, 0.55) 52%,
    #020617 100%);
  opacity: 0;
  transition: opacity 0.5s;
}
.pcard__content {
  display: flex; flex-direction: column; align-items: flex-start;
}
.pcard:hover .pcard__overlay,
.pcard:focus-visible .pcard__overlay { opacity: 1; }
.pcard__eyebrow {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.875rem; color: var(--teal-300);
}
.pcard__title {
  margin-top: 4px;
  font-size: var(--t-h2); font-weight: 700; line-height: 1.34;
  color: #fff;
}
/* desc + badges: collapsed to zero height, slide/fade up on hover and
   push the persistent title + eyebrow up (content is bottom-anchored) */
.pcard__reveal {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s var(--ease-out);
}
.pcard:hover .pcard__reveal,
.pcard:focus-visible .pcard__reveal { grid-template-rows: 1fr; }
.pcard__reveal-inner {
  overflow: hidden; min-height: 0;
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}
.pcard:hover .pcard__reveal-inner,
.pcard:focus-visible .pcard__reveal-inner { opacity: 1; transform: translateY(0); }
.pcard__desc {
  margin-top: 14px; /* gap below the title; collapses with the reveal */
  font-size: 0.75rem; line-height: 2;
  color: var(--slate-300);
  max-width: 56em;
}
.pcard__badges { display: flex; flex-wrap: wrap; gap: 8px; }
/* Touch devices have no real hover — but a tap still fires :hover, which
   made the reveal jump open mid-scroll and feel janky. Suppress the whole
   hover treatment on touch: cards stay at eyebrow + title and a tap just
   navigates to the case study. (:focus-visible still reveals for keyboard
   users on hybrid devices.) */
@media (hover: none) {
  .pcard:hover .pcard__img { transform: scale(1); }
  .pcard:hover .pcard__overlay { opacity: 0; }
  .pcard:hover .pcard__reveal { grid-template-rows: 0fr; }
  .pcard:hover .pcard__reveal-inner { opacity: 0; transform: translateY(10px); }
}

/* ============================================================
   CAPABILITIES (03.) — light section
   ============================================================ */
.caps {
  background: var(--slate-900);
  color: #fff;
  padding: 100px 0 80px;
  position: relative; z-index: 1;
}
.caps__list { margin-top: 64px; }
.cap {
  display: flex; align-items: center; gap: 32px;
  padding: 48px 0;
  border-bottom: 1px solid var(--slate-800);
}
.cap:last-child { border-bottom: 0; }
.cap__num {
  font-weight: 300; font-size: 2rem; line-height: 1;
  color: var(--primary-400);
  width: 2.8rem; flex-shrink: 0;
}
.cap__name {
  font-size: var(--t-h1); font-weight: 700; line-height: 1.5;
  color: #fff;
}
.cap__spacer { flex: 1; }
.cap__desc {
  font-size: 1rem; line-height: 1.75;
  color: var(--slate-300);
  text-align: right;
}

/* ============================================================
   ABOUT (04. Meet Joshua)
   ============================================================ */
.about {
  position: relative;
  background: var(--slate-950);
  padding: 120px 0;
  overflow: hidden;
  z-index: 1;
}
/* blurred teal bloom, top-left */
.about::before {
  content: ''; position: absolute;
  left: -260px; top: -260px; width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.3) 0%, rgba(20, 184, 166, 0.12) 50%, transparent 72%);
  filter: blur(60px);
  pointer-events: none;
}
.about__grid {
  display: grid; grid-template-columns: 420px minmax(0, 1fr);
  gap: 80px; align-items: center;
  position: relative;
}
.about__portrait {
  height: 460px; border-radius: 12px; overflow: hidden;
  background: var(--slate-800);
}
.about__portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.about__title {
  margin-top: 32px;
  font-size: var(--t-title); font-weight: 300; line-height: 1.34;
  color: #fff;
}
.about__bio {
  margin-top: 32px;
  font-family: var(--font-geist);
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem); line-height: 1.6;
  color: var(--slate-300);
  max-width: 40em;
}
.about__stats { margin-top: 32px; display: flex; gap: 48px; }
.stat__value {
  font-family: var(--font-geist); font-weight: 600;
  font-size: 1.5rem; line-height: 1.3;
  color: var(--teal-400);
}
.stat__label {
  font-family: var(--font-geist); font-weight: 500;
  font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--slate-500);
  margin-top: 4px;
}
.about__more { margin-top: 40px; display: inline-flex; }

/* ============================================================
   CONTACT + FOOTER
   ============================================================ */
.contact {
  position: relative;
  padding: 80px var(--edge);
  display: flex; flex-direction: column; align-items: center; gap: 32px;
  text-align: center;
  overflow: hidden;
  z-index: 1;
}
.contact::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--secondary-999) url('../assets/img/contact-paint.webp') center / cover no-repeat;
}
.contact::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(rgba(223, 51, 97, 0.15), rgba(50, 5, 26, 0.35));
}
.contact__mark {
  width: 71px; height: 84px;
  background: var(--grey-100);
  -webkit-mask: url('../assets/img/buckwalter_logo-alt.svg') no-repeat center / contain;
          mask: url('../assets/img/buckwalter_logo-alt.svg') no-repeat center / contain;
}
.contact__title {
  font-size: var(--t-display); font-weight: 300; line-height: 1.25;
  color: #fff;
}
.contact__kicker {
  font-weight: 700; font-size: 1rem; line-height: 1.5;
  color: var(--slate-300);
}
.footer {
  width: 100%; max-width: var(--content-w);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  padding-top: 40px; margin-top: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.75rem; text-transform: uppercase;
  color: var(--primary-500);
  text-align: left;
}
.footer__link { text-decoration: underline; text-underline-offset: 0.25em; transition: color 0.3s; }
.footer__link:hover { color: var(--primary-250); }
.footer__top { display: inline-flex; align-items: center; gap: 16px; color: var(--primary-500); }
.footer__top-icon {
  width: 14px; height: 14px;
  background: var(--primary-500);
  -webkit-mask: url('../assets/img/arrow-down.svg') no-repeat center / contain;
          mask: url('../assets/img/arrow-down.svg') no-repeat center / contain;
  rotate: 180deg;
}
.footer__top:hover { color: var(--primary-250); }
.footer__top:hover .footer__top-icon { background: var(--primary-250); }

/* footer-only variant for the contact page (no repeated CTA) */
.contact--slim { padding-top: 40px; }
.contact--slim .footer { margin-top: 0; }

/* ============================================================
   CONTACT PAGE — form
   ============================================================ */
.contact-page { position: relative; padding: 96px 0 140px; }
.contact-page__grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 64px var(--card-gap);
  align-items: start;
}
.contact-page__lede {
  font-size: 1rem; line-height: 1.75;
  color: var(--slate-300);
}
.contact-page__steps {
  margin-top: 40px;
  display: flex; flex-direction: column; gap: 24px;
}
.contact-page__step { display: flex; gap: 16px; align-items: baseline; }
.contact-page__step-num {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.875rem;
  color: var(--primary-400);
  flex-shrink: 0;
}
.contact-page__step p { color: var(--slate-300); font-size: 1rem; line-height: 1.75; }
.contact-page__step strong { display: block; color: var(--grey-100); font-weight: 700; }
.contact-page__kicker {
  margin-top: 40px;
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--primary-500);
}

.cform {
  position: relative;
  background: var(--slate-900);
  border: 1px solid var(--slate-800);
  border-radius: 12px;
  padding: clamp(28px, 4vw, 48px);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px var(--card-gap);
}
.cform__field { display: flex; flex-direction: column; gap: 8px; }
.cform__field--full { grid-column: 1 / -1; }
.cform__label {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--slate-400);
}
.cform__label abbr { color: var(--secondary-250); text-decoration: none; }
.cform__opt { color: var(--slate-500); text-transform: none; letter-spacing: normal; }
.cform__input {
  width: 100%;
  font-family: var(--font); font-size: 1rem; line-height: 1.5;
  color: var(--grey-100);
  background: var(--slate-950);
  border: 1px solid var(--slate-600);
  border-radius: 8px;
  padding: 14px 16px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.cform__input::placeholder { color: var(--slate-500); }
.cform__input:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(113, 213, 203, 0.22);
}
textarea.cform__input { min-height: 160px; resize: vertical; }
.cform__field.is-invalid .cform__input { border-color: var(--secondary-500); }
.cform__err {
  display: none;
  font-size: 0.75rem; line-height: 1.6;
  color: var(--secondary-250);
}
.cform__field.is-invalid .cform__err { display: block; }
.cform__foot {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.cform__status { font-size: 0.875rem; line-height: 1.6; color: var(--slate-400); }
.cform__status.is-error { color: var(--secondary-250); }
.cform.is-sending .btn { opacity: 0.6; pointer-events: none; }
/* honeypot — visually gone, still in the DOM for bots to find */
.cform__hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
/* success panel swaps in after the form */
.cform-done {
  background: var(--slate-900);
  border: 1px solid var(--primary-750);
  border-radius: 12px;
  padding: clamp(28px, 4vw, 48px);
  display: flex; flex-direction: column; gap: 12px;
}
.cform-done__title {
  font-size: var(--t-h1); font-weight: 700; line-height: 1.5;
  color: var(--primary-400);
}
.cform-done p { color: var(--slate-300); }

@media (max-width: 960px) {
  .contact-page__grid { grid-template-columns: 1fr; }
  .cform { grid-template-columns: 1fr; }
  .cform__field--full { grid-column: auto; }
  .cform__foot { grid-column: auto; }
}

/* ============================================================
   CASE STUDY (dark — 2026 fixed layout)
   ============================================================ */
.cs-page { position: relative; background: var(--slate-950); }

/* --- decorative parallax layers (Tertiary 600 art) ---
   Rules that keep these reading as texture rather than clutter:
   1. low opacity — they sit *under* the page, never compete with it
   2. always anchored past a viewport edge, so the browser frame crops
      them at any width (a deco floating free in the margin looks like
      a stray asset; a cropped one looks intentional)
   3. banded vertically on alternating sides so two never collide */
.deco { position: absolute; pointer-events: none; }
.deco--ghost { width: min(560px, 38vw); opacity: 0.35; }
.deco--grid { width: min(360px, 24vw); opacity: 0.25; }

/* --- case hero: featured image under a Secondary-900 fade --- */
.cs-hero { position: relative; padding-top: 150px; }
.cs-hero__bg {
  position: absolute; inset: 0 0 auto 0;
  height: clamp(430px, 55.4vw, 798px);
  z-index: 0; overflow: hidden; pointer-events: none;
}
.cs-hero__bg-img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
}
/* Secondary 900 @ 85% fading to the page background (per Figma) */
.cs-hero__bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(50, 5, 26, 0.85) 0%, var(--slate-950) 100%);
}
.cs-hero__head { position: relative; z-index: 2; padding-bottom: 120px; }
.cs-hero__title {
  position: relative; z-index: 2;
  font-size: var(--t-display); font-weight: 300; line-height: 1.333;
  color: #fff;
  max-width: 13em;
}
/* berry highlight bars — Secondary 600 @ 73% (per Figma) */
.cs-hero__title .hl {
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
  background: rgba(223, 51, 97, 0.73);
  padding: 0.06em 0.22em 0.1em 0.16em;
  margin-left: -0.16em;
}
/* multi-line highlights: JS (bdHl) splits the span per rendered line —
   separated by explicit <br> so the measured breaks hold — and the
   outward-only paddings make the translucent bars butt cleanly instead
   of overlapping into darker seams */
.cs-hero__title .hl--top, .page-head__title .hl--top { padding-top: 0.06em; padding-bottom: 0; white-space: nowrap; }
.cs-hero__title .hl--mid, .page-head__title .hl--mid { padding-top: 0; padding-bottom: 0; white-space: nowrap; }
.cs-hero__title .hl--bottom, .page-head__title .hl--bottom { padding-top: 0; padding-bottom: 0.1em; white-space: nowrap; }
.cs-hero__badges {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-top: 32px;
}
.cs-hero__tagline {
  position: relative; z-index: 2;
  margin-top: 32px;
  font-size: var(--t-body-lg); line-height: 1.5;
  color: #fff;
  max-width: 25.5em;
}
.cs-hero__orbit { position: absolute; right: var(--pad); bottom: 110px; z-index: 2; }

/* --- fixed body column --- */
.cs-body { position: relative; }
/* Full-bleed clipping layer. It breaks out of the 1280 column to span the
   viewport, then crops its own children with plain `overflow: hidden` —
   so the decos are cut by the frame without depending on `overflow: clip`
   (Safari 16+) further up the tree, and they can never widen the document. */
.cs-deco {
  position: absolute;
  top: -540px; bottom: 0;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
/* offsets are now relative to the viewport-wide layer, so a negative value
   is simply how far the art runs off that edge */
.cs-body__ghost1 { right: -150px; top: 1%; }
.cs-body__grid1  { left:  -130px; top: 28%; }
.cs-body__ghost2 { right: -190px; top: 55%; }
.cs-body__grid2  { left:  -110px; top: 80%; }

.cs-text { position: relative; z-index: 1; padding: 56px 0; }
.cs-text__col { position: relative; max-width: 640px; }
.cs-text p {
  font-size: 1rem; font-weight: 300; line-height: 1.75;
  color: #fff;
  margin-bottom: 20px;
}
.cs-text p:last-child { margin-bottom: 0; }
.cs-text h2, .cs-text h3, .cs-text h4 {
  font-size: var(--t-h2); font-weight: 700; line-height: 1.34;
  letter-spacing: -0.02em;
  color: var(--primary-400);
  margin: 44px 0 16px;
}
.cs-text h2:first-child, .cs-text h3:first-child { margin-top: 0; }
.cs-text a { color: var(--primary-400); text-decoration: underline; text-underline-offset: 0.2em; }
.cs-text a:hover { color: var(--primary-250); }
.cs-text strong { font-weight: 900; color: #fff; }
.cs-text ul, .cs-text ol {
  list-style: disc; padding-left: 1.3em; margin-bottom: 20px;
  font-weight: 300;
  color: #fff;
}
.cs-text ol { list-style: decimal; }
.cs-text li { margin-bottom: 8px; }
.cs-text li::marker { color: var(--primary-400); }
.cs-text blockquote {
  border-left: 2px solid var(--primary-500);
  padding-left: 1.4em; margin: 24px 0;
  color: var(--slate-300); font-style: italic;
}
.cs-text hr { border: 0; }

/* --- featured collage: contained to the column up to 1440, breaking
   outward past it, stacking full-width under 740 --- */
.cs-featured {
  position: relative; z-index: 1;
  display: grid;
  /* seam column creates the 13.4% overlap from the mockups */
  grid-template-columns: 54.8% 13.4% 31.8%;
  align-items: start;
  margin: 8px 0 24px;
}
.cs-featured__item {
  position: relative; margin: 0;
  border: 1px solid var(--tertiary-600);
  border-radius: 16px;
  overflow: hidden;
  background: var(--slate-900);
}
.cs-featured__item img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
}
.cs-featured__item--1 { grid-column: 1 / 3; grid-row: 1; margin-top: 8.7%; z-index: 1; }
.cs-featured__item--1 img { aspect-ratio: 873 / 610; }
.cs-featured__item--2 { grid-column: 2 / 4; grid-row: 1; z-index: 2; }
.cs-featured__item--2 img { aspect-ratio: 579 / 404; }
/* lone featured image spans the column */
.cs-featured__item--1:only-child { grid-column: 1 / 4; margin-top: 0; }
.cs-featured__item--1:only-child img { aspect-ratio: 1280 / 640; }
@media (min-width: 1441px) {
  .cs-featured {
    width: min(1496px, calc(100vw - 232px));
    margin-left: calc((var(--content-w) - 2 * var(--pad) - min(1496px, calc(100vw - 232px))) / 2);
  }
}

/* --- Body 2 + Results aside --- */
/* Body 2 — a stack of segments. A segment holding an aside (a graphic, a
   results box, or several) is a two-column grid: text left, aside right,
   top-aligned with the prose it annotates. Text-only segments keep the
   standard measure. Explicit grid-row placement lets the aside sit FIRST
   in the DOM, so when the phone stylesheet flattens a segment to a plain
   block, the aside reads above its paragraph — not after all the prose. */
.cs-seg { position: relative; }
.cs-seg .cs-text__col { max-width: 640px; }
.cs-seg--aside {
  display: grid;
  grid-template-columns: minmax(0, 624fr) minmax(0, 516fr);
  column-gap: clamp(48px, 9.7vw, 140px);
  align-items: start;
}
.cs-seg__text { grid-column: 1; grid-row: 1; }
.cs-seg__aside {
  grid-column: 2; grid-row: 1;
  display: flex; flex-direction: column; gap: 40px;
}
/* an aside with no text of its own still holds the right column */
.cs-seg__aside:only-child { grid-column: 2; }
/* supporting graphic — a diagram or detail that isn't part of the gallery.
   Deliberately unstyled: no rule, no padding, so the asset itself decides
   whether it reads as a bordered panel or a bare image. */
.cs-aside-fig {
  margin: 0;
}
.cs-aside-fig img { width: 100%; height: auto; }
.cs-aside-fig figcaption {
  margin-top: 16px;
  font-size: 0.75rem; line-height: 2; font-style: italic;
  color: var(--slate-300);
}
.cs-results {
  background: var(--slate-900);
  border-left: 1px solid var(--primary-500);
  padding: 32px 32px 24px;
}
.cs-results ul { list-style: disc; padding-left: 1.2em; }
.cs-results li {
  font-style: italic;
  font-size: var(--t-body-md); line-height: 1.5;
  color: var(--primary-400);
  margin-bottom: 32px;
}
.cs-results li:last-child { margin-bottom: 0; }
/* the box takes any markdown now, so paragraphs match the list voice */
.cs-results p {
  font-style: italic;
  font-size: var(--t-body-md); line-height: 1.5;
  color: var(--primary-400);
  margin-bottom: 16px;
}
.cs-results p:last-child { margin-bottom: 0; }
.cs-results li::marker { color: var(--primary-400); }

/* --- manifesto band (full-bleed image + berry/dark overlay) --- */
.cs-callout {
  position: relative; isolation: isolate;
  margin-top: 48px;
  padding: 80px var(--edge);
  min-height: 280px;
  display: flex; align-items: center; justify-content: center; gap: 2rem;
}
.cs-callout::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(rgba(223, 51, 97, 0.22), rgba(50, 5, 26, 0.25)),
    linear-gradient(rgba(2, 6, 23, 0.84), rgba(2, 6, 23, 0.84)),
    var(--slate-950) url('../assets/img/space-swirls.webp') center / cover no-repeat;
}
.cs-callout .manifesto__quote { color: #fff; max-width: 894px; text-align: center; }

/* --- gallery --- */
.cs-gallery {
  position: relative; z-index: 1;
  padding: 96px 0 100px;
  scroll-margin-top: 40px;
}
.cs-gallery__inner {
  max-width: var(--content-w);
  margin-inline: auto;
  padding-inline: var(--pad);
}
/* past 1440 the gallery breaks the grid too (80px margins at 1728) */
@media (min-width: 1441px) {
  .cs-gallery__inner { max-width: 1728px; padding-inline: 80px; }
}
.cs-gallery__title {
  font-size: var(--t-h2); font-weight: 700; line-height: 1.34;
  color: #fff;
  margin-bottom: 48px;
}
.cs-gallery__grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--card-gap);
  /* backfill: a hinted std followed by a wide would otherwise strand half
     a row, so let later items slot into gaps they fit rather than leaving
     holes in the masonry */
  grid-auto-flow: dense;
}
/* row layout: equal-width strip (phone-shot galleries) */
.cs-gallery__grid--row { display: flex; align-items: flex-start; }
.cs-gallery__grid--row .cs-grid__item { flex: 1 1 0; min-width: 0; }
.cs-gallery__grid--row .cs-grid__item img,
.cs-gallery__grid--row .cs-grid__item video { height: auto; aspect-ratio: auto; }

/* --- gallery tiles --- */
.cs-grid__item {
  position: relative; z-index: 1;
  border-radius: 16px; overflow: hidden;
  background: var(--slate-900);
  border: 1px solid var(--tertiary-500);
  grid-column: span 2;
}
.cs-grid__item img, .cs-grid__item video { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.cs-grid__item--tall { grid-row: span 2; }
.cs-grid__item--wide { grid-column: span 4; }
.cs-grid__item--tall img { aspect-ratio: 624 / 848; }
.cs-grid__item--std img, .cs-grid__item--std video { aspect-ratio: 624 / 408; }
.cs-grid__item--wide img, .cs-grid__item--wide video { aspect-ratio: 1280 / 578; }
/* captions reveal on hover over a dark gradient */
.cs-grid__caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 48px 32px 24px;
  font-size: 0.75rem; line-height: 2;
  color: var(--slate-300);
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.92) 85%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.cs-grid__item:hover .cs-grid__caption,
.cs-featured__item:hover .cs-grid__caption { opacity: 1; }
@media (hover: none) {
  .cs-grid__caption { opacity: 1; }
}

/* --- embeds --- */
.cs-embed {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 8px;
}
.cs-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* --- pagination --- */
.cs-pager {
  position: relative; z-index: 2;
  background: var(--slate-900);
  border-block: 1px solid var(--slate-800);
  padding: 96px max(var(--pad), calc(50% - var(--content-w) / 2 + var(--pad)));
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.cs-pager a {
  display: inline-flex; align-items: center; gap: 16px;
  font-size: var(--t-body-lg); line-height: 1.5;
  color: var(--primary-500);
  transition: color 0.3s;
}
.cs-pager a:hover { color: var(--primary-250); }
.cs-pager__icon {
  width: 48px; height: 48px; flex-shrink: 0;
  background: var(--primary-500);
  transition: background 0.3s, transform 0.3s var(--ease-out);
}
.cs-pager a:hover .cs-pager__icon { background: var(--primary-250); }
.cs-pager__icon--left {
  -webkit-mask: url('../assets/img/arrow-left.svg') no-repeat center / contain;
          mask: url('../assets/img/arrow-left.svg') no-repeat center / contain;
}
.cs-pager a:hover .cs-pager__icon--left { transform: translateX(-4px); }
.cs-pager__icon--right {
  -webkit-mask: url('../assets/img/arrow-right.svg') no-repeat center / contain;
          mask: url('../assets/img/arrow-right.svg') no-repeat center / contain;
}
.cs-pager a:hover .cs-pager__icon--right { transform: translateX(4px); }

.cs-error {
  position: relative; z-index: 2;
  text-align: center; padding: 6rem 0; font-size: var(--t-body-lg);
  color: var(--slate-400);
}
.cs-error a { color: var(--primary-400); text-decoration: underline; }

/* ============================================================
   SUBPAGE HERO (work / about)
   ============================================================ */
.page-head { padding-top: 150px; position: relative; z-index: 2; }
.page-head__title {
  margin-top: 64px;
  font-size: var(--t-display); font-weight: 300; line-height: 1.25;
  color: var(--grey-100);
}
.page-head__title .hl {
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
  background: rgba(115, 2, 45, 0.73);
  padding: 0.06em 0.22em 0.1em 0.16em;
  margin-left: -0.16em;
}
.page-head__sub {
  margin-top: 54px;
  font-size: var(--t-body-lg); line-height: 1.5;
  color: var(--slate-300);
  max-width: 29.5em;
}

/* about page facts */
.facts { margin-top: 48px; border-top: 1px solid var(--slate-800); max-width: 760px; }
.facts li {
  display: grid; grid-template-columns: minmax(8rem, auto) 1fr; gap: 24px;
  padding: 20px 0; border-bottom: 1px solid var(--slate-800);
  align-items: baseline;
}
.facts__when {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.875rem; text-transform: uppercase;
  color: var(--primary-400);
}
.facts__what { font-size: 1rem; line-height: 1.75; color: var(--slate-300); }

/* ---------- Reveal defaults (JS enhances) ---------- */
[data-reveal] { opacity: 0; transform: translateY(36px); }
.no-js [data-reveal], .reduced-motion [data-reveal] { opacity: 1; transform: none; }
.pcard, .cs-grid__item { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.pcard.is-in, .cs-grid__item.is-in,
.reduced-motion .pcard, .reduced-motion .cs-grid__item,
.no-io .pcard, .no-io .cs-grid__item { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .work__grid { grid-template-columns: 1fr; }
  .cs-gallery__grid { grid-template-columns: 1fr; }
  .pcard, .pcard--tall, .pcard--wide { grid-column: span 1; grid-row: span 1; aspect-ratio: 4 / 5; }
  .pcard--wide { aspect-ratio: 4 / 3; }
  .cs-grid__item, .cs-grid__item--tall, .cs-grid__item--wide { grid-column: span 1; grid-row: span 1; }
  .cs-grid__item--tall img { aspect-ratio: auto; }
  .cs-grid__item--std img, .cs-grid__item--wide img { aspect-ratio: auto; }
  .cs-gallery__grid--row { flex-wrap: wrap; }
  .cs-gallery__grid--row .cs-grid__item { flex: 1 1 calc(50% - var(--card-gap)); }
  /* flatten aside segments: the aside is first in the DOM, so block flow
     puts it above the paragraph it annotates */
  .cs-seg--aside { display: block; }
  .cs-seg--aside .cs-seg__aside { margin: 40px 0; }
  .about__grid { grid-template-columns: 1fr; gap: 40px; }
  .about__portrait { order: 2; max-width: 420px; }
  .cap { flex-wrap: wrap; gap: 12px 24px; padding: 32px 0; }
  .cap__spacer { display: none; }
  .cap__desc { width: 100%; text-align: left; }
  .manifesto, .cs-callout { flex-direction: column; gap: 1.5rem; padding-block: 40px; }
  .manifesto__side { writing-mode: horizontal-tb; rotate: none; }
  .process__star { opacity: 0.5; }
  .process__orbit { position: relative; right: auto; bottom: auto; margin: 64px var(--pad) 0 auto; }
  /* Pair Previous/Next on one row with "Back to all" beneath, instead of
     three left-aligned rows leaving the middle link stranded. Icons come
     down from 48px, which is desktop-scale and overbearing on a phone. */
  .cs-pager {
    flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 28px 16px; padding-block: 48px;
  }
  .cs-pager a { font-size: 1rem; gap: 12px; }
  .cs-pager a[rel="prev"] { order: 1; }
  .cs-pager a[rel="next"] { order: 2; }
  .cs-pager a:not([rel]) { order: 3; flex-basis: 100%; }
  .cs-pager__icon { width: 32px; height: 32px; }
}

@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav__burger {
    display: grid; gap: 7px;
    width: 44px; height: 44px; place-content: center;
    background: none; border: 1px solid rgba(250, 248, 248, 0.3); border-radius: 50%;
    cursor: pointer; z-index: 110; position: relative;
  }
  .nav__burger span {
    display: block; width: 18px; height: 2px;
    background: var(--grey-100);
    transition: transform 0.35s var(--ease-out);
  }
  .nav__burger[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
  .nav__burger[aria-expanded="true"] span:last-child { transform: translateY(-4.5px) rotate(-45deg); }
  .nav__logo { height: 32px; }

  .hero { padding-top: 110px; }
  .hero__bottom { flex-direction: column; align-items: flex-start; gap: 2.5rem; }
  .hero__orbit { /*align-self: flex-end;*/ margin-top:0.25em;}
  .step { gap: 20px; }
  .step__icon { width: 48px; height:48px; }
  .about__stats { gap: 32px; flex-wrap: wrap; }
  .footer { flex-direction: column; gap: 1.25rem; align-items: flex-start; }
  .cs-hero__head { padding-bottom: 96px; }
  .cs-hero__orbit { position: relative; right: auto; bottom: auto; margin: 3em 0 0; }
  /* featured images stack and go full width on mobile */
  .cs-featured { display: block; }
  .cs-featured__item--1 { margin-top: 0; }
  .cs-featured__item--1, .cs-featured__item--2 { margin-bottom: 20px; }
  .cs-gallery__grid--row .cs-grid__item { flex-basis: 100%; }
  /* Drop the decorative layer on phones. flow-path decodes to ~2.3MB and
     renders twice per case study, plus each one is a parallax compositing
     layer — 5MB+ of memory for texture that's barely legible at this width,
     and memory pressure is what makes WebKit evict the logo and icons. */
  .cs-deco { display: none; }
}

/* ---------- Lightbox ---------- */
html.lb-lock, html.lb-lock body { overflow: hidden; }

.cs-grid__item img, .cs-featured__item img { cursor: zoom-in;  }
.cs-grid__item img:focus-visible, .cs-featured__item img:focus-visible { outline: 2px solid var(--primary-400); outline-offset: -2px; }

/* the class rule below would otherwise beat the UA's [hidden] display:none,
   leaving an invisible click-eating overlay after close */
.lb[hidden] { display: none; }

.lb {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 23, 0.94);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  overscroll-behavior: contain;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}
.lb.is-open { opacity: 1; }

.lb__stage {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  max-width: min(1280px, calc(100vw - 176px));
  max-height: 100vh;
  padding: 48px 0;
}
.lb__img {
  max-width: 100%; max-height: min(82vh, 848px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  opacity: 1;
  transition: opacity 0.2s ease;
  cursor: default;
}
.lb__img.is-loading { opacity: 0; }
.lb__caption {
  font-family: var(--font-mono);
  font-size: 0.75rem; line-height: 1.6; letter-spacing: 0.04em;
  color: var(--slate-400);
  text-align: center;
  max-width: 56ch;
}

.lb__close {
  position: absolute; top: 28px; right: 28px;
  width: 44px; height: 44px;
  border: 1px solid var(--slate-600); border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.25s ease;
}
.lb__close::before, .lb__close::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 16px; height: 1.5px;
  background: var(--slate-300);
  transition: background 0.25s ease;
}
.lb__close::before { transform: translate(-50%, -50%) rotate(45deg); }
.lb__close::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.lb__close:hover { border-color: var(--primary-400); }
.lb__close:hover::before, .lb__close:hover::after { background: var(--primary-400); }

.lb__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 56px; height: 56px;
  border: 1px solid var(--slate-600); border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.25s ease;
}
.lb__arrow--prev { left: 28px; }
.lb__arrow--next { right: 28px; }
.lb__arrow-icon {
  display: block; width: 22px; height: 22px; margin: 0 auto;
  background: var(--slate-300);
  transition: background 0.25s ease, transform 0.25s var(--ease-out);
}
.lb__arrow-icon--left {
  -webkit-mask: url('../assets/img/arrow-left.svg') no-repeat center / contain;
          mask: url('../assets/img/arrow-left.svg') no-repeat center / contain;
}
.lb__arrow-icon--right {
  -webkit-mask: url('../assets/img/arrow-right.svg') no-repeat center / contain;
          mask: url('../assets/img/arrow-right.svg') no-repeat center / contain;
}
.lb__arrow:hover { border-color: var(--primary-400); }
.lb__arrow:hover .lb__arrow-icon { background: var(--primary-400); }
.lb__arrow--prev:hover .lb__arrow-icon { transform: translateX(-3px); }
.lb__arrow--next:hover .lb__arrow-icon { transform: translateX(3px); }

.lb__count {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.75rem; letter-spacing: 0.12em;
  color: var(--slate-400);
}

@media (max-width: 720px) {
  .lb__stage { max-width: calc(100vw - 32px); padding: 72px 0 88px; }
  .lb__img { max-height: 72vh; }
  .lb__close { top: 16px; right: 16px; }
  .lb__arrow { width: 44px; height: 44px; top: auto; bottom: 20px; transform: none; }
  .lb__arrow-icon { width: 18px; height: 18px; }
  .lb__arrow--prev { left: 16px; }
  .lb__arrow--next { right: 16px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  html { scroll-behavior: auto; }
  [data-reveal], .hero__line, [data-hero-fade], .pcard, .cs-grid__item { opacity: 1 !important; transform: none !important; }
  [data-parallax] { transform: none !important; }
  .lb { transition: none; }
}
