/* Font Faces */
/* Plantin and Neue Haas Grotesk Text are loaded via Adobe Fonts (Typekit
   kit hex4hmw) — see baseof.html <head>. Commercial/CDN-delivered
   typefaces served under an Adobe Fonts subscription; the kit link only
   permits linking, not self-hosting the woff2 binaries, so neither is
   vendored here.
   Live in the kit today: plantin (400/700 + italics — no 600/Semibold),
   neue-haas-grotesk-text (400/700 + italics — no 500/Medium).
   Weight snap: the type scale below calls for Plantin 600 on page/section
   titles. The kit has no 600, so those snap to 700 (nearest real cut) —
   flagged inline at each declaration. Every other weight used (Plantin
   400/700, NHG Text 400/700) is a real shipped cut with no snapping
   needed. font-synthesis: none stays set globally so a genuinely missing
   cut would fail visibly instead of being faked. */
@font-face {
  font-family: 'HomeVideo';
  src: url('/fonts/HomeVideo-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Metric-adjusted fallbacks, sized/positioned to match the real kit faces so
   the swap on load causes minimal layout shift. Values measured by
   temporarily inspecting the live Typekit woff2 binaries' font tables
   (never stored/self-hosted — deleted immediately after reading metrics)
   against the local system faces they stand in for. */
@font-face {
  font-family: 'Plantin Fallback';
  src: local('Georgia'), local('Times New Roman');
  size-adjust: 120.02%;
  ascent-override: 75.91%;
  descent-override: 20.83%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'NHG Text Fallback';
  src: local('Arial'), local('Helvetica');
  size-adjust: 128.23%;
  ascent-override: 76.27%;
  descent-override: 19.11%;
  line-gap-override: 0%;
}

/* Design Tokens */
:root {
  /* Brand colors (unchanged) */
  --color-ink: #000;
  --color-bg: #fff;
  --color-muted: #737378;
  --color-muted-soft: #6f6f6f;
  --color-accent: #F54F00;
  --color-surface: #f5f5f5;
  --color-surface-2: #ececec;
  --color-hairline: #ebebeb;
  --color-pill-bg: #F2F2F2;
  --color-pill-border: #E0E0E0;
  color-scheme: light;

  /* Type families.
     --font-heading ("plantin") carries page/section/sub-headings, the
     lead/intro paragraph, navigation, and the wordmark.
     --font-body ("neue-haas-grotesk-text") carries body copy, small/meta
     text (dates, table labels, eyebrows), and captions.
     Note the split does NOT follow "headings vs paragraphs" — the lead
     paragraph is Plantin (heading family) and small/meta/caption text is
     NHG Text (body family), matching the two roles as specified rather
     than a serif/sans-by-tag-type assumption. */
  --font-heading: 'plantin', 'Plantin Fallback', Georgia, 'Times New Roman', serif;
  --font-body: 'neue-haas-grotesk-text', 'NHG Text Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;

  /* Type scale — explicit rem values (unchanged from the previous pass;
     only the families/weights mapped onto it changed).
     --text-small: shared size for NHG Text labels/meta/captions AND
     Plantin navigation (same size, different family per role).
     --text-body: NHG Text — body & long-form.
     --text-prose: NHG Text — shared running-text size for page body copy
     (About bio, Colophon, project descriptions — see .prose below).
     --text-lead: Plantin — lead/intro paragraph.
     --text-h3/h2/h1: Plantin — heading sizes; h1 is fluid via clamp(). */
  --text-small: 1rem;        /* 16px — nav, labels, captions, meta */
  --text-body: 1.25rem;      /* 20px — body & long-form */
  --text-prose: 1.135rem;    /* ~18px — shared running-text size (see .prose) */
  --text-lead: 1.75rem;      /* 28px — lead/intro paragraph */
  --text-h3: 1.5rem;         /* 24px — sub-heading */
  --text-h2: 1.75rem;        /* 28px — section heading */
  --text-h1: clamp(2rem, 1.8rem + 0.9vw, 2.5rem); /* 32px -> 40px — page title */

  /* Layout */
  --container-max: 1280px;
  --gutter: clamp(20px, 5vw, 56px);
  /* Hero/navbar horizontal padding — alignment reference for the hero section */
  --hero-pad: clamp(24px, 4vw, 48px);

  /* Spacing scale (8px rhythm) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* Media corner rounding — kept subtle so it reads as a soft edge, not a pill */
  --radius-card: 4px;

  /* Section top space (responsive editorial breathing room) */
  --section-top: clamp(96px, 16vh, 200px);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.4s;

  /* Focus ring */
  --focus-ring: 2px solid var(--color-accent);
}

/* Dark theme — toggled via [data-theme] on <html>, set before first paint
   (see the inline script at the top of baseof.html) so there's no flash of
   the wrong theme. Every other rule in this file reads color through the
   tokens above, so overriding them here is the whole theme: no rule below
   needs a [data-theme="dark"] variant of its own, with the sole exception
   of the client-logo marquee, which needs an extra invert (see .marquee__logo
   below) since those logos are authored dark-on-transparent for a light page.
   --color-accent is intentionally unchanged: #F54F00 already reads better
   against this dark background than it did against white (more contrast
   headroom on dark, not less), so the brand color stays identical in both
   themes rather than needing its own dark variant. */
:root[data-theme="dark"] {
  --color-ink: #f2f0ec;
  --color-bg: #0e0e0e;
  --color-muted: #a3a3a3;
  --color-muted-soft: #949494;
  --color-surface: #1a1a1a;
  --color-surface-2: #242424;
  --color-hairline: #2a2a2a;
  --color-pill-bg: #1c1c1c;
  --color-pill-border: #333333;
  color-scheme: dark;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* auto so Lenis smooth scroll doesn't conflict with native smooth scroll */
  scroll-behavior: auto;
}

body {
  font-family: var(--font-heading);
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.4;
  color: var(--color-ink);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
video {
  max-width: 100%;
}

/* Selection — brand-tinted instead of default browser blue. A light accent
   tint with the normal ink foreground keeps text contrast effectively
   unchanged (unlike white-on-accent, which only reaches ~3.5:1). */
::selection {
  background: rgba(245, 79, 0, 0.22);
  color: var(--color-ink);
}

::-moz-selection {
  background: rgba(245, 79, 0, 0.22);
  color: var(--color-ink);
}

/* Accessible focus states */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
  border-radius: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translate(-50%, -150%);
  z-index: 1000;
  background: var(--color-ink);
  color: var(--color-bg);
  padding: 10px 18px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  text-decoration: none;
  transition: transform 0.2s var(--ease-out);
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

/* Layout — full-width, no max-width container.
   Side inset uses --hero-pad (the same responsive clamp the header, hero,
   and About page's .info-inset use) instead of a flat 24px — .container
   is the shared class behind the homepage work grid, Playground, Colophon,
   projects, gear/stack, and the footer, so this is the one place to fix
   the edge alignment across all of them at once. */
.container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-left: var(--hero-pad);
  padding-right: var(--hero-pad);
}

/* Reduced motion: honour user preference */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .portfolio-item:hover,
  .work-card:hover {
    transform: none !important;
  }
}

/* Header / navbar — full-width, pinned to top, name left + links right */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: var(--space-3);
  width: 100%;
  /* Lowered ~64px from the top at rest (40px offset + 24px padding); the offset
     scrolls away so the bar stays compact when pinned. */
  margin-top: 40px;
  padding: var(--space-5) var(--hero-pad);
  background: var(--color-bg);
}

.site-name {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  /* Wordmark: Plantin Bold, the heaviest cut Plantin ships — a real
     loaded weight, not a snap. */
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  text-decoration: none;
  text-wrap: balance;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.nav a {
  text-decoration: none;
  color: var(--color-ink);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-small);
  line-height: 1.25;
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a.is-active,
.nav a[aria-current="page"] {
  color: var(--color-accent);
}

/* Light/dark toggle — sits beside the last nav link. Both icons are always
   in the markup; CSS shows only the one for the mode a click will switch TO. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: var(--color-ink);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--color-accent);
}

/* In dark mode the toggle reads pure white (not the warm off-white ink),
   so it sits brighter against the dark bar. Hover stays accent in both
   modes — the dark-mode hover rule is spelled out so it outranks the
   white base rule above it. */
:root[data-theme="dark"] .theme-toggle {
  color: #fff;
}

:root[data-theme="dark"] .theme-toggle:hover {
  color: var(--color-accent);
}

.theme-toggle__icon {
  display: block;
}

/* Typography */
/* Body text in paragraphs - use Neue Haas Grotesk Text, except for
   paragraphs starting with <strong> */
p {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.5;
  margin: 1.25em 0;
  text-wrap: pretty;
}

p:first-child {
  margin-top: 0;
}

/* Exclude paragraphs that start with <strong> from NHG Text */
p:has(> strong:first-child) {
  font-family: var(--font-heading);
}

/* Real bold emphasis in body copy: NHG Text has its own 700 (Bold) cut, a
   real shipped weight, so this only needs a weight bump, no family switch.
   font-synthesis: none means a genuinely missing cut would fail visibly
   rather than fake bold — not a concern here since 700 is loaded. No
   content currently uses inline bold in body copy — this is a forward
   guard, not a live fix; the paragraph-starts-with-strong callout above is
   a separate pattern and is excluded so it keeps switching to Plantin as
   designed. */
p:not(:has(> strong:first-child)) strong,
p:not(:has(> strong:first-child)) b,
.info-body strong, .info-body b,
.masthead-text strong, .masthead-text b,
.body-content strong, .body-content b,
.project-description strong, .project-description b,
.project-additional-content strong, .project-additional-content b,
.info-list strong, .info-list b {
  font-weight: 700;
}

.hero-title {
  font-size: var(--text-h1);
  font-weight: 700; /* target: 600 (Semibold) — not in the kit; snapped to nearest real cut */
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.section-title {
  font-size: var(--text-h2);
  font-weight: 700; /* target: 600 (Semibold) — not in the kit; snapped to nearest real cut */
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  text-wrap: balance;
}

.hero-description {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.25;
  max-width: 300px;
  margin-bottom: var(--space-4);
  color: var(--color-muted);
}

/* Hero Section — description in the lower-left, logo marquee below it */
.hero {
  display: flex;
  flex-direction: column;
  padding: 0;
  text-align: left;
}

/* Description offset ~30vh + navbar ≈ ~37vh from the top. The -40px cancels the
   navbar's new top offset so the description/marquee stay exactly where they were. */
.hero__body {
  padding: calc(30vh - 40px) var(--hero-pad) 0;
}

.hero__desc {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 4.5vw, 2.5rem);
  font-weight: 700; /* target: 600 (Semibold) — not in the kit; snapped to nearest real cut */
  line-height: 1.2;
  letter-spacing: -0.015em;
  /* No narrow cap — the forced <br> breaks define the wrap, keeping wide screens
     from re-wrapping the three lines into fewer/arbitrary lines. text-wrap:
     balance is intentionally omitted here — it would fight the manual
     desc-break <br> placement that already defines the three-line shape.
     pretty is safe alongside those hard breaks (it only tunes orphan
     avoidance within a wrapped segment) and is what actually matters once
     the breaks are hidden on mobile and the text reflows for real. */
  text-wrap: pretty;
  max-width: none;
  width: fit-content;
  margin: 0;
  /* The signature moment: a single wipe reveal on load, like a cut clearing
     frame — the one deliberate animation on the page. width: fit-content
     above makes the clip-path track the text's own bounds rather than the
     full flex column, so the wipe travels across the statement, not empty
     space. prefers-reduced-motion is handled by the existing global rule
     that collapses all animation-duration to ~0, landing instantly at the
     fully-revealed end state. */
  animation: hero-wipe 0.9s var(--ease-out) both;
}

@keyframes hero-wipe {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

.hero__desc-lead { color: var(--color-ink); }      /* near-black opening phrase */
.hero__desc-rest { color: var(--color-muted); }    /* light gray remainder */

/* Forced desktop line breaks; on mobile, drop them so the text reflows naturally */
@media (max-width: 810px) {
  .hero__desc .desc-break { display: none; }
}

/* Projects "All work" intro: description + marquee placed above the list */
.work-page__intro {
  padding: 0 var(--hero-pad);
}
.work-page__list {
  margin-top: var(--space-9);
}

/* Client logo marquee — edge fade (mask) so logos don't reach the viewport edges.
   The mask is visual only; it does not affect the measured group width / loop reset. */
.marquee {
  /* Bound to the content column (page inset), then fade the ends inside that band
     so logos fade out near the inset instead of hard-cutting. The mask is visual
     only — it doesn't affect the measured group width / loop reset. */
  --marquee-fade: clamp(24px, 4vw, 80px);
  overflow: hidden;
  margin: clamp(28px, 6vh, 72px) var(--hero-pad) 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--marquee-fade), #000 calc(100% - var(--marquee-fade)), transparent);
          mask-image: linear-gradient(to right, transparent, #000 var(--marquee-fade), #000 calc(100% - var(--marquee-fade)), transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.marquee__group {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.marquee__logo {
  height: 88px;
  width: auto;
  margin: 0 clamp(20px, 2.5vw, 40px);
  flex: 0 0 auto;
  filter: grayscale(1);
  opacity: 0.45;
}

/* Logos are authored dark-mark-on-transparent for a light page; on the dark
   theme an extra invert turns them light-on-transparent instead of having
   them disappear into the dark background. */
:root[data-theme="dark"] .marquee__logo {
  filter: grayscale(1) invert(1);
}

@media (max-width: 810px) {
  .hero__body {
    padding-top: clamp(24px, 8vh, 64px);
  }
  .hero__desc {
    max-width: 88vw;
  }
  .header {
    margin-top: 16px;            /* ~32px offset (16px + 16px padding) on mobile */
    padding-block: var(--space-4);
  }
  .nav {
    gap: var(--space-3);
  }
  .nav a {
    padding: 8px 2px;          /* larger touch target */
    white-space: nowrap;
  }
  .marquee {
    margin-top: clamp(20px, 5vh, 48px);
  }
  .marquee__logo {
    height: 64px;
    margin: 0 clamp(14px, 3.5vw, 24px);
  }
}

@media (max-width: 480px) {
  .nav {
    gap: var(--space-2);
  }
}

/* Home work section — generous vertical rhythm between sections */
.work {
  padding: 110px 0 200px;
}

/* ===== Work: heads, grids, cards, controls ===== */

/* Homepage "Selected Work" head */
.work-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.work-head .section-title {
  margin-bottom: 0;
}

.work-head__all {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s var(--ease-out);
}

.work-head__all:hover {
  color: var(--color-accent);
}

.work-head__arrow {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  transition: transform 0.2s var(--ease-out);
}

.work-head__all:hover .work-head__arrow {
  transform: translateX(2px);
}

/* Projects page wrapper */
.work-page {
  padding: var(--section-top) 0;
}

.work-page__title {
  margin-bottom: var(--space-6);
}

/* Featured grid (homepage) — 4 columns of 16:9 thumbnails, matching /works. */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: var(--space-4);
  row-gap: var(--space-6);
  margin-bottom: var(--space-10);
}

/* Projects grid — 4 columns of 16:9 thumbnails; even gutters, roomy rows. */
.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: var(--space-4);
  row-gap: var(--space-6);
}

/* Card — image on top, label below; sits directly on the page */
.work-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.work-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--color-surface);
  overflow: hidden;
  border-radius: var(--radius-card);
}

.work-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(1);
  transition: filter 0.4s var(--ease-out);
}

/* Video facade — poster + play button, swaps to iframe on click */
.video-facade {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  overflow: hidden;
  background-color: var(--color-surface);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-card);
}

.video-facade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0) 45%);
  opacity: 0;
  transition: opacity var(--duration) var(--ease-out);
  pointer-events: none;
}

.video-facade__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  backdrop-filter: blur(2px);
  transition: background-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
  z-index: 1;
}

.video-facade__play svg {
  margin-left: 3px;
}

@media (hover: hover) {
  .video-facade:hover .video-facade__play,
  .video-facade:focus-visible .video-facade__play {
    background-color: var(--color-accent);
    transform: scale(1.06);
  }
  .video-facade:hover::after {
    opacity: 1;
  }
}

.video-facade.is-playing {
  cursor: default;
  background: #000;
}

.video-facade.is-playing .video-facade__play,
.video-facade.is-playing::after {
  display: none;
}

.video-facade__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Label: project name on top, client name beneath (all views) */
.work-card__label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: var(--space-3);
}

.work-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-small);
  font-weight: 700; /* target: 600 (Semibold) — not in the kit; snapped to nearest real cut */
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
  color: var(--color-ink);
  transition: color 0.2s var(--ease-out);
  text-wrap: balance;
}

.work-card__type {
  font-family: var(--font-heading);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-muted);
}

/* Home variant: title on top, client name directly below.
   Matches the original .portfolio-title / .portfolio-client treatment. */
.work-card--home .work-card__label {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.work-card--home .work-card__title {
  text-transform: none;
  letter-spacing: normal;
}

.work-card__client {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-muted);
}

/* Hidden by the default home filter, but kept in markup with its tag data */
.is-filtered-out {
  display: none;
}

@media (hover: hover) {
  .work-card:hover .work-card__media img {
    filter: brightness(1.05);
  }
  .work-card:hover .work-card__title {
    color: var(--color-accent);
  }
}

/* ===== Filter bar + view toggle ===== */
.work-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filter-pill {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1;
  padding: 9px 16px;
  border-radius: var(--radius-card);
  text-decoration: none;
  background: var(--color-pill-bg);
  color: var(--color-ink);
  border: 1px solid var(--color-pill-border);
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out),
              border-color 0.2s var(--ease-out);
}

.filter-pill:hover {
  border-color: var(--color-accent);
}

.filter-pill.is-active {
  background: var(--color-accent);
  /* Always white on the accent fill (was --color-bg, which went dark in
     dark mode); keeps the active category legible in both themes. */
  color: #fff;
  border-color: var(--color-accent);
}

.view-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  letter-spacing: 0.06em;
}

.view-toggle__link {
  text-decoration: none;
  color: var(--color-muted);
  transition: color 0.2s var(--ease-out);
}

.view-toggle__link.is-active {
  color: var(--color-ink);
}

.view-toggle__link:hover {
  color: var(--color-ink);
}

.view-toggle__sep {
  color: var(--color-muted-soft);
}

.work-empty {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-muted);
  padding: var(--space-8) 0;
  margin-bottom: var(--space-9);
}

/* ===== List view ===== */
.work-list {
  border-top: 1px solid var(--color-hairline);
  margin-bottom: var(--space-10);
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-hairline);
  text-decoration: none;
  color: var(--color-ink);
}

.list-row__title {
  font-family: var(--font-heading);
  font-size: var(--text-small);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
  transition: color 0.2s var(--ease-out);
  text-wrap: balance;
}

.list-row__thumb {
  width: 64px;
  height: 64px;
  justify-self: center;
  overflow: hidden;
  background: var(--color-surface);
  border-radius: var(--radius-card);
}

.list-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.list-row__type {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-muted);
  text-align: right;
  justify-self: end;
}

.list-row__year {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
  justify-self: end;
  min-width: 3.5ch;
}

@media (hover: hover) {
  .list-row:hover .list-row__title {
    color: var(--color-accent);
  }
}

/* Hover-reveal preview (list view, fine-pointer desktops only).
   The small inline thumbnail is dropped in favour of a large image that
   fades in and follows the cursor. Touch / coarse pointers keep the inline
   thumbnail, since they have no hover. */
@media (hover: hover) and (pointer: fine) and (min-width: 811px) {
  .list-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }
  .list-row__thumb {
    display: none;
  }
}

.work-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: clamp(240px, 26vw, 380px);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) scale(0.96);
  transform-origin: left center;
  transition: opacity 0.18s var(--ease-out), transform 0.22s var(--ease-out);
  will-change: transform;
  z-index: 60;
}

.work-preview.is-visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.work-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .work-preview {
    transition: opacity 0.12s linear;
    transform: translateY(-50%);
  }
  .work-preview.is-visible {
    transform: translateY(-50%);
  }
}

/* ===== Scroll entrance + filter fade ===== */
.js .work-card,
.js .list-row {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
  will-change: transform;
}

.work-card.is-visible,
.list-row.is-visible {
  opacity: 1;
  transform: none;
}

.work-card.is-leaving,
.list-row.is-leaving {
  opacity: 0 !important;
  transform: none;
  transition: opacity 0.15s ease;
}

/* ===== Responsive: grids collapse ===== */
/* Grids step down 4 -> 3 -> 2 -> 1 as width shrinks. */
@media (max-width: 1100px) {
  .featured-grid,
  .work-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 810px) {
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .work-controls {
    align-items: flex-start;
  }
  .list-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title thumb"
      "meta  thumb";
    gap: 2px var(--space-3);
    row-gap: 4px;
  }
  .list-row__title { grid-area: title; }
  .list-row__thumb { grid-area: thumb; width: 56px; height: 56px; }
  .list-row__type { grid-area: meta; text-align: left; justify-self: start; }
  .list-row__year {
    grid-area: meta;
    text-align: left;
    justify-self: end;
    align-self: center;
  }
}

@media (max-width: 520px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
  .work-grid {
    grid-template-columns: 1fr;
  }
}

/* About Page */
.about {
  padding: var(--section-top) 0 var(--space-5);
}

/* ===== About / Info page (two-zone grid) ===== */
.about-info {
  padding: clamp(80px, 12vh, 160px) 0 var(--space-9);
}

.info-inset {
  padding: 0 var(--hero-pad);
}

/* Two-zone layout: left profile (col 1) — empty gutter (col 2) — right zone (col 3) */
.info-grid {
  display: grid;
  /* Profile column widened (was 1.3fr) and the empty middle gutter column
     trimmed (was 1.7fr, nearly as wide as the profile column itself with
     no content in it) — the bio/portrait were reading as cramped because
     the gutter was eating width that could go to them. Right zone
     unchanged. */
  grid-template-columns: minmax(0, 1.8fr) 1fr minmax(0, 2.7fr);
  column-gap: clamp(20px, 3vw, 44px);
  row-gap: var(--space-8);
  align-items: start;
}

.info-profile { grid-column: 1; }

/* Right zone is its own 2×2 grid so Tools/Contact share row 2 and line up,
   independent of the (taller) profile column on the left. */
.info-right {
  grid-column: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(20px, 3vw, 44px);
  row-gap: var(--space-8);
  align-items: start;
}

.info-block--services { grid-column: 1; grid-row: 1; }
.info-block--tools    { grid-column: 1; grid-row: 2; }
.info-block--clients  { grid-column: 2; grid-row: 1; }
.info-block--contact  { grid-column: 2; grid-row: 2; }

.info-block { margin: 0; }

/* Small section label — matches the site's small-label treatment, inked for hierarchy */
.info-label {
  font-family: var(--font-heading);
  font-size: var(--text-small);
  font-weight: 700; /* target: 600 (Semibold) — not in the kit; snapped to nearest real cut */
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-ink);
  margin: 0 0 var(--space-4);
}

/* Shared running-text treatment for page body copy — About bio, Colophon,
   project descriptions, gear/stack item pages, and anywhere else long-form
   text appears. One place to keep font, size, and rhythm uniform across
   pages: add class="prose" to a wrapping element alongside its own
   layout-specific class (max-width, color, spacing) and it picks this up.
   Color is deliberately not set here — each context still chooses ink vs.
   muted for its own emphasis. */
.prose p {
  font-family: var(--font-body);
  font-size: var(--text-prose);
  font-weight: 400;
  line-height: 1.4;
  margin: 0 0 1.25em;
  text-wrap: pretty;
}
.prose p:last-child { margin-bottom: 0; }

/* Profile body — constrained line length; location line is the third paragraph */
.info-body {
  max-width: 65ch;
  color: var(--color-ink);
}

/* Portrait, beneath the bio */
.info-person { margin-top: var(--space-8); }

.info-portrait {
  display: block;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--color-surface);
  border-radius: var(--radius-card);
}

/* Right-zone lists — tightly stacked single-line items */
.info-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.info-list li {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-muted);
}

/* Contact links — original dashed-underline ("dash-line") treatment, no arrows */
.info-list--links a {
  color: var(--color-muted);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color 0.2s var(--ease-out), text-decoration 0.2s var(--ease-out);
}
.info-list--links a:hover {
  color: var(--color-accent);
  text-decoration-style: solid;
}

/* Responsive: single stacked column in reading order */
@media (max-width: 810px) {
  .info-grid { grid-template-columns: 1fr; }
  .info-profile,
  .info-right { grid-column: auto; }
  .info-right { grid-template-columns: 1fr; }
  .info-block--services,
  .info-block--tools,
  .info-block--clients,
  .info-block--contact {
    grid-column: auto;
    grid-row: auto;
  }
  .info-portrait { max-width: 290px; }
}


.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: auto;
  gap: 24px;
  align-items: start;
}

.about-image,
.hero-image {
  width: 100%;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-image img,
.hero-image img {
  max-width: 100%;
  height: auto;
  display: block;
}

.hero-image {
  grid-column: 1;
  grid-row: 3;
  max-width: 500px;
  justify-self: start;
  margin-top: 80px;
}

.about-grid > .masthead-text {
  grid-column: 1;
  grid-row: 1;
}

.masthead-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 66ch; /* running-text measure, ~60-72ch target */
  color: var(--color-muted);
}

.masthead-text a,
.meta-grid a {
  color: var(--color-muted);
  font-weight: 400;
  text-decoration: underline;
  text-decoration-style: solid;
  text-decoration-color: var(--color-muted);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.masthead-text a:hover,
.meta-grid a:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

.body-content {
  max-width: 65ch; /* running-text measure, ~60-72ch target */
  color: var(--color-ink);
}

.body-content a {
  color: var(--color-muted);
  font-weight: 400;
  text-decoration: underline;
  text-decoration-style: solid;
  text-decoration-color: var(--color-muted);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.body-content a:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

.meta-grid {
  grid-column: 1 / span 1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 48px;
  row-gap: 24px;
  padding: 20px 0 0;
}

.meta-grid .masthead-text {
  gap: 8px;
}

.meta-grid .masthead-text p strong {
  font-weight: 400;
  color: var(--color-ink) !important;
}

.about-image {
  grid-column: 1 / span 1;
  grid-row: 3;
  max-width: 500px;
  justify-self: center;
  margin-top: 80px;
}

.gallery-grid {
  margin-top: 40px;
}

/* Playground */
.playground {
  padding: var(--section-top) 0 var(--space-5);
}

.playground-intro {
  margin-bottom: var(--space-4);
}

.playground-subtitle {
  font-family: var(--font-heading);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-muted);
  margin: 0;
  text-wrap: pretty;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 120px;
  align-items: start;
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  text-decoration: none;
  color: var(--color-ink);
}

.category-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-card);
}

.category-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-title {
  font-family: var(--font-heading);
  font-size: var(--text-body);
  font-weight: 700; /* target: 600 (Semibold) — not in the kit; snapped to nearest real cut */
  line-height: 1.25;
  margin: 0;
  text-wrap: balance;
}

.category-description {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  letter-spacing: 0.025em;
  line-height: 1.25;
  /* Spec calls for ~0.85 opacity on captions, but #6f6f6f is already close
     to the AA floor (5.02:1) — 0.85 opacity would drop it to 3.71:1,
     failing AA. Skipped here to keep gray text passing; kept on
     .gear-tile-caption below, where the base color has headroom (black). */
  margin: 0;
  color: var(--color-muted-soft);
}

.category-card:hover .category-title {
  color: var(--color-accent);
}

/* Playground categories — a flat tint ladder of the brand orange (#F54F00),
   each step adding more white: full brand (Gear) through to a light peach
   (Photography). */
.category-gear .category-media {
  background-color: #F54F00;
}

.category-uses .category-media {
  background-color: #F76926;
}

.category-reviews .category-media {
  background-color: #F8844D;
}

.category-inspiration .category-media {
  background-color: #FAA47A;
}

.category-photo .category-media {
  background-color: #FCC3A8;
}

/* Gear (/gear) and Uses (/uses) — gallery sections */
.gear-uses {
  padding: var(--section-top) 0 var(--space-5);
}

.gear-uses-intro {
  margin-bottom: 32px;
}

.gear-uses-title {
  font-family: var(--font-heading);
  font-size: var(--text-h1);
  font-weight: 700; /* target: 600 (Semibold) — not in the kit; snapped to nearest real cut */
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  color: var(--color-ink);
  text-wrap: balance;
}

.gear-uses-subtitle {
  font-family: var(--font-heading);
  font-size: var(--text-lead);
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-muted);
  margin: 0;
  max-width: 36em;
  text-wrap: pretty;
}

.gear-uses-empty {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-muted);
}

.gear-uses-empty code {
  font-size: var(--text-small);
}

.gear-gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  /* Max 5 columns so tiles read larger; generous gutters; extra row rhythm below captions */
  column-gap: clamp(20px, 3.5vw, 40px);
  row-gap: clamp(28px, 4.5vw, 52px);
  background: var(--color-bg);
  margin-bottom: 120px;
  align-items: start;
}

.gear-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.gear-tile-surface {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--color-surface-2);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gear-tile-media {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.gear-tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.gear-tile-caption {
  font-family: var(--font-body);
  font-size: var(--text-small);
  line-height: 1.25;
  font-weight: 400;
  letter-spacing: 0.025em;
  opacity: 0.85;
  color: var(--color-ink);
  margin: 0;
  padding: 0 2px;
  text-wrap: balance;
  width: 100%;
}

.gear-tile-caption--meta {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  letter-spacing: 0.025em;
  line-height: 1.25;
  /* Spec calls for ~0.85 opacity on captions, but #737378 is already close
     to the AA floor (4.72:1) — 0.85 opacity would drop it to 3.53:1,
     failing AA. Skipped here to keep gray text passing. */
  color: var(--color-muted);
  margin-top: -2px;
}

@media (max-width: 1200px) {
  .gear-gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: clamp(18px, 3vw, 32px);
    row-gap: clamp(24px, 4vw, 44px);
  }
}

@media (max-width: 900px) {
  .gear-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: clamp(16px, 2.8vw, 28px);
    row-gap: clamp(22px, 3.5vw, 40px);
  }
}

@media (max-width: 600px) {
  .gear-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 28px;
  }
}

@media (max-width: 380px) {
  .gear-gallery {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 24px;
  }
}

/* Gallery items will be positioned by Masonry */
.gallery-item {
  width: 32%;              /* 3 columns desktop */
  margin-bottom: var(--space-4);
  display: inline-block;
  vertical-align: top;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-card);
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.image-title {
  font-family: var(--font-heading);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.25;
  margin-top: 6px;
}

/* Responsive breakpoints */
@media (max-width: 1024px) {
  .gallery-item {
    width: 48%;   /* 2 columns tablet */
  }
}

@media (max-width: 600px) {
  .gallery-item {
    width: 100%;  /* 1 column mobile */
  }
}

/* Footer */
.footer .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
  padding-top: var(--space-10);
  padding-bottom: var(--space-8);
  margin-top: var(--space-9);
  border-top: 1px solid var(--color-hairline);
}

.footer-left {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-muted);
}

.footer-right {
  color: var(--color-muted);
}

.footer-copyright,
.footer-message {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-muted);
}

.footer-message {
  font-style: italic;
}

.footer-links {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.footer-links a {
  text-decoration: none;
  color: var(--color-ink);
  font-family: var(--font-heading);
  font-size: var(--text-small);
  font-weight: 700;
  line-height: 1.25;
  transition: opacity 0.2s ease;
}

.footer-links a:hover {
  opacity: 0.7;
}

/* Email footer link — hover/focus reveals a "Copy email" pill above it.
   The pill is a real <button>, separate from the mailto link: clicking the
   link still opens a mail client as normal, clicking the pill copies the
   address to the clipboard ("Copy email" → "Copied!"). */
.email-copy {
  position: relative;
  display: inline-flex;
}

.email-copy__tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, 2px);
  margin-bottom: 8px;
  padding: 5px 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-hairline);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  color: var(--color-ink);
  white-space: nowrap;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s var(--ease-out), transform 0.15s var(--ease-out);
}

/* Invisible bridge over the margin-bottom gap above — without it, moving the
   pointer from the link up to the pill crosses a dead zone with no hoverable
   box in it, so :hover drops and the pill vanishes before it's reachable. */
.email-copy__tooltip::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 8px;
}

.email-copy:hover .email-copy__tooltip,
.email-copy:focus-within .email-copy__tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.footer a {
  text-decoration: none;
  color: var(--color-ink);
}

.footer a:hover {
  color: var(--color-ink);
  text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header .header-inner {
    padding-top: var(--space-4);
  }

  .nav {
    gap: 16px;
  }

  .about,
  .playground,
  .gear-uses {
    padding: var(--space-8) 0 var(--space-5);
  }

  .gear-gallery {
    margin-bottom: 60px;
    column-gap: 16px;
    row-gap: 28px;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 60px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero-image {
    grid-column: 1;
    grid-row: auto;
    max-width: 100%;
    justify-self: center;
  }

  .about-grid > .masthead-text {
    grid-column: 1;
  }

  .meta-grid {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .about-image {
    grid-column: 1;
    grid-row: auto;
    max-width: 100%;
    justify-self: center;
    margin-top: 40px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .nav {
    gap: 15px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1199px) {
  .hero-image {
    max-width: 400px;
  }

  .about-image {
    max-width: 400px;
  }
}

/* Project Detail Pages */
.project {
  padding: clamp(64px, 10vh, 104px) 0 var(--space-5);
  width: 100%;
}

/* Constrained reading/viewing column so the video isn't oversized */
.project-container {
  max-width: 820px;
}

.project-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-muted);
  text-decoration: none;
  margin-bottom: var(--space-6);
  transition: color 0.2s var(--ease-out);
}

.project-back__arrow {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  transition: transform 0.2s var(--ease-out);
}

.project-back:hover {
  color: var(--color-accent);
}

.project-back:hover .project-back__arrow {
  transform: translateX(-2px);
}

.project-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-hairline);
}

.project-eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 var(--space-3);
}

.project-title {
  font-size: var(--text-h1);
  font-weight: 700; /* target: 600 (Semibold) — not in the kit; snapped to nearest real cut */
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--color-ink);
  text-wrap: balance;
}

.project-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5) var(--space-7);
  margin: var(--space-5) 0 0;
}

.project-fact dt {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-1);
}

.project-fact dd {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.project-description {
  color: var(--color-ink);
  max-width: 65ch;
  margin-bottom: var(--space-7);
  word-wrap: break-word;
}

/* Videos — stacked, constrained by the column width */
.project-videos {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: var(--space-7);
}

.video-container {
  width: 100%;
  margin: 0;
}

/* Stills gallery — under the videos, click to preview */
.project-stills {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin: 0 0 var(--space-7);
}

.project-still {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-surface);
  cursor: zoom-in;
}

.project-still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease-out);
}

@media (hover: hover) {
  .project-still:hover img {
    transform: scale(1.04);
  }
}

.project-additional-content {
  color: var(--color-muted);
  max-width: 65ch; /* running-text measure, ~60-72ch target */
  margin-bottom: var(--space-7);
}

.project-additional-content a {
  color: var(--color-muted);
  font-weight: 400;
  text-decoration: underline;
  text-decoration-style: solid;
  text-decoration-color: var(--color-muted);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s var(--ease-out), text-decoration-color 0.2s var(--ease-out);
}

.project-additional-content a:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

/* Prev / next navigation */
.project-nav {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-hairline);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.project-nav__cell--next {
  text-align: right;
}

.project-nav__link {
  display: inline-flex;
  flex-direction: column;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-ink);
  max-width: 100%;
}

.project-nav__cell--next .project-nav__link {
  align-items: flex-end;
}

.project-nav__dir {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  transition: color 0.2s var(--ease-out);
}

.project-nav__arrow {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  transition: transform 0.2s var(--ease-out);
}

.project-nav__link.prev-project:hover .project-nav__arrow {
  transform: translateX(-2px);
}

.project-nav__link.next-project:hover .project-nav__arrow {
  transform: translateX(2px);
}

.project-nav__name {
  font-family: var(--font-heading);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.3;
  transition: color 0.2s var(--ease-out);
  text-wrap: balance;
}

.project-nav__link:hover .project-nav__dir,
.project-nav__link:hover .project-nav__name {
  color: var(--color-accent);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(0, 0, 0, 0.9);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-card);
}

.lightbox__close {
  position: absolute;
  top: clamp(12px, 3vw, 24px);
  right: clamp(12px, 3vw, 24px);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out);
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Project Detail - Responsive */
@media (max-width: 768px) {
  .project-back {
    margin-bottom: var(--space-5);
  }

  .project-facts {
    gap: var(--space-4) var(--space-6);
  }

  .project-stills {
    grid-template-columns: 1fr;
  }
}
