/* ============ Theme tokens ============ */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --font-serif: "Instrument Serif", "Times New Roman", serif;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

html[data-theme="dark"] {
  --bg: #0a0613;
  --fg: #faf3fb;
  --fg-dim: rgba(250,243,251,.62);
  --fg-mute: rgba(250,243,251,.44);
  --line: rgba(255,255,255,.08);
  --glass-bg: rgba(255,255,255,.045);
  --glass-bg-strong: rgba(255,255,255,.07);
  --glass-border: rgba(255,255,255,.1);
  --glass-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 30px 60px -20px rgba(0,0,0,.6);
  --chip-bg: rgba(255,255,255,.06);
  --accent:   #ff7ed4;     /* pink */
  --accent-2: #c87bff;     /* pink→violet midpoint */
  --accent-3: #8a5bff;     /* purple */
  --blob-1: #ff7ed4;
  --blob-2: #c073ff;
  --blob-3: #6e42e6;
  --noise-opacity: .035;
}

html[data-theme="light"] {
  --bg: #fdf3fa;
  --fg: #1f132e;
  --fg-dim: rgba(31,19,46,.64);
  --fg-mute: rgba(31,19,46,.46);
  --line: rgba(120,40,140,.10);
  --glass-bg: rgba(255,255,255,.55);
  --glass-bg-strong: rgba(255,255,255,.72);
  --glass-border: rgba(255,255,255,.85);
  --glass-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 24px 50px -22px rgba(160,80,180,.22);
  --chip-bg: rgba(255,255,255,.7);
  --accent:   #ff5fbf;
  --accent-2: #b15bff;
  --accent-3: #6d3df0;
  --blob-1: #ffc8e5;
  --blob-2: #e2c0ff;
  --blob-3: #c4a8ff;
  --noise-opacity: .025;
}

/* ============ Reset ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
  overflow-x: hidden;
  transition: background .6s var(--ease), color .4s var(--ease);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ============ Background atmosphere ============ */
.atmosphere { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(110px); opacity: .55;
  transition: background .6s var(--ease), opacity .6s var(--ease);
  will-change: transform;
}
.blob.b1 { width: 620px; height: 620px; background: var(--blob-1); top: -180px; left: -120px; animation: float1 22s var(--ease) infinite; }
.blob.b2 { width: 520px; height: 520px; background: var(--blob-2); top: 30%; right: -160px; animation: float2 26s var(--ease) infinite; }
.blob.b3 { width: 480px; height: 480px; background: var(--blob-3); bottom: -160px; left: 25%; animation: float3 30s var(--ease) infinite; }
html[data-theme="light"] .blob { opacity: .85; }

@keyframes float1 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(60px,80px) scale(1.08)} }
@keyframes float2 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-90px,40px) scale(1.05)} }
@keyframes float3 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(40px,-70px) scale(1.1)} }

.noise {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: var(--noise-opacity); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ============ Layout ============ */
.container { max-width: 980px; margin: 0 auto; padding: 0 28px; }

/* ============ Nav ============ */
nav.glass {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 0;
  border-radius: 0;
  background: var(--glass-bg-strong);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  border: 0;
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset;
  transition: background .4s var(--ease), border-color .4s var(--ease);
}
.nav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 4px 28px;
  display: flex; align-items: center; gap: 0;
  width: 100%;
}
nav .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; font-weight: 600; letter-spacing: -0.02em;
  font-size: 14px;
  margin-right: auto; /* push links + toggle to the right */
}
.ytl-mark {
  width: 32px; height: 32px;
  border-radius: 50%;
  background-image: url('img/avatar.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: block;
  font-size: 0;
  color: transparent;
  letter-spacing: 0;
  box-shadow:
    0 6px 18px -6px color-mix(in srgb, var(--accent-2) 60%, transparent),
    0 0 0 1.5px rgba(255,255,255,.5) inset;
}
/* Interactive YTTL name mark next to avatar — letters expand into the full name on hover */
.ytl-name {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  line-height: 1.4;
}
.ytl-grp { display: inline-flex; align-items: center; }
.ytl-grp > b,
.ytl-dot {
  font-weight: 800;
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ytl-dot { margin-left: 1px; letter-spacing: 0.05em; }
.ytl-rest {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  color: var(--fg-dim);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
  transition: max-width .4s var(--ease), opacity .3s var(--ease), margin-right .4s var(--ease);
}
.ytl-grp:hover > .ytl-rest {
  max-width: 160px;
  opacity: 1;
  margin-right: 5px;
}
nav .links { display: flex; gap: 6px; align-items: center; }
nav .links a {
  font-size: 13.5px; padding: 8px 14px; border-radius: 999px;
  color: var(--fg-dim); transition: all .25s var(--ease); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
nav .links a svg { width: 16px; height: 16px; }
/* Light pink vertical dividers (placed outside buttons, between siblings) */
nav .links .nav-div {
  display: inline-block;
  width: 1px; height: 14px;
  background: color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 1px;
  margin: 0 4px;
  flex-shrink: 0;
  align-self: center;
}

/* Desktop: hide the inline link icons (only visible inside mobile menu) */
nav .links a .link-icon { display: none; }

/* Icon-only nav links (LinkedIn, Email) — match the theme-toggle chip style */
nav .links a.icon-link {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--chip-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--fg);
  flex-shrink: 0;
}
nav .links a.icon-link svg { width: 16px; height: 16px; }
nav .links a:not(.icon-link) + a.icon-link { margin-left: 12px; }
nav .links a.icon-link + a.icon-link { margin-left: 12px; }

/* Pink-purple hover for icon-style buttons */
nav .links a.icon-link:hover,
nav .theme-toggle:hover {
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent-2) 35%, var(--glass-border));
}

/* Tooltip below each icon button */
nav .links a.icon-link::after,
nav .theme-toggle::after {
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%) translateY(2px);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--fg);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  margin-top: 8px;
  letter-spacing: -0.01em;
  font-weight: 500;
}
nav .links a.icon-link::after { content: attr(data-tip); }
html[data-theme="light"] nav .theme-toggle::after { content: "Dark mode"; }
html[data-theme="dark"] nav .theme-toggle::after  { content: "Light mode"; }

nav .links a.icon-link:hover::after,
nav .theme-toggle:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(6px);
}
nav .links a:hover { color: var(--fg); background: var(--chip-bg); }
nav .links a.active {
  color: var(--fg);
  background: linear-gradient(120deg,
    color-mix(in srgb, var(--accent)   16%, transparent) 0%,
    color-mix(in srgb, var(--accent-2) 16%, transparent) 25%,
    color-mix(in srgb, var(--accent-3) 16%, transparent) 50%,
    color-mix(in srgb, var(--accent-2) 16%, transparent) 75%,
    color-mix(in srgb, var(--accent)   16%, transparent) 100%);
  background-size: 300% 100%;
  animation: nav-active-shift 6s linear infinite;
  box-shadow: 0 0 0 1px var(--glass-border) inset;
  font-weight: 600;
}
nav .links a.active:hover { color: var(--fg); }
@keyframes nav-active-shift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  nav .links a.active { animation: none; }
}
nav .theme-toggle {
  margin-left: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--chip-bg);
  display: grid; place-items: center;
  color: var(--fg);
  transition: all .3s var(--ease);
}
nav .theme-toggle:hover { transform: scale(1.06); }
nav .theme-toggle svg { width: 16px; height: 16px; }
html[data-theme="dark"] .theme-icon-light { display: none; }
html[data-theme="light"] .theme-icon-dark { display: none; }

/* ============ Hero ============ */
.hero {
  min-height: auto;
  display: flex; align-items: flex-end;
  padding: 130px 0 36px;
  position: relative;
}
.hero-inner { width: 100%; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 12.5px; color: var(--fg-dim);
  letter-spacing: 0.02em;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 12px #4ade80;
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

h1.title {
  font-size: clamp(34px, 5.4vw, 64px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.035em;
  margin: 22px 0 20px;
  background: linear-gradient(180deg, var(--fg) 0%, var(--fg) 60%, var(--fg-dim) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
h1.title .accent {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Waving hand animation */
.wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 2.6s var(--ease) infinite;
  -webkit-text-fill-color: initial;
  background: none !important;
  filter: drop-shadow(0 4px 16px rgba(255, 126, 212, 0.35));
  margin-left: 8px;
}
@keyframes wave {
  0%   { transform: rotate(0deg); }
  10%  { transform: rotate(14deg); }
  20%  { transform: rotate(-8deg); }
  30%  { transform: rotate(14deg); }
  40%  { transform: rotate(-4deg); }
  50%  { transform: rotate(10deg); }
  60%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

.hero p.lead {
  max-width: 620px;
  font-size: clamp(15.5px, 1.4vw, 17px);
  line-height: 1.55;
  color: var(--fg-dim);
  font-weight: 400;
}

.hero-cta { margin-top: 26px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 15px; font-weight: 500;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--fg);
  transition: all .3s var(--ease);
}
.btn:hover { transform: translateY(-2px); background: var(--chip-bg); }
.btn.primary { background: var(--fg); color: var(--bg); border-color: transparent; }
.btn.primary:hover { transform: translateY(-2px) scale(1.02); }
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* Looping single-line marquee of past employers under hero */
.marquee {
  margin-top: 36px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: 28px;
  align-items: center;
  animation: marquee-scroll 48s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-size: 13px;
  color: var(--fg-dim);
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.marquee-track span::after {
  content: "";
  display: inline-block;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--fg-mute);
  margin-left: 22px;
  opacity: .55;
}
.marquee-track span:last-child::after { display: none; }
.marquee-track span b { color: var(--fg); font-weight: 500; }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* ============ Page hero (smaller, used on subpages) ============ */
.page-hero {
  padding: 130px 0 24px;
}
.page-hero .eyebrow { margin-bottom: 16px; }
.page-hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
  background: linear-gradient(180deg, var(--fg) 0%, var(--fg) 60%, var(--fg-dim) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-hero h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-hero p {
  max-width: 640px;
  font-size: clamp(15.5px, 1.4vw, 17px);
  line-height: 1.55;
  color: var(--fg-dim);
}

/* ============ Section header ============ */
section { padding: 100px 0; position: relative; }
section.work-section { padding-top: 28px; }
section.first-section { padding-top: 32px; }
.section-head {
  display: flex; align-items: end; justify-content: space-between; gap: 24px;
  margin-bottom: 28px;
}
.section-head.compact { margin-bottom: 22px; }
.section-head .label {
  font-size: 12.5px; color: var(--fg-mute); letter-spacing: 0.18em;
  text-transform: uppercase; font-weight: 500;
}
.section-head h2 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05; letter-spacing: -0.035em; font-weight: 600;
  margin-top: 10px;
}
.section-head h2 em {
  font-style: italic; font-family: var(--font-serif); font-weight: 400;
}
.section-head p {
  max-width: 380px; color: var(--fg-dim); font-size: 15px; line-height: 1.55;
}

/* ============ Works grid ============ */
.works { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: saturate(160%) blur(24px);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  transition: transform .5s var(--ease), background .4s var(--ease), border-color .4s var(--ease);
  isolation: isolate;
  display: flex;
  flex-direction: column;
}
.card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(800px circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,.08), transparent 40%);
  opacity: 0; transition: opacity .4s var(--ease); pointer-events: none;
}
.card:hover { transform: translateY(-4px); }
.card:hover::before { opacity: 1; }

/* All cards take a single column in the new 2-col layout */
.card.span-4, .card.span-3, .card.span-2, .card.span-6 { grid-column: span 1; }

.card .visual {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
/* When a real image is used as the card cover, let it sit at its natural aspect */
.card .visual:has(> .card-cover) {
  aspect-ratio: auto;
}
.card .visual .card-cover {
  position: static;
  width: 100%;
  height: auto;
  display: block;
  object-fit: initial;
}
/* Forced-ratio override: visual stays at fixed aspect, image fills via cover */
.card .visual.ratio-4-3 {
  aspect-ratio: 4 / 3;
}
/* Zoom variant — cover image scaled inside the card, parent clips overflow */
.card .visual.card-cover-zoom {
  overflow: hidden;
}
.card .visual.card-cover-zoom .card-cover.card-cover--zoom-120 {
  transform: scale(1.2);
  transform-origin: center center;
}
.card .visual.ratio-4-3 .card-cover {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Decorative project visuals (no external images needed) */
.viz {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c1, #5b8cff), var(--c2, #c372ff));
}
.viz::after {
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(at 18% 28%, rgba(255,255,255,.32), transparent 50%),
    radial-gradient(at 82% 72%, rgba(0,0,0,.22), transparent 55%);
}
.viz .frame {
  position: relative; z-index: 1;
  width: 64%; aspect-ratio: 4/3; border-radius: 14px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.6) inset;
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* SOCA card — fill viz with thumbnail image, natural ratio (crop OK, no shadow) */
.viz.viz--soca {
  background: #f4eef9;
  padding: 0;
  display: block;
  overflow: hidden;
}
.viz.viz--soca::after { display: none; }
.viz.viz--soca .viz-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.16) translateY(6%);
  transform-origin: center center;
}

/* Moodio card — animated cross-fade gradient background.
   Keep position: absolute + inset: 0 inherited from .viz so the box fills the
   .visual container at its native aspect-ratio. */
.viz.viz--moodio {
  background-image: url('img/moodio/bg-1.webp');
  background-size: cover;
  background-position: center;
  isolation: isolate;
}
.viz.viz--moodio::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('img/moodio/bg-2.webp');
  background-size: cover;
  background-position: center;
  animation: moodio-bg-swap 10s ease-in-out infinite;
  z-index: 0;
}
.viz.viz--moodio > * { position: relative; z-index: 1; }
/* Moodio card — logo on top, browser keeps its original 4:3 ratio + 64% width,
   browser slightly covers the bottom of the logo. */
.viz.viz--moodio {
  display: flex;
  flex-direction: column;
  place-items: initial;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.moodio-logo {
  width: 16%;
  height: auto;
  display: block;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.35));
}
/* Frame keeps inherited width:64% + aspect-ratio:4/3; don't let flex shrink it */
.viz.viz--moodio .moodio-frame {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
/* Frame keeps its original 4:3 ratio (inherited from .viz .frame) */
/* WIP / Beta tag styling — accent pill */
.tag.tag--wip {
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  background-size: 200% 100%;
  animation: nav-active-shift 6s linear infinite;
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}
@keyframes moodio-bg-swap {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .viz.viz--moodio::before { animation: none; opacity: 0.5; }
}
.viz .frame .bar { height: 14px; background: rgba(0,0,0,.06); display:flex; align-items:center; gap:4px; padding: 0 8px; }
.viz .frame .bar i { width:6px; height:6px; border-radius:50%; background: rgba(0,0,0,.18); display:inline-block; }
.viz .frame .body { flex:1; padding: 10px; display: grid; gap: 6px; grid-template-columns: 1fr 1fr; }
.viz .frame .body div { background: rgba(0,0,0,.06); border-radius: 6px; }
.viz .frame .body div:nth-child(1) { grid-column: span 2; height: 38%; background: linear-gradient(135deg, var(--c1), var(--c2)); }

.viz .label-tag {
  position: absolute; top: 16px; right: 18px; z-index: 2;
  font-size: 10.5px; letter-spacing: 0.18em; font-weight: 600;
  color: rgba(255,255,255,.95); text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.18); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.25);
}

/* Make project cards fully clickable — anchor overlay */
.card .card-link {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
}
.card { cursor: pointer; }

/* CTA card variant — white semi-transparent promo block */
.card.card-cta {
  display: flex; flex-direction: column; justify-content: center;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  border: 1px solid color-mix(in srgb, var(--accent-2) 28%, var(--glass-border));
  min-height: 100%;
  cursor: pointer;
}
html[data-theme="dark"] .card.card-cta { background: rgba(255, 255, 255, 0.06); }
.card.card-cta:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent-2) 55%, var(--glass-border)); }
.card-cta .cta-content { padding: 40px 32px; }
.card-cta .cta-eyebrow {
  display: inline-block;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 600;
  margin-bottom: 18px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-2) 28%, transparent);
}
.card-cta h3 {
  font-size: clamp(24px, 2.4vw, 30px);
  line-height: 1.18;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--fg);
}
.card-cta h3 em {
  font-family: inherit;
  font-style: normal;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.card-cta .cta-arrow {
  display: inline-block;
  transition: transform .35s var(--ease);
  margin-left: 6px;
}
.card-cta:hover .cta-arrow { transform: translateX(8px); }
.card-cta p {
  font-size: 15px;
  color: var(--fg-dim);
  line-height: 1.55;
  max-width: 92%;
  margin-bottom: 18px;
}
.card-cta .cta-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.card-cta .cta-tags .tag {
  background: rgba(255,255,255,.5);
  border-color: color-mix(in srgb, var(--accent-2) 25%, var(--glass-border));
  color: var(--fg);
  font-weight: 500;
}
html[data-theme="dark"] .card-cta .cta-tags .tag {
  background: rgba(255,255,255,.08);
}
@keyframes cta-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.card .body {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.card .body .tags { margin-top: auto; padding-top: 16px; }
.card .meta {
  display:flex; align-items:center; justify-content:space-between;
  font-size: 12px; color: var(--fg-mute);
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px;
}
.card h3 { font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; margin-bottom: 8px; }
.card p { font-size: 14.5px; color: var(--fg-dim); line-height: 1.55; }
.card .tags { display:flex; gap:6px; flex-wrap:wrap; margin-top: 16px; }
/* Global tag-pill style (light, subtly pink-tinted border) */
.tag {
  display: inline-flex; align-items: center;
  font-size: 11.5px; padding: 6px 12px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--glass-border));
  color: var(--fg);
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.card .tag { font-size: 11.5px; padding: 5px 10px; color: var(--fg-dim); }

/* ============ Research paper chips ============ */
.paper-venue { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }

/* Paper cards: pin the award badge to the bottom of every card */
.papers-grid .card { display: flex; flex-direction: column; }
.papers-grid .card .body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100%;
}
.papers-grid .card .body > .paper-venue:last-child {
  margin-top: auto !important;
  padding-top: 18px;
}
.venue-pill {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: var(--chip-bg); border: 1px solid var(--glass-border);
  color: var(--fg-dim); letter-spacing: .04em; font-weight: 500;
}
.venue-award {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  color: #fff; font-weight: 600; letter-spacing: .02em;
  box-shadow: 0 6px 18px -8px var(--accent-2);
}

/* ============ About / 2-col grid ============ */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; align-items: stretch; }
.panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: saturate(160%) blur(24px);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  box-shadow: var(--glass-shadow);
  padding: 32px 34px;
}
.panel h3 { font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-mute); font-weight: 500; margin-bottom: 22px; }
.bio p { font-size: 17px; line-height: 1.6; color: var(--fg); margin-bottom: 14px; }
.bio p:last-child { margin-bottom: 0; }
.bio strong { font-weight: 600; color: var(--fg); }
.bio em.serif { font-family: inherit; font-style: normal; font-weight: 600; color: var(--accent-2); font-size: inherit; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline .row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 14px 0; border-bottom: 1px dashed var(--line);
}
.timeline .row:last-child { border-bottom: 0; }
.timeline .co { font-size: 15px; font-weight: 500; }
.timeline .yr { font-size: 13px; color: var(--fg-mute); letter-spacing: 0.04em; }

/* Education row with school logo (logo on left, school + year stacked on right) */
.edu-info { display: flex; align-items: flex-start; gap: 12px; min-width: 0; width: 100%; }
.edu-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.edu-info .co { line-height: 1.3; }
.edu-info .co small {
  display: block; font-size: 12px; font-weight: 400;
  color: var(--fg-dim); letter-spacing: 0.02em; margin-top: 2px;
}
.edu-logo {
  width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 14px -8px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.08) inset;
}
.edu-logo svg { display: block; }

/* Skills — categorized list. Category as accent text label, skills as light-bordered tags */
.skills-list { display: flex; flex-direction: column; gap: 0; }
.skill-group {
  padding: 18px 0;
  border-bottom: 1px dashed var(--line);
}
.skill-group:first-child { padding-top: 4px; }
.skill-group:last-child { border-bottom: 0; padding-bottom: 4px; }
.skill-cat {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.skill-group .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 0;
}

.awards { display: grid; gap: 12px; }
.award {
  display: flex; gap: 14px; padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--chip-bg);
  border: 1px solid var(--glass-border);
}
.award .ribbon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.award .ribbon svg { width: 18px; height: 18px; }
.award .meta { font-size: 12px; color: var(--fg-mute); letter-spacing: 0.06em; text-transform: uppercase; }
.award .ttl { font-size: 14.5px; font-weight: 500; line-height: 1.4; margin-top: 2px; }

/* ============ Contact ============ */
.contact-card {
  position: relative;
  border-radius: 36px;
  padding: clamp(40px, 6vw, 80px);
  text-align: center;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}
.contact-card::before {
  content:""; position:absolute; inset:-1px;
  background: conic-gradient(from 180deg at 50% 50%, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  z-index: -1; filter: blur(40px); opacity: .35;
}
.contact-card h2 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05; letter-spacing: -0.035em; font-weight: 600;
  margin-bottom: 16px;
}
.contact-card h2 em {
  font-style: italic; font-family: var(--font-serif); font-weight: 400;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.contact-card p { color: var(--fg-dim); font-size: 17px; max-width: 560px; margin: 0 auto 32px; line-height: 1.55; }
.email-pill {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 26px; border-radius: 999px;
  background: var(--fg); color: var(--bg);
  font-size: 17px; font-weight: 500; letter-spacing: -0.01em;
  transition: transform .3s var(--ease);
}
.email-pill:hover { transform: scale(1.03); }
.socials { display: flex; gap: 10px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.socials a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--glass-border);
  color: var(--fg-dim);
  font-size: 13.5px;
  transition: all .3s var(--ease);
}
.socials a:hover { color: var(--fg); transform: translateY(-2px); }
.socials svg { width: 14px; height: 14px; }

/* ============ Resume page (embedded Google Drive) ============ */
.resume-frame-wrap {
  position: relative;
  width: 100%;
  height: calc(100vh - 200px);
  min-height: 600px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  backdrop-filter: saturate(160%) blur(24px);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  box-shadow: var(--glass-shadow);
}
.resume-frame-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  background: #fff;
}
.resume-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 18px;
}
.resume-actions a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 500;
  background: var(--chip-bg);
  border: 1px solid var(--glass-border);
  color: var(--fg);
  transition: all .25s var(--ease);
}
.resume-actions a:hover { background: color-mix(in srgb, var(--accent) 14%, var(--chip-bg)); border-color: color-mix(in srgb, var(--accent-2) 35%, var(--glass-border)); }
.resume-actions a.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  background-size: 200% 100%;
  animation: nav-active-shift 6s linear infinite;
  color: #fff;
  border-color: transparent;
}
.resume-actions a svg { width: 14px; height: 14px; }

/* ============ Case study (project detail) page ============ */
.case-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: start;
  padding-top: 100px;
}
.case-sidebar {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* shared "card" style for Back + TOC blocks */
.case-back,
.case-sidebar .case-toc {
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--glass-bg);
  backdrop-filter: saturate(160%) blur(24px);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
/* Back card hugs its single button so its visible height matches one active TOC pill */
.case-back { padding: 0; }
.case-back a { width: 100%; border-radius: 12px; }
.case-toc-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
  font-weight: 500;
  margin: 0 12px 12px;
}
.case-toc { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.case-toc li { margin: 0; padding: 0; }
.case-toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  min-height: 48px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--fg-dim);
  transition: all .25s var(--ease);
  position: relative;
  text-decoration: none;
}
.case-toc a::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px; bottom: 14px;
  width: 2px;
  background: transparent;
  border-radius: 2px;
  transition: background .35s var(--ease);
}
.case-toc a:hover { color: var(--fg); background: var(--chip-bg); }
.toc-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-2) 14%, transparent);
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  flex-shrink: 0;
}
.case-toc a.is-active .toc-num {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.case-toc a.is-active {
  color: var(--fg);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-weight: 500;
  padding-left: 18px;
}
.case-toc a.is-active::before {
  background: linear-gradient(180deg, var(--accent), var(--accent-2), var(--accent-3));
  box-shadow: 0 0 12px -2px var(--accent-2);
}
.case-back {
  margin: 0;
  display: flex;
}
.case-back a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  min-height: 48px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease), background .25s var(--ease);
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  background-size: 200% 100%;
  animation: nav-active-shift 6s linear infinite;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.case-back a:hover { transform: translateX(-3px); }

.case-content { min-width: 0; }

/* Case study hero */
.case-hero { margin-bottom: 8px; }
.case-hero .crumb {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
  font-weight: 500;
  margin-bottom: 14px;
}
.case-hero h1 {
  font-size: clamp(38px, 5.5vw, 60px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 14px;
  background: linear-gradient(180deg, var(--fg) 0%, var(--fg) 60%, var(--fg-dim) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.case-hero h1 em {
  font-family: inherit;
  font-style: normal;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.case-hero .lead {
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-dim);
  max-width: 640px;
  margin-bottom: 24px;
}
.case-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0;
  border: 0;
  margin-top: 8px;
}
/* Modifier — give the Team column substantially more width to fit multi-line role lists */
.case-meta--team-wide {
  grid-template-columns: 0.85fr 0.85fr 2fr 1.05fr;
}
.case-meta > div {
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
}
.case-meta dt {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute);
  font-weight: 500;
  margin-bottom: 6px;
}
.case-meta dd {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.5;
}
.case-cover {
  margin-top: 8px;
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  position: relative;
}

/* Sections */
.case-section {
  scroll-margin-top: 80px;
  padding: 24px 0;
}
.case-section + .case-section { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 24px; }
.case-section-head { margin-bottom: 8px; }
.case-section-head .num { display: none; }
.case-section-head h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 14px;
}
.case-section-head p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-dim);
  max-width: 640px;
}
.case-section-head p + p { margin-top: 12px; }

/* Published date + categories line */
.case-pubdate {
  font-size: 13px !important;
  letter-spacing: 0.02em;
  color: var(--fg-mute) !important;
  margin-bottom: 14px;
}
.case-pubdate a {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color .25s var(--ease);
}
.case-pubdate a:hover { color: var(--accent-3); }

/* Sub-headings inside a section (e.g. "Branding Requirements") */
/* Linked section title (Honda — opens external page anchor) */
.case-h2--link a,
.case-subhead--link a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: color .2s var(--ease);
}
.case-h2--link a:hover,
.case-subhead--link a:hover {
  color: var(--accent-2);
}
.case-h2--link a svg,
.case-subhead--link a svg {
  width: 0.7em;
  height: 0.7em;
  opacity: 0.55;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.case-h2--link a:hover svg,
.case-subhead--link a:hover svg {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* ===== SOCA case-study specific blocks ===== */
.soca-p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-dim);
  max-width: 680px;
  margin: 12px 0 0;
}
.soca-callout {
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  max-width: 720px;
  margin: 18px 0 0;
  padding: 18px 22px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent-2) 9%, var(--glass-bg));
  border: 1px solid color-mix(in srgb, var(--accent-2) 22%, var(--glass-border));
  border-left: 3px solid var(--accent-2);
}
.soca-callout strong { color: var(--accent-2); }

/* Vibe-coding build method callout */
.vibe-build {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  padding: 20px 24px;
  border-radius: 0 14px 14px 0;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 10%, var(--glass-bg)),
    color-mix(in srgb, var(--accent-3) 10%, var(--glass-bg)));
  border: 1px solid color-mix(in srgb, var(--accent-2) 28%, var(--glass-border));
  position: relative;
  overflow: hidden;
}
.vibe-build::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), var(--accent-3));
}
.vibe-build-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent-3);
  align-self: flex-start;
  line-height: 1;
}
.vibe-build-tag svg {
  width: 14px;
  height: 14px;
  color: var(--accent-2);
  flex-shrink: 0;
}
.vibe-build p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg);
  margin: 0;
  max-width: 720px;
}
.vibe-build p strong {
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}
.soca-table-wrap { overflow-x: auto; margin-top: 16px; }
.soca-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 560px;
}
.soca-table th, .soca-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.45;
}
.soca-table th {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-mute);
  font-weight: 600;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.soca-table td { color: var(--fg-dim); }
.soca-table td strong { color: var(--fg); }
/* Stat cards */
.soca-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 18px 0 8px;
}
.soca-stat {
  padding: 20px 18px;
  border-radius: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.soca-stat-num {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}
.soca-stat-label {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--fg-dim);
}
@media (max-width: 820px) {
  .soca-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .soca-stats { grid-template-columns: 1fr; }
}

/* Logo grid (Moodio adoption) — 4 cols × 3 rows, with brand mark + label */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: color-mix(in srgb, var(--fg) 2%, transparent);
}
.logo-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 6cqi, 14px);
  padding: clamp(14px, 10cqi, 22px) 10px;
  min-width: 0;
  position: relative;
  overflow: hidden;
  transition: background .25s var(--ease);
  /* each cell is its own query container — children scale with CELL width */
  container-type: inline-size;
}
.logo-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  pointer-events: none;
}
.logo-cell:nth-child(4n)::after { border-right: 0; }
.logo-cell:nth-child(n+9)::after { border-bottom: 0; }
.logo-cell:hover { background: color-mix(in srgb, var(--accent-2) 4%, transparent); }

.logo-icon {
  display: flex; align-items: center; justify-content: center;
  height: clamp(24px, 18cqi, 38px);
  max-width: 100%;
  color: var(--fg);
  flex-shrink: 0;
}
.logo-icon svg { height: 100%; width: auto; max-width: 100%; }

.logo-mark {
  /* responsive — shrinks with cell width via container query units */
  font-size: clamp(13px, 11cqi, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  line-height: 1;
  white-space: nowrap;
  max-width: 100%;
}
.logo-mark--bold { font-weight: 700; letter-spacing: -0.03em; }
.logo-mark--italic {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(18px, 15cqi, 32px);
  letter-spacing: -0.01em;
}
.logo-mark--wide { letter-spacing: 0.02em; font-weight: 500; }

/* Xiaomi rounded-square "mi" */
.logo-mi {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--fg);
  color: var(--bg);
  width: clamp(26px, 18cqi, 38px);
  height: clamp(26px, 18cqi, 38px);
  border-radius: clamp(7px, 5cqi, 11px);
  font-weight: 700;
  font-size: clamp(11px, 7.5cqi, 16px);
  letter-spacing: -0.02em;
}

/* Microsoft 4 squares */
.logo-squares {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2px, 1.4cqi, 3px);
  width: clamp(22px, 16cqi, 34px);
  height: clamp(22px, 16cqi, 34px);
}
.logo-squares span {
  background: var(--fg);
}

.logo-label {
  font-size: clamp(8px, 4.5cqi, 10px);
  letter-spacing: 0.22em;
  color: color-mix(in srgb, var(--fg) 45%, transparent);
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 720px) {
  .logo-grid { grid-template-columns: repeat(3, 1fr); }
  .logo-cell:nth-child(4n)::after { border-right: 1px solid var(--line); }
  .logo-cell:nth-child(n+9)::after { border-bottom: 1px solid var(--line); }
  .logo-cell:nth-child(3n)::after { border-right: 0; }
  .logo-cell:nth-child(n+10)::after { border-bottom: 0; }
}
@media (max-width: 480px) {
  .logo-grid { grid-template-columns: repeat(2, 1fr); }
  .logo-cell:nth-child(3n)::after { border-right: 1px solid var(--line); }
  .logo-cell:nth-child(n+10)::after { border-bottom: 1px solid var(--line); }
  .logo-cell:nth-child(2n)::after { border-right: 0; }
  .logo-cell:nth-child(n+11)::after { border-bottom: 0; }
}

/* Research grid (Moodio research) — 3 cols × 2 rows, paper cards */
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: color-mix(in srgb, var(--fg) 2%, transparent);
}
.research-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 30px 26px;
  min-width: 0;
  position: relative;
  transition: background .25s var(--ease);
  /* container query — title scales with card width */
  container-type: inline-size;
}
.research-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  pointer-events: none;
}
.research-card:nth-child(3n)::after { border-right: 0; }
.research-card:nth-child(n+4)::after { border-bottom: 0; }
.research-card:hover { background: color-mix(in srgb, var(--accent-2) 4%, transparent); }

.research-venue {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--accent-3);
  text-transform: uppercase;
  font-weight: 600;
  line-height: 1;
}

.research-tag {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: 6px 10px;
  /* always 2 lines tall: 8.5px font × 1.4 line-height × 2 = ~24px text + 12px padding ≈ 36px */
  min-height: 36px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: color-mix(in srgb, var(--fg) 78%, var(--accent-3));
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 5px;
  line-height: 1.4;
  box-sizing: border-box;
}

.research-title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  /* responsive to card width via container query */
  font-size: clamp(20px, 10.5cqi, 28px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 6px 0 0;
}

.research-desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--fg-dim);
  margin: 0;
  flex: 1;
}

.research-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--fg);
  text-transform: uppercase;
  font-weight: 600;
  text-decoration: none;
  margin-top: 8px;
  transition: gap .25s var(--ease);
}
.research-link span { transition: transform .25s var(--ease); }
.research-link:hover { gap: 12px; }
.research-link:hover span { transform: translateX(2px); }

@media (max-width: 900px) {
  .research-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .research-card:nth-child(3n)::after { border-right: 1px solid var(--line); }
  .research-card:nth-child(n+4)::after { border-bottom: 1px solid var(--line); }
  .research-card:nth-child(2n)::after { border-right: 0; }
  .research-card:nth-child(n+5)::after { border-bottom: 0; }
}
@media (max-width: 560px) {
  .research-grid { grid-template-columns: 1fr; }
  .research-card::after { border-right: 0; border-bottom: 1px solid var(--line); }
  .research-card:last-child::after { border-bottom: 0; }
}

/* Numbered prefix inside .case-subhead — accent (purple) color */
.case-subhead-num {
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  margin-right: 2px;
}

.case-subhead {
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 28px 0 14px;
  color: var(--fg);
}

/* Numbered / bulleted lists inside a case study */
.case-list {
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-dim);
  padding-left: 26px;
  margin-bottom: 24px;
  max-width: 720px;
}
.case-list li { margin-bottom: 10px; }
.case-list li::marker {
  color: var(--accent-2);
  font-weight: 600;
}
.case-list strong { color: var(--fg); font-weight: 600; }
.case-list--bullet { list-style: disc; }

/* Feature block — text on one side, image on the other (Xiaomi wireframe pattern) */
.feature-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}
.feature-block.feature-block--stack {
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: stretch;
}
.feature-block.feature-block--stack > img.feature-image {
  width: 100%;
  max-width: 100%;
}
.feature-block .feature-text h4 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--accent-2);
  letter-spacing: -0.01em;
}
.feature-block .feature-text p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg-dim);
}
.feature-list {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-dim);
  padding-left: 22px;
  margin-top: 12px;
}
.feature-list li { margin-bottom: 8px; }
.feature-list li::marker { color: var(--accent-2); font-weight: 600; }
.feature-list strong { color: var(--fg); font-weight: 600; }
.feature-image {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--c1, #a8d8e8), var(--c2, #cab8ff));
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 30px 60px -25px rgba(0,0,0,.2);
}
div.feature-image::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(at 18% 28%, rgba(255,255,255,.32), transparent 55%),
    radial-gradient(at 82% 72%, rgba(0,0,0,.18), transparent 55%);
}
img.feature-image {
  display: block;
  aspect-ratio: auto;
  width: 100%;
  height: auto;
  background: none;
  object-fit: contain;
  box-shadow: none;
  border-radius: 16px;
}
.feature-image .placeholder-tag {
  position: absolute; bottom: 14px; right: 16px; z-index: 2;
  font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  font-weight: 600; color: rgba(255,255,255,.85);
  padding: 4px 10px; border-radius: 999px;
  background: rgba(0,0,0,.18); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.18);
}

/* 14-screenshot grid for Visual Design */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
.screenshot-placeholder {
  aspect-ratio: 9 / 19;
  background: linear-gradient(135deg, var(--c1, #a8d8e8), var(--c2, #cab8ff));
  position: relative;
  overflow: hidden;
}
.screenshot-placeholder::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(at 22% 28%, rgba(255,255,255,.32), transparent 55%),
    radial-gradient(at 78% 76%, rgba(0,0,0,.20), transparent 55%);
}
.screenshot-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 19;
  object-fit: cover;
  border-radius: 14px;
  background: transparent;
  cursor: zoom-in;
  transition: transform .25s var(--ease, ease), box-shadow .25s var(--ease, ease);
}
.screenshot-img:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 36px -18px rgba(0,0,0,.25);
}

/* Lightbox overlay */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 6, 18, 0.78);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  z-index: 9999;
  padding: 60px 80px;
  animation: lb-fade .22s ease;
}
.lightbox.is-open { display: flex; }
@keyframes lb-fade { from { opacity: 0 } to { opacity: 1 } }
.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.5);
  user-select: none;
  pointer-events: none;
}
.lb-close, .lb-nav {
  position: absolute;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: background .2s var(--ease, ease), transform .2s var(--ease, ease);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.lb-close:hover, .lb-nav:hover {
  background: rgba(255,255,255,.22);
  transform: scale(1.05);
}
.lb-close {
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  font-size: 26px;
  line-height: 1;
}
.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 30px;
  line-height: 1;
}
.lb-nav:hover { transform: translateY(-50%) scale(1.05); }
.lb-prev { left: 24px; }
.lb-next { right: 24px; }
.lb-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.85);
  font-size: 13px;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,.10);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
@media (max-width: 720px) {
  .lightbox { padding: 60px 16px; }
  .lb-nav { width: 42px; height: 42px; font-size: 24px; }
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
}

/* Branding Design — side-by-side on desktop, stacked on mobile, equal height */
.branding-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 18px;
  align-items: stretch;
}
.branding-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}
@media (max-width: 720px) {
  .branding-stack { grid-template-columns: 1fr; gap: 24px; }
  .branding-img { height: auto; }
}

/* 3-video row for Motion Design — clips sit flush against each other */
.video-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 18px;
}
.video-clip {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 600 / 1094;
}
.video-placeholder {
  position: relative;
  aspect-ratio: 9 / 16;
  background: linear-gradient(135deg, var(--c1, #a8d8e8), var(--c2, #cab8ff));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.video-placeholder::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(at 22% 28%, rgba(255,255,255,.32), transparent 55%),
    radial-gradient(at 78% 76%, rgba(0,0,0,.20), transparent 55%);
}
.video-placeholder span {
  position: relative; z-index: 2;
  color: rgba(255,255,255,.92);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.22);
  backdrop-filter: blur(10px);
}

/* CTA button (rounded gradient pill — e.g. "Click to view") */
.case-cta-btn {
  display: flex;
  width: fit-content;
  margin: 18px auto 0;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  background-size: 200% 100%;
  animation: nav-active-shift 6s linear infinite;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent-2) 65%, transparent);
}
.case-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--accent-2) 75%, transparent);
}
.case-cta-btn svg { width: 16px; height: 16px; }
/* Sidebar variant — sits at the bottom of the sidebar, same radius as Back card */
.case-cta-btn.case-cta-btn--sidebar {
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  font-size: 13px;
  gap: 6px;
  justify-content: center;
  border-radius: 12px;
}

/* ===== Request access form (Builder's Connect) ===== */
.request-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 40px;
  max-width: 720px;
}
.rf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.rf-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rf-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--fg-dim);
}
.rf-field input,
.rf-field textarea {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  color: var(--fg);
  background: color-mix(in srgb, var(--glass-bg) 90%, transparent);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
  resize: vertical;
  font-family: inherit;
}
.rf-field textarea { min-height: 130px; line-height: 1.55; }
.rf-field input::placeholder,
.rf-field textarea::placeholder { color: color-mix(in srgb, var(--fg-dim) 70%, transparent); }
.rf-field input:focus,
.rf-field textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-2) 60%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 14%, transparent);
}
.rf-submit { margin: 6px 0 0; align-self: flex-start; cursor: pointer; border: none; }
.rf-note {
  font-size: 13.5px;
  color: var(--fg-dim);
  margin: 0;
  min-height: 1.4em;
}
.rf-note.is-success { color: color-mix(in srgb, var(--accent-2) 80%, var(--fg)); }
.rf-note.is-error { color: #ff6b6b; }

@media (max-width: 720px) {
  .rf-row { grid-template-columns: 1fr; gap: 14px; }
  .request-form { gap: 14px; }
  .rf-submit { align-self: stretch; justify-content: center; }
}

@media (max-width: 940px) {
  .screenshot-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 720px) {
  .feature-block { grid-template-columns: 1fr; gap: 14px; }
  .screenshot-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .video-row { grid-template-columns: 1fr; gap: 0; }
}

/* Long image placeholder blocks */
.case-img {
  border-radius: 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c1, #ff5fbf), var(--c2, #8a5bff));
  position: relative;
  box-shadow: 0 30px 60px -25px rgba(0,0,0,.2);
  margin-bottom: 0;
  isolation: isolate;
  display: block;
}
/* Real image variant — use <img class="case-img">. Drops the gradient bg + overlay. */
img.case-img {
  display: block;
  width: 100%;
  height: auto;
  background: none;
  border: 1px solid var(--glass-border);
}
/* Variant — drop the drop-shadow */
.case-img--no-shadow { box-shadow: none !important; }

/* Square gallery grid (Chocolate Bar — 6 × 3) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 12px;
}
/* Compact row variants — 3 or 4 squares wide */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 18px;
}

/* Tea Project — Zen logo end mark — 40% of column width, centered */
.zen-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 60px 0 20px;
}
.zen-logo {
  display: block;
  width: 40%;
  height: auto;
}

/* Tea Project — Loose Leaf: small images column left + text column right.
   Image column matches a single teabag thumbnail width (5-col grid above). */
.loose-split {
  display: grid;
  grid-template-columns: 1fr 4fr;
  gap: 16px;
  align-items: start;
  margin-top: 18px;
}
.loose-images {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.loose-images > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  cursor: zoom-in;
}
.loose-text > p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-dim);
  margin: 0 0 14px;
}
.loose-text .case-list { margin: 0; }
@media (max-width: 720px) {
  .loose-split { grid-template-columns: 1fr; gap: 18px; }
  .loose-images {
    flex-direction: row;
    gap: 10px;
  }
  .loose-images > img { width: 50%; }
}

/* Honey — Highlights split: images column on the left, text column on the right */
.hi-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  margin-top: 18px;
}
.hi-images {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.hi-images > img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  cursor: zoom-in;
}
.hi-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.hi-row-2 > img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.hi-text {
  margin: 0;
  padding-left: 22px;
}
@media (max-width: 720px) {
  .hi-split { grid-template-columns: 1fr; gap: 20px; }
}
.highlights-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) {
  .highlights-grid,
  .highlights-grid--3 { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}

/* Color & type system grid — 2 narrow columns + 1 double-wide column */
.color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 12px;
  margin: 18px 0;
  align-items: stretch;
}
.color-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}
.color-col img {
  display: block;
  width: 100%;
  border-radius: 8px;
  cursor: zoom-in;
}
/* Narrow columns — 4 images split the column height equally, cropping to fit */
.color-col:not(.color-col--wide) img {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  object-fit: cover;
}
/* Wide column — image keeps its natural aspect, paragraph sits below */
.color-col--wide img { height: auto; }
.color-col--wide p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-dim);
  margin-top: 6px;
}
@media (max-width: 720px) {
  .color-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .color-col--wide { grid-column: span 2; }
}
.gallery-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--c1, #fde68a), var(--c2, #fca5a5));
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
  transition: transform .25s var(--ease, ease), box-shadow .25s var(--ease, ease);
}
.gallery-cell::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(at 22% 28%, rgba(255,255,255,.32), transparent 55%),
    radial-gradient(at 78% 76%, rgba(0,0,0,.18), transparent 55%);
}
.gallery-cell:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -18px rgba(0,0,0,.25); }
img.gallery-cell {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
  border-radius: 10px;
}
img.gallery-cell::after { display: none; }
@media (max-width: 940px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 720px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

/* Video — same defaults as case-img so they slot interchangeably */
.case-video {
  display: block;
  width: 100%;
  height: auto;
  background: transparent;
  border: 0;
}

/* Side-by-side video + image (or video + video) row */
.case-video-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: stretch;
}
.case-video-row > .case-video,
.case-video-row > .case-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 720px) {
  .case-video-row { grid-template-columns: 1fr; }
}
/* Top corners rounded only (Honda stage images) */
.case-img--top-round {
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* ===== Carousel — switch between paired images ===== */
.case-carousel {
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
  isolation: isolate;
  box-shadow: 0 30px 60px -25px rgba(0,0,0,.2);
}
.case-carousel-track {
  display: flex;
  width: 100%;
  transition: transform .45s var(--ease);
}
.case-carousel-track > .case-img {
  flex: 0 0 100%;
  min-width: 0;
  margin-bottom: 0;
  box-shadow: none;
}

/* Fixed 16:9 frame — images keep aspect, letterboxed with dark backdrop */
.case-carousel.is-fixed-ratio {
  aspect-ratio: 16 / 9;
}
.case-carousel.is-fixed-ratio .case-carousel-track {
  height: 100%;
}
.case-carousel.is-fixed-ratio .case-carousel-track > .case-img {
  height: 100%;
  width: auto;
  flex: 0 0 100%;
  object-fit: contain;
  background: #fff;
  border: 0;
}

/* Thumbnails strip — sits below the carousel inside a [data-carousel] wrapper */
.case-carousel-thumbs {
  display: grid;
  grid-template-columns: repeat(var(--thumb-cols, 5), 1fr);
  gap: 8px;
  margin-top: 8px;
}
.case-carousel-thumb {
  appearance: none;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  border: 1.5px solid var(--glass-border);
  background: var(--glass-bg);
  transition: opacity .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
  opacity: .55;
  position: relative;
}
.case-carousel-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.case-carousel-thumb:hover { opacity: .9; }
.case-carousel-thumb.is-active {
  opacity: 1;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px var(--accent-2), 0 8px 22px -10px var(--accent-2);
  transform: translateY(-1px);
}
@media (max-width: 720px) {
  .case-carousel-thumbs { gap: 6px; margin-top: 6px; }
  .case-carousel-thumb { border-radius: 4px; }
}
.case-carousel-arrow {
  position: absolute;
  top: 12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border: 1px solid rgba(255,255,255,.32);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 5;
  transition: background .25s var(--ease), transform .25s var(--ease), opacity .25s var(--ease), border-color .25s var(--ease);
  font-size: 0;
  appearance: none;
  padding: 0;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.25));
}
.case-carousel-arrow svg { width: 16px; height: 16px; }
.case-carousel-arrow.prev { right: 56px; left: auto; }
.case-carousel-arrow.next { right: 12px; }
.case-carousel-arrow:hover:not(:disabled) {
  background: rgba(255,255,255,.42);
  border-color: rgba(255,255,255,.55);
  transform: scale(1.06);
}
.case-carousel-arrow:disabled { opacity: 0.35; cursor: not-allowed; }
.case-carousel-dots {
  position: absolute;
  top: 18px;
  right: 108px; left: auto;
  display: flex; gap: 6px; align-items: center;
  z-index: 5;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20,10,40,.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.case-carousel-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.45);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: all .3s var(--ease);
}
.case-carousel-dot.is-active {
  background: #fff;
  width: 26px;
  border-radius: 999px;
}
@media (max-width: 720px) {
  .case-carousel-arrow { width: 32px; height: 32px; top: 8px; }
  .case-carousel-arrow.prev { right: 48px; left: auto; }
  .case-carousel-arrow.next { right: 8px; }
  .case-carousel-dots { top: 14px; right: 92px; left: auto; padding: 4px 8px; }
}
.case-img::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(at 18% 28%, rgba(255,255,255,.32), transparent 55%),
    radial-gradient(at 82% 72%, rgba(0,0,0,.18), transparent 55%);
}
.case-img:last-child { margin-bottom: 0; }
.case-img .placeholder-tag {
  position: absolute;
  bottom: 18px; right: 22px;
  z-index: 2;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.18);
}

/* Next-project footer */
.case-next {
  margin: 100px 0 60px;
  padding: 44px 40px;
  border-radius: 28px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  text-decoration: none;
  color: var(--fg);
  transition: transform .35s var(--ease), border-color .25s var(--ease);
}
.case-next:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent-2) 35%, var(--glass-border)); }
.case-next .label { font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-mute); font-weight: 500; margin-bottom: 6px; }
.case-next h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.case-next .arrow { font-size: 24px; color: var(--accent-2); transition: transform .3s var(--ease); }
.case-next:hover .arrow { transform: translateX(6px); }

@media (max-width: 940px) {
  .case-layout { grid-template-columns: 180px 1fr; gap: 32px; }
  .case-sidebar { padding: 16px 12px; }
  .case-meta { grid-template-columns: repeat(2, 1fr); gap: 16px 24px; }
}
@media (max-width: 720px) {
  .case-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 72px;
  }
  .case-sidebar {
    position: sticky;
    top: 48px;
    padding: 0;
    border-radius: 0;
    z-index: 40;
    margin-bottom: 16px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .case-toc-label { display: none; }
  .case-toc {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-width: 0;
  }
  .case-toc::-webkit-scrollbar { display: none; }
  .case-toc a {
    flex-shrink: 0;
    padding: 0 14px;
    min-height: 36px;
    font-size: 12.5px;
    white-space: nowrap;
    border-radius: 999px;
  }
  .case-toc a::before { display: none; }
  .case-toc a.is-active {
    padding-left: 14px;
    background: linear-gradient(120deg,
      color-mix(in srgb, var(--accent) 24%, transparent),
      color-mix(in srgb, var(--accent-2) 24%, transparent),
      color-mix(in srgb, var(--accent-3) 24%, transparent));
    background-size: 200% 100%;
    animation: nav-active-shift 6s linear infinite;
  }
  /* Back button sits on its own card above the TOC pill card */
  .case-back {
    display: flex;
    margin: 0;
    padding: 4px 8px;
    flex-shrink: 0;
    align-items: center;
  }
  .case-back a {
    padding: 0 6px;
    min-height: 36px;
    font-size: 12.5px;
    display: inline-flex;
    align-items: center;
  }
  .case-section { padding: 24px 0; }
  .case-section + .case-section { margin-top: 16px; padding-top: 24px; }
  .case-img { border-radius: 0; margin-bottom: 0; }
  .case-next { flex-direction: column; align-items: flex-start; padding: 28px 22px; margin: 60px 0 40px; }
}

/* ============ Footer ============ */
footer {
  padding: 50px 0 70px; text-align: center;
  color: var(--fg-mute); font-size: 13px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

/* ============ Tabs (segmented control) ============ */
.tabs {
  display: inline-flex; gap: 2px; padding: 6px;
  border-radius: 999px;
  background: var(--glass-bg-strong);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  margin-bottom: 28px;
  flex-wrap: wrap;
  /* Stay visible while scrolling through long tabs */
  position: sticky;
  top: 72px;
  z-index: 30;
  align-self: flex-start;
}
.tab-btn {
  appearance: none; background: transparent; border: 0;
  padding: 9px 18px;
  font-size: 13.5px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--fg-dim);
  border-radius: 999px;
  cursor: pointer;
  transition: all .3s var(--ease);
  white-space: nowrap;
}
.tab-btn { position: relative; }
.tab-btn:hover { color: var(--fg); background: var(--chip-bg); }
.tab-btn.is-active {
  background: var(--chip-bg);
  color: var(--fg);
  box-shadow: 0 0 0 1px var(--glass-border) inset;
  font-weight: 600;
}
.tab-btn.is-active::after {
  content: "";
  position: absolute;
  left: 16%; right: 16%;
  bottom: -1.25px; /* sits on the pill's bottom border, half on / half off */
  height: 2.5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 50%, var(--accent-3), var(--accent-2) 90%, var(--accent));
  background-size: 200% 100%;
  animation: tab-underline-shift 5s linear infinite;
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--accent-2) 60%, transparent);
}
@keyframes tab-underline-shift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: tabfade .35s var(--ease); }
@keyframes tabfade { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none; } }

.empty-state {
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 60px 28px;
  text-align: center;
  color: var(--fg-dim);
  background: var(--glass-bg);
}
.empty-state h3 { font-size: 22px; margin-bottom: 8px; color: var(--fg); letter-spacing: -0.02em; }
.empty-state p { font-size: 14.5px; max-width: 380px; margin: 0 auto; line-height: 1.55; }

/* ============ Gallery (masonry — uniform width, varying heights) ============ */
.gallery {
  column-count: 3;
  column-gap: 18px;
}

/* Explicit balanced columns (Paintings) — all columns stretch to equal height,
   the last image in each column grows to fill so the bottoms line up. */
.gallery--cols {
  column-count: initial;
  display: flex;
  gap: 18px;
  align-items: stretch;
}
.gallery--cols .gallery-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.gallery--cols .gallery-item { margin-bottom: 0; break-inside: auto; }
/* Last item in each column fills remaining height → bottoms align.
   Keep its aspect-ratio as the minimum size (so it never collapses on the
   tallest column) while still allowing flex-grow to stretch it taller. */
.gallery--cols .gallery-col > .gallery-item:last-child {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.gallery--cols .gallery-col > .gallery-item:last-child .visual {
  flex: 1 1 auto;
}
@media (max-width: 720px) {
  .gallery--cols { flex-direction: column; }
  .gallery--cols .gallery-col > .gallery-item:last-child { flex: 0 0 auto; }
}

/* Visual Design — 3-row layout: uniform row height, varied widths */
.vis-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.vis-row {
  display: flex;
  gap: 18px;
  align-items: stretch;
}
.vis-item {
  flex: 1 1 0;
  min-width: 0;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform .35s var(--ease);
}
.vis-item:hover { transform: translateY(-3px); }
.vis-item .visual {
  position: relative;
  height: 260px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}
/* Hover overlay with title — white text on a bottom gradient strip.
   Text padding: 8px L/R, 8px bottom.
   Strip min height 24px, grows with the number of text lines.
   Text is always white in BOTH light and dark mode. */
.vis-item .caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: 36px 8px 8px;
  min-height: 60px;
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 100%);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  pointer-events: none;
}
.vis-item .caption .ttl { color: #ffffff; }
html[data-theme="light"] .vis-item .caption,
html[data-theme="dark"] .vis-item .caption { color: #ffffff; }
.vis-item:hover .caption { opacity: 1; transform: translateY(0); }
.vis-item .visual .viz {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--c1, #ff7ed4), var(--c2, #8a5bff));
}
.vis-item .visual .viz::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(at 22% 28%, rgba(255,255,255,.32), transparent 55%),
    radial-gradient(at 78% 72%, rgba(0,0,0,.18), transparent 55%);
}
.vis-item .visual img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* Zoom variants — scale the image inside the visual, parent clips overflow */
.vis-item .visual.vis-zoom-120 img { transform: scale(1.2); transform-origin: center center; }
.vis-item .visual.vis-zoom-132 img { transform: scale(1.32); transform-origin: center center; }
.vis-item .visual.vis-zoom-160 img { transform: scale(1.6); transform-origin: center center; }
.vis-item .visual.vis-zoom-200 img { transform: scale(2.0); transform-origin: center center; }
/* CTA card sits below the 3 rows — same height as a single visual */
.vis-cta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: 200px;
  padding: 26px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  border: 1px solid color-mix(in srgb, var(--accent-2) 28%, var(--glass-border));
  transition: transform .35s var(--ease), border-color .25s var(--ease);
  margin-top: 18px;
}
html[data-theme="dark"] .vis-cta { background: rgba(255, 255, 255, 0.06); }
.vis-cta:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent-2) 55%, var(--glass-border));
}
.vis-cta h3 {
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.vis-cta h3 em {
  font-family: inherit;
  font-style: normal;
  font-weight: 600;
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.vis-cta .cta-arrow {
  display: inline-block;
  transition: transform .35s var(--ease);
  margin-left: 4px;
}
.vis-cta:hover .cta-arrow { transform: translateX(6px); }
.vis-cta p {
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.5;
  max-width: 520px;
  margin: 0;
}
@media (max-width: 940px) {
  .vis-item .visual { height: 200px; }
}
@media (max-width: 720px) {
  .vis-row { flex-direction: column; gap: 18px; }
  .vis-item .visual { height: 220px; }
  .vis-item { flex: none !important; }
}
.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  transition: transform .5s var(--ease);
  isolation: isolate;
  text-decoration: none;
  color: inherit;
  display: block;
  display: block;
  width: 100%;
  margin: 0 0 18px 0;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
}
.gallery-item:hover { transform: translateY(-3px); }

/* CTA variant for gallery — drops the gradient/image, shows centered text */
.gallery-item.gallery-item--cta {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 26px;
  text-decoration: none;
  color: var(--fg);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 12%, var(--glass-bg)),
    color-mix(in srgb, var(--accent-2) 18%, var(--glass-bg)),
    color-mix(in srgb, var(--accent-3) 12%, var(--glass-bg)));
  background-size: 200% 200%;
  animation: cta-shift 12s linear infinite;
  border: 1px solid color-mix(in srgb, var(--accent-2) 30%, var(--glass-border));
  transition: transform .35s var(--ease), border-color .25s var(--ease);
}
.gallery-item.gallery-item--cta:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent-2) 55%, var(--glass-border));
}
.gallery-item.gallery-item--cta .cta-content { text-align: center; }
.gallery-item.gallery-item--cta h3 {
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.gallery-item.gallery-item--cta h3 em {
  font-family: inherit;
  font-style: normal;
  font-weight: 600;
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gallery-item.gallery-item--cta .cta-arrow {
  display: inline-block;
  transition: transform .35s var(--ease);
  margin-left: 4px;
}
.gallery-item.gallery-item--cta:hover .cta-arrow { transform: translateX(6px); }
.gallery-item.gallery-item--cta p {
  font-size: 13px;
  color: var(--fg-dim);
  line-height: 1.5;
  margin: 0;
}
.gallery-item .visual {
  position: relative;
  aspect-ratio: 1 / 1; /* default; can be overridden by helper class */
  overflow: hidden;
}
/* Variable-height helpers for masonry feel */
.gallery-item.h-tall   .visual { aspect-ratio: 3 / 4; }
.gallery-item.h-xtall  .visual { aspect-ratio: 2 / 3; }
.gallery-item.h-xxtall .visual { aspect-ratio: 9 / 14; }
.gallery-item.h-wide   .visual { aspect-ratio: 4 / 3; }
.gallery-item.h-xwide  .visual { aspect-ratio: 5 / 3; }
.gallery-item.h-sq     .visual { aspect-ratio: 1 / 1; }
.gallery-item .visual img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* Year badge — top-right pill (Moodio-style) */
.gallery-year {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 4;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(0,0,0,.28);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border: 1px solid rgba(255,255,255,.22);
  pointer-events: none;
}
.gallery-item .visual.vis-zoom-120 img { transform: scale(1.2); transform-origin: center center; }
.gallery-item .visual.vis-zoom-132 img { transform: scale(1.32); transform-origin: center center; }
.gallery-item .visual.vis-zoom-160 img { transform: scale(1.6); transform-origin: center center; }
.gallery-item .visual.vis-zoom-200 img { transform: scale(2.0); transform-origin: center center; }
.gallery-item .visual .viz {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--c1, #ff7ed4), var(--c2, #8a5bff));
}
.gallery-item .visual .viz::after {
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(at 22% 28%, rgba(255,255,255,.32), transparent 55%),
    radial-gradient(at 78% 76%, rgba(0,0,0,.20), transparent 55%);
}
/* Caption — hover-only, bottom gradient strip (matches Visual Design design) */
.gallery-item:not(.gallery-item--cta) .caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: 36px 8px 8px;
  min-height: 60px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 100%);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  pointer-events: none;
  color: #ffffff !important;
}
.gallery-item:not(.gallery-item--cta):hover .caption { opacity: 1; transform: translateY(0); }
.gallery-item .ttl {
  font-size: 14px; font-weight: 600; color: #ffffff; letter-spacing: -0.01em;
  line-height: 1.3;
}
.gallery-item .yr {
  font-size: 11px; color: rgba(255,255,255,.85); letter-spacing: 0.04em;
  background: rgba(0,0,0,.25); backdrop-filter: blur(6px);
  padding: 3px 8px; border-radius: 999px;
  flex-shrink: 0;
}
html[data-theme="light"] .gallery-item .caption,
html[data-theme="dark"] .gallery-item .caption { color: #ffffff; }
@media (max-width: 940px) {
  .gallery { column-count: 2; column-gap: 14px; }
  .gallery-item { margin-bottom: 14px; }
}
@media (max-width: 540px) {
  .gallery { column-count: 1; }
}

/* ============ Reveal ============ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }

/* ============ Responsive ============ */
.lbl-short { display: none; }

/* Hamburger button — hidden on desktop, shown on mobile */
.hamburger {
  display: none;
  appearance: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--chip-bg);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  margin-left: 6px;
  padding: 0;
  color: var(--fg);
  transition: all .3s var(--ease);
  flex-shrink: 0;
}
.hamburger:hover {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent-2) 35%, var(--glass-border));
}
.hamburger span {
  display: block;
  width: 16px; height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: transform .3s var(--ease), opacity .25s var(--ease);
}
.hamburger.is-open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0.3); }
.hamburger.is-open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 940px) {
  .about-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  nav .links a { padding: 8px 10px; font-size: 13px; }
}
@media (max-width: 820px) {
  .nav-inner { padding: 4px 16px; gap: 0; }
  nav .links { gap: 0; }
  nav .links a { padding: 7px 8px; font-size: 12px; letter-spacing: -0.01em; }
  nav .theme-toggle { width: 32px; height: 32px; margin-left: 6px; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
}
@media (max-width: 720px) {
  .works { grid-template-columns: 1fr !important; gap: 16px; }

  /* Research papers stay in a single horizontal row on mobile */
  .works.papers-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px;
  }
  .papers-grid .card .body { padding: 14px 12px !important; }
  .papers-grid .card h3 { font-size: 14.5px; line-height: 1.2; margin-bottom: 6px; }
  .papers-grid .card p { font-size: 11.5px; line-height: 1.4; }
  .papers-grid .venue-pill { font-size: 9.5px; padding: 3px 7px; letter-spacing: 0; }
  .papers-grid .venue-award { font-size: 9.5px; padding: 3px 7px; letter-spacing: 0; }

  /* Experience timeline becomes 2-column on mobile */
  .timeline.exp-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 14px;
  }
  .timeline.exp-list .row {
    border-bottom: 0;
    padding: 8px 0;
    gap: 2px;
  }
  .timeline.exp-list .co { font-size: 13px; line-height: 1.25; }
  .timeline.exp-list .yr { font-size: 11.5px; }

  .hero { padding-top: 120px; }
  .marquee { gap: 16px; }

  /* My Design tabs span the full screen width on mobile */
  .tabs {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    top: 56px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn {
    flex: 1 0 auto;
    padding: 9px 12px !important;
    font-size: 12.5px !important;
    text-align: center;
    justify-content: center;
  }

  /* Reveal hamburger; collapse links into glass dropdown */
  .hamburger { display: inline-flex; }

  nav .links {
    position: fixed;
    top: 56px;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 14px 14px;
    border: 1px solid var(--glass-border);
    border-top: 0;
    border-radius: 0 0 18px 18px;
    /* Solid frosted-glass surface — opaque page bg + heavy blur halo + inset highlight */
    background: var(--bg);
    backdrop-filter: saturate(200%) blur(80px);
    -webkit-backdrop-filter: saturate(200%) blur(80px);
    box-shadow:
      0 24px 50px -22px rgba(0,0,0,.22),
      0 1px 0 rgba(255,255,255,.45) inset;
    transform: translateY(-8px);
    transform-origin: top center;
    opacity: 0;
    pointer-events: none;
    transition: transform .3s var(--ease), opacity .25s var(--ease);
    z-index: 49;
  }
  nav .links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  /* Stack each link — unified text color across all entries */
  nav .links a {
    width: 100% !important;
    padding: 12px 14px !important;
    font-size: 15px !important;
    justify-content: flex-start;
    border-radius: 12px;
    flex-direction: row;
    gap: 12px;
    letter-spacing: -0.011em;
    height: auto !important;
    color: var(--fg);
  }
  nav .links a.icon-link {
    background: transparent !important;
    border: 0 !important;
    border-radius: 12px !important;
    margin-left: 0 !important;
    justify-content: flex-start;
  }
  nav .links a.icon-link svg { width: 18px; height: 18px; }
  /* Inline label using data-tip text */
  nav .links a.icon-link::after {
    content: attr(data-tip);
    position: static;
    transform: none;
    opacity: 1;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: inherit;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: -0.011em;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: auto;
    white-space: normal;
    box-shadow: none;
  }

  /* Hide vertical dividers in mobile dropdown */
  nav .links .nav-div { display: none; }

  /* In mobile menu, show the full long labels (not the desktop-narrow short ones) */
  nav .links a .lbl-long { display: inline; }
  nav .links a .lbl-short { display: none; }

  /* Show inline link icons (only visible in mobile menu) */
  nav .links a .link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    flex-shrink: 0;
    color: var(--fg); /* unified neutral default — same as LinkedIn / Email / Mode buttons */
  }
  nav .links a.active .link-icon { color: var(--accent-2); }
  nav .links a:hover .link-icon { color: var(--accent-2); }
  nav .links a .link-icon svg { width: 18px; height: 18px; }

  /* No hover tooltips on touch devices — keep things in place */
  nav .links a.icon-link:hover::after { transform: none; }
  nav .theme-toggle::after { display: none; }
}
@media (max-width: 480px) {
  .nav-inner { padding: 8px 12px; }
}
