/*
 * Liquid Glass portfolio layer
 * The existing site remains intact underneath this design system. This file
 * owns global theme tokens, navigation, and responsive
 * corrections so future case studies can migrate without a framework rewrite.
 */

:root {
  --page: #eef1f6;
  --page-deep: #dce3ec;
  --ink: #111318;
  --ink-soft: #4e5663;
  --ink-faint: #717b89;
  --line: rgb(20 26 36 / 14%);
  --line-strong: rgb(20 26 36 / 24%);
  --glass: rgb(248 251 255 / 58%);
  --glass-strong: rgb(250 252 255 / 78%);
  --glass-solid: #f7f9fc;
  --glass-edge: rgb(255 255 255 / 82%);
  --glass-shadow: 0 24px 70px rgb(43 58 79 / 16%), inset 0 1px 0 rgb(255 255 255 / 82%);
  --accent: #1268f0;
  --accent-ink: #f8fbff;
  --media: #cfd6e0;
  --ambient:
    radial-gradient(circle at 12% 14%, rgb(71 166 255 / 36%), transparent 32%),
    radial-gradient(circle at 84% 25%, rgb(255 180 106 / 27%), transparent 28%),
    radial-gradient(circle at 64% 80%, rgb(114 89 255 / 24%), transparent 32%),
    linear-gradient(135deg, #e8edf5 0%, #f5f7fa 48%, #dce4ee 100%);
  --radius-sm: 14px;
  --radius-md: 24px;
  --radius-lg: 38px;
  --nav-height: 60px;
  --ease-spring: cubic-bezier(.2, .9, .2, 1.18);
}

:root[data-theme="dark"] {
  --page: #080a0e;
  --page-deep: #111722;
  --ink: #f1f4f8;
  --ink-soft: #b0b8c4;
  --ink-faint: #818b99;
  --line: rgb(224 235 255 / 14%);
  --line-strong: rgb(224 235 255 / 25%);
  --glass: rgb(16 21 30 / 58%);
  --glass-strong: rgb(19 25 35 / 82%);
  --glass-solid: #141922;
  --glass-edge: rgb(255 255 255 / 18%);
  --glass-shadow: 0 30px 90px rgb(0 0 0 / 52%), inset 0 1px 0 rgb(255 255 255 / 16%);
  --accent: #79adff;
  --accent-ink: #07101e;
  --media: #1a202b;
  --ambient:
    radial-gradient(circle at 12% 14%, rgb(21 112 211 / 34%), transparent 34%),
    radial-gradient(circle at 84% 25%, rgb(196 104 48 / 22%), transparent 30%),
    radial-gradient(circle at 64% 80%, rgb(78 57 190 / 28%), transparent 34%),
    linear-gradient(135deg, #080a0f 0%, #111722 52%, #06070a 100%);
}

html {
  background: var(--page);
  color: var(--ink);
  overflow-x: clip;
  scroll-padding-top: calc(var(--nav-height) + 32px);
}

body {
  min-width: 0;
  color: var(--ink);
  background: var(--page);
  overflow-x: clip !important;
  transition: color .35s ease, background-color .35s ease;
}

body,
button,
a,
input,
textarea,
select {
  font-family: 'Graphik Light', -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

main {
  position: relative;
  z-index: auto;
  width: 100%;
  padding-left: 0 !important;
  background: transparent !important;
}

.container {
  box-sizing: border-box;
  width: min(100%, 1280px);
  max-width: 1280px;
  padding: clamp(86px, 11vw, 164px) clamp(22px, 6vw, 84px);
}

.section-title,
#hero .name {
  color: var(--ink);
  font-family: 'Graphik Wide', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -.035em;
}

.section-title {
  margin: 0 0 clamp(32px, 5vw, 68px);
  font-size: clamp(2.25rem, 5vw, 5.75rem);
  line-height: .94;
  font-weight: 400;
}

.bio,
.reference-tagline,
.rejected-accordion-context,
.award-item,
.award-list,
.client-list,
.talks-item,
.press-item {
  color: var(--ink-soft) !important;
}

#mobile-nav,
#section-nav {
  display: none !important;
}

#scroll-progress {
  z-index: 1200;
  height: 2px;
  background: var(--accent);
}

/* Atmospheric scene: the lightweight source copied into refractive lenses. */
.optical-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--ambient);
  transition: background .45s ease;
}

.optical-atmosphere::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .17;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.optical-orb {
  position: absolute;
  width: 52vw;
  aspect-ratio: 1;
  border-radius: 46% 54% 63% 37% / 40% 37% 63% 60%;
  filter: blur(70px);
  opacity: .22;
  animation: optical-drift 24s ease-in-out infinite alternate;
}

.optical-orb--one {
  top: -25%;
  left: -15%;
  background: #2f9cff;
}

.optical-orb--two {
  right: -20%;
  bottom: -28%;
  background: #e37f56;
  animation-delay: -9s;
}

.optical-grid {
  position: absolute;
  inset: 0;
  opacity: .18;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

@keyframes optical-drift {
  to { transform: translate3d(10vw, 8vh, 0) rotate(18deg) scale(1.12); }
}

/* Glass material */
.glass-surface {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--glass-edge);
  background: var(--glass);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
}

.glass-surface::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 24%), transparent 30%),
    linear-gradient(to bottom, transparent 62%, rgb(255 255 255 / 9%));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%);
}

.glass-refraction {
  position: absolute;
  inset: -18px;
  z-index: -2;
  pointer-events: none;
  background: var(--ambient) fixed center / cover;
  opacity: .72;
  transform: scale(1.04);
}

/* Floating navigation and a single interruptible lens. */
.glass-nav {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  z-index: 1100;
  display: flex;
  align-items: center;
  width: min(calc(100vw - 28px), 1120px);
  min-height: var(--nav-height);
  padding: 7px;
  border-radius: 22px;
  transform: translateX(-50%);
  overflow: visible;
}

.glass-nav > .glass-refraction {
  overflow: hidden;
  border-radius: inherit;
}

.glass-brand {
  flex: 0 0 auto;
  padding-inline: 15px !important;
  font-family: 'Graphik Wide', sans-serif;
  letter-spacing: -.025em !important;
}

.glass-nav-groups {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin-inline: auto;
}

.glass-nav-trigger {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 15px;
  color: var(--ink);
  background: transparent;
  font-size: .68rem;
  line-height: 1;
  letter-spacing: .11em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.glass-nav-trigger::-webkit-details-marker { display: none; }

.glass-nav-trigger:hover,
.glass-nav-trigger:focus-visible,
.glass-nav-trigger[aria-current="true"] {
  color: var(--ink);
}

.glass-nav-lens {
  position: absolute;
  top: var(--lens-y, 7px);
  left: var(--lens-x, 7px);
  z-index: 1;
  width: var(--lens-w, 92px);
  height: var(--lens-h, 44px);
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 15px;
  background: rgb(255 255 255 / 12%);
  box-shadow: 0 8px 28px rgb(12 25 47 / 12%), inset 0 1px 1px rgb(255 255 255 / 38%);
  transition:
    left .5s var(--ease-spring),
    top .5s var(--ease-spring),
    width .5s var(--ease-spring),
    height .5s var(--ease-spring);
  pointer-events: none;
}

.glass-nav-group {
  position: relative;
}

.glass-nav-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  display: grid;
  min-width: 190px;
  padding: 8px;
  border-radius: 20px;
  opacity: 0;
  transform: translate(-50%, -8px) scale(.97);
  transition: opacity .22s ease, transform .35s var(--ease-spring);
  pointer-events: none;
}

.glass-nav-group[open] .glass-nav-menu {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}

.glass-nav-menu a {
  padding: 12px 13px;
  border-radius: 13px;
  color: var(--ink-soft);
  font-size: .78rem;
  text-decoration: none;
}

.glass-nav-menu a:hover,
.glass-nav-menu a:focus-visible {
  color: var(--ink);
  background: rgb(255 255 255 / 13%);
}

.theme-toggle {
  flex: 0 0 auto;
  gap: 8px;
  margin-left: 6px;
  border-left: 1px solid var(--line);
  border-radius: 0 15px 15px 0;
}

.glass-mobile-toggle { display: none; }

.theme-toggle-icon {
  width: 12px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  transition: transform .45s var(--ease-spring);
}

:root[data-theme="dark"] .theme-toggle-icon { transform: rotate(180deg); }

/* Hero */
#hero {
  display: grid;
  align-content: center;
  min-height: 100svh;
  padding-top: 130px;
}

#hero .name {
  max-width: 12ch;
  margin: 0 0 24px;
  font-size: clamp(4.1rem, 10vw, 9.5rem);
  line-height: .84;
}

.subtitle-rule {
  width: 72px;
  background: var(--line-strong);
}

#hero .subtitle {
  max-width: 70ch;
  color: var(--ink-faint);
  font-size: .68rem;
}

#hero .bio {
  max-width: 74ch;
  margin-block: 18px;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.4vw, 1.24rem);
  line-height: 1.58;
}

#contact-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.reel-card,
.contact-btn {
  min-height: 48px;
  margin: 0;
  padding: 0 19px;
  border-color: var(--line-strong);
  border-radius: 16px;
  color: var(--ink);
  background: rgb(255 255 255 / 8%);
}

#social-links {
  flex-basis: 100%;
  margin-top: 4px;
}

/* Existing work sections: preserve mechanics, establish visual hierarchy. */
#selected-work,
#artifacts,
#rejected,
#selected-clients,
#press,
#talks,
#awards,
#reference {
  position: relative;
  color: var(--ink);
}

#selected-work-carousel,
#artifacts-carousel {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden !important;
  contain: paint;
}

#selected-work-carousel .slides,
#artifacts-carousel .slides {
  max-width: 100%;
}

#selected-work-carousel .slide-media,
#artifacts-carousel .slide-media {
  overflow: hidden;
  border: 1px solid var(--glass-edge);
  border-radius: clamp(18px, 3vw, 38px);
  background: var(--media);
  box-shadow: var(--glass-shadow);
}

#selected-work-carousel .slide img,
#selected-work-carousel .slide video {
  border-radius: inherit;
}

#selected-work-carousel .nav,
#artifacts-carousel .nav {
  color: var(--ink-soft);
}

.selected-work-bento,
.modal-inner,
.reference-modal-content,
.reference-fullscreen-header {
  color: var(--ink);
}

.selected-work-modal {
  z-index: 1900 !important;
}

.selected-work-case-detail {
  grid-column: 1 / -1;
  padding: clamp(24px, 5vw, 64px);
  border-color: var(--line) !important;
  color: var(--ink);
  background: var(--glass) !important;
}

.selected-work-case-header {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 44px;
}

.selected-work-case-header p {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.selected-work-case-header span,
.selected-work-case-sections h3 {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-faint);
  font-family: monospace;
  font-size: .63rem;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.selected-work-case-header strong {
  color: var(--ink);
  font-weight: 400;
}

.selected-work-case-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 72px);
}

.selected-work-case-sections section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.selected-work-case-sections p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.selected-work-case-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 44px;
}

.selected-work-case-gallery img {
  width: 100%;
  height: 280px;
  border-radius: 18px;
  object-fit: cover;
}

/* Experimental Lab */
.experimental-lab {
  width: min(calc(100% - 32px), 1380px);
  max-width: 1380px;
  margin-block: clamp(60px, 8vw, 120px);
  padding-inline: clamp(14px, 4vw, 54px);
  border: 1px solid var(--glass-edge);
  border-radius: clamp(30px, 5vw, 70px);
  background: linear-gradient(145deg, rgb(255 255 255 / 12%), transparent 60%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 16%);
}

.experimental-lab.reveal {
  opacity: 1;
  transform: none;
}

#social-links a {
  color: var(--ink-faint) !important;
}

#contact-block .reel-card,
#contact-block .contact-btn {
  color: var(--ink) !important;
  background: var(--glass) !important;
}

.lab-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  align-items: end;
  gap: clamp(30px, 7vw, 100px);
  margin-bottom: clamp(44px, 7vw, 88px);
}

.lab-heading .section-title { margin-bottom: 0; }

.lab-kicker,
.lab-modal-index {
  margin: 0 0 13px;
  color: var(--accent);
  font-family: monospace;
  font-size: .67rem;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.lab-intro {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.6;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: clamp(10px, 1.4vw, 20px);
}

.lab-card {
  position: relative;
  grid-column: span 4;
  min-height: 340px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-md);
  color: white;
  background: var(--media);
  box-shadow: 0 18px 54px rgb(0 0 0 / 16%);
  cursor: pointer;
  text-align: left;
  isolation: isolate;
}

.lab-card:nth-child(1),
.lab-card:nth-child(6) {
  grid-column: span 7;
  min-height: 480px;
}

.lab-card:nth-child(2),
.lab-card:nth-child(5) {
  grid-column: span 5;
  min-height: 480px;
}

.lab-card:nth-child(8) { grid-column: span 8; }

.lab-card-media,
.lab-card-media video,
.lab-card-media img,
.lab-card-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lab-card-media video,
.lab-card-media img {
  object-fit: cover;
  filter: saturate(.82) contrast(1.04);
  transition: transform .8s var(--ease-spring), filter .5s ease;
}

.lab-card:hover .lab-card-media video,
.lab-card:hover .lab-card-media img,
.lab-card:focus-visible .lab-card-media video,
.lab-card:focus-visible .lab-card-media img {
  transform: scale(1.04);
  filter: saturate(1) contrast(1.02);
}

.lab-card-placeholder,
.lab-media-placeholder {
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 20%, hsl(var(--lab-hue, 210) 82% 64% / .68), transparent 36%),
    radial-gradient(circle at 78% 72%, hsl(calc(var(--lab-hue, 210) + 70) 70% 52% / .55), transparent 42%),
    linear-gradient(145deg, #121822, #030405);
}

.lab-card-placeholder::before,
.lab-media-placeholder::before {
  content: '';
  width: 44%;
  aspect-ratio: 1;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 36% 64% 54% 46% / 43% 39% 61% 57%;
  box-shadow: inset 0 0 42px rgb(255 255 255 / 12%), 0 0 70px hsl(var(--lab-hue, 210) 80% 55% / .28);
  animation: lab-placeholder 11s ease-in-out infinite alternate;
}

@keyframes lab-placeholder {
  to { transform: rotate(35deg) scale(1.17); border-radius: 62% 38% 45% 55% / 54% 64% 36% 46%; }
}

.lab-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(18px, 2.5vw, 32px);
  background: linear-gradient(to top, rgb(3 5 8 / 90%) 0%, rgb(3 5 8 / 20%) 66%, transparent 100%);
}

.lab-card-number,
.lab-card-meta {
  font-family: monospace;
  font-size: .63rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.lab-card-number { opacity: .68; }

.lab-card-title {
  max-width: 17ch;
  margin: 12px 0 8px;
  font-family: 'Graphik Wide', sans-serif;
  font-size: clamp(1.45rem, 2.2vw, 2.5rem);
  line-height: 1;
  letter-spacing: -.035em;
}

.lab-card-meta { opacity: .72; }

.lab-card-summary {
  max-height: 0;
  max-width: 50ch;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  font-size: .9rem;
  line-height: 1.5;
  transform: translateY(10px);
  transition: max-height .45s ease, opacity .3s ease, transform .45s var(--ease-spring), margin .3s ease;
}

.lab-card:hover .lab-card-summary,
.lab-card:focus-visible .lab-card-summary {
  max-height: 8em;
  margin-top: 14px;
  opacity: .9;
  transform: none;
}

.lab-card:focus-visible,
.theme-toggle:focus-visible,
.glass-nav-trigger:focus-visible,
.lab-modal-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Lab mini-case-study overlay */
.lab-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  visibility: hidden;
  opacity: 0;
  transition: opacity .28s ease, visibility 0s linear .28s;
}

.lab-modal[aria-hidden="false"] {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.lab-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(2 5 9 / 66%);
  -webkit-backdrop-filter: blur(18px) saturate(80%);
  backdrop-filter: blur(18px) saturate(80%);
}

.lab-dialog {
  width: min(1180px, 100%);
  max-height: calc(100svh - 32px);
  border-radius: var(--radius-lg);
  color: var(--ink);
  transform: translateY(22px) scale(.985);
  transition: transform .5s var(--ease-spring);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lab-modal[aria-hidden="false"] .lab-dialog { transform: none; }

.lab-dialog-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(22px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(26px);
  backdrop-filter: blur(26px);
}

.lab-dialog-header h2 {
  max-width: 20ch;
  margin: 0;
  color: var(--ink);
  font-family: 'Graphik Wide', sans-serif;
  font-size: clamp(2rem, 5vw, 5rem);
  line-height: .94;
  letter-spacing: -.04em;
}

.lab-modal-close {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink);
  background: rgb(255 255 255 / 9%);
  font-size: 1.5rem;
  cursor: pointer;
}

.lab-dialog-body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 24px);
  padding: clamp(14px, 3vw, 38px);
}

.lab-hero-media,
.lab-gif-media,
.lab-gallery-item {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--media);
}

.lab-hero-media {
  grid-column: span 8;
  min-height: min(58vw, 570px);
}

.lab-copy {
  grid-column: span 4;
  align-self: stretch;
  padding: clamp(20px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 6%);
}

.lab-modal-summary {
  margin: 0 0 42px;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  line-height: 1.65;
}

.lab-meta {
  display: grid;
  gap: 20px;
  margin: 0;
}

.lab-meta div {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.lab-meta dt {
  margin-bottom: 7px;
  color: var(--ink-faint);
  font-family: monospace;
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.lab-meta dd {
  margin: 0;
  color: var(--ink);
}

.lab-gif-media {
  grid-column: span 4;
  min-height: 420px;
}

.lab-gallery {
  grid-column: span 8;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.5vw, 18px);
}

.lab-gallery-item { min-height: 420px; }

.lab-hero-media video,
.lab-gif-media img,
.lab-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lab-media-placeholder {
  position: absolute;
  inset: 0;
  color: rgb(255 255 255 / 72%);
}

.lab-media-placeholder span {
  position: absolute;
  right: 16px;
  bottom: 14px;
  font-family: monospace;
  font-size: .61rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

body.lab-modal-open { overflow: hidden !important; }

/* Keep archive sections legible in both themes. */
.rejected-accordion-header,
.talks-item,
.press-item,
.award-item,
.award-list li,
.client-list li,
.section-list-toggle,
#reference button {
  color: var(--ink) !important;
  border-color: var(--line) !important;
}

.rejected-accordion-item,
.talks-item,
.press-item,
.awards-group {
  border-color: var(--line) !important;
}

.reference-grid img,
.reference-grid video {
  border-radius: 18px;
}

@media (max-width: 900px) {
  :root { --nav-height: 58px; }

  .glass-nav {
    align-items: stretch;
    flex-wrap: wrap;
    min-height: 58px;
    overflow: hidden;
    border-radius: 20px;
  }

  .glass-brand { margin-right: auto; }

  .theme-toggle {
    order: 2;
    margin-left: auto;
  }

  .theme-toggle-label { display: none; }

  .glass-nav-groups {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
    max-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    opacity: 0;
    transition: max-height .35s ease, opacity .25s ease, padding .35s ease;
    scrollbar-width: none;
  }

  .glass-nav.is-mobile-open .glass-nav-groups {
    max-height: 150px;
    padding-top: 7px;
    opacity: 1;
    overflow: visible;
    flex-wrap: wrap;
  }

  .glass-nav.is-mobile-open { overflow: visible; }

  .glass-mobile-toggle {
    display: inline-flex;
    order: 1;
    align-self: center;
    margin-left: auto;
    padding: 12px 8px;
    border: 0;
    color: var(--ink-faint);
    background: transparent;
    font-family: monospace;
    font-size: .62rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
  }

  .glass-nav.is-mobile-open .glass-mobile-toggle::after { content: ''; }

  .glass-nav-lens { display: none; }

  .glass-nav-group { position: static; }

  .glass-nav-menu {
    top: calc(100% + 10px);
    right: 7px;
    left: 7px;
    width: auto;
    transform: translateY(-8px) scale(.97);
  }

  .glass-nav-group[open] .glass-nav-menu {
    transform: translateY(0) scale(1);
  }

  .lab-heading { grid-template-columns: 1fr; }

  .lab-card,
  .lab-card:nth-child(n) {
    grid-column: span 6;
    min-height: 360px;
  }

  .lab-hero-media,
  .lab-copy,
  .lab-gif-media,
  .lab-gallery {
    grid-column: 1 / -1;
  }

  .lab-gallery-item { min-height: 300px; }
}

@media (max-width: 620px) {
  .container {
    padding-block: 92px;
    padding-inline: 18px;
  }

  #hero { padding-top: 142px; }

  #hero .name { font-size: clamp(3.5rem, 18vw, 5.3rem); }

  #contact-block { align-items: stretch; }

  .reel-card,
  .contact-btn { flex: 1 1 140px; }

  .experimental-lab {
    width: calc(100% - 20px);
    padding-inline: 10px;
    border-radius: 32px;
  }

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

  .lab-card,
  .lab-card:nth-child(n) {
    grid-column: 1;
    min-height: min(118vw, 470px);
  }

  .lab-dialog-body { display: block; }

  .lab-dialog-body > * { margin-bottom: 12px; }

  .lab-hero-media { min-height: 52svh; }

  .lab-gif-media { min-height: 380px; }

  .lab-gallery {
    display: grid;
    grid-template-columns: 1fr;
  }

  .lab-gallery-item { min-height: 380px; }

  .selected-work-case-header,
  .selected-work-case-sections,
  .selected-work-case-gallery {
    grid-template-columns: 1fr;
  }

  #selected-work-carousel,
  #artifacts-carousel,
  #selected-work-carousel .slides,
  #artifacts-carousel .slides {
    max-width: calc(100vw - 36px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .optical-orb,
  .lab-card-placeholder::before,
  .lab-media-placeholder::before {
    animation: none !important;
  }

  .glass-nav-lens,
  .lab-dialog,
  .lab-card-media img,
  .lab-card-media video {
    transition-duration: .01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .glass-surface,
  .glass-nav-menu,
  .lab-dialog-header {
    background: var(--glass-solid) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .glass-refraction,
  .glass-surface::after,
  .lab-modal-backdrop {
    display: none !important;
  }
}

:root[data-theme="dark"] #section-nav,
:root[data-theme="dark"] .glass-nav {
  background: rgb(29 29 31 / 42%);
}

/* Experimental Lab uses the same quiet editorial hierarchy as the identity. */
#experimental-lab .lab-heading {
  grid-template-columns: minmax(0, 760px);
  align-items: start;
  gap: 18px;
  margin-bottom: clamp(38px, 6vw, 68px);
}

#experimental-lab .section-title {
  margin: 0;
  font-family: 'Graphik Light', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(1.5rem, 2vw, 2rem);
  line-height: 1.1;
  letter-spacing: -.025em;
}

#experimental-lab .lab-kicker {
  margin: 0 0 4px;
  color: var(--ink-faint);
  font-family: 'Graphik Light', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: .72rem;
  line-height: 1.2;
  letter-spacing: .01em;
  text-transform: lowercase;
}

#experimental-lab .lab-intro {
  max-width: 64ch;
  color: var(--ink-soft);
  font-size: clamp(.92rem, 1.25vw, 1.08rem);
  line-height: 1.6;
}

.lab-modal-index { color: var(--ink-faint); }

/* Keep secondary profile actions attached to the primary contact controls. */
#hero #contact-block {
  display: grid;
  grid-template-columns: repeat(2, 170px);
  justify-content: start;
  align-items: center;
  width: fit-content;
  gap: 12px;
}

#hero #social-links {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-self: start;
  width: auto;
  margin: 2px 0 0;
  gap: 0;
}

#hero #social-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--ink-soft) !important;
  font-family: 'Graphik Light', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: .7rem;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: lowercase;
  opacity: 1;
  transition: color .2s ease;
}

#hero #social-links a + a::before {
  content: '/';
  margin: 0 11px;
  color: var(--ink-faint);
  opacity: .52;
}

#hero #social-links a:hover,
#hero #social-links a:focus-visible {
  color: var(--ink) !important;
}

@media (max-width: 620px) {
  #hero #contact-block {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}

@media (forced-colors: active) {
  .optical-atmosphere,
  .glass-refraction,
  .glass-nav-lens,
  .glass-surface::after {
    display: none !important;
  }

  .glass-surface,
  .lab-card,
  .lab-copy,
  .lab-modal-close {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }
}

/*
 * Quiet editorial pass
 * Glass is a functional layer for navigation and transient controls. Content
 * sits on a calm, neutral canvas so the work supplies the colour and energy.
 */
:root {
  --page: #ffffff;
  --page-deep: #f5f5f7;
  --ink: #161617;
  --ink-soft: #4d4d51;
  --ink-faint: #6e6e73;
  --line: rgb(22 22 23 / 11%);
  --line-strong: rgb(22 22 23 / 20%);
  --glass: rgb(255 255 255 / 38%);
  --glass-strong: rgb(255 255 255 / 68%);
  --glass-solid: #ffffff;
  --glass-edge: rgb(255 255 255 / 84%);
  --glass-shadow: 0 10px 32px rgb(0 0 0 / 7%), inset 0 1px 0 rgb(255 255 255 / 86%);
  --ambient: linear-gradient(#ffffff, #ffffff);
  --accent: #0066cc;
}

:root[data-theme="dark"] {
  --page: #0d0d0e;
  --page-deep: #161617;
  --ink: #f5f5f7;
  --ink-soft: #c7c7cc;
  --ink-faint: #98989d;
  --line: rgb(245 245 247 / 12%);
  --line-strong: rgb(245 245 247 / 22%);
  --glass: rgb(29 29 31 / 70%);
  --glass-strong: rgb(29 29 31 / 90%);
  --glass-solid: #1d1d1f;
  --glass-edge: rgb(255 255 255 / 13%);
  --glass-shadow: 0 18px 54px rgb(0 0 0 / 38%), inset 0 1px 0 rgb(255 255 255 / 11%);
  --ambient: radial-gradient(circle at 50% -20%, #272729 0%, transparent 44%), linear-gradient(#0d0d0e, #111112);
  --accent: #2997ff;
}

html { scroll-padding-top: 24px; }

.optical-atmosphere {
  background: var(--ambient);
}

.optical-atmosphere::after {
  opacity: .025;
  mix-blend-mode: normal;
}

.optical-orb,
.optical-grid { display: none; }

.glass-refraction { opacity: .58; }

.container {
  width: min(100%, 1200px);
  max-width: 1200px;
  padding: clamp(76px, 9vw, 128px) clamp(28px, 6vw, 80px);
}

.section-title {
  margin-bottom: clamp(28px, 4vw, 52px);
  font-family: 'Graphik Light', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(1.5rem, 2vw, 2rem);
  line-height: 1.1;
  letter-spacing: -.025em;
}

#hero {
  min-height: 92svh;
  padding-top: clamp(72px, 10vh, 120px);
  padding-bottom: clamp(112px, 15vh, 180px);
}

#hero .name {
  max-width: none;
  margin-bottom: 16px;
  font-family: 'Graphik Light', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(1.5rem, 2vw, 2rem);
  line-height: 1.1;
  letter-spacing: -.025em;
}

#hero .subtitle {
  color: var(--ink-soft);
  font-size: .72rem;
}

#social-links a {
  color: var(--ink-soft) !important;
  text-decoration-color: var(--line-strong);
}

/* Restore the original vertical navigation as the desktop signature. */
@media (min-width: 901px) {
  .glass-nav { display: none !important; }

  main { padding-left: 72px !important; }

  #section-nav {
    display: flex !important;
    position: fixed;
    top: 50%;
    left: 12px;
    z-index: 1700;
    width: 48px;
    max-height: calc(100svh - 32px);
    padding: 10px 4px;
    gap: clamp(3px, .65vh, 8px);
    overflow: visible;
    transform: translateY(-50%);
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-edge);
    border-radius: 24px;
    color: var(--ink);
    background: rgb(255 255 255 / 32%);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    backdrop-filter: blur(18px) saturate(145%);
  }

  #section-nav a {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 34px;
    padding: 5px 0;
    border-radius: 14px;
    color: var(--ink);
    font-family: monospace;
    font-size: clamp(.48rem, .62vh, .58rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: .035em;
    opacity: .52;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transition: color .2s ease, opacity .2s ease, background .2s ease;
  }

  #section-nav a:hover,
  #section-nav a:focus-visible,
  #section-nav a.active {
    color: var(--ink);
    font-weight: 400;
    opacity: 1;
    background: rgb(127 127 127 / 11%);
  }

  #section-nav a.active::before {
    content: '';
    position: absolute;
    left: -7px;
    width: 3px;
    height: 14px;
    border-radius: 999px;
    background: var(--ink);
  }

  .vertical-theme-toggle {
    display: grid;
    place-items: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    margin-top: 3px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink);
    background: rgb(127 127 127 / 8%);
    cursor: pointer;
  }

  .vertical-theme-toggle .theme-toggle-label { display: none; }

  .scroll-indicator {
    top: auto;
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 900;
    opacity: .58;
    pointer-events: none;
    transition: opacity .35s ease, visibility .35s ease;
  }

  .scroll-indicator .mouse {
    width: 20px;
    height: 32px;
    border: 1px solid var(--ink);
    border-radius: 11px;
  }

  .scroll-indicator .mouse .wheel {
    top: 7px;
    width: 2px;
    height: 5px;
    background: var(--ink);
    animation-duration: 1.8s;
  }
}

/* July refinement: work titles behave like a continuous horizontal index. */
#selected-work-carousel .nav {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding-inline: 28px !important;
  scroll-behavior: smooth;
  scroll-padding-inline: 28px;
  scroll-snap-type: x proximity;
  overscroll-behavior-inline: contain;
  touch-action: pan-x;
  cursor: grab;
  scrollbar-width: none;
}

#selected-work-carousel .nav::-webkit-scrollbar { display: none; }
#selected-work-carousel .nav.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  scroll-snap-type: none;
  user-select: none;
}
#selected-work-carousel .nav li { scroll-snap-align: center; }

/* Artifact canvases are deliberately white; keep their clipped corner pixels white too. */
#artifacts-carousel .slide-media--artifact,
#artifacts-carousel .slide-media--artifact .artifact-model,
#artifacts-carousel .slide-media--artifact .artifact-model-viewer,
#artifacts-carousel .slide-media--artifact .artifact-fallback-img {
  background: #fff !important;
  border-radius: inherit;
}

/* Experiments read as clean, landscape proof-of-concept studies. */
#experimental-lab .lab-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: row;
}

#experimental-lab .lab-card,
#experimental-lab .lab-card:nth-child(n) {
  grid-column: span 6;
  min-height: 0;
  aspect-ratio: 16 / 9;
  border-color: rgb(0 0 0 / 10%);
  color: #161617;
  background: #fff;
  box-shadow: 0 14px 38px rgb(0 0 0 / 7%);
}

#experimental-lab .lab-card:nth-child(7),
#experimental-lab .lab-card:nth-child(10) {
  grid-column: 1 / -1;
}

#experimental-lab .lab-card-placeholder {
  background: #fff;
}

#experimental-lab .lab-card-placeholder::before {
  width: 58%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgb(0 0 0 / 10%);
  border-radius: 20px;
  background: linear-gradient(145deg, #fafafa, #f1f1f3);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 90%);
  animation: none;
}

#experimental-lab .lab-card-overlay {
  color: #161617;
  background: linear-gradient(to top, rgb(255 255 255 / 99%) 0 36%, rgb(255 255 255 / 82%) 57%, transparent 82%);
}

#experimental-lab .lab-card-title {
  max-width: 24ch;
  font-family: 'Graphik Light', 'Graphik', sans-serif;
  font-size: clamp(1.25rem, 2vw, 2.35rem);
  font-weight: 400;
}

#experimental-lab .lab-card-number,
#experimental-lab .lab-card-meta { color: rgb(22 22 23 / 66%); }

#experimental-lab-modal .lab-dialog,
#experimental-lab-modal .lab-dialog-header,
#experimental-lab-modal .lab-dialog-body,
#experimental-lab-modal .lab-copy {
  color: #161617;
  background: #fff;
}

#experimental-lab-modal .lab-dialog-header { border-color: rgb(0 0 0 / 10%); }
#experimental-lab-modal .lab-dialog-header h2 {
  color: #161617;
  font-family: 'Graphik Light', 'Graphik', sans-serif;
  font-size: clamp(1.9rem, 3.5vw, 3.4rem);
  font-weight: 400;
  line-height: 1;
}

#experimental-lab-modal .lab-hero-media,
#experimental-lab-modal .lab-gif-media,
#experimental-lab-modal .lab-gallery-item {
  min-height: 0;
  aspect-ratio: 16 / 9;
  border-color: rgb(0 0 0 / 10%);
  background: #fff;
}

#experimental-lab-modal .lab-media-placeholder {
  color: rgb(22 22 23 / 48%);
  background: #fff;
}

#experimental-lab-modal .lab-media-placeholder::before {
  aspect-ratio: 16 / 9;
  border-color: rgb(0 0 0 / 10%);
  border-radius: 20px;
  background: linear-gradient(145deg, #fafafa, #f1f1f3);
  box-shadow: none;
  animation: none;
}

#experimental-lab-modal .lab-copy { border-color: rgb(0 0 0 / 10%); }
#experimental-lab-modal .lab-modal-summary,
#experimental-lab-modal .lab-meta dd { color: rgb(22 22 23 / 72%); }
#experimental-lab-modal .lab-meta dt { color: rgb(22 22 23 / 48%); }
#experimental-lab-modal .lab-meta div { border-color: rgb(0 0 0 / 10%); }

/* Press media is fitted once by CSS; transform zoom begins from this full-screen fit. */
.press-modal { padding: 16px !important; overflow: hidden !important; }
.press-modal .press-zoom-container {
  width: min(1600px, calc(100vw - 32px)) !important;
  height: calc(100svh - 32px) !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 28px;
  background: rgb(255 255 255 / 97%);
}
.press-modal .press-zoom-container img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  transform-origin: center center;
}

/* Only the body is fixed while a modal is open; the root retains its position. */
html.modal-open {
  position: static !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  overflow: hidden !important;
}

@media (max-width: 620px) {
  #experimental-lab .lab-card,
  #experimental-lab .lab-card:nth-child(n) {
    grid-column: 1 / -1;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .press-modal { padding: 8px !important; }
  .press-modal .press-zoom-container {
    width: calc(100vw - 16px) !important;
    height: calc(100svh - 16px) !important;
    border-radius: 22px;
  }
}

/* Content is content, not glass. */
.experimental-lab {
  width: min(100%, 1200px);
  max-width: 1200px;
  margin-block: 0;
  padding-inline: clamp(28px, 6vw, 80px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* White-backed portfolio media should disappear into the white canvas. */
#selected-work-carousel .slide,
#selected-work-carousel .slide-media,
#selected-work-carousel .slide-media img,
#selected-work-carousel .slide-media video {
  background-color: #fff !important;
}

#selected-work-carousel .slide-media {
  border-color: rgb(22 22 23 / 7%);
  box-shadow: 0 8px 28px rgb(0 0 0 / 4%);
}

/* Preserve the full phone silhouette in the Matrix project instead of
   letting the carousel's default cover crop trim its hardware frame. */
#selected-work-carousel .slide[data-title="matrix"] .slide-media img,
#selected-work-carousel .slide[data-title="matrix"] .slide-media video {
  object-fit: contain !important;
  object-position: center center !important;
}

/*
 * A true translucent control layer over changing media. Unlike glass over an
 * empty white field, the dock visibly transmits and blurs the active project.
 */
@media (min-width: 901px) {
  #selected-work-carousel .nav {
    position: absolute;
    left: 50%;
    bottom: 48px;
    z-index: 8;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-start;
    width: max-content;
    max-width: calc(100% - 36px);
    min-height: 44px;
    margin: 0;
    padding: 7px 12px;
    gap: 6px;
    overflow-x: auto;
    border: 1px solid rgb(255 255 255 / 62%);
    border-radius: 999px;
    color: var(--ink-soft);
    background: rgb(255 255 255 / 16%);
    box-shadow: 0 10px 30px rgb(0 0 0 / 10%), inset 0 1px 0 rgb(255 255 255 / 76%);
    -webkit-backdrop-filter: blur(18px) saturate(165%) contrast(104%);
    backdrop-filter: blur(18px) saturate(165%) contrast(104%);
    transform: translateX(-50%);
    scrollbar-width: none;
  }

  #selected-work-carousel .nav li {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    color: rgb(22 22 23 / 56%);
    transition: color .2s ease, background-color .2s ease;
  }

  #selected-work-carousel .nav li:hover,
  #selected-work-carousel .nav li.active {
    color: var(--ink);
    background: rgb(255 255 255 / 38%);
  }

  :root[data-theme="dark"] #selected-work-carousel .nav {
    border-color: rgb(255 255 255 / 16%);
    color: var(--ink-soft);
    background: rgb(20 20 22 / 28%);
    box-shadow: 0 12px 34px rgb(0 0 0 / 34%), inset 0 1px 0 rgb(255 255 255 / 15%);
  }

  :root[data-theme="dark"] #selected-work-carousel .nav li {
    color: rgb(245 245 247 / 62%);
  }

  :root[data-theme="dark"] #selected-work-carousel .nav li:hover,
  :root[data-theme="dark"] #selected-work-carousel .nav li.active {
    color: var(--ink);
    background: rgb(255 255 255 / 12%);
  }
}

/* Final cascade: these interaction refinements intentionally win legacy overrides. */
#selected-work-carousel .nav {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding-inline: 28px !important;
  scroll-behavior: smooth;
  scroll-padding-inline: 28px;
  scroll-snap-type: x proximity;
  overscroll-behavior-inline: contain;
  touch-action: pan-x;
  cursor: grab;
  scrollbar-width: none;
}
#selected-work-carousel .nav::-webkit-scrollbar { display: none; }
#selected-work-carousel .nav.is-dragging { cursor: grabbing; scroll-behavior: auto; scroll-snap-type: none; user-select: none; }
#selected-work-carousel .nav li { scroll-snap-align: center; }

#experimental-lab .lab-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: row; }
#experimental-lab .lab-card,
#experimental-lab .lab-card:nth-child(n) {
  grid-column: span 6;
  min-height: 0;
  aspect-ratio: 16 / 9;
  border-color: rgb(0 0 0 / 10%);
  color: #161617;
  background: #fff;
  box-shadow: 0 14px 38px rgb(0 0 0 / 7%);
}
#experimental-lab .lab-card:nth-child(7),
#experimental-lab .lab-card:nth-child(10) { grid-column: 1 / -1; }
#experimental-lab .lab-card-placeholder { background: #fff; }
#experimental-lab .lab-card-placeholder::before {
  width: 58%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgb(0 0 0 / 10%);
  border-radius: 20px;
  background: linear-gradient(145deg, #fafafa, #f1f1f3);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 90%);
  animation: none;
}
#experimental-lab .lab-card-overlay {
  color: #161617;
  background: linear-gradient(to top, rgb(255 255 255 / 99%) 0 36%, rgb(255 255 255 / 82%) 57%, transparent 82%);
}
#experimental-lab .lab-card-title {
  max-width: 24ch;
  font-family: 'Graphik Light', 'Graphik', sans-serif;
  font-size: clamp(1.25rem, 2vw, 2.35rem);
  font-weight: 400;
}
#experimental-lab .lab-card-number,
#experimental-lab .lab-card-meta { color: rgb(22 22 23 / 66%); }

#experimental-lab-modal .lab-dialog,
#experimental-lab-modal .lab-dialog-header,
#experimental-lab-modal .lab-dialog-body,
#experimental-lab-modal .lab-copy { color: #161617; background: #fff; }
#experimental-lab-modal .lab-dialog-header { border-color: rgb(0 0 0 / 10%); }
#experimental-lab-modal .lab-dialog-header h2 {
  color: #161617;
  font-family: 'Graphik Light', 'Graphik', sans-serif;
  font-size: clamp(1.9rem, 3.5vw, 3.4rem);
  font-weight: 400;
  line-height: 1;
}
#experimental-lab-modal .lab-hero-media,
#experimental-lab-modal .lab-gif-media,
#experimental-lab-modal .lab-gallery-item {
  min-height: 0;
  aspect-ratio: 16 / 9;
  border-color: rgb(0 0 0 / 10%);
  background: #fff;
}
#experimental-lab-modal .lab-media-placeholder { color: rgb(22 22 23 / 48%); background: #fff; }
#experimental-lab-modal .lab-media-placeholder::before {
  aspect-ratio: 16 / 9;
  border-color: rgb(0 0 0 / 10%);
  border-radius: 20px;
  background: linear-gradient(145deg, #fafafa, #f1f1f3);
  box-shadow: none;
  animation: none;
}
#experimental-lab-modal .lab-copy { border-color: rgb(0 0 0 / 10%); }
#experimental-lab-modal .lab-modal-summary,
#experimental-lab-modal .lab-meta dd { color: rgb(22 22 23 / 72%); }
#experimental-lab-modal .lab-meta dt { color: rgb(22 22 23 / 48%); }
#experimental-lab-modal .lab-meta div { border-color: rgb(0 0 0 / 10%); }

/* Case-study Bentos follow the active appearance instead of remaining light. */
:root[data-theme="dark"] .selected-work-modal {
  color: rgb(245 245 247 / 92%);
  background:
    radial-gradient(circle at 50% 38%, rgb(44 44 46 / 88%), rgb(22 22 24 / 94%) 54%, rgb(8 8 9 / 97%)),
    rgb(8 8 9 / 96%);
}

:root[data-theme="dark"] .selected-work-bento-card {
  border-color: rgb(255 255 255 / 11%);
  color: rgb(245 245 247 / 92%);
  background: rgb(29 29 31 / 78%);
  box-shadow: 0 22px 72px rgb(0 0 0 / 38%), inset 0 1px 0 rgb(255 255 255 / 7%);
}

:root[data-theme="dark"] .selected-work-bento-card--thumb {
  background: #111113;
}

:root[data-theme="dark"] .selected-work-bento-card--video {
  background: #000;
}

:root[data-theme="dark"] .selected-work-bento-card--meta {
  background: rgb(29 29 31 / 86%);
}

:root[data-theme="dark"] .selected-work-bento-card--meta div + div {
  border-color: rgb(255 255 255 / 10%);
}

:root[data-theme="dark"] .selected-work-bento-card--intro h2,
:root[data-theme="dark"] .selected-work-bento-card--meta dd {
  color: rgb(245 245 247 / 94%);
}

:root[data-theme="dark"] .selected-work-bento-card--intro p:last-child {
  color: rgb(245 245 247 / 66%);
}

:root[data-theme="dark"] .selected-work-bento-card--meta dt,
:root[data-theme="dark"] .selected-work-bento-label,
:root[data-theme="dark"] .selected-work-kicker {
  color: rgb(245 245 247 / 48%);
}

:root[data-theme="dark"] .selected-work-modal-close {
  border-color: rgb(255 255 255 / 13%) !important;
  color: rgb(245 245 247 / 92%) !important;
  background: rgb(44 44 46 / 66%) !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 9%);
}

:root[data-theme="dark"] .selected-work-modal-close:hover,
:root[data-theme="dark"] .selected-work-modal-close:focus-visible {
  color: #111 !important;
  background: rgb(245 245 247 / 92%) !important;
}

:root[data-theme="dark"] #experimental-lab-modal .lab-dialog,
:root[data-theme="dark"] #experimental-lab-modal .lab-dialog-header,
:root[data-theme="dark"] #experimental-lab-modal .lab-dialog-body,
:root[data-theme="dark"] #experimental-lab-modal .lab-copy {
  color: rgb(245 245 247 / 92%);
  background: #1c1c1e;
}

:root[data-theme="dark"] #experimental-lab-modal .lab-dialog-header,
:root[data-theme="dark"] #experimental-lab-modal .lab-copy,
:root[data-theme="dark"] #experimental-lab-modal .lab-meta div {
  border-color: rgb(255 255 255 / 10%);
}

:root[data-theme="dark"] #experimental-lab-modal .lab-dialog-header h2 {
  color: rgb(245 245 247 / 94%);
}

:root[data-theme="dark"] #experimental-lab-modal .lab-hero-media,
:root[data-theme="dark"] #experimental-lab-modal .lab-gif-media,
:root[data-theme="dark"] #experimental-lab-modal .lab-gallery-item,
:root[data-theme="dark"] #experimental-lab-modal .lab-media-placeholder {
  border-color: rgb(255 255 255 / 10%);
  color: rgb(245 245 247 / 48%);
  background: #111113;
}

:root[data-theme="dark"] #experimental-lab-modal .lab-media-placeholder::before {
  border-color: rgb(255 255 255 / 10%);
  background: linear-gradient(145deg, #242426, #101012);
}

:root[data-theme="dark"] #experimental-lab-modal .lab-modal-summary,
:root[data-theme="dark"] #experimental-lab-modal .lab-meta dd {
  color: rgb(245 245 247 / 70%);
}

:root[data-theme="dark"] #experimental-lab-modal .lab-meta dt {
  color: rgb(245 245 247 / 46%);
}

.press-modal { padding: 16px !important; overflow: hidden !important; }
.press-modal .press-zoom-container {
  width: min(1600px, calc(100vw - 32px)) !important;
  height: calc(100svh - 32px) !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 28px;
  background: rgb(255 255 255 / 97%);
}
.press-modal .press-zoom-container img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  transform-origin: center center;
}
html.modal-open { position: static !important; inset: auto !important; width: auto !important; height: auto !important; overflow: hidden !important; }

@media (max-width: 620px) {
  .selected-work-active-meta {
    margin-top: 16px;
    padding-inline: 4px;
  }

  #experimental-lab .lab-card,
  #experimental-lab .lab-card:nth-child(n) { grid-column: 1 / -1; min-height: 0; aspect-ratio: 16 / 9; }
  .press-modal { padding: 8px !important; }
  .press-modal .press-zoom-container { width: calc(100vw - 16px) !important; height: calc(100svh - 16px) !important; border-radius: 22px; }
}

/* Final desktop Lab composition, after legacy card rules. */
@media (min-width: 1100px) {
  #experimental-lab .lab-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr)) auto;
    gap: clamp(8px, 1vh, 12px);
  }

  #experimental-lab .lab-card,
  #experimental-lab .lab-card:nth-child(n) {
    grid-column: span 1;
    min-height: 0;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgb(0 0 0 / 7%);
  }

  #experimental-lab .lab-card:nth-child(9),
  #experimental-lab .lab-card:nth-child(10) { grid-column: span 2; }

  #experimental-lab .lab-card-overlay {
    inset: auto 8px 8px;
    padding: 9px 11px 10px;
    border: 1px solid rgb(255 255 255 / 62%);
    border-radius: 13px;
    color: #161617;
    background: rgb(255 255 255 / 58%);
    box-shadow: 0 5px 18px rgb(0 0 0 / 8%), inset 0 1px 0 rgb(255 255 255 / 74%);
    -webkit-backdrop-filter: blur(15px) saturate(145%);
    backdrop-filter: blur(15px) saturate(145%);
  }

  #experimental-lab .lab-card-number { display: none; }
  #experimental-lab .lab-card-title {
    display: -webkit-box;
    max-width: none;
    margin: 0 0 4px;
    overflow: hidden;
    font-size: clamp(.76rem, .92vw, 1rem);
    line-height: 1.08;
    letter-spacing: -.015em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  #experimental-lab .lab-card-meta {
    overflow: hidden;
    color: rgb(22 22 23 / 62%);
    font-size: .48rem;
    letter-spacing: .07em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Press list children must inherit the active theme, not legacy black. */
#press .press-article {
  color: var(--ink) !important;
}

#press .press-publication,
#press .press-date {
  color: var(--ink-soft) !important;
}

#press .press-grid--orderly .press-list,
#press .press-grid--orderly .press-item {
  border-color: var(--line-strong) !important;
}

/* Reference tiles expose the page canvas at their rounded corners. */
#reference .reference-item,
#reference .reference-item img,
#reference .reference-item video {
  border-radius: 18px;
  background-color: var(--page) !important;
}

/* Desktop Lab: one-screen contact sheet with compact translucent captions. */
@media (min-width: 1100px) {
  #experimental-lab {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: min(100%, 1100px);
    max-width: 1100px;
    height: 100svh;
    min-height: 0;
    padding: clamp(20px, 3.5vh, 38px) 40px;
    justify-content: center;
    overflow: clip;
  }

  #experimental-lab .lab-heading {
    display: block;
    margin-bottom: clamp(18px, 2.5vh, 28px);
  }

  #experimental-lab .lab-kicker {
    margin-bottom: 6px;
    font-family: monospace;
    font-size: .58rem;
    letter-spacing: .09em;
  }

  #experimental-lab .section-title {
    font-size: clamp(1.5rem, 2vw, 2rem);
  }

  #experimental-lab .lab-intro {
    max-width: 58ch;
    font-size: clamp(.72rem, .8vw, .84rem);
    line-height: 1.48;
  }

  #experimental-lab .lab-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr)) auto;
    gap: clamp(8px, 1vh, 12px);
  }

  #experimental-lab .lab-card,
  #experimental-lab .lab-card:nth-child(n) {
    grid-column: span 1;
    min-height: 0;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgb(0 0 0 / 7%);
  }

  #experimental-lab .lab-card:nth-child(9),
  #experimental-lab .lab-card:nth-child(10) {
    grid-column: span 2;
  }

  #experimental-lab .lab-card-placeholder::before {
    width: 42%;
    border-radius: 12px;
  }

  #experimental-lab .lab-card-overlay {
    inset: auto 8px 8px;
    padding: 9px 11px 10px;
    border: 1px solid rgb(255 255 255 / 62%);
    border-radius: 13px;
    color: #161617;
    background: rgb(255 255 255 / 58%);
    box-shadow: 0 5px 18px rgb(0 0 0 / 8%), inset 0 1px 0 rgb(255 255 255 / 74%);
    -webkit-backdrop-filter: blur(15px) saturate(145%);
    backdrop-filter: blur(15px) saturate(145%);
  }

  #experimental-lab .lab-card-number {
    display: none;
  }

  #experimental-lab .lab-card-title {
    display: -webkit-box;
    max-width: none;
    margin: 0 0 4px;
    overflow: hidden;
    font-size: clamp(.76rem, .92vw, 1rem);
    line-height: 1.08;
    letter-spacing: -.015em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  #experimental-lab .lab-card-meta {
    overflow: hidden;
    color: rgb(22 22 23 / 62%);
    font-size: .48rem;
    letter-spacing: .07em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #experimental-lab .lab-card-summary {
    position: absolute;
    inset: auto 0 0;
    max-height: 0;
    padding: 0 11px;
    border-radius: 0 0 13px 13px;
    color: rgb(22 22 23 / 72%);
    background: rgb(255 255 255 / 82%);
    font-size: .62rem;
    line-height: 1.35;
  }

  #experimental-lab .lab-card:hover .lab-card-summary,
  #experimental-lab .lab-card:focus-visible .lab-card-summary {
    max-height: 6em;
    margin: 0;
    padding-block: 8px;
  }
}

/* Recognition tables use semantic theme colors, including their child spans. */
#talks .talks-publication,
#talks .talks-title {
  color: var(--ink) !important;
}

#talks .talks-year {
  color: var(--ink-soft) !important;
}

#talks .talks-item {
  border-color: var(--line-strong) !important;
}

/* Rejected row children previously bypassed the themed header color. */
#rejected .rejected-accordion-title {
  color: var(--ink) !important;
}

#rejected .rejected-accordion-client,
#rejected .rejected-accordion-chevron,
#rejected .rejected-accordion-context {
  color: var(--ink-soft) !important;
}

#rejected .rejected-accordion-item {
  border-color: var(--line-strong) !important;
}

/* Modal scroll lock preserves scrollY; only overflow changes. */
html.modal-open,
body.modal-open {
  position: static !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

/* The secret trigger belongs to the canvas; it must not create a light strip in dark mode. */
#secret-arrow {
  color: var(--ink);
  background: transparent;
  text-shadow: none;
}

.lab-card-placeholder,
.lab-media-placeholder {
  background:
    radial-gradient(circle at 28% 24%, rgb(255 255 255 / 11%), transparent 34%),
    linear-gradient(145deg, #2c2c2f, #09090a);
}

.lab-card-placeholder::before,
.lab-media-placeholder::before {
  box-shadow: inset 0 0 42px rgb(255 255 255 / 9%), 0 0 55px rgb(255 255 255 / 6%);
}

.lab-dialog-header h2 { font-size: clamp(1.9rem, 4vw, 3.9rem); }

/* Rejected pitches now share the same transient glass language as the Lab. */
.modal {
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)) !important;
  background: rgb(0 0 0 / 58%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(80%);
  backdrop-filter: blur(18px) saturate(80%);
}

.modal.active { display: grid !important; place-items: center; }

body:has(.modal.active) .scroll-indicator,
body.lab-modal-open .scroll-indicator { display: none !important; }

.modal .modal-inner {
  box-sizing: border-box;
  width: min(1180px, 100%) !important;
  max-width: 1180px !important;
  max-height: calc(100svh - 32px) !important;
  padding: clamp(28px, 4vw, 54px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  border: 1px solid var(--glass-edge);
  border-radius: clamp(24px, 3vw, 38px) !important;
  color: var(--ink) !important;
  background: var(--glass-strong) !important;
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(28px) saturate(125%);
  backdrop-filter: blur(28px) saturate(125%);
  overscroll-behavior: contain;
}

.modal .modal-inner h2 {
  max-width: 22ch;
  margin: 0 64px 18px 0;
  color: var(--ink);
  font-family: 'Graphik Wide', sans-serif;
  font-size: clamp(1.8rem, 3.5vw, 3.6rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.045em;
}

.modal .modal-inner > p {
  max-width: 76ch;
  margin: 0 0 28px;
  color: var(--ink-soft) !important;
  font-size: clamp(.82rem, 1vw, .98rem) !important;
  line-height: 1.65 !important;
}

.modal .image-scroll {
  gap: 14px;
  margin: 0 !important;
  padding: 0 0 12px;
  scrollbar-color: var(--ink-faint) transparent;
  scroll-padding-inline: 0;
}

.modal .image-scroll img {
  flex-basis: auto;
  max-width: min(86vw, 920px);
  height: min(62svh, 660px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--page-deep);
  filter: none;
  box-shadow: none;
}

.modal .image-scroll img:hover { filter: none; box-shadow: none; }

.modal .modal-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.modal .control-btn,
.rejected-modal-close {
  min-width: 44px !important;
  min-height: 44px !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 999px !important;
  color: var(--ink) !important;
  background: rgb(127 127 127 / 10%) !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.modal .control-btn {
  padding: 0 18px;
  font-family: monospace;
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: lowercase;
}

.modal .control-btn:hover,
.modal .control-btn:focus-visible,
.rejected-modal-close:hover,
.rejected-modal-close:focus-visible {
  color: var(--page) !important;
  background: var(--ink) !important;
}

@media (max-width: 900px) {
  .vertical-theme-toggle { display: none; }

  .glass-nav {
    background: rgb(255 255 255 / 38%);
    box-shadow: 0 8px 28px rgb(0 0 0 / 8%), inset 0 1px 0 var(--glass-edge);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    backdrop-filter: blur(18px) saturate(145%);
  }

  .scroll-indicator { display: none !important; }
}

@media (max-width: 620px) {
  #hero .name { font-size: 1.65rem; }

  .experimental-lab {
    width: 100%;
    padding-inline: 18px;
  }

  .modal { padding: 8px !important; }

  .modal .modal-inner {
    max-height: calc(100svh - 16px) !important;
    padding: 24px 18px !important;
    border-radius: 24px !important;
  }

  .modal .image-scroll img {
    max-width: calc(100vw - 52px);
    height: auto;
    max-height: 58svh;
  }
}

@media (prefers-reduced-transparency: reduce) {
  #section-nav,
  .modal .modal-inner,
  .modal .control-btn,
  .rejected-modal-close {
    background: var(--glass-solid) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

:root[data-theme="dark"] #section-nav,
:root[data-theme="dark"] .glass-nav {
  background: rgb(29 29 31 / 42%);
}

/* The work selector belongs beneath the media, as its control base. */
@media (min-width: 901px) {
  #selected-work-carousel .nav {
    position: relative;
    left: auto;
    bottom: auto;
    width: max-content;
    max-width: calc(100% - 36px);
    margin: 12px auto 0;
    transform: none;
  }
}

/* Cascade seal: retain the latest Lab, title-index, modal, and Press decisions. */
#selected-work-carousel .nav { overflow-x: auto !important; overflow-y: hidden !important; padding-inline: 28px !important; scroll-behavior: smooth; scroll-padding-inline: 28px; scroll-snap-type: x proximity; overscroll-behavior-inline: contain; touch-action: pan-x; cursor: grab; scrollbar-width: none; }
#selected-work-carousel .nav::-webkit-scrollbar { display: none; }
#selected-work-carousel .nav.is-dragging { cursor: grabbing; scroll-behavior: auto; scroll-snap-type: none; user-select: none; }
#selected-work-carousel .nav li { scroll-snap-align: center; }

#selected-work-carousel .nav {
  border-color: rgb(22 22 23 / 7%) !important;
  color: rgb(22 22 23 / 42%) !important;
  background: rgb(255 255 255 / 68%) !important;
  box-shadow: 0 14px 38px rgb(0 0 0 / 5%), inset 0 1px 0 rgb(255 255 255 / 82%) !important;
}

#selected-work-carousel .nav li {
  color: inherit !important;
  background: transparent !important;
}

#selected-work-carousel .nav li:hover,
#selected-work-carousel .nav li.active {
  color: #161617 !important;
  background: rgb(255 255 255 / 54%) !important;
}

#selected-work-carousel .fade { display: none !important; }

:root[data-theme="dark"] #selected-work-carousel .nav {
  border-color: rgb(245 245 247 / 12%) !important;
  color: rgb(245 245 247 / 46%) !important;
  background: rgb(29 29 31 / 46%) !important;
  box-shadow: 0 16px 40px rgb(0 0 0 / 26%), inset 0 1px 0 rgb(255 255 255 / 12%) !important;
}

:root[data-theme="dark"] #selected-work-carousel .nav li:hover,
:root[data-theme="dark"] #selected-work-carousel .nav li.active {
  color: rgb(245 245 247 / 92%) !important;
  background: rgb(255 255 255 / 10%) !important;
}

.selected-work-active-meta {
  display: block;
  width: 100%;
  margin: 22px auto 0;
  padding-inline: clamp(4px, .8vw, 12px);
  text-align: left;
}

/* Match the site's lowercase editorial voice while preserving semantic source copy. */
#selected-work,
#selected-work * {
  text-transform: lowercase;
}

.selected-work-active-title {
  display: inline;
  margin: 0;
  color: var(--ink);
  font-family: 'Graphik Medium', 'Graphik', sans-serif;
  font-size: clamp(1rem, 1.1vw, 1.08rem);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
}

.selected-work-active-title::after { content: ' '; }

.selected-work-active-description {
  display: inline;
  margin: 0;
  color: var(--ink-soft);
  font-family: 'Graphik', sans-serif;
  font-size: clamp(1rem, 1.1vw, 1.08rem);
  font-weight: 400;
  line-height: 1.5;
}

#experimental-lab .lab-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: row; }
#experimental-lab .lab-card,
#experimental-lab .lab-card:nth-child(n) { grid-column: span 6; min-height: 0; aspect-ratio: 16 / 9; border-color: rgb(0 0 0 / 10%); color: #161617; background: #fff; box-shadow: 0 14px 38px rgb(0 0 0 / 7%); }
#experimental-lab .lab-card:nth-child(7),
#experimental-lab .lab-card:nth-child(10) { grid-column: 1 / -1; }
#experimental-lab .lab-card-placeholder { background: #fff; }
#experimental-lab .lab-card-placeholder::before { width: 58%; aspect-ratio: 16 / 9; border: 1px solid rgb(0 0 0 / 10%); border-radius: 20px; background: linear-gradient(145deg, #fafafa, #f1f1f3); box-shadow: inset 0 1px 0 rgb(255 255 255 / 90%); animation: none; }
#experimental-lab .lab-card-overlay { color: #161617; background: linear-gradient(to top, rgb(255 255 255 / 99%) 0 36%, rgb(255 255 255 / 82%) 57%, transparent 82%); }
#experimental-lab .lab-card-title { max-width: 24ch; font-family: 'Graphik Light', 'Graphik', sans-serif; font-size: clamp(1.25rem, 2vw, 2.35rem); font-weight: 400; }
#experimental-lab .lab-card-number,
#experimental-lab .lab-card-meta { color: rgb(22 22 23 / 66%); }

@media (min-width: 1100px) {
  #experimental-lab .lab-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)) auto; gap: clamp(8px, 1vh, 12px); }
  #experimental-lab .lab-card,
  #experimental-lab .lab-card:nth-child(n) { grid-column: span 1; min-height: 0; aspect-ratio: 16 / 9; border-radius: 18px; box-shadow: 0 8px 24px rgb(0 0 0 / 7%); }
  #experimental-lab .lab-card:nth-child(9),
  #experimental-lab .lab-card:nth-child(10) { grid-column: span 2; }
  #experimental-lab .lab-card-overlay { inset: auto 8px 8px; padding: 9px 11px 10px; border: 1px solid rgb(255 255 255 / 62%); border-radius: 13px; color: #161617; background: rgb(255 255 255 / 58%); box-shadow: 0 5px 18px rgb(0 0 0 / 8%), inset 0 1px 0 rgb(255 255 255 / 74%); -webkit-backdrop-filter: blur(15px) saturate(145%); backdrop-filter: blur(15px) saturate(145%); }
  #experimental-lab .lab-card-number { display: none; }
  #experimental-lab .lab-card-title { display: -webkit-box; max-width: none; margin: 0 0 4px; overflow: hidden; font-size: clamp(.76rem, .92vw, 1rem); line-height: 1.08; letter-spacing: -.015em; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  #experimental-lab .lab-card-meta { overflow: hidden; color: rgb(22 22 23 / 62%); font-size: .48rem; letter-spacing: .07em; text-overflow: ellipsis; white-space: nowrap; }
  #experimental-lab .lab-card-summary { position: relative; inset: auto; flex: 0 0 auto; max-height: 0; margin: 0; padding: 0; overflow: hidden; border-radius: 0; background: transparent; opacity: 0; transform: translateY(4px); transition: max-height .3s ease, margin .25s ease, opacity .2s ease, transform .25s ease; }
  #experimental-lab .lab-card:hover .lab-card-summary,
  #experimental-lab .lab-card:focus-visible .lab-card-summary { max-height: 5.4em; margin-top: 6px; padding: 0; opacity: .78; transform: none; }
}

#experimental-lab-modal .lab-dialog,
#experimental-lab-modal .lab-dialog-header,
#experimental-lab-modal .lab-dialog-body,
#experimental-lab-modal .lab-copy { color: #161617; background: #fff; }
#experimental-lab-modal .lab-dialog-header { border-color: rgb(0 0 0 / 10%); }
#experimental-lab-modal .lab-dialog-header h2 { color: #161617; font-family: 'Graphik Light', 'Graphik', sans-serif; font-size: clamp(1.9rem, 3.5vw, 3.4rem); font-weight: 400; line-height: 1; }
#experimental-lab-modal .lab-hero-media,
#experimental-lab-modal .lab-gif-media,
#experimental-lab-modal .lab-gallery-item { min-height: 0; aspect-ratio: 16 / 9; border-color: rgb(0 0 0 / 10%); background: #fff; }
#experimental-lab-modal .lab-media-placeholder { color: rgb(22 22 23 / 48%); background: #fff; }
#experimental-lab-modal .lab-media-placeholder::before { aspect-ratio: 16 / 9; border-color: rgb(0 0 0 / 10%); border-radius: 20px; background: linear-gradient(145deg, #fafafa, #f1f1f3); box-shadow: none; animation: none; }
#experimental-lab-modal .lab-copy { border-color: rgb(0 0 0 / 10%); }
#experimental-lab-modal .lab-modal-summary,
#experimental-lab-modal .lab-meta dd { color: rgb(22 22 23 / 72%); }
#experimental-lab-modal .lab-meta dt { color: rgb(22 22 23 / 48%); }
#experimental-lab-modal .lab-meta div { border-color: rgb(0 0 0 / 10%); }

.press-modal { padding: 16px !important; overflow: hidden !important; }
.press-modal .press-zoom-container { width: min(1600px, calc(100vw - 32px)) !important; height: calc(100svh - 32px) !important; max-width: none !important; max-height: none !important; border-radius: 28px; background: rgb(255 255 255 / 97%); }
.press-modal .press-zoom-container img { width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; object-fit: contain !important; transform-origin: center center; }
html.modal-open { position: static !important; inset: auto !important; width: auto !important; height: auto !important; overflow: hidden !important; }

@media (max-width: 620px) {
  #experimental-lab .lab-card,
  #experimental-lab .lab-card:nth-child(n) { grid-column: 1 / -1; min-height: 0; aspect-ratio: 16 / 9; }
  .press-modal { padding: 8px !important; }
  .press-modal .press-zoom-container { width: calc(100vw - 16px) !important; height: calc(100svh - 16px) !important; border-radius: 22px; }
}

/* Resume: a concise editorial preview that unfolds into the full document. */
.resume-section {
  --resume-paper: #fff;
  --resume-text: #2d2d2f;
  --resume-muted: #99999e;
  --resume-rule: #dedee1;
  --resume-shadow: 0 28px 90px rgb(0 0 0 / 9%);
  position: relative;
  color: var(--ink);
}

:root[data-theme="dark"] .resume-section {
  --resume-paper: #1c1c1e;
  --resume-text: rgb(245 245 247 / 92%);
  --resume-muted: rgb(245 245 247 / 48%);
  --resume-rule: rgb(245 245 247 / 14%);
  --resume-shadow: 0 32px 100px rgb(0 0 0 / 34%);
}

.resume-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(28px, 4vw, 52px);
}

.resume-section-heading .section-title { margin: 0; }

.resume-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  background: var(--glass);
  box-shadow: none;
  font-family: monospace;
  font-size: .67rem;
  letter-spacing: .07em;
  text-decoration: none;
  text-transform: lowercase;
  transition: transform .2s ease, background-color .2s ease;
}

.resume-download span { font-size: 1rem; }
.resume-download:hover { transform: translateY(-2px); background: var(--glass-strong); }
.resume-download:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.resume-full {
  margin-top: clamp(26px, 3.6vw, 42px);
}

.resume-show-all {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 0 22px;
  border: 1px solid var(--resume-rule);
  border-radius: 999px;
  color: var(--resume-text);
  background: color-mix(in srgb, var(--resume-paper) 80%, transparent);
  box-shadow: none;
  cursor: pointer;
  font-family: monospace;
  font-size: .7rem;
  letter-spacing: .08em;
  list-style: none;
  text-transform: lowercase;
  transition: background-color .2s ease, transform .2s ease;
}

.resume-show-all::-webkit-details-marker { display: none; }
.resume-show-all:hover { background: var(--glass-strong); }
.resume-show-all:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.resume-show-less-label { display: none; }
.resume-show-all-icon { font-size: 1rem; transition: transform .25s ease; }
.resume-full[open] .resume-show-all-label { display: none; }
.resume-full[open] .resume-show-less-label { display: inline; }
.resume-full[open] .resume-show-all-icon { transform: rotate(45deg); }

.resume-expanded-content {
  padding-top: clamp(30px, 4vw, 48px);
  animation: resume-expand .32s cubic-bezier(.2, .8, .2, 1) both;
}

.resume-expanded-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(28px, 4vw, 42px);
  padding-bottom: clamp(20px, 3vw, 28px);
  border-bottom: 1px solid var(--resume-rule);
}

.resume-expanded-toolbar p {
  margin: 0;
  color: var(--resume-muted);
  font-size: .9em;
}

@keyframes resume-expand {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.resume-pages {
  display: grid;
  gap: clamp(20px, 3vw, 34px);
}

.resume-page {
  box-sizing: border-box;
  width: 100%;
  padding: clamp(30px, 5vw, 58px);
  border: 1px solid var(--resume-rule);
  border-radius: clamp(22px, 3vw, 38px);
  color: var(--resume-text);
  background: var(--resume-paper);
  box-shadow: var(--resume-shadow);
  font-family: 'Graphik', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(.79rem, 1.06vw, .96rem);
  line-height: 1.34;
  letter-spacing: -.006em;
}

.resume-document-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: clamp(22px, 3vw, 34px);
}

.resume-document-header h3 {
  margin: 0 0 6px !important;
  color: var(--resume-text);
  font-family: 'Graphik Light', 'Graphik', sans-serif;
  font-size: clamp(1.65rem, 2.5vw, 2.35rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.025em;
}

.resume-positioning,
.resume-document-header address {
  margin: 0;
  color: var(--resume-text);
  font-size: clamp(.8rem, 1.12vw, 1rem);
  font-style: normal;
  line-height: 1.55;
}

.resume-document-header address {
  color: var(--resume-muted);
  text-align: right;
}

.resume-document-header a { color: inherit; text-decoration: none; }
.resume-document-header a:hover { color: var(--resume-text); }
.resume-positioning span,
.resume-document-header address span,
.resume-role header p > span,
.resume-inline-list span,
.resume-skills span { padding-inline: .32em; color: var(--resume-muted); }

.resume-block + .resume-block { margin-top: clamp(20px, 2.7vw, 32px); }

.resume-rule-heading {
  display: grid;
  grid-template-columns: minmax(28px, 1fr) auto minmax(28px, 1fr);
  align-items: center;
  gap: 16px;
  margin: 0 0 9px !important;
  color: var(--resume-text);
  font-size: clamp(.85rem, 1.18vw, 1.05rem);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.resume-rule-heading::before,
.resume-rule-heading::after {
  content: '';
  height: 1px;
  background: var(--resume-rule);
}

.resume-bullets {
  display: grid;
  gap: .23em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.resume-bullets li {
  position: relative;
  margin: 0;
  padding-left: 1.05em;
}

.resume-bullets li::before {
  content: '·';
  position: absolute;
  left: .18em;
  top: 0;
  color: var(--resume-muted);
}

.resume-role + .resume-role { margin-top: 14px; }

.resume-role > header {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 10px;
  margin-bottom: 4px;
}

.resume-role header p { margin: 0; }
.resume-role header strong { font-weight: 600; }

.resume-role-meta {
  color: var(--resume-muted);
  font-size: .9em;
  text-align: right;
  white-space: nowrap;
}

.resume-mark {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  color: #fff;
  background: #62676d;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 6px;
  font-weight: 700;
  line-height: 1;
}

.resume-mark--apple {
  border-radius: 0;
  color: var(--resume-text);
  background: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}
.resume-mark--ae { background: #34545d; }
.resume-mark--newblood {
  width: 20px;
  height: 20px;
  overflow: hidden;
  border-radius: 4px;
  background: #191919;
}

.resume-mark--newblood img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.resume-mark--tripp {
  width: 20px;
  height: 20px;
  overflow: hidden;
  border-radius: 5px;
  background: #7b4ce2;
}

.resume-mark--tripp img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.resume-mark--vfs { background: #df2f33; }
.resume-mark--red {
  width: 20px;
  height: 20px;
  overflow: hidden;
  border-radius: 4px;
  background: #1b1b1b;
}

.resume-mark--red img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.resume-mark--freelance { border-radius: 50%; background: #657078; }

.resume-inline-list {
  margin: 0;
  text-align: center;
  line-height: 1.5;
}

.resume-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.resume-skills p { margin: 0 0 .34em; line-height: 1.42; }
.resume-skills p:last-child { margin-bottom: 0; }
.resume-skills strong { margin-right: .45em; font-size: .86em; font-weight: 600; letter-spacing: .02em; }

.resume-skill-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(20px, 2.8vw, 30px);
}

.resume-skill-matrix > section {
  min-width: 0;
  padding: 0 clamp(18px, 2.6vw, 30px) clamp(18px, 2.4vw, 28px);
}

.resume-skill-matrix > section:first-child { padding-left: 0; }
.resume-skill-matrix > section:last-child { padding-right: 0; }
.resume-skill-matrix > section + section { border-left: 1px solid var(--resume-rule); }

.resume-skill-matrix h5 {
  margin: 0 0 clamp(10px, 1.5vw, 16px);
  color: var(--resume-text);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  font-weight: 600;
  letter-spacing: -.02em;
  text-align: center;
}

.resume-skill-matrix p {
  margin: 0;
  font-size: clamp(.82rem, 1.05vw, .95rem);
  line-height: 1.48;
}

.resume-education-tools { margin-top: clamp(6px, 1.5vw, 14px); }
.resume-education-tools .resume-rule-heading { margin-bottom: clamp(10px, 1.6vw, 16px); }

#talks .talks-item--external,
#talks .talks-item--audio {
  color: inherit;
  text-decoration: none;
}

#talks button.talks-item--audio {
  width: 100%;
  appearance: none;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  font: inherit;
}

.podcast-modal {
  width: min(720px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: clamp(24px, 4vw, 44px);
  overflow: visible;
  border: 1px solid var(--glass-edge);
  border-radius: clamp(24px, 3vw, 36px);
  color: var(--ink);
  background: var(--glass-strong);
  box-shadow: 0 34px 120px rgb(0 0 0 / 38%), inset 0 1px 0 rgb(255 255 255 / 18%);
  -webkit-backdrop-filter: blur(30px) saturate(130%);
  backdrop-filter: blur(30px) saturate(130%);
}

.podcast-modal::backdrop {
  background: rgb(0 0 0 / 58%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.podcast-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--glass-edge);
  border-radius: 50%;
  color: var(--ink);
  background: var(--glass-strong);
  font: 400 1.15rem/1 'Graphik', sans-serif;
  cursor: pointer;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.podcast-modal-copy {
  display: grid;
  gap: 10px;
  padding-right: 44px;
}

.podcast-modal-publication,
.podcast-modal-year {
  margin: 0;
  color: var(--ink-soft);
  font: 500 .62rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .1em;
  text-transform: lowercase;
}

.podcast-modal h2 {
  max-width: 26ch;
  margin: 0;
  font-family: 'Graphik Light', 'Graphik', sans-serif;
  font-size: clamp(1.35rem, 3.2vw, 2.7rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.035em;
  text-transform: lowercase;
}

.podcast-modal audio {
  display: block;
  width: 100%;
  margin-top: clamp(24px, 4vw, 38px);
  color-scheme: light dark;
}

.podcast-modal-close:focus-visible,
#talks button.talks-item--audio:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

@media (prefers-reduced-transparency: reduce), (forced-colors: active) {
  .podcast-modal,
  .podcast-modal-close {
    background: var(--glass-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* The press overlay has viewport-sized content plus padding. Border-box keeps
   that padding inside the viewport; the fixed close control stays in a safe
   inset regardless of the zoom surface's dimensions. */
.press-modal {
  box-sizing: border-box !important;
}

.press-modal .modal-close {
  position: fixed !important;
  top: max(16px, env(safe-area-inset-top)) !important;
  right: max(16px, env(safe-area-inset-right)) !important;
  left: auto !important;
}

/* The resume is taller than a viewport on phones, so a percentage-based
   intersection reveal can never complete. Keep the document immediately
   available while retaining reveal motion for the site's shorter sections. */
.resume-section.reveal {
  opacity: 1;
  transform: none;
}

@media (max-width: 760px) {
  .resume-section-heading { align-items: flex-end; }
  .resume-download { min-height: 44px; padding-inline: 15px; }
  .resume-page { padding: 24px 20px 28px; border-radius: 22px; font-size: .78rem; line-height: 1.4; }
  .resume-document-header { display: grid; gap: 12px; }
  .resume-document-header address { text-align: left; }
  .resume-positioning { display: flex; flex-wrap: wrap; gap: 2px 4px; }
  .resume-role > header { grid-template-columns: 22px minmax(0, 1fr); align-items: start; }
  .resume-role-meta { grid-column: 2; margin-top: 2px !important; text-align: left; white-space: normal; }
  .resume-columns { grid-template-columns: 1fr; gap: .23em; }
  .resume-skill-matrix { grid-template-columns: 1fr; }
  .resume-skill-matrix > section { padding: 18px 0; }
  .resume-skill-matrix > section:first-child { padding-top: 0; }
  .resume-skill-matrix > section + section { border-top: 1px solid var(--resume-rule); border-left: 0; }
  .resume-skill-matrix h5 { margin-bottom: 8px; text-align: left; }
  .resume-rule-heading { gap: 10px; }
  .resume-expanded-toolbar { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .resume-expanded-content { animation: none; }
  .resume-show-all-icon { transition: none; }
}

@media (max-width: 430px) {
  .resume-section-heading { display: grid; align-items: start; }
  .resume-download { width: max-content; }
  .resume-document-header h3 { font-size: 1.65rem; }
  .resume-positioning,
  .resume-document-header address { font-size: .75rem; }
}

/* Keep the Reference archive entry point available at every viewport.
   The legacy responsive sheet hid it below 1200px. */
@media (max-width: 1200px) {
  #reference .reference-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #reference-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  #reference .reference-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #reference-expand-btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/*
 * Mobile artifact picker
 *
 * The legacy mobile stylesheet hid the artifact titles entirely, leaving the
 * first model as a dead end. Keep all three choices inside the model canvas as
 * a compact, thumb-reachable glass control.
 */
@media (max-width: 900px) {
  #artifacts-carousel .nav {
    position: absolute !important;
    z-index: 12;
    left: 50% !important;
    right: auto !important;
    bottom: max(14px, env(safe-area-inset-bottom)) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: max-content;
    max-width: calc(100% - 24px);
    min-height: 52px;
    margin: 0 !important;
    padding: 4px !important;
    gap: 2px !important;
    overflow-x: auto;
    transform: translateX(-50%) !important;
    border: 1px solid rgb(0 0 0 / 9%);
    border-radius: 999px;
    background: rgb(255 255 255 / 72%);
    box-shadow: 0 12px 36px rgb(0 0 0 / 12%);
    -webkit-backdrop-filter: saturate(1.35) blur(22px);
    backdrop-filter: saturate(1.35) blur(22px);
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
    touch-action: pan-x;
  }

  #artifacts-carousel .nav::-webkit-scrollbar {
    display: none;
  }

  #artifacts-carousel .nav li {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 999px;
    color: rgb(22 22 23 / 55%);
    font-family: 'Graphik', sans-serif;
    font-size: clamp(0.62rem, 2.7vw, 0.72rem);
    line-height: 1;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }

  #artifacts-carousel .nav li.active {
    color: #161617;
    background: rgb(255 255 255 / 92%);
    box-shadow: 0 2px 12px rgb(0 0 0 / 9%);
  }

  #artifacts-carousel .nav li:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
  }
}

/* Mobile is intentionally navigation-free. The desktop vertical rail remains
   available at wider breakpoints. */
@media (max-width: 900px) {
  .glass-nav,
  #mobile-nav,
  #section-nav {
    display: none !important;
  }

  html {
    scroll-padding-top: 24px;
  }

  #hero {
    padding-top: max(36px, env(safe-area-inset-top)) !important;
  }
}

/* Reference controls need their own dark glass surface because the legacy
   responsive sheet gives the refresh and fullscreen buttons a white fill. */
:root[data-theme="dark"] #reference-refresh,
:root[data-theme="dark"] #reference-mobile-fullscreen,
:root[data-theme="dark"] #reference-expand-btn {
  color: #f5f5f7;
  border-color: rgb(245 245 247 / 20%);
  background: rgb(28 28 30 / 76%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 10%),
    0 10px 28px rgb(0 0 0 / 18%);
  -webkit-backdrop-filter: saturate(1.25) blur(22px);
  backdrop-filter: saturate(1.25) blur(22px);
}

:root[data-theme="dark"] #reference-refresh:hover,
:root[data-theme="dark"] #reference-refresh:focus-visible,
:root[data-theme="dark"] #reference-mobile-fullscreen:hover,
:root[data-theme="dark"] #reference-mobile-fullscreen:focus-visible,
:root[data-theme="dark"] #reference-expand-btn:hover,
:root[data-theme="dark"] #reference-expand-btn:focus-visible {
  color: #fff;
  border-color: rgb(255 255 255 / 38%);
  background: rgb(44 44 46 / 90%);
  opacity: 1;
}

:root[data-theme="dark"] #reference-mobile-fullscreen::after {
  color: currentColor;
}
