/* =====================================================================
   styles.css: shared by every page of the portfolio
   Change a color, font, or size here and it updates everywhere.
   ===================================================================== */

/* Fonts: to swap a font, change this line and the matching --font-* variable below */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* =====================================================================
   1. DESIGN TOKENS
   ===================================================================== */
:root {
  /* Base */
  --paper: #FFFFFF;        /* gallery wall, dominant background */
  --surface: #F6F4EF;      /* warm off-white for frames, placeholders, the table */
  --surface-2: #EDEAE2;    /* slightly deeper surface */
  --ink: #16161A;          /* main text */
  --ink-soft: #55555E;     /* secondary text (7.5:1 on white) */
  --ink-faint: #B9B5AC;    /* placeholder icons only, never text */
  --line: #E3E0D8;         /* hairlines and borders */

  /* Accents: "workshop materials" */
  --orange: #FF5A1F;       /* Safety Orange: cursor, name hover, big moments (shapes / large type only) */
  --orange-deep: #D9420B;
  --blue: #2F5BEA;         /* Blueprint Blue: links, active nav, focus (text-safe) */
  --blue-deep: #2349C4;
  --green: #2E7D5B;        /* Cutting-Mat Green: fabrication (text-safe) */
  --green-deep: #22634A;
  --tape: #F5D76E;         /* Masking-Tape Yellow: highlights and fills (never text) */
  --tape-deep: #E2BE45;

  /* Type */
  --font-display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --fs-small: 0.875rem;
  --fs-body: 1.0625rem;
  --fs-lead: clamp(1.125rem, 1rem + 0.45vw, 1.35rem);
  --fs-h3: clamp(1.5rem, 1.2rem + 0.9vw, 2rem);
  --fs-h2: clamp(2.75rem, 1.6rem + 4.4vw, 6rem);
  --fs-hero: clamp(4rem, 3rem + 8vw, 10.5rem);

  /* Layout: everything sits on a 12-column grid with one shared gap */
  --max: 1320px;
  --gutter: clamp(20px, 4vw, 56px);   /* page edge padding */
  --gap: clamp(20px, 2.4vw, 32px);    /* column gap everywhere */
  --section-pad: clamp(96px, 11vw, 160px);
  --block-gap: clamp(56px, 7vw, 104px);
  --nav-h: 68px;
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 24px;
  --cover-ar: 16 / 10;                /* project cover + case study hero aspect ratio */

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --reel-bg: #FFFFFF;       /* matches the showreel video's background (white, same as the page) */
  --shadow-frame: 0 1px 2px rgba(22, 22, 26, 0.06), 0 12px 30px rgba(22, 22, 26, 0.09);
}

/* =====================================================================
   2. BASE
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
html.is-locked { overflow: hidden; }
html.is-locked body { padding-right: var(--sbw, 0px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: var(--fs-body); line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: var(--blue); text-underline-offset: 0.2em; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--tape); color: var(--ink); }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 3000; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; transform: translateY(-160%); transition: transform 0.3s var(--ease-out); text-decoration: none; }
.skip-link:focus { transform: translateY(0); }

/* Different hints for mouse users and touch users */
.only-coarse { display: none; }
@media (hover: none), (pointer: coarse) {
  .only-fine { display: none; }
  .only-coarse { display: inline; }
}

/* Color classes for the object SVGs */
.f-orange { fill: var(--orange); } .f-orange-deep { fill: var(--orange-deep); }
.f-blue { fill: var(--blue); }     .f-blue-deep { fill: var(--blue-deep); }
.f-green { fill: var(--green); }   .f-green-deep { fill: var(--green-deep); }
.f-tape { fill: var(--tape); }     .f-tape-deep { fill: var(--tape-deep); }
.f-paper { fill: var(--paper); }   .f-paper-a { fill: rgba(255, 255, 255, 0.55); }

/* =====================================================================
   3. BUTTONS, PILLS, TAGS
   ===================================================================== */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px; border: 2px solid var(--ink);
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  background: var(--ink); color: var(--paper); overflow: hidden; isolation: isolate;
  transition: transform 0.4s var(--ease-out), color 0.3s;
}
.btn::before { /* orange fill that sweeps in on hover */
  content: ""; position: absolute; inset: -2px; z-index: -1; border-radius: inherit;
  background: var(--orange); transform: scaleX(0); transform-origin: left center;
  transition: transform 0.5s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); color: var(--ink); }
.btn:hover::before { transform: scaleX(1); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost::before { background: var(--tape); }
.btn-sm { padding: 10px 18px; font-size: 0.9rem; }

.pill {
  display: inline-flex; align-items: center; padding: 10px 18px; border-radius: 999px;
  border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 500;
  transition: border-color 0.25s, transform 0.35s var(--ease-out);
}
.pill:hover { border-color: var(--ink); transform: translateY(-2px); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tags li {
  font-family: var(--font-mono); font-size: 0.75rem; line-height: 1;
  padding: 7px 11px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--paper);
  transition: border-color 0.25s;
}

/* =====================================================================
   4. IMAGE PLACEHOLDERS
   A quiet neutral frame with the file path it's waiting for. When the
   real image exists at that path, it fades in and covers the frame.
   ===================================================================== */
.ph { position: relative; overflow: hidden; aspect-ratio: var(--ar, 4 / 3); background: var(--surface); border-radius: var(--radius-m); }
.ph::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.ph-art { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-faint); transition: transform 0.9s var(--ease-out); }
.ph-art svg { width: clamp(28px, 10%, 44px); height: auto; }
.ph-label {
  position: absolute; left: 14px; right: 14px; bottom: 12px;
  display: flex; flex-direction: column; gap: 1px; text-align: left;
  font-size: 0.78rem; line-height: 1.35; color: var(--ink-soft); transition: opacity 0.3s;
}
.ph-label b { font-weight: 500; }
.ph-label span { font-family: var(--font-mono); font-size: 0.68rem; opacity: 0.8; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s, transform 0.9s var(--ease-out); }
.ph img.is-loaded { opacity: 1; }

/* =====================================================================
   5. CUSTOM CURSOR (desktop only, turned on by main.js)
   ===================================================================== */
.cursor { display: none; position: fixed; left: 0; top: 0; z-index: 2000; pointer-events: none; transition: opacity 0.2s; }
html.has-cursor .cursor { display: block; }
.cursor.is-hidden { opacity: 0; }
.cursor-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--orange); transition: transform 0.35s var(--ease-out), opacity 0.25s; }
.cursor-label {
  position: absolute; left: 0; top: 0; white-space: nowrap; padding: 8px 13px; border-radius: 999px;
  background: var(--orange); color: var(--ink); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  transform: translate(-50%, -50%) scale(0); transition: transform 0.4s var(--ease-spring);
}
.cursor.is-link .cursor-dot { transform: scale(2.8); opacity: 0.35; }
.cursor.is-label .cursor-dot { transform: scale(0); }
.cursor.is-label .cursor-label { transform: translate(-50%, -50%) scale(1); }
.cursor.is-down .cursor-dot { transform: scale(0.6); }
.cursor.is-label.is-down .cursor-label { transform: translate(-50%, -50%) scale(0.9); }   /* only squish the label when it's showing */
html.has-cursor, html.has-cursor * { cursor: none !important; }

/* =====================================================================
   6. INTRO (home page only: the unboxing)
   ===================================================================== */
.intro { display: none; }
html.intro-play .intro { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; background: var(--paper); }
.intro-stage { position: relative; display: grid; place-items: center; perspective: 700px; }
.box { position: relative; width: 220px; height: 220px; border-radius: 12px; background: var(--surface-2); border: 3px solid var(--ink); transform-style: preserve-3d; }
.flap { position: absolute; top: -3px; bottom: -3px; width: calc(50% + 3px); background: var(--surface); border: 3px solid var(--ink); backface-visibility: visible; }
.flap-l { left: -3px; transform-origin: left center; border-radius: 12px 0 0 12px; }
.flap-r { right: -3px; transform-origin: right center; border-radius: 0 12px 12px 0; }
.box-tape { position: absolute; left: 50%; top: -18px; bottom: -18px; width: 46px; margin-left: -23px; background: var(--tape); transform-origin: center top; z-index: 2; }
.intro-name {
  position: absolute; display: flex; align-items: center; gap: 14px; white-space: nowrap; z-index: 3; opacity: 0;
  font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 7vw, 3.6rem); letter-spacing: -0.03em;
}
.intro-name span { display: block; width: 0.9em; height: 0.9em; }
.intro-name svg { width: 100%; height: 100%; display: block; }
.intro-skip { position: absolute; right: 24px; bottom: 24px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; font-family: var(--font-mono); font-size: 0.8rem; }
.intro-skip:hover { border-color: var(--ink); }

/* =====================================================================
   7. NAV (desktop bar + mobile dock and menu sheet)
   ===================================================================== */
.site-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--nav-h); }
.nav-bg { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.94); border-bottom: 1px solid var(--line); opacity: 0; transition: opacity 0.35s; }
html.nav-scrolled .nav-bg { opacity: 1; }
.nav-inner { position: relative; display: flex; align-items: center; justify-content: space-between; height: 100%; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; }
.wordmark > span { width: 26px; height: 26px; display: block; transition: transform 0.7s var(--ease-spring); }
.wordmark svg { width: 100%; height: 100%; display: block; }
.wordmark:hover > span { transform: rotate(135deg); }
.nav-links { position: relative; display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-links a { display: block; padding: 8px 13px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; transition: color 0.25s, transform 0.3s var(--ease-out); }
.nav-links a:hover { transform: translateY(-2px); }
.nav-links a[aria-current] { color: var(--blue); }
.nav-indicator { position: absolute; left: 0; bottom: -4px; width: 100px; height: 3px; border-radius: 2px; background: var(--blue); transform-origin: left center; opacity: 0; pointer-events: none; transition: transform 0.55s var(--ease-out), opacity 0.3s; }

.dock, .sheet { display: none; }
@media (max-width: 860px) {
  .nav-links { display: none; }
  .dock {
    position: fixed; z-index: 110; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%); display: flex; align-items: center; gap: 14px;
    padding: 6px 6px 6px 20px; border-radius: 999px; background: var(--ink); color: var(--paper);
    box-shadow: 0 10px 30px rgba(22, 22, 26, 0.25);
  }
  .dock-current { display: flex; align-items: center; gap: 9px; min-width: 104px; font-weight: 600; font-size: 0.95rem; overflow: hidden; }
  .dock-current i { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); flex: none; }
  .dock-btn { border: 0; border-radius: 999px; padding: 11px 18px; background: var(--orange); color: var(--ink); font-weight: 600; cursor: pointer; }
  .sheet { position: fixed; inset: 0; z-index: 120; display: block; }
  .sheet-bg { position: absolute; inset: 0; background: rgba(22, 22, 26, 0.45); }
  .sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom, 0px)); background: var(--paper); border-radius: var(--radius-l) var(--radius-l) 0 0; }
  .sheet-panel ul { list-style: none; margin: 0 0 20px; padding: 0; }
  .sheet-panel a { display: flex; align-items: center; gap: 14px; padding: 10px 0; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 2.1rem; letter-spacing: -0.02em; }
  .sheet-panel a[aria-current] { color: var(--blue); }
  .sheet-panel a i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
  .sheet-panel a[aria-current] i { background: var(--blue); }
  .sheet-close { width: 100%; justify-content: center; }
}

/* =====================================================================
   8. SECTION + PAGE HEADERS (shared 12-column layout)
   ===================================================================== */
.section { padding-top: var(--section-pad); scroll-margin-top: var(--nav-h); }
.page-top { padding-top: calc(var(--nav-h) + clamp(56px, 9vw, 128px)); }
.sec-head {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 20px;
  align-items: end; margin-bottom: clamp(40px, 5vw, 72px);
}
.sec-title { grid-column: 1 / span 7; display: flex; align-items: center; gap: 0.18em; font-size: var(--fs-h2); font-weight: 800; letter-spacing: -0.04em; line-height: 0.9; }
.sec-marker { width: 0.6em; height: 0.6em; flex: none; margin-right: 0.08em; }
.sec-marker svg { width: 100%; height: 100%; display: block; }
.sec-count { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 400; color: var(--ink-soft); letter-spacing: 0; align-self: flex-start; margin-top: 0.4em; }
.sec-intro { grid-column: 8 / span 5; max-width: 44ch; margin: 0; color: var(--ink-soft); font-size: var(--fs-lead); line-height: 1.5; }
@media (max-width: 860px) { .sec-title, .sec-intro { grid-column: 1 / -1; } }

/* =====================================================================
   9. HOME: HERO
   ===================================================================== */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--nav-h) + clamp(24px, 4vh, 48px)) 0 clamp(40px, 7vh, 80px); }
.hero-grid {
  width: 100%; display: grid; column-gap: var(--gap);
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: "hello photo" "name photo" "intro photo" "cta photo";
  align-items: start;
}
.hero-hello { grid-area: hello; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-lead); margin: 0 0 0.3em; }
.hero-name { grid-area: name; font-weight: 800; font-size: var(--fs-hero); line-height: 0.86; letter-spacing: -0.045em; cursor: default; user-select: none; }
.name-line { display: block; white-space: nowrap; }
.ch { display: inline-block; will-change: transform; }
.hero-intro { grid-area: intro; max-width: 40ch; font-size: var(--fs-lead); color: var(--ink-soft); margin: 1.3em 0 0; line-height: 1.5; }
.hero-cta { grid-area: cta; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2em; }

/* Framed photos: white frame, slight tilt, straightens on hover */
.frame { position: relative; margin: 0; padding: 12px; background: var(--paper); box-shadow: var(--shadow-frame); transition: transform 0.7s var(--ease-spring); }
.frame .ph { border-radius: 2px; }
.frame .ph::after { border-radius: 2px; }
.polaroid { grid-area: photo; align-self: center; justify-self: end; width: 100%; max-width: 380px; transform: rotate(3deg); }
.polaroid:hover { transform: rotate(0deg) translateY(-6px); }

@media (max-width: 860px) {
  .hero { align-items: flex-start; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hello" "name" "photo" "intro" "cta"; }
  .hero-name { font-size: clamp(4rem, 24vw, 8rem); }
  .polaroid { justify-self: end; max-width: min(240px, 60vw); margin-top: 28px; padding: 10px; }
  .hero-intro { margin-top: 1.1em; }
}

/* Showreel band: full width, same color as the video's background so its edges disappear */
.reel { background: var(--reel-bg); display: grid; place-items: center; overflow: hidden; }
.reel-video {
  display: block; width: min(780px, 100vw, 95svh); aspect-ratio: 1080 / 828; height: auto; background: var(--reel-bg);
  clip-path: inset(3px);   /* trims the outer pixels (all white) so browsers can't draw a hairline at the video's edge */
}
/* Keep the ring close to the intro above and Projects below */
.hero:has(+ .reel) { min-height: auto; padding-bottom: clamp(16px, 3vh, 32px); }
.reel + .section { padding-top: clamp(28px, 4vw, 56px); }

/* =====================================================================
   10. HOME: FEATURED PROJECTS
   ===================================================================== */
.projects { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: clamp(48px, 6vw, 88px); }
.card { grid-column: span 6; }
.card-link { display: block; color: inherit; text-decoration: none; }
.card-link:focus-visible { outline-offset: 8px; border-radius: var(--radius-m); }
.card-media { --ar: var(--cover-ar); transition: transform 0.7s var(--ease-out); }
.card-link:hover .card-media, .card-link:focus-visible .card-media { transform: translateY(-6px); }
.card-link:hover .ph-art, .card-link:hover .card-media img { transform: scale(1.04); }
.card-link:hover .tags li { border-color: var(--ink); }
.card-badge {
  position: absolute; top: 16px; right: 16px; z-index: 3; width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center; background: var(--orange); color: var(--ink);
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500;
  transform: scale(0) rotate(-120deg); transition: transform 0.55s var(--ease-spring);
}
.card-link:hover .card-badge, .card-link:focus-visible .card-badge { transform: scale(1) rotate(0); }
.card-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 22px 0 8px; }
.card-title { font-size: var(--fs-h3); font-weight: 800; letter-spacing: -0.03em; }
.card-year { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); }
.card-summary { color: var(--ink-soft); max-width: 46ch; margin-bottom: 14px; }
.more-work { margin-top: var(--block-gap); padding-top: 32px; border-top: 1px solid var(--line); }
.more-title { margin: 0 0 20px; font-size: 1.5rem; line-height: 1.2; }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; list-style: none; margin: 0; padding: 0; }
.more-card { display: block; color: var(--ink); text-decoration: none; }
.more-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-m); background: var(--surface); }
.more-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.7s var(--ease-out); }
.more-card:hover .more-img img, .more-card:focus-visible .more-img img { transform: scale(1.04); }
.more-name { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 1.25rem; font-weight: 600; }
.more-arrow { transition: transform 0.4s var(--ease-out); }
.more-card:hover .more-arrow { transform: translateX(4px); }
.more-desc { display: block; margin-top: 4px; color: var(--ink-soft); line-height: 1.45; }
@media (max-width: 720px) {
  .more-grid { grid-template-columns: 1fr; gap: 12px; }
  .more-card { display: grid; grid-template-columns: 112px 1fr; column-gap: 16px; align-items: center; }
  .more-img { grid-row: span 2; }
  .more-name { margin-top: 0; align-self: end; font-size: 1.1rem; }
  .more-desc { align-self: start; font-size: 0.92rem; }
}
@media (max-width: 760px) {
  .card { grid-column: 1 / -1; }
  .card-badge { display: none; }
}

/* "Coming soon" panel (home card and its opened view) */
.soon-panel {
  container-type: inline-size; display: grid; place-items: center;
  background-color: var(--surface);
  background-image: radial-gradient(circle, rgba(22, 22, 26, 0.12) 1px, transparent 1.6px);
  background-size: 22px 22px;
}
.soon-inner { display: flex; flex-direction: column; align-items: center; gap: 2.2cqw; text-align: center; }
.soon-tag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); font-family: var(--font-mono); font-size: clamp(0.7rem, 2cqw, 0.9rem); color: var(--ink); }
.soon-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); animation: soon-pulse 1.8s ease-in-out infinite; }
@keyframes soon-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.55); opacity: 0.5; } }
.soon-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 11cqw, 7.5rem); letter-spacing: -0.045em; line-height: 0.9; color: var(--ink); }
.soon-sub { font-family: var(--font-mono); font-size: clamp(0.7rem, 1.8cqw, 0.95rem); color: var(--ink-soft); }
.case-hero.case-soon-hero { max-width: clamp(calc(300px + var(--gutter) * 2), calc((100svh - 560px) * 1.6 + var(--gutter) * 2), calc(640px + var(--gutter) * 2)); }   /* sized so the whole message fits on screen */
.case-inner.case-soon { max-width: calc(820px + var(--gutter) * 2); text-align: center; }
.case-soon .case-question, .case-soon .case-note { margin-inline: auto; }
.case-soon { padding-top: 28px; padding-bottom: 120px; }
.case-question { font-size: clamp(1.9rem, 1.2rem + 2.2vw, 3.1rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; max-width: 22ch; }
.case-note { font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-soft); max-width: 52ch; margin: 28px 0 0; }
.case-note a { color: var(--blue); font-weight: 500; }

/* =====================================================================
   11. CASE STUDY OVERLAY (opens from a project card)
   ===================================================================== */
.case { position: fixed; inset: 0; z-index: 500; }
.case-bg { position: absolute; inset: 0; background: var(--paper); }
.case-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; }
.case-top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px var(--gutter); pointer-events: none; }
.case-top > * { pointer-events: auto; }
.case-crumb { padding: 9px 16px; border-radius: 999px; background: var(--paper); font-size: 0.9rem; color: var(--ink-soft); box-shadow: 0 0 0 1px var(--line); }
.case-crumb b { color: var(--ink); font-weight: 600; }
.case-close { background: var(--paper); }
.case-close svg { width: 14px; height: 14px; }
/* Hero image and text share one column width, sized so the title peeks in below the image */
.case-hero, .case-inner { max-width: max(760px, min(1240px, calc((100svh - 250px) * 1.6 + var(--gutter) * 2))); margin-inline: auto; padding-inline: var(--gutter); }
.case-hero { margin-top: -6px; }
.case-media { --ar: var(--cover-ar); }
.case-inner { padding-top: clamp(40px, 5vw, 72px); padding-bottom: 140px; }
.case-kicker { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 16px; }
.case-title { font-size: clamp(3.2rem, 2rem + 6.5vw, 7.5rem); font-weight: 800; letter-spacing: -0.05em; line-height: 0.88; }
.case-summary { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.25rem, 1rem + 0.9vw, 1.7rem); line-height: 1.35; max-width: 34ch; margin: 22px 0 0; }
.case-meta { display: flex; flex-wrap: wrap; gap: 20px clamp(40px, 6vw, 96px); margin: clamp(40px, 5vw, 64px) 0 var(--block-gap); padding: 24px 0; border-block: 1px solid var(--line); }
.case-meta dt { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 6px; }
.case-meta dd { margin: 0; font-weight: 500; line-height: 1.45; }
.case-sec { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 16px; margin-bottom: clamp(32px, 4vw, 48px); }
.case-sec h3 { grid-column: 1 / span 3; font-size: var(--fs-h3); font-weight: 800; letter-spacing: -0.03em; padding-top: 4px; }
.case-sec > div { grid-column: 5 / span 8; }
.case-sec p { font-size: var(--fs-lead); line-height: 1.55; max-width: 58ch; margin: 0; }
.case-block { margin-bottom: var(--block-gap); }
.case-sec .about-note { padding: 20px 24px; max-width: none; background: var(--surface); border-radius: var(--radius-m); font-size: 1.05rem; }
/* Process steps with labeled galleries (click an image to enlarge) */
.step-wide { grid-column: 1 / -1; }
.step-wide h4 { margin-top: 0; }
.step-wide > p { max-width: 64ch; font-size: 1.05rem; }
.step-group { margin-top: 28px; }
.step-group h5 { margin: 0 0 12px; font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500; color: var(--ink-soft); }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gfig { margin: 0; }
.gfig-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radius-m); }
.gfig .ph-label { display: none; }
.gallery.is-wide { grid-template-columns: 1fr; }   /* one big image, e.g. a mood board */
.gallery.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .gallery.cols-3 { grid-template-columns: 1fr; } }
.text-sec p { max-width: 64ch; line-height: 1.65; color: var(--ink-soft); }
.text-sec p + p { margin-top: 14px; }
.text-sec b { color: var(--ink); font-weight: 600; }
@media (max-width: 560px) { .gallery.cols-2 { grid-template-columns: 1fr; } }
/* Galleries in case studies run a little wider than the text, up to the full page width */
.case .step-group { position: relative; left: 50%; transform: translateX(-50%); width: max(100%, min(calc(1240px - 2 * var(--gutter)), calc(100vw - 2 * var(--gutter) - 24px))); }
.case-scroll { overflow-x: hidden; }
.gfig-btn:hover img, .gfig-btn:hover .ph-art { transform: scale(1.04); }
.gfig figcaption { margin-top: 8px; font-size: 0.85rem; line-height: 1.35; color: var(--ink-soft); }
@media (max-width: 560px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

/* Order-of-operations strip (optional per project); scrolls sideways on small screens */
.timeline { list-style: none; margin: 8px 0 0; padding: 0 0 12px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 32px; counter-reset: op; }
.timeline li { counter-increment: op; position: relative; padding: 38px 18px 0 0; }
@media (max-width: 900px) {
  /* smaller screens: one row that scrolls sideways */
  .timeline { display: flex; overflow-x: auto; scrollbar-width: thin; }
  .timeline li { flex: 0 0 150px; }
}
.timeline li::before { content: counter(op); position: absolute; top: 0; left: 0; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--paper); border: 2px solid var(--blue); font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; }
.timeline li::after { content: ""; position: absolute; top: 12px; left: 26px; right: 0; height: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline b { display: block; font-weight: 600; line-height: 1.3; }
.timeline span { display: block; margin-top: 4px; font-size: 0.88rem; line-height: 1.35; color: var(--ink-soft); }
.timeline li.is-pivot::before { content: "!"; background: var(--orange); border-color: var(--orange); color: var(--ink); }

/* Requirements checklist, goals, and "next time" (optional per project) */
.checklist, .goal-list, .next-cols ul { list-style: none; margin: 0; padding: 0; }
.checklist li { position: relative; padding: 12px 0 12px 40px; border-bottom: 1px solid var(--line); font-size: var(--fs-lead); }
.checklist li:first-child { padding-top: 4px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 50%; width: 24px; height: 24px; margin-top: -12px; border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 12.5l3.2 3.2L17 9' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 24px no-repeat; }
.checklist li:first-child::before { margin-top: -16px; }
.goal-list { counter-reset: goal; display: grid; gap: 20px; }
.goal-list li { counter-increment: goal; position: relative; padding-left: 44px; font-size: var(--fs-lead); line-height: 1.5; max-width: 58ch; }
.goal-list li::before { content: counter(goal); position: absolute; left: 0; top: 2px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tape); font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500; }
.next-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.next-cols h4 { font-size: 1.15rem; margin: 0 0 12px; }
.next-cols li { position: relative; padding: 10px 0 10px 20px; border-top: 1px solid var(--line); color: var(--ink-soft); }
.next-cols li::before { content: ""; position: absolute; left: 0; top: 20px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
@media (max-width: 760px) { .next-cols { grid-template-columns: 1fr; } }

/* Market comparison table (optional per project) */
.market { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.5; }
.market th, .market td { text-align: left; vertical-align: top; padding: 14px 20px 14px 0; border-bottom: 1px solid var(--line); }
.market thead th { padding-top: 0; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 400; color: var(--ink-soft); }
.market tbody th { font-weight: 600; }
.market td { color: var(--ink-soft); }
.market .market-price { color: var(--ink); white-space: nowrap; }
.case-sec .market-takeaway { margin-top: 28px; padding: 20px 24px; max-width: none; background: var(--surface); border-radius: var(--radius-m); font-size: 1.05rem; }
.market-takeaway b { font-weight: 600; }
@media (max-width: 760px) {
  /* Phones: each product becomes a small card */
  .market, .market tbody, .market tr, .market th, .market td { display: block; }
  .market thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .market tr { padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius-m); }
  .market th, .market td { padding: 0; border: 0; }
  .market tbody th { font-size: 1.05rem; margin-bottom: 10px; }
  .market td { margin-top: 8px; }
  .market td::before { content: attr(data-label); display: block; font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft); }
  .market .market-price { white-space: normal; }
}
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap); row-gap: clamp(40px, 5vw, 64px); }
.step:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* an odd last step gets the full width */
.step h4 { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; margin: 20px 0 8px; }
.step-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tape); font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500; letter-spacing: 0; }
.step p { color: var(--ink-soft); margin: 0; max-width: 46ch; }
.outcome-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.outcome-grid .ph:first-child { grid-column: 1 / -1; }
.outcome-grid.has-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.case-next { border-top: 1px solid var(--line); padding-top: 40px; }
.next-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.next-label { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-soft); }
.next-title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-h2); letter-spacing: -0.04em; line-height: 0.95; transition: transform 0.5s var(--ease-out), color 0.3s; }
.next-btn:hover .next-title { transform: translateX(14px); color: var(--blue); }
@media (max-width: 760px) {
  .case-meta { gap: 20px 40px; }
  .case-sec h3, .case-sec > div { grid-column: 1 / -1; }
  .steps, .outcome-grid, .outcome-grid.has-4 { grid-template-columns: 1fr; }
  .case-top { padding: 12px var(--gutter); }
  .case-crumb { display: none; }
  .case-top { justify-content: flex-end; }
}

/* =====================================================================
   12. HOME: ABOUT + CONTACT
   ===================================================================== */
.about-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 40px; align-items: start; }
.about-photo { grid-column: 1 / span 5; max-width: 440px; transform: rotate(-2.5deg); }
.about-photo:hover { transform: rotate(0deg); }
.about-copy { grid-column: 1 / span 8; }
.about-copy p { font-size: var(--fs-lead); line-height: 1.55; max-width: 52ch; }
.about-copy p:first-child { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.2rem); line-height: 1.2; letter-spacing: -0.02em; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px var(--gap); margin: 40px 0 0; padding-top: 28px; border-top: 1px solid var(--line); }
.facts dt { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 4px; }
.facts dd { margin: 0; font-weight: 500; }
@media (max-width: 860px) {
  .about-photo, .about-copy { grid-column: 1 / -1; }
  .about-photo { max-width: 300px; }
}
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } }

.contact-title { font-size: clamp(3rem, 1.6rem + 6.5vw, 8rem); font-weight: 800; letter-spacing: -0.05em; line-height: 0.88; max-width: 12ch; }
.contact-lede { font-size: var(--fs-lead); color: var(--ink-soft); max-width: 44ch; margin: 28px 0 48px; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-bottom: 56px; }
.email-link { position: relative; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 1rem + 2.5vw, 3.3rem); letter-spacing: -0.03em; overflow-wrap: anywhere; }
.email-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; background: var(--orange); transform: scaleX(0.25); transform-origin: left; transition: transform 0.6s var(--ease-out); }
.email-link:hover::after, .email-link:focus-visible::after { transform: scaleX(1); }
@media (max-width: 600px) { .email-link { font-size: 5.4vw; white-space: nowrap; overflow-wrap: normal; } }   /* keep the address on one line */
.contact-links { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.contact-links a {
  position: relative; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 16px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; overflow: hidden; isolation: isolate;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 1rem + 1.5vw, 2.2rem); letter-spacing: -0.02em; transition: color 0.3s;
}
.contact-links a::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fill); transform: scaleY(0); transform-origin: bottom; transition: transform 0.5s var(--ease-out); }
.contact-links a:hover::before, .contact-links a:focus-visible::before { transform: scaleY(1); }
.contact-links a:hover, .contact-links a:focus-visible { color: var(--on-fill, var(--ink)); }
.contact-links .handle { font-family: var(--font-mono); font-weight: 400; font-size: 0.85rem; letter-spacing: 0; }
.link-li { --fill: var(--blue); --on-fill: var(--paper); }
.link-ig { --fill: var(--orange); }
.link-cv { --fill: var(--tape); }

/* =====================================================================
   13. HOME: THE TABLE (throwable objects, bottom of the page)
   ===================================================================== */
.playground { position: relative; height: clamp(240px, 34vh, 340px); margin-top: var(--section-pad); background: var(--surface); border-top: 1px solid var(--line); overflow: hidden; }
.playground-hint { position: absolute; top: 20px; left: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); margin: 0; font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); z-index: 1; }
.arena { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.obj { position: absolute; left: 0; top: 0; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; will-change: transform; }
.obj svg { width: 100%; height: 100%; display: block; overflow: visible; transition: transform 0.3s var(--ease-out); }
.obj.is-held svg { transform: scale(1.08); }

/* =====================================================================
   14. FABRICATION PAGE (scrub through build stages)
   ===================================================================== */
.fab-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: clamp(56px, 6vw, 88px); }
.fab { grid-column: span 6; }
.fab-media { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-m); overflow: hidden; touch-action: pan-y; background: var(--surface); }
.fab-media .ph { position: absolute; inset: 0; aspect-ratio: auto; border-radius: inherit; opacity: 0; transition: opacity 0.35s; }
.fab-media .ph.is-active { opacity: 1; }
.fab-progress { position: relative; height: 4px; margin-top: 16px; background: var(--line); border-radius: 2px; overflow: hidden; }
.fab-progress span { position: absolute; inset: 0; background: var(--green); transform-origin: left center; transform: scaleX(1); transition: transform 0.45s var(--ease-out); }
.fab-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
.fab-steps button { width: 100%; padding: 10px 6px 0 0; border: 0; background: none; cursor: pointer; text-align: left; font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-soft); transition: color 0.25s; }
.fab-steps button[aria-pressed="true"] { color: var(--green); font-weight: 500; }
.fab-steps button:hover { color: var(--ink); }
.fab-text { margin-top: 20px; }
.fab-text h3 { font-size: var(--fs-h3); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; }
.fab-mat { font-family: var(--font-mono); font-size: 0.8rem; color: var(--green); margin-bottom: 10px; }
.fab-text p:last-child { color: var(--ink-soft); max-width: 48ch; margin: 0; }
@media (max-width: 760px) { .fab { grid-column: 1 / -1; } }

/* One build per section: intro and scrub photo, research interviews, process photos */
.fab-project + .fab-project { margin-top: var(--section-pad); }
.fab-intro { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 32px; align-items: start; }
.fab-copy { grid-column: 1 / span 5; }
.fab-intro .fab { grid-column: 7 / span 6; }
.fab-title { font-size: clamp(2rem, 1.4rem + 2.2vw, 3.4rem); font-weight: 800; letter-spacing: -0.035em; line-height: 0.95; margin-bottom: 18px; }
.fab-text { color: var(--ink-soft); line-height: 1.6; }
.fab-materials { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.fab-materials div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; }
.fab-materials dt { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); padding-top: 2px; }
.fab-materials dd { margin: 0; font-weight: 500; }
.fab-block { margin-top: var(--block-gap); }
.fab-h3 { font-size: var(--fs-h3); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 20px; }
.interviews { columns: 3 280px; column-gap: var(--gap); }
.interview { break-inside: avoid; margin-bottom: var(--gap); padding: 20px 22px; border-radius: var(--radius-m); background: var(--surface); font-size: 0.9rem; line-height: 1.45; }
.interview h4 { font-size: 1.25rem; margin: 0 0 4px; }
.interview-meta { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-soft); margin: 0 0 12px; line-height: 1.5; }
.interview h5 { margin: 12px 0 4px; font-family: var(--font-mono); font-size: 0.74rem; font-weight: 500; color: var(--green); }
.interview ul { margin: 0; padding-left: 1.1em; color: var(--ink); }
.interview li + li { margin-top: 3px; }
.fab-group + .fab-group { margin-top: 28px; }
.fab-group-title { margin: 0 0 10px; font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; color: var(--ink-soft); }
@media (max-width: 860px) { .fab-copy, .fab-intro .fab { grid-column: 1 / -1; } }
.fab-cards .card-media { --ar: 4 / 3; }   /* Fabrication cards use 4:3 covers */
.case-inner.fab-case { max-width: calc(var(--max)); padding-top: 12px; }   /* opened build uses the full page width */

/* =====================================================================
   15. RENDERINGS PAGE (gallery + lightbox)
   ===================================================================== */
.render-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); grid-auto-rows: clamp(220px, 26vw, 400px); }
.render-grid li { grid-column: span var(--span, 4); }
.render-item { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--radius-m); overflow: hidden; text-align: left; }
.render-item .ph { height: 100%; aspect-ratio: auto; }
.render-item:hover .ph-art, .render-item:hover img { transform: scale(1.04); }
.render-cap { position: absolute; left: 12px; bottom: 12px; z-index: 3; max-width: calc(100% - 24px); padding: 8px 14px; border-radius: 999px; background: var(--paper); color: var(--ink); font-size: 0.9rem; font-weight: 500; transform: translateY(160%); transition: transform 0.5s var(--ease-out); }
.render-item:hover .render-cap, .render-item:focus-visible .render-cap { transform: translateY(0); }
.render-item:hover .ph-label, .render-item:focus-visible .ph-label { opacity: 0; }
@media (hover: none) { .render-cap { transform: none; } .render-item .ph-label { display: none; } }
@media (max-width: 760px) {
  /* Phones: a swipeable row instead of a grid */
  .render-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 8px; scrollbar-width: none; }
  .render-grid::-webkit-scrollbar { display: none; }
  .render-grid li { flex: 0 0 84%; scroll-snap-align: center; height: 110vw; max-height: 520px; }
}

/* Renderings: each project's renders fill rows at an even height; sketches sit small underneath */
.render-set + .render-set { margin-top: clamp(56px, 7vw, 96px); }
.jrow { display: flex; flex-wrap: wrap; gap: 16px; --h: clamp(200px, 26vw, 360px); }
.jrow::after { content: ""; flex-grow: 1000; }   /* keeps a short last row from stretching */
.jrow-renders { gap: 16px; }
.jrow-renders::after { display: none; }
.jrow-renders .jitem { flex: none; }   /* sizes set by main.js so each row fills the width */
.jrow-renders .jitem .ph { height: 100%; aspect-ratio: auto; }
.jitem { flex-grow: var(--arn); flex-shrink: 1; flex-basis: calc(var(--arn) * var(--h)); min-width: 0; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--radius-m); overflow: hidden; }
.jitem .ph { aspect-ratio: var(--ar); }
.jitem .ph-label { display: none; }
.jitem:hover img { transform: scale(1.03); }
.jrow-sketches { --h: clamp(80px, 9vw, 120px); gap: 10px; margin-top: 16px; }
.jrow-sketches::after { flex-grow: 100000; }
.jitem.is-sketch { flex-grow: 0; border-radius: var(--radius-s); box-shadow: 0 0 0 1px var(--line); background: var(--paper); }
.jitem.is-sketch .ph { background: var(--paper); border-radius: var(--radius-s); }
.jitem.is-sketch .ph::after { display: none; }
@media (max-width: 600px) { .jrow { --h: 150px; gap: 10px; } .jrow-renders { gap: 10px; } .jrow-sketches { --h: 72px; gap: 8px; } }

.lb { position: fixed; inset: 0; z-index: 600; display: grid; place-items: center; }
.lb-bg { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.97); }
.lb-frame { position: relative; z-index: 1; width: min(88vw, calc(72vh * var(--arn, 1.333)), 1400px); touch-action: pan-y; }
.lb-frame .ph img { object-fit: contain; }
.lb-caprow { display: flex; justify-content: space-between; gap: 20px; margin-top: 14px; }
.lb-cap { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; margin: 0; }
.lb-count { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-soft); white-space: nowrap; }
.lb-btn { position: absolute; z-index: 2; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--paper); cursor: pointer; transition: transform 0.35s var(--ease-out), background 0.25s; }
.lb-btn:hover { background: var(--tape); transform: scale(1.06); }
.lb-btn svg { width: 20px; height: 20px; }
.lb-prev { left: clamp(12px, 3vw, 40px); top: 50%; margin-top: -28px; }
.lb-next { right: clamp(12px, 3vw, 40px); top: 50%; margin-top: -28px; }
.lb-close { right: clamp(12px, 3vw, 40px); top: 16px; }
@media (max-width: 760px) {
  .lb-frame { width: 92vw; }
  .lb-prev, .lb-next { top: auto; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); margin-top: 0; }
  .lb-prev { left: calc(50% - 68px); } .lb-next { right: calc(50% - 68px); }
}

/* =====================================================================
   16. SKETCHES PAGE (the sketchbook table)
   ===================================================================== */
.sketch-tools { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.sketch-tools p { margin: 0; font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); }
.sketchbook {
  position: relative; height: 900px; border-radius: var(--radius-l); overflow: hidden;
  background-color: var(--surface);
  background-image: radial-gradient(circle, rgba(22, 22, 26, 0.12) 1px, transparent 1.6px);
  background-size: 22px 22px;
}
.sketch { position: absolute; left: 0; top: 0; display: block; padding: 10px; border: 0; text-align: left; background: var(--paper); cursor: pointer; box-shadow: 0 1px 2px rgba(22, 22, 26, 0.08), 0 6px 18px rgba(22, 22, 26, 0.07); will-change: transform; }
.sketchbook.can-drag .sketch { touch-action: none; }
.sketch::after { content: ""; position: absolute; inset: 0; z-index: -1; box-shadow: 0 26px 50px rgba(22, 22, 26, 0.22); opacity: 0; transition: opacity 0.3s; }
.sketch.is-grabbed::after { opacity: 1; }
.sketch .ph, .sketch .ph::after { border-radius: 2px; }
.sketch .ph-label { display: none; }
.sketch-cap { position: absolute; left: 12px; right: 12px; bottom: 9px; font-size: 0.78rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 719px) { .sketch-tools button { display: none; } }
.sketch-set + .sketch-set { margin-top: clamp(48px, 6vw, 80px); }
.set-title { margin: 0 0 16px; font-size: var(--fs-h3); font-weight: 800; letter-spacing: -0.03em; }

/* =====================================================================
   17. FOOTER + TOAST
   ===================================================================== */
.site-foot { border-top: 1px solid var(--line); }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px; padding-block: 32px calc(32px + env(safe-area-inset-bottom, 0px)); font-size: var(--fs-small); color: var(--ink-soft); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }
.foot-links a { color: var(--ink-soft); text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
.site-foot.on-table { background: var(--surface); border-top: 0; }   /* home: footer sits on the table */
@media (max-width: 860px) { .foot-inner { padding-bottom: 110px; } }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 1800; padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 500; font-size: 0.95rem; transform: translate(-50%, 200%); opacity: 0; transition: transform 0.5s var(--ease-spring), opacity 0.3s; pointer-events: none; }
.toast.is-shown { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 860px) { .toast { bottom: 96px; } }

/* =====================================================================
   18. REDUCED MOTION: everything stays usable, nothing travels
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- UX case study blocks (findings, decision table, survey, quotes, audit notes) ---------- */
.case .case-link { margin: 28px 0 64px; }
.case-link .btn { text-decoration: none; }
.gallery.cols-1 { grid-template-columns: 1fr; }
.gallery.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
.gallery.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; }
@media (max-width: 900px) { .gallery.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
.gallery.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .gallery.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
.gallery.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.audit-notes { margin: 16px 0 0; padding: 0; list-style: none; counter-reset: an; display: grid; gap: 10px; max-width: 78ch; }
.audit-notes li { counter-increment: an; position: relative; padding-left: 36px; line-height: 1.5; color: var(--ink-soft); }
.audit-notes li::before { content: counter(an); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: #F2B705; border: 1.5px solid var(--ink); color: var(--ink); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; }
.findings { margin: 28px 0 0; padding: 0; list-style: none; counter-reset: fd; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.findings li { counter-increment: fd; padding: 22px 24px 24px; background: var(--surface); border-radius: var(--radius-m); }
.findings li::before { content: counter(fd, decimal-leading-zero); display: block; margin-bottom: 10px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); }
.findings h5 { margin: 0 0 8px; font-size: 1.1rem; line-height: 1.3; font-weight: 600; }
.findings p { margin: 0; color: var(--ink-soft); line-height: 1.55; }
@media (max-width: 720px) { .findings { grid-template-columns: 1fr; } }
.dtable { margin-top: 24px; }
.dtable tbody th { width: 42%; font-weight: 500; color: var(--ink-soft); }
.dtable td { color: var(--ink); }
.survey { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 820px) { .survey { grid-template-columns: 1fr; } }
.sv { margin: 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius-m); }
.sv figcaption { margin-bottom: 16px; font-weight: 600; line-height: 1.35; }
.sv ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.sv li { display: grid; grid-template-columns: minmax(0, 11em) 1fr 3.4em; align-items: center; gap: 12px; font-size: 0.9rem; }
.sv-l { color: var(--ink-soft); line-height: 1.25; }
.sv-track { height: 14px; border-radius: 7px; background: var(--surface); overflow: hidden; }
.sv-bar { display: block; height: 100%; width: calc(var(--v) * 100%); border-radius: 7px; background: var(--ink); }
.sv-bar.is-y { background: #F2B705; }
.sv-bar.is-r { background: #C8302A; }
.sv-v { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-soft); }
.sv .sv-note { margin: 18px 0 0; font-size: 0.9rem; line-height: 1.5; color: var(--ink-soft); }
@media (max-width: 480px) { .sv li { grid-template-columns: minmax(0, 8.5em) 1fr 3em; gap: 8px; } }
.quotes { margin-top: 16px; padding: 22px 24px; background: var(--surface); border-radius: var(--radius-m); }
.quotes h5 { margin: 0 0 12px; font-weight: 600; font-size: 1rem; line-height: 1.35; }
.quotes blockquote { margin: 8px 0 0; padding-left: 16px; border-left: 3px solid #F2B705; line-height: 1.5; }
/* Wide steps: text and tables use the same full width as the galleries, with no one-word last lines */
.case .step-wide > p { max-width: 90ch; }
.case .findings, .case .dtable, .case .survey, .case .quotes { position: relative; left: 50%; transform: translateX(-50%); width: max(100%, min(calc(1240px - 2 * var(--gutter)), calc(100vw - 2 * var(--gutter) - 24px))); }
.case .dtable { display: table; }
.case .step p, .case .dtable th, .case .dtable td, .findings p, .findings h5, .sv-note, .audit-notes li, .quotes blockquote { text-wrap: pretty; }
@media (max-width: 720px) { .case .dtable { display: block; } .case .dtable tbody th { width: auto; font-weight: 600; color: var(--ink); } }
/* Two-column spread of step groups (the site audit) */
.case .group-grid { position: relative; left: 50%; transform: translateX(-50%); width: max(100%, min(calc(1240px - 2 * var(--gutter)), calc(100vw - 2 * var(--gutter) - 24px)));
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px; align-items: start; }
.case .group-grid .step-group { left: auto; transform: none; width: auto; }
.case .group-grid .audit-notes { gap: 6px; font-size: 0.9rem; }
.case .group-grid .audit-notes li { padding-left: 32px; }
.case .group-grid .audit-notes li::before { width: 22px; height: 22px; font-size: 0.7rem; }
@media (max-width: 760px) { .case .group-grid { grid-template-columns: 1fr; } }

/* No hyphen splits in the project details, and no single words left on their own line */
.case-meta > div { flex: 0 1 auto; max-width: 48ch; }
.case-meta dd { hyphens: none; }
.case-summary, .card-summary, .sec-intro, .hero-intro { text-wrap: balance; }
p, li, dd, td, th, blockquote { text-wrap: pretty; }
/* Capstone "coming soon" card spans both columns on the last row */
.card.is-wide { grid-column: 1 / -1; }
.card.is-wide .card-media { --ar: 16 / 5 !important; }
@media (max-width: 860px) { .card.is-wide .card-media { --ar: 16 / 10 !important; } }
/* Final photo gallery in the Outcome section */
.case .final-shots { margin-top: 32px; position: relative; left: 50%; transform: translateX(-50%); width: max(100%, min(calc(1240px - 2 * var(--gutter)), calc(100vw - 2 * var(--gutter) - 24px))); }

