/* ============================================================
   CSS CUSTOM PROPERTIES
   All contrast ratios calculated against --bg (#FAF8F4)
   Targeting WCAG AAA (7:1 for normal text, 4.5:1 large text)
============================================================ */
:root {
  --bg:             #F6F2EC;
  --bg-secondary:   #EDE7DC;
  --surface:        rgba(255, 253, 249, 0.80);
  --surface-solid:  #FDFAF5;
  --border:         rgba(196, 180, 162, 0.52);
  --border-solid:   #C8B9A8;
  --border-hi:      rgba(255, 255, 255, 0.55);
  --text-primary:   #1A1614;   /* 16.8:1 ✓ AAA */
  --text-secondary: #524841;   /* 8.2:1  ✓ AAA */
  --text-muted:     #5A4D44;   /* 7.5:1  ✓ AAA */
  --accent-text:    #5C4E45;   /* 7.3:1  ✓ AAA */
  --accent:         #7B6A5F;
  --accent-btn-bg:  #4A3E38;
  --accent-light:   #E8DDD4;
  --accent-lighter: #F2EDE7;
  --shadow-sm:  0 2px 8px rgba(26,22,20,0.09);
  --shadow-md:  0 8px 28px rgba(26,22,20,0.13);
  --shadow-lg:  0 24px 56px rgba(26,22,20,0.17);
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --radius-sm:  10px;
  --radius-md:  16px;
  --radius-lg:  22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --focus-color: #5C4E45;
  /* Header chips are fixed at top:20px, ~55px tall → bottom at ~75px.
     64px breathing room (matching main gap) = 139px. */
  --header-clearance: 140px;
}

/* ---- Dark mode ---- */
[data-theme="dark"] {
  --bg:             #17110E;
  --bg-secondary:   #211710;
  --surface:        rgba(36, 26, 22, 0.82);
  --surface-solid:  #2A1E18;
  --border:         rgba(123,106,95,0.22);
  --border-solid:   rgba(123,106,95,0.35);
  --border-hi:      rgba(255,255,255,0.08);
  --text-primary:   #F5F0EA;
  --text-secondary: #C9BCB2;
  --text-muted:     #A89A90;
  --accent-text:    #D4C5BC;
  --accent:         #C4B5AA;
  --accent-btn-bg:  #D4C5BC;
  --accent-light:   rgba(123,106,95,0.22);
  --accent-lighter: rgba(123,106,95,0.12);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.28);
  --shadow-md:  0 8px 28px rgba(0,0,0,0.32);
  --shadow-lg:  0 24px 56px rgba(0,0,0,0.44);
}

/* ---- High contrast ---- */
[data-contrast="high"] {
  --bg:             #FFFFFF;
  --bg-secondary:   #F5F5F5;
  --surface:        rgba(255,255,255,0.98);
  --surface-solid:  #FFFFFF;
  --border:         #1A1614;
  --border-solid:   #1A1614;
  --text-primary:   #000000;
  --text-secondary: #000000;
  --text-muted:     #111111;
  --accent-text:    #1A0A00;
  --accent:         #1A0A00;
  --accent-btn-bg:  #000000;
  --accent-light:   #E0E0E0;
  --accent-lighter: #F0F0F0;
  --focus-color:    #000000;
}

[data-theme="dark"][data-contrast="high"] {
  --bg:             #000000;
  --bg-secondary:   #0A0A0A;
  --surface:        rgba(0,0,0,0.98);
  --surface-solid:  #000000;
  --border:         #FFFFFF;
  --border-solid:   #FFFFFF;
  --text-primary:   #FFFFFF;
  --text-secondary: #EEEEEE;
  --text-muted:     #DDDDDD;
  --accent-text:    #FFD9CC;
  --accent:         #FFD9CC;
  --accent-btn-bg:  #FFD9CC;
  --accent-light:   #1A1A1A;
  --accent-lighter: #0D0D0D;
  --focus-color:    #FFFFFF;
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; } /* Native smooth scroll (Lenis removed). Reduced-motion overrides to auto below. */

body {
  font-family: var(--font-body);
  line-height: 1.6;
  scrollbar-gutter: stable;
  background-color: #F2EDE6;
  background-image:
    linear-gradient(rgba(242, 237, 230, 0.25), rgba(242, 237, 230, 0.25)),
    url('./assets/shared/background-noise.png'),
    radial-gradient(ellipse at 14% 8%,  #FAF5EE 0%, transparent 58%),
    radial-gradient(ellipse at 88% 94%, #E0D5C0 0%, transparent 52%);
  background-size: 100% 100%, 200px 200px, 100% 100%, 100% 100%;
  background-repeat: no-repeat, repeat, no-repeat, no-repeat;
  background-blend-mode: normal, multiply, normal, normal;
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}
[data-theme="dark"] body {
  background-color: #17110E;
  background-image:
    linear-gradient(rgba(23, 17, 14, 0.65), rgba(23, 17, 14, 0.65)),
    url('./assets/shared/background-noise.png'),
    radial-gradient(ellipse at 14% 8%,  rgba(40, 28, 16, 1) 0%, transparent 58%),
    radial-gradient(ellipse at 88% 94%, rgba(5,  2,  0,  1) 0%, transparent 52%);
  background-blend-mode: normal, multiply, normal, normal;
}

/* ============================================================
   FOCUS STATES — WCAG 2.4.11
============================================================ */
:focus { outline: none; }
:focus-visible {
  outline: 2px dashed var(--focus-color);
  outline-offset: 4px;
  border-radius: 3px;
}
.card:focus-visible,
.bento-card:focus-visible {
  outline: 2px dashed var(--focus-color);
  outline-offset: 4px;
  border-radius: var(--radius-md);
}
a:focus-visible,
button:focus-visible {
  outline: 2px dashed var(--focus-color);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ============================================================
   SKIP LINK
============================================================ */
.skip-link {
  position: absolute; top: -100%; left: 16px;
  padding: 8px 16px;
  background: var(--text-primary); color: var(--bg);
  font-size: 14px; font-weight: 600;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 9999; text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* ============================================================
   KEYFRAME ANIMATIONS
============================================================ */
@keyframes blobFloat1 {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(30px,-20px) scale(1.05); }
  66%      { transform: translate(-15px,15px) scale(0.97); }
}
@keyframes blobFloat2 {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(-25px,20px) scale(1.03); }
  66%      { transform: translate(20px,-10px) scale(0.95); }
}
@keyframes fadeIn    { from { opacity:0 } to { opacity:1 } }
@keyframes slideLeft { from { opacity:0; transform:translateX(-20px) } to { opacity:1; transform:translateX(0) } }


/* ============================================================
   CUSTOM CURSOR
============================================================ */
.cursor-dot {
  position: fixed; left: 0; top: 0;
  width: 8px; height: 8px;
  background: var(--accent-text); border-radius: 50%;
  pointer-events: none; z-index: 9999;
  will-change: transform;
  /* No transform transition — the dot tracks the pointer instantly (the 0.15s
     ease here was a hidden source of lag). */
}
.cursor-ring {
  position: fixed; left: 0; top: 0;
  width: 36px; height: 36px;
  /* Theme-adaptive + higher contrast so the ring stays trackable on every
     background (was hardcoded light-brown → invisible on dark). */
  border: 2px solid color-mix(in srgb, var(--accent-text) 60%, transparent);
  border-radius: 50%; pointer-events: none; z-index: 9998;
  will-change: transform;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; white-space: nowrap; box-sizing: border-box;
  transition: width 0.28s cubic-bezier(0.22,1,0.36,1),
              height 0.28s cubic-bezier(0.22,1,0.36,1),
              border-radius 0.28s cubic-bezier(0.22,1,0.36,1),
              border-color 0.3s ease,
              background-color 0.2s ease,
              padding 0.28s cubic-bezier(0.22,1,0.36,1);
}
.cursor-ring.hovering { width: 54px; height: 54px; border-color: var(--accent-text); }

/* Label pill — ring morphs into a small accent-filled pill on hover.
   Label colour is --bg, which auto-contrasts against the --accent-text fill
   in every theme (cream-on-brown light, dark-on-tan dark). */
.cursor-label {
  opacity: 0;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em; line-height: 1;
  color: var(--bg);
  transition: opacity 0.16s ease;
}
.cursor-ring.is-label { background: var(--accent-text); border-color: transparent; }
.cursor-ring.is-label .cursor-label { opacity: 1; }
.cursor-ring.is-view { width: 88px; height: 30px; border-radius: 16px; padding: 0 14px; }
.cursor-ring.is-ext  { width: 46px; height: 30px; border-radius: 16px; padding: 0 12px; font-size: 14px; }

/* ============================================================
   HEADER — Glassmorphism
============================================================ */
/* Floating header:
   Nav pill anchors to the left, extras pill + cog anchor to the right.
   justify-content: space-between keeps them at opposite edges; the nav
   pill shrinks fluidly via clamp() on its internal spacing so the two
   pills never collide on mid-size laptop widths.
   Container is transparent and pointer-events:none so gaps don't
   block clicks; each floating chip re-enables pointer events. */
body > header {
  position: fixed; top: 20px; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 32px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
}
body > header > * { pointer-events: auto; }
.header-spacer { display: none; }

/* ---- Shared glass treatment — nav pills, hamburger, settings cog ----
   Higher opacity + tighter bevel keeps text WCAG-readable over any
   underlying image (including dark card hero backgrounds).

   Page tint system: each page declares data-page-tint on <body>, setting
   --tint-color to a muted version of that page's background. A ::before
   pseudo-element carries the tint and fades in after the typewriter
   completes, gently shifting the glass toward the page's signature color. */
/* The unified bar carries the glass; inner controls are transparent.
   Brighter white frost (mirrors the project-card caption strips) so the bar
   reads as glass over the same-hue sand background instead of vanishing. */
nav.nav-pill {
  background-color: rgba(255, 255, 255, 0.60);
  backdrop-filter: blur(28px) saturate(1.4) brightness(1.08);
  -webkit-backdrop-filter: blur(28px) saturate(1.4) brightness(1.08);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.80);
  position: relative;
}

/* Tint layer — sits above the glass, fades in via body.tint-filled */
nav.nav-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--tint-color, transparent);
  opacity: 0;
  transition: opacity 700ms ease;
  pointer-events: none;
}
body.tint-filled nav.nav-pill::before {
  opacity: 1;
}

/* Shadow layer behind the backdrop-filter stacking context — prevents the
   drop shadow from compositing through the glass and causing flash/bleed. */
nav.nav-pill::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    0 8px 28px rgba(62,40,22,0.16),
    0 2px 6px  rgba(62,40,22,0.08);
  z-index: -1;
  pointer-events: none;
}

/* Keep bar content above the tint layer */
nav.nav-pill > * {
  position: relative;
  z-index: 1;
}

[data-theme="dark"] nav.nav-pill {
  background-color: rgba(30,22,16,0.72);
  border-color: rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}
[data-theme="dark"] nav.nav-pill::after {
  box-shadow:
    0 8px 28px rgba(0,0,0,0.35),
    0 2px 6px  rgba(0,0,0,0.20);
}
/* Reduced motion: snap to final state — no fade */
[data-motion="reduced"] nav.nav-pill::before {
  transition: none;
}
/* High contrast: remove the tint overlay entirely so the bar stays crisp */
[data-contrast="high"] nav.nav-pill::before {
  background: transparent;
}
@supports not (backdrop-filter: blur(1px)) {
  nav.nav-pill {
    background-color: var(--surface-solid);
  }
  nav.nav-pill::before {
    background: transparent;
  }
}


/* Per-page tint palette — a desaturated MID-TONE of each page's own --bg, so
   the header reads as "the page background, gently intensified" rather than a
   saturated brand wash. Low alpha keeps it glass, not paint. */
body[data-page-tint="home"]     { --tint-color: rgba(205, 186, 158, 0.20); } /* warm sand  (#F6F2EC) */
body[data-page-tint="about"]    { --tint-color: rgba(203, 184, 158, 0.20); } /* warm sand  (#F6F2EC) */
body[data-page-tint="linger"]   { --tint-color: rgba(150, 190, 222, 0.20); } /* pale sky   (#E8F4FD) */
body[data-page-tint="weact"]    { --tint-color: rgba(158, 182, 216, 0.22); } /* pale blue  (#EEF2F8) */
body[data-page-tint="crimemap"] { --tint-color: rgba(16, 19, 25, 0.48); }    /* cool black (#0F1115) */
body[data-page-tint="portfolio"]{ --tint-color: rgba(26, 27, 33, 0.42); }    /* near-black (#0D0D0D) */
/* Dark theme: sample the deepened dark --bg of each page, faint tint. */
[data-theme="dark"] body[data-page-tint="home"]     { --tint-color: rgba(150, 122, 92, 0.14); } /* warm brown (#17110E) */
[data-theme="dark"] body[data-page-tint="about"]    { --tint-color: rgba(150, 122, 92, 0.14); } /* warm brown (#17110E) */
[data-theme="dark"] body[data-page-tint="linger"]   { --tint-color: rgba(108, 138, 150, 0.14); } /* muted teal-grey */
[data-theme="dark"] body[data-page-tint="weact"]    { --tint-color: rgba(80, 110, 155, 0.16); }  /* navy (#080E1A) */
[data-theme="dark"] body[data-page-tint="crimemap"] { --tint-color: rgba(10, 11, 16, 0.52); }    /* cool black (#08090C) */
[data-theme="dark"] body[data-page-tint="portfolio"]{ --tint-color: rgba(24, 24, 30, 0.42); }     /* near-black (#0D0D0D) */

/* Unified bar — left-set: identity │ nav list, then utilities pushed to the
   far right via margin-left:auto. */
nav.nav-pill {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1280px;
  height: 60px; box-sizing: border-box;
  padding: 0 12px 0 10px;
  /* Fixed value, NOT var(--radius-lg) — some pages (e.g. linger.css) redefine
     that token to 32px, which on a 60px bar reads as a full oval. The header is
     a global element and must look identical on every page. */
  border-radius: 22px;
  animation: fadeIn 0.6s ease both;
  animation-delay: 0.1s;
}
.nav-pill-left   { display: flex; align-items: center; }
.nav-pill-center { display: flex; align-items: center; gap: 2px; }
.nav-pill-right  { display: flex; align-items: center; gap: 4px; margin-left: auto; height: 100%; }
.nav-pill-social { display: inline-flex; align-items: center; gap: 2px; }

/* ---- Nav pill contents ----
   Wordmark (serif, heading-sized) | divider | section links with highlighter */
.nav-pill-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(18px, 1.4vw, 21px);
  letter-spacing: -0.3px;
  color: var(--text-primary);
  text-decoration: none;
  padding: 8px clamp(12px, 1.4vw, 18px); border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  position: relative; z-index: 2;
}
.nav-pill-name:hover { background: var(--accent-lighter); }
.nav-pill-name[aria-current="true"] { color: var(--text-primary); }

.nav-pill-divider--name {
  width: 1px; height: 20px;
  background: var(--border-solid);
  opacity: 0.45;
  margin: 0 clamp(3px, 0.5vw, 6px);
}

.nav-pill-sections {
  position: relative;
  display: flex; align-items: center; gap: 0;
  padding: 0 clamp(4px, 0.6vw, 8px) 0 2px;
}

.nav-pill-section {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center;
  padding: 9px clamp(10px, 1.2vw, 16px); border-radius: 999px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: clamp(13px, 1vw, 14px); font-weight: 550; letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 0.2s ease;
  cursor: pointer;
  opacity: 0.78;
}
.nav-pill-section:hover { opacity: 1; }
.nav-pill-section[aria-current="true"] { opacity: 1; font-weight: 600; }

/* Sliding highlighter behind the active section link */
/* Sliding underline — echoes the hero's underline-draw motif. JS sets width +
   translateX; vertical placement is CSS. */
.nav-highlighter {
  position: absolute;
  left: 0; bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
  opacity: 0;
  transform: translateX(0);
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1),
              width 0.4s cubic-bezier(0.22,1,0.36,1),
              opacity 0.2s ease;
  pointer-events: none;
  z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
  .nav-highlighter { transition: opacity 0.15s ease; }
}

/* ---- About — a page link living in the center nav cluster. Styled to match
   the section links, but it's a real navigation (not scroll-spied), so its
   active state is a static underline rather than the sliding one. ---- */
.nav-pill-pagelink {
  position: relative;
  display: inline-flex; align-items: center;
  padding: 9px clamp(10px, 1.2vw, 16px);
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: clamp(13px, 1vw, 14px); font-weight: 550; letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0.78;
  transition: opacity 0.2s ease;
}
.nav-pill-pagelink:hover { opacity: 1; }
.nav-pill-pagelink[aria-current="page"] { opacity: 1; font-weight: 600; }
.nav-pill-pagelink[aria-current="page"]::after {
  content: '';
  position: absolute; left: 12px; right: 12px; bottom: 6px;
  height: 2px; border-radius: 2px;
  background: var(--text-primary);
}

/* ---- Résumé — the single solid accent action. Inverts on theme (dark pill /
   cream text in light mode, and vice-versa) by reusing the CTA token pair. ---- */
.nav-pill-resume {
  display: inline-flex; align-items: center;
  padding: 9px 18px; border-radius: 9999px;
  background: var(--text-primary); color: var(--surface-solid);
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600; letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-pill-resume:hover { opacity: 0.85; transform: translateY(-1px); }
.nav-pill-resume:active { transform: translateY(0); }

/* ---- Extras pill contents ----
   About keeps its label (internal page link needs a word).
   LinkedIn and Contact are icon-only — logos are universally legible,
   and aria-label on the anchor keeps screen-reader labelling intact. */
.extras-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px; font-weight: 550; letter-spacing: 0.01em;
  transition: background 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
  opacity: 0.82;
}
.extras-item svg { flex-shrink: 0; transition: transform 0.25s var(--ease); }
.extras-item:hover { background: rgba(255,255,255,0.35); opacity: 1; }
.extras-item:hover svg:first-of-type { transform: translateY(-1px); }
.extras-item[aria-current="page"] {
  background: var(--accent-light);
  opacity: 1;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}
[data-theme="dark"] .extras-item:hover { background: rgba(255,255,255,0.08); }

.extras-external {
  padding: 9px 11px;
  width: 38px; height: 38px; box-sizing: border-box;
  justify-content: center;
}
.extras-external .extras-label {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.extras-external svg:first-of-type { width: 18px; height: 18px; }
.extras-arrow { display: none; }

.extras-divider {
  width: 1px; height: 18px;
  background: var(--border-solid);
  opacity: 0.45;
  margin: 0 4px;
}

/* Back-compat aliases for lingering generic divider refs */
.nav-pill-divider {
  width: 1px; height: 18px;
  background: var(--border-solid);
  opacity: 0.45;
  margin: 0 4px;
}

/* ---- Mobile hamburger (shown only on narrow viewports) ---- */
/* Glass treatment comes from the shared nav.nav-pill / .extras-pill group above */
.nav-menu-btn {
  display: none;
  width: 42px; height: 42px; border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  background: transparent; border: none;
  align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.nav-menu-btn:hover { background: rgba(255,255,255,0.35); }
[data-theme="dark"] .nav-menu-btn:hover { background: rgba(255,255,255,0.08); }

/* ---- Hamburger bars → × morph ---- */
.nav-menu-btn { flex-direction: column; gap: 4px; }
.burger-bar {
  display: block;
  width: 18px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              opacity   0.20s ease,
              width     0.32s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}
.nav-menu-btn[aria-expanded="true"] .burger-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-menu-btn[aria-expanded="true"] .burger-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-menu-btn[aria-expanded="true"] .burger-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- Mobile slide-down sheet ---- */
.nav-sheet { position: fixed; inset: 0; z-index: 200; }
.nav-sheet[hidden] { display: none; }
.nav-sheet-scrim {
  position: absolute; inset: 0;
  background: rgba(26,22,20,0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.22s ease;
}
.nav-sheet.is-open .nav-sheet-scrim { opacity: 1; }
.nav-sheet-panel {
  position: absolute; top: 0; left: 0; right: 0;
  background: rgba(243,232,215,0.68);
  backdrop-filter: blur(48px) saturate(1.6);
  -webkit-backdrop-filter: blur(48px) saturate(1.6);
  border-bottom: 1px solid rgba(255,255,255,0.65);
  border-radius: 0 0 24px 24px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.80),
    0 24px 60px rgba(62,40,22,0.20),
    0 6px 16px rgba(62,40,22,0.10);
  padding: 76px 24px 28px;
  transform: translateY(-100%);
  transition: transform 0.34s cubic-bezier(0.22,1,0.36,1);
}
[data-theme="dark"] .nav-sheet-panel {
  background: rgba(22,16,12,0.72);
  border-color: rgba(255,255,255,0.12);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 24px 60px rgba(0,0,0,0.45),
    0 6px 16px rgba(0,0,0,0.28);
}
.nav-sheet.is-open .nav-sheet-panel { transform: translateY(0); }

/* Home link row at top of sheet */
.nav-sheet-home {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 18px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 18px; font-weight: 600; letter-spacing: -0.2px;
  border-bottom: 1px solid rgba(62,40,22,0.14);
  margin-bottom: 4px;
  opacity: 0.9;
}
[data-theme="dark"] .nav-sheet-home { border-color: rgba(255,255,255,0.10); }
.nav-sheet-home:hover { opacity: 1; }
.nav-sheet-home svg { flex-shrink: 0; opacity: 0.7; }

.nav-sheet-close {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(243,232,215,0.62);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.72),
    0 4px 12px rgba(62,40,22,0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-primary); cursor: pointer;
}
[data-theme="dark"] .nav-sheet-close {
  background: rgba(30,22,16,0.68);
  border-color: rgba(255,255,255,0.12);
}
.nav-sheet-group {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 0;
}
.nav-sheet-group + .nav-sheet-group {
  border-top: 1px solid rgba(62,40,22,0.12);
  margin-top: 8px; padding-top: 12px;
}
[data-theme="dark"] .nav-sheet-group + .nav-sheet-group {
  border-color: rgba(255,255,255,0.10);
}
.nav-sheet-link {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px; font-weight: 500;
}
.nav-sheet-link:hover { background: rgba(255,255,255,0.38); }
[data-theme="dark"] .nav-sheet-link:hover { background: rgba(255,255,255,0.07); }
.nav-sheet-link[aria-current="true"],
.nav-sheet-link[aria-current="page"] {
  background: rgba(255,255,255,0.50);
  font-weight: 600;
}
[data-theme="dark"] .nav-sheet-link[aria-current="true"],
[data-theme="dark"] .nav-sheet-link[aria-current="page"] {
  background: rgba(255,255,255,0.10);
}
.nav-sheet-link svg { flex-shrink: 0; }

.nav-sheet-group-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.8px; color: var(--text-muted);
  padding: 0 16px 6px;
}
.nav-sheet-toggle[aria-checked="true"] {
  background: rgba(255,255,255,0.50);
  font-weight: 600;
}
[data-theme="dark"] .nav-sheet-toggle[aria-checked="true"] {
  background: rgba(255,255,255,0.10);
}

/* Display control — a ghost button inside the bar (no own glass shell).
   position:relative anchors the settings-bubbles dropdown. */
.settings-wrap {
  display: flex; align-items: center;
  position: relative;
  height: 100%;
}

.settings-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px;
  border: none; background: transparent;
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-body); font-size: 14px; font-weight: 550;
  letter-spacing: 0.01em; white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
  opacity: 0.82;
}
.settings-btn:hover,
.settings-wrap.is-open .settings-btn {
  background: rgba(255,255,255,0.35);
  opacity: 1;
}
[data-theme="dark"] .settings-btn:hover,
[data-theme="dark"] .settings-wrap.is-open .settings-btn {
  background: rgba(255,255,255,0.08);
}
.display-cog { display: none; }
.display-chevron { width: 12px; height: 12px; transition: transform 0.3s var(--ease); }
.settings-wrap.is-open .display-chevron { transform: rotate(180deg); }

.settings-bubbles {
  /* Full mode: a fixed-width panel right-aligned under the Display button,
     holding labeled toggle rows. (Collapsed mode reverts to a narrow centered
     column of icon circles — see the collapse blocks.) */
  position: absolute; top: 100%;
  right: 0; left: auto;
  width: 216px;
  display: flex; flex-direction: column;
  align-items: stretch; gap: 8px; padding-top: 12px;
  z-index: 1;
  /* Closed: the panel is still laid out below the button — must NOT capture
     hover, or the empty area where it will appear would trigger open. Only
     becomes interactive once open (so moving button→menu keeps it open). */
  pointer-events: none;
}
.settings-wrap.is-open .settings-bubbles {
  pointer-events: auto;
}

/* Full mode: each setting is a labeled row — icon · label · toggle switch.
   Glass treatment matches the header pills. (Collapse reverts to icon circle.) */
.settings-bubble {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: auto;
  padding: 9px 11px 9px 12px; border-radius: 12px;
  background: rgba(243, 232, 215, 0.62);
  backdrop-filter: blur(28px) saturate(1.35);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
  cursor: pointer; color: var(--text-primary);
  position: relative;
  opacity: 0; transform: scale(0.96) translateY(-8px);
  transition: opacity 0.25s var(--ease), transform 0.3s var(--ease),
              background 0.2s ease, border-color 0.2s ease;
  pointer-events: none;
}
.settings-bubble-label {
  flex: 1; text-align: left;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  letter-spacing: 0.01em; white-space: nowrap;
}
/* Toggle switch — track + sliding knob, greens on aria-checked */
.settings-toggle {
  flex-shrink: 0; position: relative;
  width: 34px; height: 20px; border-radius: 999px;
  background: var(--border-solid);
  transition: background 0.2s ease;
}
.settings-toggle-knob {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.28);
  transition: transform 0.2s var(--ease);
}
.settings-bubble[aria-checked="true"] .settings-toggle      { background: #22c55e; }
.settings-bubble[aria-checked="true"] .settings-toggle-knob { transform: translateX(14px); }
[data-theme="dark"] .settings-bubble {
  background: rgba(30,22,16,0.68);
  border-color: rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}
body.tint-filled .settings-bubble {
  background:
    linear-gradient(var(--tint-color, transparent), var(--tint-color, transparent)),
    rgba(243, 232, 215, 0.62);
}
[data-theme="dark"] body.tint-filled .settings-bubble {
  background:
    linear-gradient(var(--tint-color, transparent), var(--tint-color, transparent)),
    rgba(30,22,16,0.68);
}
.settings-bubble::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    0 8px 28px rgba(62,40,22,0.16),
    0 2px 6px  rgba(62,40,22,0.08);
  z-index: -1;
  pointer-events: none;
}
[data-theme="dark"] .settings-bubble::after {
  box-shadow:
    0 8px 28px rgba(0,0,0,0.35),
    0 2px 6px  rgba(0,0,0,0.20);
}
.settings-bubble svg { width: 17px; height: 17px; flex-shrink: 0; }
/* Stagger only the entrance (opacity/transform) — keep background/border-color
   instant so a theme toggle recolours every row at once, not in sequence.
   Order matches the transition list: opacity, transform, background, border. */
.settings-bubble:nth-child(1) { transition-delay: 0.04s, 0.04s, 0s, 0s; }
.settings-bubble:nth-child(2) { transition-delay: 0.1s, 0.1s, 0s, 0s; }

.settings-wrap.is-open .settings-bubble {
  opacity: 1; transform: scale(1) translateY(0); pointer-events: auto;
}
/* Green ring in high contrast modes — strengthen ring, no glow needed */
[data-contrast="high"] .settings-bubble[aria-checked="true"],
[data-theme="dark"][data-contrast="high"] .settings-bubble[aria-checked="true"] {
  box-shadow:
    0 0 0 3px #22c55e;
  border-color: #22c55e;
}
/* OS-level forced colors (Windows high contrast) — use outline so it isn't stripped */
@media (forced-colors: active) {
  .settings-bubble[aria-checked="true"] {
    outline: 3px solid Highlight;
    forced-color-adjust: none;
  }
}
/* Tooltip + On/Off popout are only needed in collapsed (icon-only) mode —
   in full mode the visible label + toggle convey everything. */
.settings-bubble::before { display: none; }
.settings-state { display: none; }
.settings-bubble::before {
  content: attr(data-tooltip);
  position: absolute; right: calc(100% + 10px);
  top: 50%; transform: translateY(-50%) translateX(0);
  background: var(--text-primary); color: var(--bg);
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  white-space: nowrap; padding: 4px 9px; border-radius: 6px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease, transform 0.18s ease;
}
.settings-bubble:hover::before { opacity: 1; }
/* Push tooltip label further left while state pill is visible */
.settings-bubble:has(.settings-state--visible)::before {
  transform: translateY(-50%) translateX(-54px);
}
/* Dark Mode row always shows the moon (represents the setting, not the action) */
.settings-bubble .icon-moon { display: block; }
.settings-bubble .icon-sun  { display: none; }

/* ---- Settings On/Off state pill ---- */
.settings-bubble { overflow: visible; }
.settings-state {
  position: absolute; right: calc(100% + 8px);
  background: var(--surface-solid); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 8px;
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  color: var(--text-secondary); white-space: nowrap; pointer-events: none;
  opacity: 0; visibility: hidden; transform: translateX(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}
.settings-state--visible {
  opacity: 1; visibility: visible; transform: translateX(0);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0s;
}
.settings-state--exit {
  opacity: 0; transform: translateX(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

/* ---- Reduced motion ---- */
[data-motion="reduced"] *,
[data-motion="reduced"] *::before,
[data-motion="reduced"] *::after {
  animation: none !important;
  transition: none !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}
/* Undo CSS pre-hides that GSAP would normally animate away */
[data-motion="reduced"] .hero-liquid-bg,
[data-motion="reduced"] .hero-glass-sheen,
[data-motion="reduced"] .hero,
[data-motion="reduced"] .hero-bg-zone,
[data-motion="reduced"] .case-hero { opacity: 1 !important; transform: none !important; }

/* === FOUC prevention: pre-hide GSAP reveal targets ===========================
   The inline applyPrefs script in each page's <head> adds .pre-anim to <html>
   when motion is enabled. Each page's GSAP script removes it as its first
   statement, before any tween reads the DOM. A safety timeout in applyPrefs
   clears it if GSAP fails to load (CDN down), so content can never be
   permanently invisible. Hero targets are hidden on all viewports; scroll
   reveals mirror GSAP's min-width:800px gate so mobile (where no scroll
   reveal runs) doesn't end up with stuck-invisible content. */
html.pre-anim .hero,
html.pre-anim .hero-bg-zone,
html.pre-anim .hero-liquid-bg,
html.pre-anim .hero-glass-sheen,
html.pre-anim .case-hero,
/* portfolio.html reveals these unconditionally (no min-width gate) */
html.pre-anim .pf-section,
html.pre-anim .pf-meta { opacity: 0; }
/* Reveal targets gated by `min-width: 800px` in each page's GSAP — mirror
   the gate here so mobile (where no scroll reveal runs) doesn't end up with
   stuck-invisible content if pre-anim's safety timeout doesn't fire in time. */
@media (min-width: 800px) {
  html.pre-anim .card,
  html.pre-anim .bento-card,
  html.pre-anim .section-heading,
  html.pre-anim .meta-item,
  html.pre-anim .overview-card,
  html.pre-anim .stat-card,
  html.pre-anim .process-pipeline-card,
  html.pre-anim .process-step,
  html.pre-anim .reflection-card,
  html.pre-anim .glass-gallery-pane,
  html.pre-anim .glass-tile,
  html.pre-anim .about-card,
  html.pre-anim .linger-showcase-row,
  html.pre-anim .case-showcase,
  html.pre-anim .proto-compare,
  html.pre-anim .content-row .text-col,
  html.pre-anim .content-row .image-col,
  html.pre-anim .content-full,
  html.pre-anim .section-eyebrow,
  html.pre-anim footer { opacity: 0; }
}

/* ============================================================
   IO ENTRANCE ANIMATIONS — replaces GSAP ScrollTrigger for
   all one-shot scroll reveals. GPU-composited (transform +
   opacity only) so they never block the main thread.
   Only active on desktop (mirrors the GSAP 800px gate).
============================================================ */
@keyframes io-fade-up {
  from { opacity: 0; transform: translateY(28px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes io-slide-left {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes io-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes io-expand {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Hidden states — applied by anim-io.js before elements reach the viewport */
@media (min-width: 800px) {
  .io-pending          { opacity: 0; transform: translateY(28px) scale(0.98); will-change: transform, opacity; }
  .io-pending-fade     { opacity: 0; will-change: opacity; }
  .io-pending-slide    { opacity: 0; transform: translateX(-24px); will-change: transform, opacity; }
  .io-pending-expand   { transform: scaleX(0); transform-origin: left center; opacity: 0; will-change: transform, opacity; }

  /* Revealed states */
  .io-pending.io-in          { animation: io-fade-up    0.72s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .io-pending-fade.io-in     { animation: io-fade-in    0.70s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .io-pending-slide.io-in    { animation: io-slide-left 0.60s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .io-pending-expand.io-in   { animation: io-expand     1.00s cubic-bezier(0.65, 0, 0.35, 1) both; }
}

/* Under reduced motion: skip hidden state entirely */
@media (prefers-reduced-motion: reduce) {
  .io-pending, .io-pending-fade, .io-pending-slide, .io-pending-expand { opacity: 1 !important; transform: none !important; }
  .io-pending.io-in, .io-pending-fade.io-in, .io-pending-slide.io-in, .io-pending-expand.io-in { animation: none !important; }
}
[data-motion="reduced"] .io-pending,
[data-motion="reduced"] .io-pending-fade,
[data-motion="reduced"] .io-pending-slide,
[data-motion="reduced"] .io-pending-expand { opacity: 1 !important; transform: none !important; animation: none !important; }

/* Settings dropdown: under reduced motion, kill ALL transitions, animations,
   and transforms across the entire settings tree so nothing bounces, slides,
   or fades — elements just appear/disappear via opacity. */
[data-motion="reduced"] .settings-wrap,
[data-motion="reduced"] .settings-wrap *,
[data-motion="reduced"] .settings-wrap *::before,
[data-motion="reduced"] .settings-wrap *::after {
  transition: none !important;
  transition-delay: 0s !important;
  animation: none !important;
}
[data-motion="reduced"] .settings-bubble {
  transform: none !important;
}
/* Cursor ring also transitions size on hover — kill that too under reduced
   motion so cursor effects don't appear to drift. */
[data-motion="reduced"] .cursor-ring {
  transition: none !important;
}

/* ============================================================
   FOOTER
============================================================ */
footer {
  background: var(--surface-solid);
  background: var(--surface);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
  padding: 28px 44px; width: 100%;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  transition: background 0.3s ease;
}
.footer-links {
  display: flex; gap: 32px; align-items: center; flex-wrap: wrap; justify-content: center;
}
.footer-links a {
  display: flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  text-decoration: none; color: var(--text-secondary);
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--text-primary); }
.footer-links a svg { width: 17px; height: 17px; transition: transform 0.2s ease; }
.footer-links a:hover svg { transform: translateY(-1px); }
.footer-bottom {
  position: relative; display: flex; align-items: center; width: 100%;
}
.footer-top-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: 13px; color: var(--text-muted);
  transition: color 0.2s ease; margin-left: auto;
}
.footer-top-btn:hover { color: var(--text-primary); }

/* Footer CTA pre-section */
.footer-cta {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 28px 0 20px; text-align: center;
}
.footer-avail-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text-secondary);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9999px; padding: 6px 14px;
}
.footer-avail-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4caf6e;
  box-shadow: 0 0 0 0 rgba(76, 175, 110, 0.5);
  animation: availPulse 2.4s ease-in-out infinite;
}
@keyframes availPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76, 175, 110, 0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(76, 175, 110, 0); }
}
[data-motion="reduced"] .footer-avail-dot { animation: none; }
[data-theme="dark"]     .footer-avail-dot,
[data-contrast="high"]  .footer-avail-dot { background: #4caf6e; }

/* About page status chip */
.about-status-chip {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 16px; line-height: 1.4;
  color: var(--text-secondary);
}
.about-status-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  background: #4caf6e;
  box-shadow: 0 0 0 0 rgba(76, 175, 110, 0.5);
  animation: aboutStatusPulse 2.4s ease-in-out infinite;
}
@keyframes aboutStatusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76, 175, 110, 0.85); }
  50%       { box-shadow: 0 0 0 6px rgba(76, 175, 110, 0.1); }
}
[data-theme="dark"] .about-status-dot { background: #4caf6e; animation-name: aboutStatusPulse; }
[data-motion="reduced"] .about-status-dot { animation: none; }
[data-contrast="high"] .about-status-dot { animation: none; }
.footer-cta-text {
  font-family: var(--font-heading);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 400; font-style: italic; letter-spacing: -0.8px;
  color: var(--text-primary); margin: 0;
  line-height: 1.1;
}
.footer-cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 32px; border-radius: 9999px;
  background: var(--text-primary); color: var(--surface-solid);
  font-size: 15px; font-weight: 600; letter-spacing: -0.1px;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.footer-cta-btn:hover { opacity: 0.82; transform: translateY(-2px); }
.footer-divider {
  width: 48px; height: 1px; background: var(--border);
  align-self: center;
}
.footer-colophon {
  display: block; font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.3px; margin-top: 3px;
}
.footer-copyright {
  position: absolute; left: 50%; transform: translateX(-50%);
  text-align: center; white-space: nowrap;
  font-size: 13px; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}

/* ============================================================
   DIVIDER
============================================================ */
.divider {
  width: 200px; height: 1px;
  background: var(--border-solid); border: none; margin: 0;
}

/* ============================================================
   HOMEPAGE — MAIN
============================================================ */
main {
  display: flex; flex-direction: column; align-items: center;
  gap: 64px; padding: var(--header-clearance) 44px 88px;
}

/* ============================================================
   HOMEPAGE — HERO
============================================================ */
/* Hidden before GSAP initialises — prevents flash on first paint.
   will-change pre-composites effects (backdrop-filter, transforms) before reveal
   so they're fully computed when opacity animates in — no 1-2 frame blur delay. */
.hero-liquid-bg,
.hero-glass-sheen,
.hero,
.hero-bg-zone {              /* atmospheric bg zone — home + about */
  opacity: 0;
  will-change: transform, opacity;
}

.hero-wrapper {
  position: relative; width: 100%; max-width: 1212px;
  display: flex; justify-content: center;
}
.hero-wrapper::before, .hero-wrapper::after {
  content: ''; position: absolute; border-radius: 50%;
  z-index: 0; pointer-events: none;
}
.hero-wrapper::before {
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(123,106,95,0.1) 0%, transparent 70%);
  top: -70px; left: -90px;
  animation: blobFloat1 12s ease-in-out infinite;
}
.hero-wrapper::after {
  width: 270px; height: 270px;
  background: radial-gradient(circle, rgba(232,221,212,0.3) 0%, transparent 70%);
  bottom: -50px; right: -50px;
  animation: blobFloat2 10s ease-in-out infinite;
}
.hero {
  position: relative; z-index: 1;
  perspective: 1200px;
  display: flex; flex-direction: column; align-items: center; gap: 28px;
  padding: 72px 80px; width: 100%;
  /* Nearly transparent — animation visible through most of the card */
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  /* Transparent border — rim rendered by .hero-glass-sheen instead */
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-lg);
  /* Outer lift shadow gives the card a raised/dome feel */
  box-shadow:
    0 6px 40px rgba(90, 58, 18, 0.22),
    0 2px 10px rgba(90, 58, 18, 0.14),
    0 1px 0   rgba(255, 255, 255, 0.80);   /* very thin top lift line */
  transition: background 0.3s ease, border-color 0.3s ease;
}
[data-theme="dark"] .hero {
  background: rgba(36, 26, 22, 0.62);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow:
    0 6px 40px rgba(0, 0, 0, 0.40),
    0 2px 10px rgba(0, 0, 0, 0.28),
    0 1px 0   rgba(255, 255, 255, 0.08);
}

/* ---- Glass dome sheen overlay ---- */
/* Positioned above hero content (z-index 2 within hero-wrapper stacking ctx).
   Creates: top-dome highlight, diagonal light catch, and bright rim edges.   */
.hero-glass-sheen {
  position: absolute; inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: 2;
  overflow: hidden;

  /* Dome gradient: bright arc at top-center fades to nothing — simulates
     light bouncing off the convex face of a raised glass surface           */
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%,
      rgba(255, 255, 255, 0.45) 0%,
      rgba(255, 255, 255, 0.12) 45%,
      transparent 70%),
    /* Top-left diagonal light catch — as if angled studio light hits rim */
    linear-gradient(148deg,
      rgba(255, 255, 255, 0.22) 0%,
      transparent 38%),
    /* Bottom-right counter-reflection — subtle secondary light bounce */
    linear-gradient(328deg,
      rgba(255, 255, 255, 0.10) 0%,
      transparent 35%);

  /* Rim highlights — 4 edges, top brightest (light source above),
     sides medium, bottom dimmest — mimics curved glass catching rim light */
  box-shadow:
    inset 0   1.5px 0 rgba(255, 255, 255, 0.92),   /* top rim */
    inset 1.5px 0   0 rgba(255, 255, 255, 0.55),   /* left rim */
    inset -1.5px 0  0 rgba(255, 255, 255, 0.40),   /* right rim */
    inset 0  -1px   0 rgba(255, 255, 255, 0.22);   /* bottom rim */
}
[data-theme="dark"] .hero-glass-sheen {
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%,
      rgba(255, 255, 255, 0.14) 0%,
      transparent 70%),
    linear-gradient(148deg, rgba(255,255,255,0.08) 0%, transparent 38%);
  box-shadow:
    inset 0   1.5px 0 rgba(255, 255, 255, 0.22),
    inset 1.5px 0   0 rgba(255, 255, 255, 0.12),
    inset -1.5px 0  0 rgba(255, 255, 255, 0.08),
    inset 0  -1px   0 rgba(255, 255, 255, 0.05);
}
/* ============================================================
   HERO — LIQUID WAVE BACKGROUND
============================================================ */
.hero-liquid-bg {
  position: absolute; inset: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  z-index: 0; pointer-events: none;
}
.liquid-canvas {
  width: 100%; height: 100%;
  display: block;
}

/* Localized frost — only behind the text, not the whole card.
   This keeps the animation visible everywhere else while meeting AA contrast. */
.hero-text-backdrop {
  display: flex; flex-direction: column; align-items: center; gap: 28px;
  padding: 40px 48px;
  border-radius: 18px;
  width: 100%; box-sizing: border-box;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px) saturate(1.4) brightness(1.06);
  -webkit-backdrop-filter: blur(18px) saturate(1.4) brightness(1.06);
  border: 1px solid rgba(255, 255, 255, 0.20);
  position: relative; z-index: 1;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
  will-change: transform, opacity;
}
/* Sheen — soft radial hotspot that tracks the cursor across the glass face. */
.hero-sheen-follow {
  position: absolute; inset: 0;
  border-radius: 18px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  background: radial-gradient(circle 180px at var(--sx, 50%) var(--sy, 50%),
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.14) 30%,
    transparent 60%);
  mix-blend-mode: screen;
  will-change: opacity, background-position;
}
[data-theme="dark"] .hero-sheen-follow {
  background: radial-gradient(circle 180px at var(--sx, 50%) var(--sy, 50%),
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.06) 35%,
    transparent 60%);
}
.hero-text-backdrop > .about-status-chip,
.hero-text-backdrop > .about-status-chip-wrap,
.hero-text-backdrop > .hero-body,
.hero-text-backdrop > h1,
.hero-text-backdrop > .hero-subtitle {
  position: relative; z-index: 3;
}
[data-theme="dark"] .hero-text-backdrop {
  background: rgba(36, 26, 22, 0.48);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
@supports not (backdrop-filter: blur(1px)) {
  .hero-text-backdrop { background: rgba(255, 255, 255, 0.80); }
  [data-theme="dark"] .hero-text-backdrop { background: rgba(36, 26, 22, 0.88); }
}

/* ============================================================
   ATMOSPHERIC HERO BACKDROP — home + about pages
   Full-bleed canvas at page level (body sibling of header).
   .hero → transparent shell (perspective only).
   .hero-text-backdrop → sole visible frosted card.
   Gradient masks: 80px top fade (under floating pills),
   240px / 200px bottom fade (dissolves into page bg).
============================================================ */
body[data-page-tint="home"],
body[data-page-tint="about"] { position: relative; }

.hero-bg-zone {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 0; pointer-events: none; overflow: hidden;
}
.hero-bg-zone .liquid-canvas { width: 100%; height: 100%; display: block; }

/* Dark-mode tint — warms to cool/dark so the page actually feels dark */
.hero-bg-zone::after {
  content: ''; position: absolute; inset: 0;
  pointer-events: none; background: transparent;
  transition: background 0.4s;
}
[data-theme="dark"] .hero-bg-zone::after { background: rgba(8, 5, 3, 0.58); }

/* Main floats above the atmospheric backdrop */
body[data-page-tint="home"] main,
body[data-page-tint="about"] main { position: relative; z-index: 1; }

/* Outer .hero → transparent shell; keeps flex layout + perspective */
body[data-page-tint="home"] .hero,
body[data-page-tint="about"] .hero {
  padding: 0; background: transparent;
  border: 1px solid transparent; box-shadow: none; transition: none;
}
[data-theme="dark"] body[data-page-tint="home"] .hero,
[data-theme="dark"] body[data-page-tint="about"] .hero {
  background: transparent; border-color: transparent; box-shadow: none;
}

/* Wrapper blob decorations compete with atmospheric bg — suppress */
body[data-page-tint="home"] .hero-wrapper::before,
body[data-page-tint="home"] .hero-wrapper::after,
body[data-page-tint="about"] .hero-wrapper::before,
body[data-page-tint="about"] .hero-wrapper::after { display: none; }

/* HOME — bg zone height + gradient mask.
   Height sized so the fade completes around the divider below the hero card. */
body[data-page-tint="home"] .hero-bg-zone {
  height: clamp(740px, 84vh, 900px);
  -webkit-mask-image: linear-gradient(to bottom,
    transparent 0, rgba(0,0,0,1) 60px,
    rgba(0,0,0,1) calc(100% - 150px), transparent 100%);
          mask-image: linear-gradient(to bottom,
    transparent 0, rgba(0,0,0,1) 60px,
    rgba(0,0,0,1) calc(100% - 150px), transparent 100%);
}
/* HOME — frosted card adopts full outer-card padding + radius + stronger frost */
body[data-page-tint="home"] .hero-text-backdrop {
  padding: 64px 80px; gap: 28px; border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.34);
  /* Fake frost — none overrides the base .hero-text-backdrop blur on home */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  justify-content: center;
  /* Middle ground — enough height to read as a deliberate, confident hero
     rather than a thin banner, without forcing dead air around the short
     copy. Projects still peek in below the fold on a standard viewport. */
  min-height: clamp(380px, 46vh, 460px);
  /* Slight elevation — the base rule has only an inset highlight, so the card
     sits visually flush with the page. A soft outer shadow gives it a touch
     of lift/authority without changing size, opacity, or adding content. */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    0 24px 48px -16px rgba(80, 55, 30, 0.16),
    0 8px 20px -8px rgba(80, 55, 30, 0.10);
}
[data-theme="dark"] body[data-page-tint="home"] .hero-text-backdrop {
  background: rgba(36, 26, 22, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 24px 48px -16px rgba(0, 0, 0, 0.45),
    0 8px 20px -8px rgba(0, 0, 0, 0.30);
}

/* ABOUT — bg zone shorter (about hero has less content) */
body[data-page-tint="about"] .hero-bg-zone {
  height: clamp(540px, 72vh, 900px);
  -webkit-mask-image: linear-gradient(to bottom,
    transparent 0, rgba(0,0,0,1) 80px,
    rgba(0,0,0,1) calc(100% - 200px), transparent 100%);
          mask-image: linear-gradient(to bottom,
    transparent 0, rgba(0,0,0,1) 80px,
    rgba(0,0,0,1) calc(100% - 200px), transparent 100%);
}
/* ABOUT — same card padding/sizing as home so both hero cards match exactly.
   justify-content stays flex-start here (unlike home) — the status chip
   needs to sit pinned near the top while the h1+underline center in the
   leftover space below it (see .hero-body / h1 margin-auto rules below). */
body[data-page-tint="about"] .hero-text-backdrop {
  padding: 64px 80px; gap: 28px; border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.34);
  /* See-through frost — none overrides the base blur over the liquid canvas */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  justify-content: flex-start;
  min-height: clamp(380px, 46vh, 460px);
}
[data-theme="dark"] body[data-page-tint="about"] .hero-text-backdrop {
  background: rgba(36, 26, 22, 0.42);
}

/* Tablet responsive */
@media (max-width: 1279px) {
  body[data-page-tint="home"] .hero  { padding: 0; }
  body[data-page-tint="home"] .hero-text-backdrop { padding: 56px 44px; }
  body[data-page-tint="about"] .hero { padding: 0; }
  body[data-page-tint="about"] .hero-text-backdrop { padding: 56px 44px; }
  body[data-page-tint="home"] .hero-bg-zone {
    height: clamp(740px, 84vh, 860px);
    -webkit-mask-image: linear-gradient(to bottom,
      transparent 0, rgba(0,0,0,1) 80px,
      rgba(0,0,0,1) calc(100% - 105px), transparent 100%);
              mask-image: linear-gradient(to bottom,
      transparent 0, rgba(0,0,0,1) 80px,
      rgba(0,0,0,1) calc(100% - 105px), transparent 100%);
  }
}
/* Mobile responsive */
@media (max-width: 799px) {
  body[data-page-tint="home"] .hero { padding: 0; }
  body[data-page-tint="home"] .hero-text-backdrop {
    padding: 48px 24px; gap: 20px; border-radius: var(--radius-lg);
    min-height: auto; /* remove desktop min-height on mobile */
    justify-content: flex-start;
  }
  body[data-page-tint="home"] .hero-text-col { gap: 20px; }
  body[data-page-tint="home"] .hero-text-col h1 {
    font-size: clamp(28px, 8vw, 38px);
  }
  body[data-page-tint="home"] .hero-bg-zone {
    height: clamp(580px, 80vh, 720px); /* extended so texture reaches the divider under the hero card */
    -webkit-mask-image: linear-gradient(to bottom,
      transparent 0, rgba(0,0,0,1) 60px,
      rgba(0,0,0,1) calc(100% - 80px), transparent 100%);
              mask-image: linear-gradient(to bottom,
      transparent 0, rgba(0,0,0,1) 60px,
      rgba(0,0,0,1) calc(100% - 80px), transparent 100%);
  }
  body[data-page-tint="about"] .hero { padding: 0; }
  body[data-page-tint="about"] .hero-text-backdrop {
    padding: 48px 24px; border-radius: var(--radius-lg);
    /* Generous min-height — the chip wraps to multiple lines at this width,
       so it needs real clearance above the centered h1 below it. */
    min-height: 340px;
    justify-content: flex-start;
  }
  body[data-page-tint="about"] .hero-text-col h1 {
    font-size: clamp(28px, 8vw, 38px);
  }
  body[data-page-tint="about"] .hero-text-backdrop > .about-status-chip-wrap {
    padding: 0 12px;
    top: 22%;
  }
  body[data-page-tint="about"] .about-status-chip-wrap .about-status-chip {
    font-size: 14px;
  }
  body[data-page-tint="about"] .hero-bg-zone {
    height: clamp(400px, 60vh, 580px);
    -webkit-mask-image: linear-gradient(to bottom,
      transparent 0, rgba(0,0,0,1) 60px,
      rgba(0,0,0,1) calc(100% - 120px), transparent 100%);
              mask-image: linear-gradient(to bottom,
      transparent 0, rgba(0,0,0,1) 60px,
      rgba(0,0,0,1) calc(100% - 120px), transparent 100%);
  }
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 66px; font-weight: 400; font-style: italic; line-height: 1.13;
  text-align: center;
  color: rgba(26, 22, 20, 0.80);
  letter-spacing: -0.02em; max-width: 880px;
  text-shadow:
    0  2px 0   rgba(255, 255, 255, 0.92),
    0 -1px 0   rgba(0,   0,   0,   0.18),
    1px 0  0   rgba(255, 255, 255, 0.35),
    0  2px 8px rgba(0,   0,   0,   0.06);
}
.hero h1 .highlight {
  color: var(--text-muted);
  text-shadow:
    0  2px 0   rgba(255, 255, 255, 0.92),
    0 -1px 0   rgba(0,   0,   0,   0.20),
    1px 0  0   rgba(255, 255, 255, 0.30),
    0  2px 8px rgba(0,   0,   0,   0.07);
}
.underline-draw {
  display: block; width: 0%;
  height: 4px; margin-top: 14px;
  background: linear-gradient(90deg, var(--text-muted), transparent);
  border-radius: 2px;
}
/* Each credential is its own line, not a single run-on sentence — the first
   clause alone (~535px at this font size) is already too long to share a
   line with a second clause inside a column narrow enough to stay readable,
   so a "single line + separator" layout would just relocate the orphan
   problem instead of solving it. Stacking sidesteps it entirely: no wrap
   point ever lands mid-clause regardless of viewport width. */
.hero-subtitle {
  display: flex; flex-direction: column;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 19px; line-height: 1.5;
  text-align: left;
  color: rgba(26, 22, 20, 0.85);
  max-width: 760px;
  text-shadow:
    0  1px 0 rgba(255, 255, 255, 0.80),
    0 -1px 0 rgba(0,   0,   0,   0.12);
}
.hero-tagline {
  font-family: var(--font-body);
  font-size: 16px; font-weight: 600;
  text-align: left;
  color: rgba(26, 22, 20, 0.62);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* ---- Dark mode hero text ---- */
[data-theme="dark"] .hero h1,
[data-theme="dark"] .hero-wrapper .hero-text-backdrop h1 {
  color: rgba(245, 240, 234, 0.88);
  text-shadow: none;
}
[data-theme="dark"] .hero h1 .highlight {
  color: var(--text-muted);
  text-shadow: none;
}
[data-theme="dark"] .hero-subtitle {
  color: rgba(245, 240, 234, 0.85);
  text-shadow: none;
}
[data-theme="dark"] .hero-tagline {
  color: rgba(245, 240, 234, 0.58);
  text-shadow: none;
}

/* ============================================================
   HOMEPAGE HERO — TWO-COLUMN BODY
============================================================ */
body[data-page-tint="home"] .hero-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 52px;
  align-items: center;
  width: 100%;
}

/* Text column */
.hero-text-col {
  display: flex; flex-direction: column;
  align-items: center; gap: 28px;
}

/* Meta block — tagline + credentials, left-aligned. The h1 shares this same
   width + alignment (see override below) so both sit on one consistent
   left edge instead of the headline centering independently above a
   left-aligned block — that mismatch is what made the underline look
   disconnected from the text under it. */
.hero-meta {
  display: flex; flex-direction: column; gap: 10px;
  align-self: center;
  max-width: 620px;
  width: 100%;
}

/* Override centered defaults for home text column — left-aligned, same
   width as .hero-meta, so the underline (which tracks the h1 box width)
   starts at the same left edge as the credentials below it. */
body[data-page-tint="home"] .hero-text-col h1 {
  text-align: left;
  max-width: 620px;
  width: 100%;
  font-size: clamp(38px, 4.6vw, 64px);
}
body[data-page-tint="home"] .hero-text-col .hero-subtitle {
  max-width: none;
  font-size: 20px;
}

/* Tablet */
@media (max-width: 1279px) {
  body[data-page-tint="home"] .hero-body { gap: 36px; }
  body[data-page-tint="home"] .hero-text-col h1 {
    font-size: clamp(36px, 4.8vw, 60px);
  }
}

/* Mobile — tighten body gap */
@media (max-width: 799px) {
  body[data-page-tint="home"] .hero-body { gap: 24px; }
}

/* ============================================================
   ABOUT HERO — the h1 + underline center in the card's full height
   (top-edge-to-h1 gap == underline-to-bottom-edge gap). The status
   chip is taken out of that flow entirely and pinned independently,
   halfway between the card's top edge and the (now-centered) h1.
============================================================ */
body[data-page-tint="about"] .hero-text-backdrop > .about-status-chip-wrap {
  position: absolute;
  top: 25%; left: 0; right: 0;
  transform: translateY(-50%);
  padding: 0 80px;
  text-align: center;
}
body[data-page-tint="about"] .about-status-chip-wrap .about-status-chip {
  display: inline-flex;
  text-align: left;
}
body[data-page-tint="about"] .hero-body {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  flex: 1;
  min-height: 0;
}
body[data-page-tint="about"] .hero-text-col {
  height: 100%;
  justify-content: center;
}
body[data-page-tint="about"] .hero-text-col h1 {
  font-size: clamp(38px, 4.6vw, 64px);
}

/* Tablet */
@media (max-width: 1279px) {
  body[data-page-tint="about"] .hero-text-col h1 {
    font-size: clamp(36px, 4.8vw, 60px);
  }
}

/* ============================================================
   HOMEPAGE — SECTION HEADINGS
============================================================ */
.section-heading {
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 2.2px;
  color: var(--text-muted); text-align: center;
}

/* ============================================================
   HOMEPAGE — PROJECTS
============================================================ */
.projects-section {
  display: flex; flex-direction: column; align-items: center;
  gap: 40px; width: 100%;
}

/* ── MORE / LESS toggle ── */
.more-toggle-wrap {
  width: 100%; max-width: 1220px;
  display: flex; align-items: center; gap: 0;
}
.more-toggle-wrap::before,
.more-toggle-wrap::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border);
}
.more-toggle-btn {
  display: flex; align-items: center; gap: 9px;
  flex-shrink: 0;
  padding: 9px 22px;
  margin: 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 12px; font-weight: 600;
  letter-spacing: 2.2px; text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.more-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: rgba(var(--surface-rgb, 255,255,255), 0.06);
}
.more-toggle-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.more-toggle-icon {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.more-toggle-btn[aria-expanded="true"] .more-toggle-icon {
  transform: rotate(180deg);
}

/* ── Expandable project section ── */
.more-projects-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%; max-width: 1220px;
  contain: layout;
}
.more-projects-wrap.is-open {
  grid-template-rows: 1fr;
}
.more-projects-inner {
  overflow: hidden;
  min-height: 0;
}
.more-projects-inner .cards--rows {
  padding: 22px 10px 32px;
}

/* Cards start invisible — no transition so there's no flash on page load */
.more-projects-inner .card {
  opacity: 0;
  transform: translateY(28px);
  will-change: transform, opacity;
}
/* Phase: entering — container has started expanding, now cards rise in */
.more-projects-wrap.is-entering .more-projects-inner .card {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Phase: closing — cards fade + drop before container collapses */
.more-projects-wrap.is-closing .more-projects-inner .card {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.cards {
  display: flex; flex-wrap: wrap; gap: 28px; justify-content: center; width: 100%; max-width: 1220px;
}
/* While scrolling, kill pointer-events site-wide so cursor sweeps can't fire
   :hover transitions mid-scroll (class set/cleared by layout.js). Restored
   120ms after scrolling stops. */
html.is-scrolling,
html.is-scrolling * { pointer-events: none !important; }

.card {
  display: flex; flex-direction: column;
  flex: 1 1 calc(33.333% - 20px); min-width: 0; max-width: 388px;
  position: relative;
  border-radius: var(--radius-md);
  background:
    linear-gradient(rgba(225, 212, 196, 0.38), rgba(225, 212, 196, 0.38)) padding-box,
    linear-gradient(135deg,
      rgba(255,255,255,0.52) 0%,
      rgba(255,255,255,0.14) 45%,
      rgba(255,255,255,0.04) 100%
    ) border-box;
  backdrop-filter: blur(8px) saturate(1.08);
  -webkit-backdrop-filter: blur(8px) saturate(1.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.50);
  border: 1px solid transparent;
  overflow: hidden;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s ease;
  /* Pre-promote to GPU layer so the heavy blur/blend effects inside are ready
     before the reveal animation fires — avoids the cold-compositor lag spike. */
  will-change: transform, opacity;
}
[data-theme="dark"] .card {
  background:
    linear-gradient(rgba(30, 20, 14, 0.52), rgba(30, 20, 14, 0.52)) padding-box,
    linear-gradient(135deg,
      rgba(255,255,255,0.22) 0%,
      rgba(255,255,255,0.06) 45%,
      rgba(255,255,255,0.01) 100%
    ) border-box;
}
.card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--radius-md);
  pointer-events: none; z-index: 2;
  background: transparent;
}
/* Single top rim — the only glass signature retained */
.card::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--radius-md);
  pointer-events: none; z-index: 10;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.50);
}
.card:hover {
  transform: translateY(-8px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 4px 16px rgba(62, 40, 22, 0.07);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Cards in vertical column — shadow capped so blur − offset ≤ 11px (half the 22px gap)
   prevents the outer shadow from bleeding into adjacent card regions */
.cards--rows .card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.60);
}
.cards--rows .card:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 4px 16px rgba(62, 40, 22, 0.07);
}

.card-image {
  position: relative; z-index: 3;
  width: 100%; aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #fff;
}
.card-image img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: top center;
  transition: transform 0.55s var(--ease), filter 0.55s ease;
}

/* Card text sits above the ::before sheen layer */
.card-text { position: relative; z-index: 3; }

/* WeAct feature card — gradient bg, phones loop, noise */
.card--feature.card--weact .card-image {
  background: linear-gradient(135deg, #E8F2FF 0%, #0D52A0 100%);
  --tile-h: 1182px;
  overflow: hidden;
}
.card--feature.card--weact .card-image img {
  opacity: 0; pointer-events: none;
}
/* Phones: repeat-y loop layer — oversized 2× so rotation never exposes corners */
.card--feature.card--weact .card-image::after {
  content: '';
  position: absolute; inset: -50%; z-index: 2;
  background-image: url('./assets/homepage/weact-phones.webp');
  background-repeat: repeat-y;
  background-size: 927px 1182px;
  background-position: center 0;
  transform: rotate(-18deg);
  animation: weact-phones var(--loop-dur, 20s) linear infinite;
  animation-play-state: paused;
}
.card--feature.card--weact:hover .card-image::after {
  animation-play-state: running;
}
/* Noise: mono grain layer over phones */
.card--feature.card--weact .card-image::before {
  content: '';
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  background-image: url('./assets/homepage/weact-noise.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.33;
  mix-blend-mode: overlay;
}
/* Layer order: gradient (bg) → noise (::before, z1) → phones (::after, z2) → overlay (z3) */
.card--feature .card-overlay { z-index: 3; }
@keyframes weact-phones {
  from { background-position: center 0px }
  to   { background-position: center calc(-1 * var(--tile-h)) }
}
@media (prefers-reduced-motion: reduce) {
  .card--feature.card--weact .card-image::after,
  .card--feature.card--linger .card-image::after,
  .card--feature.card--crimemap .card-image::after { animation: none; }
}

/* Linger phone loop */
.card--feature.card--linger .card-image {
  background: linear-gradient(135deg, #C2F6FE 0%, #FEC7F8 100%);
  --tile-h: 1182px;
  overflow: hidden;
}
.card--feature.card--linger .card-image img {
  opacity: 0; pointer-events: none;
}
.card--feature.card--linger .card-image::after {
  content: '';
  position: absolute; inset: -50%; z-index: 2;
  background-image: url('./assets/homepage/linger-phones.webp');
  background-repeat: repeat-y;
  background-size: 927px 1182px;
  background-position: center 0;
  transform: rotate(-18deg);
  animation: weact-phones var(--loop-dur, 20s) linear infinite;
  animation-play-state: paused;
}
.card--feature.card--linger:hover .card-image::after {
  animation-play-state: running;
}
.card--feature.card--linger .card-image::before {
  content: '';
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  background-image: url('./assets/homepage/linger-noise.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.33;
  mix-blend-mode: overlay;
}

/* Crime Map phone loop */
.card--feature.card--crimemap .card-image {
  background: linear-gradient(135deg, #90595A 0%, #000000 100%);
  --tile-h: 1512px;
  overflow: hidden;
}
.card--feature.card--crimemap .card-image img {
  opacity: 0; pointer-events: none;
}
.card--feature.card--crimemap .card-image::after {
  content: '';
  position: absolute; inset: -50%; z-index: 2;
  background-image: url('./assets/homepage/crimemap-phones.webp');
  background-repeat: repeat-y;
  background-size: 927px 1512px;
  background-position: center 0;
  transform: rotate(-18deg);
  animation: weact-phones var(--loop-dur, 20s) linear infinite;
  animation-play-state: paused;
}
.card--feature.card--crimemap:hover .card-image::after {
  animation-play-state: running;
}
.card--feature.card--crimemap .card-image::before {
  content: '';
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  background-image: url('./assets/homepage/crimemap-noise.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.33;
  mix-blend-mode: overlay;
}

/* Portfolio card — warm cream-to-tan gradient matching site palette, phone loop, crimemap noise */
.card--feature.card--portfolio .card-image {
  background: linear-gradient(160deg, #EDE6DC 0%, #C2B0A0 50%, #8A7868 100%);
  --tile-h: 1512px;
  overflow: hidden;
}
.card--feature.card--portfolio .card-image img {
  opacity: 0; pointer-events: none;
}
.card--feature.card--portfolio .card-image::after {
  content: '';
  position: absolute; inset: -50%; z-index: 2;
  background-image: url('./assets/homepage/portfolio-phones.webp');
  background-repeat: repeat-y;
  background-size: 927px 1512px;
  background-position: center 0;
  transform: rotate(-18deg);
  animation: weact-phones var(--loop-dur, 20s) linear infinite;
  animation-play-state: paused;
}
.card--feature.card--portfolio:hover .card-image::after {
  animation-play-state: running;
}
.card--feature.card--portfolio .card-image::before {
  content: '';
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  background-image: url('./assets/homepage/crimemap-noise.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.33;
  mix-blend-mode: overlay;
}

/* Grid cards — per-image scaled sprites; tile heights are exact integers computed
   from each asset's native ratio to avoid subpixel seam flicker at loop boundary. */
.cards--grid .card--feature.card--weact .card-image::after,
.cards--grid .card--feature.card--linger .card-image::after {
  background-size: 680px 868px;
  --tile-h: 868px;
  animation-duration: 26s;
  will-change: background-position;
}
.cards--grid .card--feature.card--crimemap .card-image::after,
.cards--grid .card--feature.card--portfolio .card-image::after {
  background-size: 680px 1109px;
  --tile-h: 1109px;
  animation-duration: 26s;
  will-change: background-position;
}

.card:hover .card-image img {
  transform: scale(1.05);
}
.card-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: flex-end; padding: 22px;
  background: linear-gradient(to top,
    rgba(20,14,10,0.92) 0%,
    rgba(20,14,10,0.55) 50%,
    rgba(20,14,10,0.20) 80%,
    transparent 100%);
  opacity: 0; transition: opacity 0.4s ease;
  overflow: hidden;
}
.card:hover .card-overlay { opacity: 1; }
.card-overlay-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.card-overlay-tag {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: #F2EDE7;
  background: rgba(0, 0, 0, 0.52);
  border: 1px solid rgba(255,255,255,0.22);
  /* No backdrop-filter: it sits inside .card-overlay's opacity fade, which
     suppresses the blur until the fade completes, then pops it on (dark→light
     flick). The chip sits over the gradient's darkest zone, so the blur added
     nothing visible anyway. */
  border-radius: 4px; padding: 4px 10px;
}
.card-overlay-date {
  display: inline-block; align-self: flex-start;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.8px;
  color: #FFD98A;
  background: rgba(0, 0, 0, 0.52);
  border: 1px solid rgba(255,200,100,0.45);
  /* No backdrop-filter — same opacity-fade flick as .card-overlay-tag. */
  border-radius: 4px; padding: 4px 10px;
  margin-bottom: 8px;
}
.card-overlay-impact { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.95); text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.card-overlay-impact strong { color: #fff; font-weight: 600; }
.card-impact {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(26,22,20,0.10);
  font-size: 13px;
  line-height: 1.45;
  color: rgba(61,52,48,0.78);
}
.card-impact-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7A5C42;
  margin-right: 5px;
  vertical-align: baseline;
  position: relative;
  top: -0.5px;
}
[data-theme="dark"] .card-impact { color: rgba(238,238,238,0.62); border-top-color: rgba(255,255,255,0.10); }
[data-theme="dark"] .card-impact-label { color: #C4956A; }
[data-contrast="high"] .card-impact { color: #2A2220; border-top-color: rgba(0,0,0,0.18); }
[data-contrast="high"] .card-impact-label { color: #5C3E28; }
[data-theme="dark"][data-contrast="high"] .card-impact { color: #EEEEEE; border-top-color: rgba(255,255,255,0.25); }
[data-theme="dark"][data-contrast="high"] .card-impact-label { color: #DDA878; }
.card-text {
  display: flex; flex-direction: column;
  gap: 12px; padding: 22px 22px 24px; flex-grow: 1;
  /* Transparent — glass effect comes from the card body's backdrop-filter */
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}
[data-theme="dark"] .card-text {
  border-top-color: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* Cards intentionally excluded from backdrop-filter fallback —
   glass appearance is preserved regardless of browser support. */
/* Display title — large, bold, engraved into the glass surface */
.card-text h3 {
  font-family: var(--font-heading);
  font-size: 30px; font-weight: 700;
  line-height: 1.12; letter-spacing: -0.6px;
  margin-top: 2px;
  /* Engraved: readable opacity + deep groove shadows */
  color: rgba(26, 22, 20, 0.80);
  text-shadow:
    0  2px 0   rgba(255, 255, 255, 0.95),  /* bright light catches bottom of groove */
    0 -1px 0   rgba(0,   0,   0,   0.28),  /* shadow at top deepens recess */
    1px 0  0   rgba(255, 255, 255, 0.40),  /* left rim catch */
    0  2px 8px rgba(0,   0,   0,   0.08);  /* soft ambient depth */
}
[data-theme="dark"] .card-text h3 {
  color: rgba(245, 240, 234, 0.78);
  text-shadow:
    0  2px 0   rgba(0,   0,   0,   0.70),
    0 -1px 0   rgba(255, 255, 255, 0.16),
    0  2px 8px rgba(0,   0,   0,   0.35);
}
/* Description — slightly more legible than the title, still engraved */
.card-text p {
  font-size: 14px; line-height: 1.65;
  color: rgba(26, 22, 20, 0.72);
  text-shadow:
    0  1px 0   rgba(255, 255, 255, 0.85),
    0 -1px 0   rgba(0,   0,   0,   0.18),
    0  1px 5px rgba(0,   0,   0,   0.06);
  flex-grow: 1;
}
[data-theme="dark"] .card-text p {
  color: rgba(245, 240, 234, 0.72);
  text-shadow:
    0  1px 0 rgba(0,   0,   0,   0.55),
    0 -1px 0 rgba(255, 255, 255, 0.10);
}
.btn-magnetic { display: block; position: relative; margin-top: 10px; }
/* In project cards, push button to bottom of the glass panel */
.card .btn-magnetic { margin-top: auto; padding-top: 8px; }
.btn {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 20px;
  background: var(--accent-light);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  color: var(--text-primary); text-decoration: none;
  cursor: pointer; width: 100%;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:hover { background: var(--accent-btn-bg); border-color: var(--accent-btn-bg); color: #fff; }

/* ---- Card buttons: frosted glass overlay panel ---- */
.card .btn {
  padding: 13px 20px;
  font-size: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.58);
  color: rgba(26, 16, 6, 0.72);
  text-shadow: none;
  font-weight: 550;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 2px 8px rgba(60, 40, 16, 0.10);
  transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}
.card .btn:hover {
  background: rgba(0, 0, 0, 0.055);
  border-color: rgba(255, 255, 255, 0.30);
  color: rgba(26, 16, 6, 0.65);
  transform: translateY(1px);
  box-shadow:
    inset 0 3px 8px rgba(0, 0, 0, 0.13),
    inset 0 1px 3px rgba(0, 0, 0, 0.08),
    inset 0 -1px 0 rgba(255, 255, 255, 0.55);
}
.card .btn svg { filter: brightness(0) opacity(0.45); }
.card .btn:hover svg { filter: brightness(0) opacity(0.55); transform: translateX(3px); }
[data-theme="dark"] .card .btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(245, 240, 234, 0.80);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.25);
  text-shadow: none;
}
[data-theme="dark"] .card .btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.20);
  color: rgba(245, 240, 234, 0.95);
  box-shadow:
    inset 0 3px 8px rgba(0, 0, 0, 0.35),
    inset 0 1px 3px rgba(0, 0, 0, 0.20),
    inset 0 -1px 0 rgba(255, 255, 255, 0.14);
}
[data-theme="dark"] .card .btn svg { filter: brightness(10) opacity(0.55); }
[data-theme="dark"] .card .btn:hover svg { filter: brightness(10) opacity(0.75); transform: translateX(3px); }
[data-theme="dark"] .btn:hover,
[data-theme="dark"] .case-btn:hover {
  background: var(--bg);
  border-color: var(--text-secondary);
  color: var(--text-primary);
}
.btn svg { width: 13px; height: 13px; transition: transform 0.2s ease, filter 0.2s ease; }
.btn:hover svg { transform: translateX(3px); filter: brightness(10); }

/* ============================================================
   HOMEPAGE — PROJECT ROW CARDS
   Compact horizontal row layout. Body (left) + image (right) in a
   grid. The card-image keeps a hover-reveal overlay with date,
   tags, and impact so the row stays clean at rest but dense on
   demand. Uniform height across all four projects.
============================================================ */
.cards--rows {
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 22px;
  max-width: 1220px;
}
.projects-section > .card--feature {
  width: 100%;
}
.cards--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  width: 100%;
  max-width: none;
}
/* Lone last card on an odd count — left-align at one column's width. */
.cards--grid > .card--feature:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  width: calc(50% - 14px);
  justify-self: start;
}
.cards--grid .card--feature {
  min-height: 380px;
}
.cards--grid .card-glass-panel {
  padding: 20px 24px;
  gap: 20px;
}
.cards--grid .card-glass-panel-text h3 {
  font-size: 22px;
  letter-spacing: -0.3px;
}
.card--row {
  flex: 1 1 auto;
  max-width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1.08fr);
  align-items: stretch;
  min-height: 320px;
}
.card--row .card-text {
  padding: 32px 36px 30px;
  gap: 14px;
  border-top: none;
  box-shadow: none;
  justify-content: center;
}
.card--row .card-image {
  position: relative;
  aspect-ratio: auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.55);
}
.card--row .card-image img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
[data-theme="dark"] .card--row .card-image {
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.08);
}
.card--row .card-text h3 {
  font-size: 40px;
  letter-spacing: -1px;
  line-height: 1.05;
}
.card--row .card-text p {
  font-size: 15px;
  line-height: 1.6;
  max-width: 48ch;
  flex-grow: 0;
}
.card--row .btn-magnetic {
  margin-top: 8px;
  padding-top: 0;
  align-self: flex-start;
}
.card--row .btn {
  width: auto;
  padding: 12px 22px;
  font-size: 14px;
}
.card--row:hover { transform: translateY(-6px); }

/* Eyebrow above title — small uppercase kicker with an accent dot */
.card-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--accent-text);
}
.kicker-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-text);
  flex-shrink: 0;
}

.card .card-num {
  position: absolute; top: 14px; left: 14px;
  z-index: 11; pointer-events: none;
  font-family: var(--font-heading);
  font-size: 17px; font-weight: 700; font-style: italic;
  line-height: 1; letter-spacing: 0.2px;
  padding: 5px 10px 6px;
  border-radius: 999px;
  color: rgba(26, 22, 20, 0.78);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow:
    inset 0  1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(0,   0,   0,   0.06),
    0 1px 3px rgba(26, 22, 20, 0.12);
}
[data-theme="dark"] .card .card-num {
  color: rgba(245, 240, 234, 0.92);
  background: rgba(26, 18, 14, 0.55);
  box-shadow:
    inset 0  1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.30),
    0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Row-card gradient strip */
.card--row .card-strip {
  background: linear-gradient(
    to bottom,
    rgba(68, 44, 24, 0.72) 0%,
    rgba(104, 72, 44, 0.58) 30%,
    rgba(148, 112, 76, 0.46) 60%,
    rgba(200, 170, 136, 0.38) 85%,
    rgba(228, 208, 182, 0.30) 100%
  );
  border-right: 1px solid rgba(255, 255, 255, 0.28);
}
[data-theme="dark"] .card--row .card-strip {
  background: linear-gradient(
    to bottom,
    rgba(18, 10, 4, 0.80) 0%,
    rgba(40, 24, 12, 0.65) 35%,
    rgba(68, 44, 24, 0.50) 65%,
    rgba(100, 70, 42, 0.36) 100%
  );
  border-right-color: rgba(255, 255, 255, 0.10);
}
@media (max-width: 799px) {
  .card--row .card-strip { display: none; }
}

/* ============================================================
   HOMEPAGE — FEATURE CARD  (full-bleed image + glass panel)
============================================================ */
.card--feature {
  max-width: 100%;
  min-height: 460px;
  display: block;
  position: relative;
  isolation: isolate;
}
.card--feature .card-image {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  aspect-ratio: auto;
  background: #2a4e80;
  filter: brightness(1);
}
.card--feature .card-image img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform 0.6s var(--ease), filter 0.6s ease;
}
.card--feature:hover .card-image img {
  transform: scale(1.04);
  filter: brightness(0.94);
}
.card--feature .card-overlay {
  justify-content: flex-start;
  padding: 28px 32px;
  background: linear-gradient(
    to bottom,
    rgba(10, 8, 6, 0.58) 0%,
    rgba(10, 8, 6, 0.20) 42%,
    transparent 62%
  );
}
/* Grid cards — lighter overlay so smaller surface doesn't feel as heavy */
.cards--grid .card--feature .card-overlay {
  background: linear-gradient(
    to bottom,
    rgba(10, 8, 6, 0.38) 0%,
    rgba(10, 8, 6, 0.10) 38%,
    transparent 56%
  );
}

.card-glass-panel {
  position: absolute; bottom: -1px; left: -1px; right: -1px;
  z-index: 5;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  display: flex; flex-direction: row;
  align-items: center; gap: 28px;
  padding: 26px 32px;
  /* Fake frosted glass — no backdrop-filter, so the infinitely-scrolling
     phone image underneath never forces a per-frame blur recompute (the
     choppy-on-mobile case). An opaque-ish white gradient reads as frost;
     the inset top highlight + border are what actually sell "glass". */
  background: linear-gradient(rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88));
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.50),
    inset 0 -1px 0 rgba(8, 30, 85, 0.12);
}
.card-glass-panel-text { flex: 1; min-width: 0; }
.card-glass-panel-text h3 {
  font-family: var(--font-heading);
  font-size: 29px; font-weight: 400;
  line-height: 1.08; letter-spacing: -0.01em;
  color: #1A1614;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.60);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-arrow {
  flex-shrink: 0;
  width: 16px; height: 16px;
  opacity: 0.32;
  transform: translateX(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.card:hover .card-arrow,
.card:focus-within .card-arrow {
  opacity: 0.72;
  transform: translateX(3px);
}
.card-stretched-link {
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: var(--radius-md);
  text-decoration: none;
  background: transparent;
}
.card-stretched-link:focus-visible {
  outline: 2px solid #7A5C42;
  outline-offset: 4px;
}
[data-theme="dark"] .card-stretched-link:focus-visible { outline-color: #C4956A; }
.card-glass-panel-text p {
  font-size: 14px; line-height: 1.55;
  color: #3D3430;
}
.card--feature .btn-magnetic { flex-shrink: 0; margin-top: 0; padding-top: 0; }
.card--feature .btn {
  white-space: nowrap;
  color: rgba(26, 22, 20, 0.80);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 2px 14px rgba(60, 40, 16, 0.22),
    0 1px 4px  rgba(60, 40, 16, 0.14);
}
.card--feature .btn:hover { color: rgba(26, 22, 20, 0.80); }
.card--feature .btn svg { opacity: 1; }
.card--feature .btn:hover svg { opacity: 1; transform: translateX(3px); }

/* Dark mode — opaque fake-frost (no backdrop-filter on the base now), so light
   text reads on bright card backgrounds and the scrolling image stays hidden. */
[data-theme="dark"] .card-glass-panel {
  background: linear-gradient(rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.86));
  border-top-color: rgba(255, 255, 255, 0.10);
}
[data-theme="dark"] .card-glass-panel-text h3 {
  color: #EEEEEE;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.60);
}
[data-theme="dark"] .card-glass-panel-text p { color: #EEEEEE; text-shadow: none; }

/* High contrast light — solid glass, black text guaranteed readable */
[data-contrast="high"] .card-glass-panel {
  background: rgb(255, 255, 255);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top-color: rgba(0, 0, 0, 0.25);
}
[data-contrast="high"] .card-glass-panel-text h3 { text-shadow: none; }
[data-contrast="high"] .card-glass-panel-text p  { text-shadow: none; }

/* High contrast dark — solid dark glass, white text guaranteed readable */
[data-theme="dark"][data-contrast="high"] .card-glass-panel {
  background: rgb(0, 0, 0);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top-color: rgba(255, 255, 255, 0.35);
}
[data-theme="dark"][data-contrast="high"] .card-glass-panel-text h3 { text-shadow: none; }
[data-theme="dark"][data-contrast="high"] .card-glass-panel-text p  { text-shadow: none; }

/* ============================================================
   HOMEPAGE — BENTO GRID
============================================================ */
.bento-section {
  --bento-card-w: 520px;
  display: flex; flex-direction: column; align-items: center;
  gap: 36px; width: 100%; max-width: 1212px;
}
.bento-grid-wrap {
  position: relative;
  width: 100%;
  overflow-x: scroll;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}
.bento-grid-wrap::-webkit-scrollbar { display: none; }
.bento-grid {
  display: flex; flex-wrap: nowrap;
  gap: 20px; width: max-content;
}
.bento-card {
  display: flex; flex-direction: column; gap: 16px;
  padding: 38px 34px;
  flex: 0 0 var(--bento-card-w);
  scroll-snap-align: start;
  position: relative; overflow: hidden;
  background: rgba(252, 246, 238, 0.38);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom-color: rgba(180, 150, 110, 0.22);
  border-right-color: rgba(180, 150, 110, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.90),
    inset 1px 0 0 rgba(255,255,255,0.35),
    var(--shadow-sm);
  border-radius: var(--radius-md);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
              border-color 0.3s ease, background 0.3s ease;
}
@supports not (backdrop-filter: blur(1px)) {
  .bento-card { background: var(--surface-solid); border-color: var(--border-solid); }
}
[data-theme="dark"] .bento-card {
  background: rgba(32, 20, 12, 0.44);
  border-color: rgba(255, 200, 150, 0.18);
  border-bottom-color: rgba(255, 200, 150, 0.08);
  border-right-color: rgba(255, 200, 150, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 1px 0 0 rgba(255,255,255,0.05),
    var(--shadow-sm);
}
.bento-card[data-num]::before {
  content: attr(data-num);
  position: absolute; bottom: -16px; right: 20px;
  font-family: var(--font-heading); font-size: 130px; font-weight: 700;
  line-height: 1; letter-spacing: -6px;
  color: var(--text-primary); opacity: 0.08;
  pointer-events: none; user-select: none;
  transition: opacity 0.3s ease;
}
.bento-card[data-num]:hover::before { opacity: 0.13; }
/* Longer strings need smaller size to avoid overlapping body text */
.bento-card[data-num="Current"]::before { font-size: 58px; letter-spacing: -1px; bottom: 12px; }
.bento-card[data-num="2023"]::before   { font-size: 80px; letter-spacing: -3px; bottom: 12px; }
.bento-card[data-num="&"]::before      { bottom: 12px; }
/* Deck-mode: JS adds .bento-deck-active, cards become absolute stack */
.bento-grid-wrap.bento-deck-active { overflow: visible; }
.bento-deck-active .bento-grid {
  position: relative; width: 520px; margin: 0 auto; height: 100%;
}
.bento-deck-active .bento-card {
  position: absolute; top: 0; left: 0; width: 520px;
  transform-origin: center center;
  will-change: transform, opacity;
  transition: box-shadow 0.35s var(--ease), border-color 0.3s ease;
}
.bento-card:hover {
  transform: translateY(-6px);
  box-shadow: inset 0 1px 0 var(--border-hi), var(--shadow-md);
  border-color: var(--accent);
}
.bento-deck-active .bento-card:hover {
  transform: none; /* JS owns transform in deck mode */
}
.bento-header { display: flex; align-items: baseline; gap: 8px; }
.bento-number {
  font-family: var(--font-heading); font-size: 13px; font-weight: 700;
  color: var(--accent-text); letter-spacing: 0.8px;
}
.bento-sep { color: var(--text-muted); font-size: 13px; }
.bento-label {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.8px; color: var(--text-muted);
}
.bento-card h3 {
  font-family: var(--font-heading); font-size: 27px; font-weight: 600;
  line-height: 1.2; letter-spacing: -0.5px; color: var(--text-primary);
}
.bento-logo-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 253, 248, 0.85);
  border: 1px solid rgba(120, 95, 65, 0.22);
  border-radius: 8px; width: fit-content;
}
[data-theme="dark"] .bento-logo-wrap {
  background: rgba(255, 245, 230, 0.06);
  border-color: rgba(255, 200, 150, 0.16);
}
.bento-logo-text { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.bento-card p { font-size: 14.5px; line-height: 1.75; color: var(--text-secondary); }

/* ---- Bento hierarchy ---------------------------------------
   01 = Active (current focus)   → pulse + accent label
   02 = Foundation               → default (quietly supporting)
   03 = Synthesis (the output)   → accent-tinted surface + accent chip
------------------------------------------------------------ */
.bento-card[data-num="01"] .bento-label { color: var(--accent); }
.bento-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  align-self: center; flex: 0 0 auto;
  --pulse-rgb: 123, 106, 95;
  box-shadow: 0 0 0 0 rgba(var(--pulse-rgb), 0.55);
  animation: bento-pulse 2.4s var(--ease) infinite;
}
[data-theme="dark"] .bento-pulse { --pulse-rgb: 196, 181, 170; }
@keyframes bento-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(var(--pulse-rgb), 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(var(--pulse-rgb), 0); }
  100% { box-shadow: 0 0 0 0   rgba(var(--pulse-rgb), 0); }
}
@media (prefers-reduced-motion: reduce) {
  .bento-pulse { animation: none; }
}
[data-motion="reduced"] .bento-pulse { animation: none; }

/* ============================================================
   CASE STUDY TEMPLATE
   ─────────────────────────────────────────────────────────────
   Use this section as the layout reference for all future
   case study / project pages. When prompting Claude, say:
   "Format this page to match the Case Study Template in style.css"

   PAGE STRUCTURE (top to bottom):
   1.  .case-hero          — Centered hero: eyebrow + large h1 + italic tagline + subtitle + CTA btn
   2.  .case-meta          — 4-column project metadata row (label above value, border dividers)
   3.  .case-showcase      — Phone/mockup images + product logo side by side
   4.  .case-band          — Full-width bg-secondary band: .overview-grid (glass cards) + .case-stats (stat cards)
   5.  .marquee-wrap       — Scrolling team names marquee
   6.  .process-pipeline   — Glass card with icon steps + arrows (Research→Synthesis→…→Iteration)
   7.  .case-section       — Wrapper for each numbered content section:
         └─ .section-eyebrow  (e.g. "01  RESEARCH & DISCOVERY")
         └─ .content-row      (text-col + image-col, alternating .reverse for layout variety)
         └─ .content-full     (full-width text + image, e.g. deliverables)
   8.  .case-divider       — Thin horizontal rule between major sections
   9.  Reflection section  — .reflection-grid with .reflection-card glass cards
                             (.reflection-card--wide spans full width for main skills block)

   KEY CLASSES:
   .case-eyebrow       small uppercase label above hero h1
   .case-tagline       italic subheading under h1
   .case-meta          project info row
   .case-band          full-bleed colored background section
   .overview-card      glass card (problem, role, etc.)
   .stat-card          large-number metric card
   .case-section       wrapper for a numbered section
   .section-eyebrow    "01  SECTION NAME" label
   .section-num        numbered pill badge
   .content-row        two-column text + image layout
   .content-row.reverse  flips image to left
   .content-full       single-column full-width content
   .reflection-card    glass card for reflection/skills blocks
   .reflection-card--wide  spans full grid width
   .proto-compare      lo-fi } hi-fi comparison layout
   .persona-carousel   swipeable image carousel
   .process-pipeline   horizontal step pipeline with icons
============================================================ */
/* ============================================================
   CASE STUDY — MAIN LAYOUT
============================================================ */
.case-main {
  display: flex; flex-direction: column;
  align-items: center; width: 100%;
  padding: 0 !important; gap: 0 !important;
}

/* Hero */
.case-hero {
  width: 100%; max-width: 1212px;
  padding: calc(var(--header-clearance) + 40px) 64px 60px;
  display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 20px;
}
.case-eyebrow {
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--accent); margin: 0;
}
.case-hero h1 {
  font-family: var(--font-heading);
  font-size: 88px; font-weight: 700;
  line-height: 1; letter-spacing: -3px;
  color: var(--text-primary);
}
.case-tagline {
  font-family: var(--font-heading);
  font-size: 28px; font-weight: 400; font-style: italic;
  color: var(--text-secondary); letter-spacing: -0.5px;
}
.case-hero .subtitle {
  font-size: 18px; line-height: 1.6;
  color: var(--text-secondary);
  max-width: 600px; letter-spacing: -0.12px;
}
.case-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px 50px; margin-top: 8px;
  background: var(--accent-light);
  border: 1px solid var(--accent-text);
  border-radius: 12px;
  font-family: var(--font-body); font-size: 16px; font-weight: 500;
  color: var(--text-primary); text-decoration: none;
  cursor: pointer; width: fit-content;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.3s var(--ease);
}
.case-btn:hover {
  background: var(--accent-btn-bg); border-color: var(--accent-btn-bg);
  color: #fff; transform: translateY(-2px);
}
.case-btn svg { width: 14px; height: 14px; transition: transform 0.2s ease, filter 0.2s ease; }
.case-btn:hover svg { transform: translate(3px, -3px); filter: brightness(10); }

/* ============================================================
   CASE PAGES — Animated glass hero card
   When .case-hero sits inside .hero-wrapper it becomes the
   same raised glass panel as the homepage hero.
============================================================ */

/* Page-level breathing room above/below the hero card */
.case-main .hero-wrapper {
  margin-top: var(--header-clearance);
  margin-bottom: 40px;
  width: calc(100% - 88px); /* 44px side gap on each side, matching main { padding: 88px 44px } */
}

.hero-wrapper .case-hero {
  perspective: 1200px;
  position: relative; z-index: 1;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-lg);
  box-shadow:
    0 6px 48px rgba(62, 40, 22, 0.22),
    0 2px 12px rgba(62, 40, 22, 0.12),
    0 1px 0   rgba(255, 255, 255, 0.80);
  transition: background 0.3s ease, border-color 0.3s ease;
  padding: 56px;
  /* Hidden before GSAP entrance — prevents flash */
  opacity: 0; will-change: transform, opacity;
}
[data-theme="dark"] .hero-wrapper .case-hero {
  background: rgba(18, 18, 22, 0.62);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow:
    0 6px 48px rgba(0, 0, 0, 0.45),
    0 2px 12px rgba(0, 0, 0, 0.28),
    0 1px 0   rgba(255, 255, 255, 0.08);
}
/* Responsive overrides for the glass case-hero */
@media (max-width: 1023px) {
  .hero-wrapper .case-hero { padding: 44px; }
  .case-main .hero-wrapper { width: calc(100% - 56px); } /* 28px each side */
}
@media (max-width: 799px) {
  .hero-wrapper .case-hero { padding: 32px; }
  .case-main .hero-wrapper { width: calc(100% - 36px); } /* 18px each side */
}
/* Text-shadow halo for case-hero elements inside hero-text-backdrop */
/* Equal padding inside the frosted text panel on case pages */
.hero-wrapper .case-hero .hero-text-backdrop { padding: 40px; }

.hero-wrapper .hero-text-backdrop .case-eyebrow,
.hero-wrapper .hero-text-backdrop h1,
.hero-wrapper .hero-text-backdrop .case-tagline,
.hero-wrapper .hero-text-backdrop .subtitle {
  text-shadow: 0 0 20px rgba(255,255,255,0.5), 0 1px 4px rgba(255,255,255,0.4);
}

/* Project Meta */
.case-meta {
  display: flex; justify-content: center; gap: 0;
  width: 100%; max-width: 1212px;
  padding: 0 64px 48px;
}
.meta-item {
  flex: 1; text-align: center;
  padding: 20px 24px;
  border-left: 1px solid var(--border);
}
.meta-item:first-child { border-left: none; }
.meta-label {
  display: block;
  font-family: var(--font-body);
  font-size: 11px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 8px;
}
.meta-value {
  font-family: var(--font-heading);
  font-size: 16px; font-weight: 600;
  color: var(--text-primary); letter-spacing: -0.2px;
}

/* Phone mockups + logo */
.case-showcase {
  display: flex; align-items: center; justify-content: center;
  gap: 67px; padding: 48px 64px 0;
  width: 100%; max-width: 1212px;
}
.phone-pair { display: flex; align-items: center; position: relative; }
.phone-pair img { height: 500px; width: auto; object-fit: cover; border-radius: 28px; }
.phone-pair img:nth-child(2) { margin-left: -14px; transform: rotate(-2.5deg); }
.case-logo-img { max-width: 405px; height: auto; object-fit: contain; }

/* Overview Band — full-width colored section */
.case-band {
  width: 100%;
  background: var(--bg-secondary);
  padding: 80px 0;
  margin-top: 64px;
  display: flex; justify-content: center;
}
.case-band-inner {
  width: 100%; max-width: 1212px;
  padding: 0 64px;
}
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 48px;
}
.overview-grid--3 {
  grid-template-columns: 1fr;
}

/* ============================================================
   GLASS GALLERY — frosted pane + bento grid of glass-plate tiles
============================================================ */
.glass-gallery {
  display: flex;
  justify-content: center;
  padding: 24px 64px 64px;
  width: 100%;
  box-sizing: border-box;
}
.glass-gallery-pane {
  position: relative;
  padding: 24px;
  width: 100%;
  max-width: 1212px;
}

/* ---- Collapsible behavior ---- */
.glass-gallery[data-glass-collapsible] {
  flex-direction: column;
  align-items: center;
}
/* Pane height — frost panel sits at halfway up the 2nd image row.
   --frost-top = pane-padding-top + row-h + row-gap + (row-h / 2)
   Default rows = 180px, gap = 14px, padding-top = 24px → 24 + 180 + 14 + 90 = 308px
   Mobile rows = 150px, gap = 10px → 24 + 150 + 10 + 75 = 259px */
.glass-gallery[data-glass-collapsible] {
  --frost-top: 358px;
  --frost-h:   240px;
}
@media (max-width: 720px) {
  .glass-gallery[data-glass-collapsible] {
    --frost-top: 259px;
    --frost-h:   200px;
  }
}
.glass-gallery[data-glass-collapsible] .glass-gallery-pane {
  overflow: visible;
}
.glass-gallery[data-glass-collapsible] .glass-gallery-clip {
  overflow: hidden;
  max-height: calc(var(--frost-top) + var(--frost-h));
  transition: max-height 1.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.glass-gallery[data-glass-collapsible].is-expanded .glass-gallery-clip {
  max-height: 5000px;
  transition: max-height 1.75s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---- Frosted-glass panel = expand button (visible only when collapsed) ---- */
.glass-gallery-veil {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  top: var(--frost-top);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0; padding: 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(225, 212, 196, 0.92);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.60),
    0 -8px 12px -6px rgba(62, 40, 22, 0.10);
  color: var(--text-primary);
  font-family: var(--font-body);
  cursor: pointer;
  z-index: 5;
  opacity: 1;
  transform: translateY(0);
  transform-origin: bottom center;
  /* Base = closing transition (when .is-expanded is removed, veil returns) */
  transition:
    opacity   0.75s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.95s cubic-bezier(0.22, 0.61, 0.36, 1),
    background 0.25s ease,
    box-shadow 0.25s ease;
}
[data-theme="dark"] .glass-gallery-veil {
  background: rgba(30, 20, 14, 0.55);
  border-top-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 -6px 24px rgba(0, 0, 0, 0.18);
}
.glass-gallery-veil:hover {
  background: rgba(225, 212, 196, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 -28px 36px -16px rgba(50, 32, 14, 0.48),
    0 -10px 14px -8px rgba(50, 32, 14, 0.30);
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease;
}
[data-theme="dark"] .glass-gallery-veil:hover {
  background: rgba(40, 28, 18, 0.65);
}
.glass-gallery-veil:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}
.glass-gallery-veil-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
}
.glass-gallery-veil-label {
  font-family: var(--font-heading);
  font-size: 29px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.5px;
  color: #1A1614;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.60);
}
[data-theme="dark"] .glass-gallery-veil-label {
  color: #F5EFE7;
  text-shadow: none;
}
.glass-gallery-veil-icon {
  width: 22px;
  height: 22px;
  opacity: 0.55;
}
.glass-gallery-veil-icon {
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.glass-gallery-veil:hover .glass-gallery-veil-icon {
  transform: translateY(2px);
}
/* On expand: panel rises and fades, slower than close */
.glass-gallery.is-expanded .glass-gallery-veil {
  opacity: 0;
  transform: translateY(50px);
  pointer-events: none;
  transition:
    opacity   1.1s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 1.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@media (prefers-reduced-transparency: reduce) {
  .glass-gallery-veil {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: rgba(245, 240, 232, 0.95);
  }
  [data-theme="dark"] .glass-gallery-veil {
    background: rgba(28, 22, 18, 0.97);
  }
}

/* ---- Glass pill toggle button (collapse only, visible when expanded) ---- */
.glass-gallery[data-glass-collapsible] .glass-gallery-toggle { display: none; }
.glass-gallery[data-glass-collapsible].is-expanded .glass-gallery-toggle { display: inline-flex; }
.glass-gallery-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 24px auto 8px;
  padding: 10px 18px;
  background: rgba(225, 212, 196, 0.42);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.60),
    0 4px 18px rgba(62, 40, 22, 0.10);
  transition: transform 0.22s var(--ease), background 0.22s ease, box-shadow 0.22s ease;
}
.glass-gallery-toggle:hover {
  transform: translateY(-1px);
  background: rgba(225, 212, 196, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 6px 22px rgba(62, 40, 22, 0.14);
}
.glass-gallery-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
[data-theme="dark"] .glass-gallery-toggle {
  background: rgba(30, 20, 14, 0.55);
  border-top-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 4px 18px rgba(0, 0, 0, 0.20);
}
[data-theme="dark"] .glass-gallery-toggle:hover {
  background: rgba(40, 28, 18, 0.65);
}
.glass-gallery-toggle-label {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.35px;
  color: #1A1614;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.60);
}
[data-theme="dark"] .glass-gallery-toggle-label {
  color: #F5EFE7;
  text-shadow: none;
}
.glass-gallery-toggle-icon {
  width: 16px;
  height: 16px;
  opacity: 0.55;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.glass-gallery.is-expanded .glass-gallery-toggle-icon {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .glass-gallery[data-glass-collapsible] .glass-gallery-pane,
  .glass-gallery-veil,
  .glass-gallery-toggle,
  .glass-gallery-toggle-icon { transition: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass-gallery-toggle {
    background: rgba(245, 240, 232, 0.95);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  [data-theme="dark"] .glass-gallery-toggle {
    background: rgba(28, 22, 18, 0.97);
  }
}
.glass-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 180px;
  grid-auto-flow: dense;
  gap: 14px;
}

/* Glass-plate tile — aligned, no rotation, with material presence */
.glass-tile {
  position: relative;
  margin: 0; padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  box-shadow:
    0 8px 20px -10px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 -1px 0 rgba(0,0,0,0.18);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  font: inherit; color: inherit;
  appearance: none; -webkit-appearance: none;
}
.glass-tile > img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 14px), transparent calc(100% - 14px));
          mask-image: linear-gradient(#000 calc(100% - 14px), transparent calc(100% - 14px));
}
.glass-tile-band {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 14px;
  background: rgba(20, 20, 20, 0.45);
  border-top: 1px solid rgba(255,255,255,0.10);
  pointer-events: none;
}
/* Cursor-reactive sheen */
.glass-tile::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(
    220px circle at var(--sheen-x, 50%) var(--sheen-y, 0%),
    rgba(255,255,255,0.18),
    rgba(255,255,255,0) 60%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
  mix-blend-mode: screen;
}
.glass-tile:hover {
  transform: translateY(-2px) scale(1.012);
  box-shadow:
    0 14px 28px -12px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 -1px 0 rgba(0,0,0,0.20);
}
.glass-tile:hover::after { opacity: 1; }
.glass-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Bento spans */
.glass-tile--wide    { grid-column: span 2; }
.glass-tile--tall    { grid-row: span 2; }
.glass-tile--feature { grid-column: span 2; grid-row: span 2; }
.glass-tile--panorama { grid-column: 1 / -1; }

@media (max-width: 1080px) {
  .glass-gallery { padding: 24px 32px 48px; }
  .glass-gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .glass-gallery { padding: 16px 18px 40px; }
  .glass-gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; gap: 10px; }
}

/* Glass photo viewer (lightbox replacement) */
.glass-viewer {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  padding: 48px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(20px) saturate(1.05);
  -webkit-backdrop-filter: blur(20px) saturate(1.05);
  z-index: 9000;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.glass-viewer::before {
  content: ''; position: absolute; inset: 0;
  background-image: url('./assets/shared/background-noise.png');
  background-size: 220px;
  opacity: 0.18; pointer-events: none;
  mix-blend-mode: overlay;
}
.glass-viewer.is-open { display: flex; opacity: 1; }

.glass-viewer-plate {
  position: relative;
  margin: 0;
  max-width: min(1400px, 92vw);
  max-height: 86vh;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.04);
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 -1px 0 rgba(0,0,0,0.22);
  transform: scale(0.96);
  transition: transform 0.3s var(--ease);
}
.glass-viewer.is-open .glass-viewer-plate { transform: scale(1); }
.glass-viewer-img {
  display: block;
  max-width: min(1400px, 92vw);
  max-height: 86vh;
  width: auto; height: auto;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 16px), transparent calc(100% - 16px));
          mask-image: linear-gradient(#000 calc(100% - 16px), transparent calc(100% - 16px));
}
.glass-viewer-plate .glass-tile-band { height: 16px; }

.glass-viewer-close,
.glass-viewer-nav {
  position: absolute;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
  z-index: 2;
}
.glass-viewer-close:hover,
.glass-viewer-nav:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.30);
}
.glass-viewer-close { top: 20px; right: 20px; width: 40px; height: 40px; }
.glass-viewer-nav   { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }
.glass-viewer-nav--prev { left: 20px; }
.glass-viewer-nav--next { right: 20px; }
.glass-viewer-close:focus-visible,
.glass-viewer-nav:focus-visible {
  outline: 2px solid #fff; outline-offset: 3px;
}

@media (max-width: 720px) {
  .glass-viewer { padding: 20px; }
  .glass-viewer-nav { width: 40px; height: 40px; }
  .glass-viewer-nav--prev { left: 8px; }
  .glass-viewer-nav--next { right: 8px; }
  .glass-viewer-close { top: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .glass-tile { transition: none; }
  .glass-tile:hover { transform: none; }
  .glass-tile::after { display: none; }
  .glass-viewer, .glass-viewer-plate { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass-tile {
    background: rgba(20, 24, 32, 0.97);
    box-shadow: 0 6px 14px -8px rgba(0,0,0,0.4);
  }
  .glass-tile-band {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: rgba(255,255,255,0.06);
  }
  .glass-viewer {
    background: rgba(0,0,0,0.92);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
}
.overview-card {
  padding: 40px;
  background: var(--surface);
  /* No backdrop-filter: these case-study cards sit over the flat page bg
     (+ faint grain), not the hero orbs (canvas is hero-scoped), so the live
     blur was visually inert while costing a per-frame composite during
     scroll and the staggered reveal. Shared across weact/linger/crimemap/about. */
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.overview-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.overview-card h3 {
  font-family: var(--font-heading);
  font-size: 24px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 16px;
  letter-spacing: -0.4px;
}
.overview-card p, .overview-card li {
  font-size: 16px; line-height: 1.65;
  color: var(--text-secondary); letter-spacing: -0.09px;
}
.overview-card ul { list-style: disc; padding-left: 20px; }
.overview-card li { margin-bottom: 4px; }
.overview-card .role-columns { display: flex; gap: 24px; }
.overview-card .role-columns ul { flex: 1; }

/* Stat Cards */
.case-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.stat-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 32px 16px;
  background: var(--surface);
  /* No backdrop-filter — inert over the flat bg; see .overview-card note. */
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.stat-number {
  font-family: var(--font-heading);
  font-size: 48px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1.5px; line-height: 1;
}
.stat-label {
  font-family: var(--font-body);
  font-size: 14px; font-weight: 500;
  color: var(--text-muted); letter-spacing: -0.08px;
}

/* Case Divider */
.case-divider {
  width: 120px; border: none;
  border-top: 1.5px solid var(--border);
  margin: 20px 0;
}

/* Section Eyebrow */
.case-section {
  width: 100%;
  display: flex; flex-direction: column;
  align-items: center;
}
.section-eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent);
  /* 80px top compensates for removed case-dividers (~41.5px) while keeping a
     deliberate section break. Was 48px when dividers handled the break. */
  padding: 80px 64px 0;
  width: 100%; max-width: 1212px;
}
.section-num {
  font-family: var(--font-heading);
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: 6px;
}

/* Marquee */
.marquee-wrap {
  width: 100%; max-width: 1212px;
  overflow: hidden; padding: 20px 0 0;
  mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
}
.marquee-track {
  display: flex; align-items: center; gap: 32px;
  width: max-content; will-change: transform;
}
.marquee-name {
  font-family: var(--font-heading);
  font-size: 20px; font-weight: 600;
  color: var(--text-primary); letter-spacing: -0.3px;
  white-space: nowrap; flex-shrink: 0;
}
.marquee-sep {
  font-family: var(--font-heading);
  font-size: 20px; font-weight: 600;
  color: var(--text-muted); flex-shrink: 0;
}
.marquee-name.info-item--logo {
  display: inline-flex; align-items: center; gap: 8px;
}
.info-logo { height: 22px; width: auto; vertical-align: middle; }

/* Process pipeline */
.process-pipeline {
  display: flex; align-items: center; justify-content: center;
  /* Symmetric vertical padding — card has equal breathing room top and bottom. */
  padding: 40px 64px; width: 100%; max-width: 1212px;
}
.process-pipeline-card {
  background: var(--surface);
  /* No backdrop-filter — inert over the flat bg; see .overview-card note. */
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  padding: 48px 64px; width: 100%;
  display: flex; align-items: center; justify-content: center;
}
.process-step { display: flex; flex-direction: column; align-items: center; gap: 15px; text-align: center; }
.process-icon {
  width: 52px; height: 52px; background: var(--accent);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s var(--ease);
}
.process-icon:hover { transform: translateY(-3px); }
.process-icon img { width: 24px; height: 24px; filter: brightness(10); }
.process-icon svg { width: 24px; height: 24px; }
.process-label { font-size: 14px; font-weight: 500; color: var(--text-primary); letter-spacing: -0.08px; }
.process-arrow { font-size: 20px; color: var(--text-muted); flex-shrink: 0; }
.process-arrow svg { width: 28px; height: 18px; stroke: var(--text-muted); }

/* Content rows */
.content-row {
  display: flex; gap: 64px; align-items: center; justify-content: center;
  padding: 48px 64px 40px; width: 100%; max-width: 1212px;
}
.content-row.reverse { flex-direction: row-reverse; }
.content-row .text-col { flex: 1; display: flex; flex-direction: column; gap: 24px; }
.content-row .image-col { flex: 1; display: flex; align-items: center; justify-content: center; }
.content-row h2 {
  font-family: var(--font-heading);
  font-size: 32px; font-weight: 700;
  line-height: 1.2; letter-spacing: -0.72px; color: var(--text-primary);
}
.content-row p, .content-row li { font-size: 16px; line-height: 1.65; color: var(--text-secondary); letter-spacing: -0.09px; }
.content-row p strong, .content-row p em { color: var(--text-primary); }
.content-row ul, .content-row ol { padding-left: 24px; }
.content-row ul { list-style: disc; }
.content-row ol { list-style: decimal; }
.content-row li { margin-bottom: 6px; }
.content-row img {
  max-width: 100%; height: auto;
  border-radius: var(--radius-sm);
}

.content-full { padding: 48px 64px 24px; width: 100%; max-width: 1212px; }
.case-section:last-child .content-full { padding-bottom: 96px; }
.content-full h2 {
  font-family: var(--font-heading);
  font-size: 32px; font-weight: 700;
  line-height: 1.2; letter-spacing: -0.72px; color: var(--text-primary); margin-bottom: 24px;
}
.content-full > p { font-size: 16px; line-height: 1.65; color: var(--text-secondary); margin-bottom: 24px; }
.content-full ul, .content-full ol { padding-left: 24px; margin-bottom: 8px; }
.content-full ul { list-style: disc; }
.content-full ol { list-style: decimal; }
.content-full li { font-size: 16px; line-height: 1.65; color: var(--text-secondary); letter-spacing: -0.09px; margin-bottom: 6px; }
.content-full li strong { color: var(--text-primary); }

/* Prototyping comparison */
.proto-compare {
  display: flex; align-items: center; justify-content: center;
  padding: 24px 64px 40px; width: 100%; max-width: 1212px;
}
.proto-compare img { max-height: 520px; width: auto; object-fit: contain; border-radius: var(--radius-sm); }
.proto-brace {
  font-family: var(--font-heading); font-size: 240px; line-height: 1;
  color: var(--accent); padding: 0 4px; user-select: none;
}
.deliverables-img { max-width: 945px; width: 100%; margin: 0 auto; display: block; border-radius: var(--radius-sm); }
.outcomes-img { max-width: 709px; width: 100%; border-radius: var(--radius-sm); }

/* Persona carousel */
.persona-carousel {
  position: relative; max-width: 540px; width: 100%;
  overflow: hidden; border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.persona-track { display: flex; transition: transform 0.5s var(--ease); }
.persona-track img { width: 100%; height: auto; flex-shrink: 0; border-radius: 0; box-shadow: none; }
.carousel-btns {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 100%; display: flex; justify-content: space-between;
  padding: 0 8px; pointer-events: none;
}
.carousel-btn {
  pointer-events: auto; background: var(--accent-light);
  border: none; border-radius: 6px; padding: 6px 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.carousel-btn:hover { background: var(--accent); }
.carousel-btn svg { width: 20px; height: 20px; stroke: var(--text-primary); }
.carousel-btn:hover svg { stroke: #fff; }

/* Reflection — Glass Cards */
.reflection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px; padding-top: 32px;
}
.reflection-card {
  padding: 36px;
  background: var(--surface);
  /* No backdrop-filter — inert over the flat bg; see .overview-card note. */
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.reflection-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.reflection-card--wide {
  grid-column: 1 / -1;
}
.reflection-card h3 {
  font-family: var(--font-heading); font-size: 22px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 20px; letter-spacing: -0.12px;
}
.reflection-card p, .reflection-card li { font-size: 16px; line-height: 1.65; color: var(--text-secondary); letter-spacing: -0.09px; }
.reflection-card ul { list-style: disc; padding-left: 24px; }
.reflection-card li { margin-bottom: 10px; }
.reflection-card li strong { color: var(--text-primary); }
.skill-detail { margin-left: 20px; padding-left: 0; list-style: disc; margin-top: 2px; }
.skill-detail li { color: var(--text-secondary); font-weight: 400; margin-bottom: 4px; }

/* ============================================================
   REDUCED TRANSPARENCY
============================================================ */

/* ============================================================
   RESPONSIVE — TABLET  800–1279px
============================================================ */
@media (max-width: 1279px) {
  body > header { padding: 16px 28px; }
  /* Homepage */
  main { padding: var(--header-clearance) 28px 52px; gap: 52px; }
  .hero { padding: 52px 44px; }
  .hero-text-backdrop { padding: 32px 36px; }
  .hero h1 { font-size: 48px; letter-spacing: -0.8px; }
  .hero-subtitle { font-size: 17px; }
  .cards { gap: 20px; }
  .card-text h3 { font-size: 30px; letter-spacing: -0.5px; }
  .card-text p { font-size: 14px; }
  .bento-card h3 { font-size: 22px; }
  .bento-card { padding: 30px 26px; }
  /* Case study */
  .case-hero { padding: 100px 28px 48px; }
  .case-hero h1 { font-size: 64px; letter-spacing: -2px; }
  .case-tagline { font-size: 22px; }
  .case-meta { padding: 0 28px 40px; }
  .meta-item { padding: 16px 16px; }
  .case-showcase { flex-direction: column; gap: 40px; padding: 32px 28px 0; }
  .phone-pair img { height: 400px; }
  .case-logo-img { max-width: 300px; }
  .case-band { padding: 60px 0; margin-top: 48px; }
  .case-band-inner { padding: 0 28px; }
  .overview-grid { gap: 20px; margin-bottom: 32px; }
  .overview-card { padding: 32px; }
  .case-stats { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .stat-card { padding: 24px 12px; }
  .stat-number { font-size: 36px; }
  .process-pipeline { padding: 32px 28px; }
  .process-pipeline-card { padding: 32px 28px; flex-wrap: wrap; gap: 16px; }
  .section-eyebrow { padding: 40px 28px 0; }
  .content-row { padding: 36px 28px 28px; gap: 40px; }
  .content-full { padding: 36px 28px 24px; }
  .proto-compare { padding: 20px 28px 40px; }
  .proto-compare img { max-height: 400px; }
  .reflection-grid { grid-template-columns: 1fr 1fr; }
  .reflection-card { padding: 28px; }
  footer { padding: 16px 28px; }
}

/* ============================================================
   RESPONSIVE — MID  800–1050px  (cards wrap to 2-up grid)
============================================================ */
/* Phone loop — tablet: Linger (full-width hero) uses a 700px sprite at ~15s to
   match desktop scroll speed (~59px/s). Grid cards get a smaller sprite (~380px)
   sized to their ~400px card width so phones aren't overly zoomed-in. */
@media (max-width: 1050px) and (min-width: 800px) {
  /* Linger hero card — full-width, keep large sprite, fix speed.
     15s base, +5% (slower) per Linger-only tablet tuning. */
  .card--feature.card--linger .card-image::after {
    background-size: 700px 893px;
    --tile-h: 893px;
    --loop-dur: 15.75s;
  }
  /* Grid cards — scale down to match card size. WeAct stays at the 15s base;
     Linger gets its own +5% (slower) tablet tuning, same as the hero card above. */
  .cards--grid .card--feature.card--weact .card-image::after {
    background-size: 380px 485px;
    --tile-h: 485px;
    animation-duration: 15s;
  }
  .cards--grid .card--feature.card--linger .card-image::after {
    background-size: 380px 485px;
    --tile-h: 485px;
    animation-duration: 15.75s;
  }
  /* Grid cards (Crimemap/Portfolio) */
  .cards--grid .card--feature.card--crimemap .card-image::after,
  .cards--grid .card--feature.card--portfolio .card-image::after {
    background-size: 380px 620px;
    --tile-h: 620px;
    animation-duration: 19s;
  }
}

@media (max-width: 1050px) and (min-width: 800px) {
  .cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .card { max-width: none; }
  .cards > .card:last-child {
    grid-column: 1 / -1;
    max-width: calc(50% - 10px);
    justify-self: center;
    width: 100%;
  }
  .cards--rows {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .cards--rows .card { max-width: 100%; }
  .cards--rows .card:last-child {
    grid-column: unset;
    max-width: 100%;
    justify-self: unset;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE  1–799px
============================================================ */
/* Phone loop — mobile: smaller sprites sized to full-width single-column cards.
   Tile heights are exact integers to prevent seam jumps at loop boundary. */
@media (max-width: 799px) {
  /* Linger full-width card on mobile */
  .card--feature.card--linger .card-image::after {
    background-size: 500px 638px;
    --tile-h: 638px;
    --loop-dur: 11s;
  }
  /* Grid cards single-column on mobile — match Linger's 500px sprite scale */
  .cards--grid .card--feature.card--weact .card-image::after,
  .cards--grid .card--feature.card--linger .card-image::after {
    background-size: 500px 638px;
    --tile-h: 638px;
    animation-duration: 11s;
  }
  .cards--grid .card--feature.card--crimemap .card-image::after,
  .cards--grid .card--feature.card--portfolio .card-image::after {
    background-size: 500px 815px;
    --tile-h: 815px;
    animation-duration: 14s;
  }
  .cards--grid {
    grid-template-columns: 1fr;
  }
  .cards--grid > .card--feature:last-child:nth-child(odd) {
    grid-column: auto;
    width: 100%;
    justify-self: stretch;
  }
}

/* Intermediate collapse (≈800–1050px, toggled by JS): the unified bar keeps
   wordmark + hamburger + Display(cog); center nav, social and résumé fold into
   the menu sheet. */
body.nav-collapsed .nav-pill-center,
body.nav-collapsed .nav-pill-divider--name,
body.nav-collapsed .nav-pill-pagelink,
body.nav-collapsed .nav-pill-social,
body.nav-collapsed .nav-pill-resume,
body.nav-collapsed .nav-pill-right > .nav-pill-divider { display: none; }
body.nav-collapsed .nav-menu-btn { display: flex; }
/* Display compacts to icon-only */
body.nav-collapsed .display-label,
body.nav-collapsed .display-chevron { display: none; }
body.nav-collapsed .display-cog { display: block; }
body.nav-collapsed .settings-btn { padding: 0; width: 42px; height: 42px; box-sizing: border-box; justify-content: center; opacity: 0.82; }
/* Collapsed dropdown reverts to compact icon circles + green-ring state */
body.nav-collapsed .settings-bubbles { right: 0; left: 0; width: auto; align-items: center; }
body.nav-collapsed .settings-bubble {
  width: 42px; height: 42px; padding: 0;
  border-radius: 50%; justify-content: center; gap: 0;
}
body.nav-collapsed .settings-bubble-label,
body.nav-collapsed .settings-toggle { display: none; }
body.nav-collapsed .settings-bubble::before,
body.nav-collapsed .settings-bubble .settings-state { display: block; }
body.nav-collapsed .settings-bubble[aria-checked="true"] {
  border-color: rgba(34,197,94,0.6);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.72),
    0 0 0 2px #22c55e,
    0 0 12px rgba(34,197,94,0.45);
}

@media (max-width: 799px) {
  body > header { padding: 14px 16px; }
  /* Full mobile: same collapse as the intermediate state */
  nav.nav-pill { height: 56px; padding: 0 8px; }
  .nav-pill-center,
  .nav-pill-divider--name,
  .nav-pill-pagelink,
  .nav-pill-social,
  .nav-pill-resume,
  .nav-pill-right > .nav-pill-divider { display: none; }
  .nav-menu-btn { display: flex; }
  /* Display compacts to icon-only */
  .display-label, .display-chevron { display: none; }
  .display-cog { display: block; }
  .settings-btn { padding: 0; width: 40px; height: 40px; box-sizing: border-box; justify-content: center; opacity: 0.82; }
  /* Collapsed dropdown reverts to compact icon circles + green-ring state */
  .settings-bubbles { right: 0; left: 0; width: auto; align-items: center; }
  .settings-bubble {
    width: 42px; height: 42px; padding: 0;
    border-radius: 50%; justify-content: center; gap: 0;
  }
  .settings-bubble-label,
  .settings-toggle { display: none; }
  .settings-bubble::before,
  .settings-bubble .settings-state { display: block; }
  .settings-bubble[aria-checked="true"] {
    border-color: rgba(34,197,94,0.6);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.72),
      0 0 0 2px #22c55e,
      0 0 12px rgba(34,197,94,0.45);
  }
  /* Homepage */
  main { padding: var(--header-clearance) 18px 40px; gap: 36px; }
  .hero-wrapper::before, .hero-wrapper::after { display: none; }
  .hero { padding: 40px 22px; gap: 20px; }
  .hero-text-backdrop { padding: 28px 20px; gap: 20px; border-radius: 14px; }
  .hero h1 { font-size: 34px; letter-spacing: -0.5px; }
  .hero-subtitle { font-size: 15px; }
  .cards { flex-direction: column; align-items: stretch; gap: 18px; }
  .card { flex: 0 0 auto; max-width: 100%; opacity: 1 !important; transform: none !important; }
  .card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .card-text { padding: 22px 20px 20px; }
  .card-text h3 { font-size: 34px; letter-spacing: -0.6px; }
  .card-text p { font-size: 14px; }
  /* Feature card glass panel: stack on mobile */
  .card-glass-panel { flex-direction: column; align-items: flex-start; gap: 16px; padding: 22px 22px 20px; }
  .card--feature .btn-magnetic { align-self: stretch; }
  .card--feature .btn { width: 100%; }
  /* Row cards stack vertically on mobile */
  .card--row { grid-template-columns: 1fr; min-height: auto; }
  .card--row .card-text { padding: 24px 22px 22px; }
  .card--row .card-text h3 { font-size: 30px; letter-spacing: -0.6px; }
  .card--row .card-image { min-height: 220px; aspect-ratio: 5/3; box-shadow: inset 0 1px 0 rgba(255,255,255,0.55); }
  [data-theme="dark"] .card--row .card-image { box-shadow: inset 0 1px 0 rgba(255,255,255,0.08); }
  .bento-section { --bento-card-w: 82vw; }
  .bento-card { padding: 26px 20px; gap: 12px; opacity: 1 !important; transform: none !important; }
  .bento-card h3 { font-size: 18px; }
  footer { padding: 16px 20px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .footer-links { gap: 20px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  /* Case study */
  .case-hero { padding: 60px 18px 32px; gap: 16px; }
  .case-hero h1 { font-size: 48px; letter-spacing: -1.5px; }
  .case-tagline { font-size: 20px; }
  .case-hero .subtitle { font-size: 15px; }
  .case-btn { padding: 12px 32px; font-size: 14px; }
  .case-meta { flex-wrap: wrap; padding: 0 18px 32px; }
  .meta-item { flex: 1 1 40%; padding: 14px 12px; }
  .meta-item:nth-child(3) { border-left: none; }
  .marquee-name { font-size: 16px; }
  .marquee-sep { font-size: 16px; }
  .case-showcase { padding: 24px 18px 0; gap: 28px; }
  .phone-pair { flex-direction: column; }
  .phone-pair img { height: 340px; }
  .phone-pair img:nth-child(2) { margin-left: 0; margin-top: -20px; transform: rotate(-1deg); }
  .case-logo-img { max-width: 220px; }
  .case-band { padding: 48px 0; margin-top: 36px; }
  .case-band-inner { padding: 0 18px; }
  .overview-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 24px; }
  .overview-card { padding: 28px; }
  .overview-card .role-columns { flex-direction: column; gap: 8px; }
  .case-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 24px 12px; }
  .stat-number { font-size: 36px; }
  .case-divider { width: 80px; }
  .section-eyebrow { padding: 32px 18px 0; font-size: 12px; }
  .process-pipeline { padding: 24px 18px; }
  .process-pipeline-card { padding: 24px 18px; flex-wrap: wrap; gap: 20px; justify-content: center; }
  .process-step { gap: 8px; }
  .process-icon { width: 40px; height: 40px; border-radius: 10px; }
  .process-icon img { width: 18px; height: 18px; }
  .process-label { font-size: 11px; }
  .process-arrow { display: none; }
  .content-row { flex-direction: column !important; padding: 28px 18px 20px; gap: 28px; }
  .content-row h2 { font-size: 26px; }
  .content-full { padding: 28px 18px 16px; }
  .content-full h2 { font-size: 26px; }
  .proto-compare { flex-direction: column; padding: 16px 18px 32px; gap: 0; }
  .proto-compare img { max-height: 320px; }
  .proto-brace { font-size: 80px; transform: rotate(90deg); }
  .reflection-grid { grid-template-columns: 1fr; gap: 12px; }
  .reflection-card { padding: 24px; }
}

/* ============================================================
   HIGH CONTRAST MODE — Full component overrides
   Activates when data-contrast="high" (light or dark).
   Strips every glass/translucency effect so all text meets
   WCAG AAA against a solid background. Variables already
   set correct colors; these rules override hardcoded rgba
   values and remove decorative shadows / backdrop-filters.
============================================================ */

/* Body — remove paper grain texture */
[data-contrast="high"] body {
  background-image: none;
  background-color: var(--bg);
}

/* Hide only the decorative blobs, keep the liquid canvas */
[data-contrast="high"] .hero-wrapper::before,
[data-contrast="high"] .hero-wrapper::after { display: none; }

/* Homepage hero — warm dim over the animation for contrast */
[data-contrast="high"] .hero {
  background: rgba(62, 40, 22, 0.52);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 2px solid var(--border);
  box-shadow: none;
}
[data-theme="dark"][data-contrast="high"] .hero {
  background: rgba(0, 0, 0, 0.68);
}

/* Case page heroes — always forced dark with white border in HC */
[data-contrast="high"] .hero-wrapper .case-hero {
  background: rgba(0, 0, 0, 0.80);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 2px solid #FFFFFF;
  box-shadow: none;
}

/* Text backdrop — homepage: near-opaque light; case pages: near-opaque dark */
[data-contrast="high"] .hero-text-backdrop {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 2px 16px rgba(90,58,18,0.15);
}
[data-theme="dark"][data-contrast="high"] .hero-text-backdrop {
  background: rgba(0, 0, 0, 0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 2px 16px rgba(0,0,0,0.30);
}
/* Case page backdrop specifically — always dark in HC */
[data-contrast="high"] .hero-wrapper .case-hero .hero-text-backdrop {
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: rgba(255,255,255,0.70);
  box-shadow: none;
}
/* Case page hero text — white on forced dark backdrop */
[data-contrast="high"] .hero-wrapper .case-hero .case-eyebrow,
[data-contrast="high"] .hero-wrapper .case-hero .case-tag { color: #FFD9CC; text-shadow: none; }
[data-contrast="high"] .hero-wrapper .case-hero h1 { color: #FFFFFF; text-shadow: none; }
[data-contrast="high"] .hero-wrapper .case-hero .case-tagline,
[data-contrast="high"] .hero-wrapper .case-hero .hero-tagline,
[data-contrast="high"] .hero-wrapper .case-hero .subtitle { color: #EEEEEE; text-shadow: none; }

/* Hero text — solid colors, no text-shadow */
[data-contrast="high"] .hero h1 {
  color: var(--text-primary);
  text-shadow: none;
}
[data-contrast="high"] .hero h1 .highlight {
  color: var(--accent-text);
  text-shadow: none;
}
[data-contrast="high"] .hero-subtitle {
  color: var(--text-primary);
  text-shadow: none;
}
[data-contrast="high"] .hero-tagline {
  color: var(--text-secondary);
  text-shadow: none;
}
[data-contrast="high"] .underline-draw {
  background: var(--text-primary);
}

/* Project cards — solid glass-free surface */
[data-contrast="high"] .card {
  background: var(--surface-solid);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 2px solid var(--border);
  box-shadow: none;
}
[data-contrast="high"] .card::before,
[data-contrast="high"] .card::after { display: none; }
[data-contrast="high"] .card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--text-primary);
}
[data-contrast="high"] .card-text {
  border-top: 2px solid var(--border);
  box-shadow: none;
}
[data-contrast="high"] .card-text h3 {
  color: var(--text-primary);
  text-shadow: none;
}
[data-contrast="high"] .card-text p {
  color: var(--text-secondary);
  text-shadow: none;
}

/* Card button */
[data-contrast="high"] .card .btn {
  background: var(--accent-light);
  border: 2px solid var(--border);
  color: var(--text-primary);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-shadow: none;
}
[data-contrast="high"] .card .btn:hover {
  background: var(--accent-btn-bg);
  border-color: var(--accent-btn-bg);
  color: var(--bg);
  transform: none;
  box-shadow: none;
}
[data-contrast="high"] .card .btn svg { filter: none; }
[data-contrast="high"] .card .btn:hover svg { filter: brightness(10); transform: translateX(3px); }

/* Bento grid cards */
[data-contrast="high"] .bento-card {
  background: var(--surface-solid);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 2px solid var(--border);
  box-shadow: none;
}
[data-contrast="high"] .bento-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--text-primary);
}

/* Header — keep transparent; pills handle their own high-contrast styles */
[data-contrast="high"] body > header {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
}

/* Footer */
[data-contrast="high"] footer {
  background: var(--surface-solid);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 2px solid var(--border);
  box-shadow: none;
}

/* Unified bar + settings bubbles */
[data-contrast="high"] nav.nav-pill,
[data-contrast="high"] .settings-bubble {
  background: var(--surface-solid);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 2px solid var(--border);
  box-shadow: none;
}

/* Overview cards (case study / about page Why Me band) */
[data-contrast="high"] .overview-card {
  background: var(--surface-solid);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 2px solid var(--border);
  box-shadow: none;
}
[data-contrast="high"] .overview-card:hover {
  transform: none;
  box-shadow: none;
}

/* Reflection cards */
[data-contrast="high"] .reflection-card {
  background: var(--surface-solid);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 2px solid var(--border);
  box-shadow: none;
}
[data-contrast="high"] .reflection-card:hover {
  transform: none;
  box-shadow: none;
}

/* Dividers */
[data-contrast="high"] .divider,
[data-contrast="high"] .case-divider { background: var(--border); }

/* Hero card — index + about: solid white/black surfaces, no frosting */
[data-contrast="high"] body[data-page-tint="home"] .hero-text-backdrop,
[data-contrast="high"] body[data-page-tint="about"] .hero-text-backdrop {
  background: #FFFFFF !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1.5px solid #000000 !important;
  box-shadow: none !important;
}
[data-theme="dark"][data-contrast="high"] body[data-page-tint="home"] .hero-text-backdrop,
[data-theme="dark"][data-contrast="high"] body[data-page-tint="about"] .hero-text-backdrop {
  background: #000000 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1.5px solid #FFFFFF !important;
  box-shadow: none !important;
}

/* Stronger focus ring */
[data-contrast="high"] :focus-visible {
  outline: 3px solid var(--focus-color);
  outline-offset: 3px;
}

/* ============================================================
   REDUCED MOTION
============================================================ */
/* Shared rules used by both the system media query and the in-app toggle.
   Written once as a ruleset under each selector to avoid duplication.      */

/* ── system preference ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-wrapper::before, .hero-wrapper::after { animation: none; }
  .liquid-blob { animation: none !important; }

  *:hover, *:focus { transform: none !important; }
  :root { --shadow-md: var(--shadow-sm); --shadow-lg: var(--shadow-sm); }
  .card:hover    { box-shadow: inset 0 1px 0 rgba(255,255,255,0.60) !important; }
  .cards--rows .card:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,0.55) !important; }
  .bento-card:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,0.90), inset 1px 0 0 rgba(255,255,255,0.35), var(--shadow-sm) !important; }

  .bento-grid-wrap {
    padding-inline: calc(50% - var(--bento-card-w) / 2);
    scroll-snap-type: none;
    overflow-x: scroll;
  }
  .bento-card { opacity: 1 !important; transform: none !important; }
}

/* ── in-app toggle (data-motion="reduced" set by settings panel) ── */
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
html[data-motion="reduced"] *:hover,
html[data-motion="reduced"] *:focus { transform: none !important; }
html[data-motion="reduced"] {
  --shadow-md: var(--shadow-sm);
  --shadow-lg: var(--shadow-sm);
}
html[data-motion="reduced"] .card:hover    { box-shadow: inset 0 1px 0 rgba(255,255,255,0.60), 0 4px 16px rgba(62,40,22,0.07) !important; }
html[data-motion="reduced"] .cards--rows .card:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 4px 16px rgba(62,40,22,0.07) !important; }
html[data-motion="reduced"] .bento-card:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,0.90), inset 1px 0 0 rgba(255,255,255,0.35), var(--shadow-sm) !important; }
html[data-motion="reduced"] .bento-grid-wrap {
  padding-inline: calc(50% - var(--bento-card-w) / 2);
  scroll-snap-type: none;
  overflow-x: scroll;
}
html[data-motion="reduced"] .bento-card { opacity: 1 !important; transform: none !important; }

/* ---- Drag-to-scroll + nav hint (reduced-motion only) ----
   Snap is disabled above so a drag (or arrow-key scroll) stops wherever
   the user releases it, instead of jumping to the nearest card. */
html[data-motion="reduced"] .bento-grid-wrap { cursor: grab; }
@media (prefers-reduced-motion: reduce) {
  .bento-grid-wrap { cursor: grab; }
}
.bento-grid-wrap.bento-dragging { cursor: grabbing; user-select: none; }
.bento-nav-hint {
  display: none;
  align-items: center; gap: 6px;
  margin-top: -20px;
  padding: 6px 14px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.bento-nav-hint kbd {
  padding: 1px 6px;
  font-family: var(--font-body);
  font-size: 11px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  line-height: 1.4;
}
html[data-motion="reduced"] .bento-nav-hint { display: inline-flex; }
@media (prefers-reduced-motion: reduce) {
  .bento-nav-hint { display: inline-flex; }
}

/* ============================================================
   PAGE TRANSITIONS — cross-document View Transitions API
   Chrome 126+; graceful no-op in other browsers.
   Glassy blur-and-scale for all navigations.
============================================================ */
@view-transition {
  navigation: auto;
}

@keyframes vt-blur-out {
  to {
    opacity: 0;
    filter: blur(14px) saturate(1.5);
    transform: scale(1.03);
  }
}
@keyframes vt-blur-in {
  from {
    opacity: 0;
    filter: blur(14px) saturate(1.5);
    transform: scale(0.98);
  }
}

::view-transition-old(root) {
  animation: 350ms cubic-bezier(0.4, 0, 1, 1) vt-blur-out both;
}
::view-transition-new(root) {
  animation: 450ms cubic-bezier(0, 0, 0.2, 1) vt-blur-in both;
}
