/* Layout and visual language inspired by robbietilton.com */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #272727;
  --strong: #000000;
  --muted: #9b9b9b;
  --faint: #c7c7c7;
  --chip: #f0f0f0;
  --line: #d0d0d0;
  --hover: #eeeeee;
  --glass: rgba(255, 255, 255, 0.75);
  --shadow: rgba(0, 0, 0, 0.15);
  --accent: #6dc9fb;
  --card: #f4f4f4;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

[data-theme="night"] {
  color-scheme: dark;
  --bg: #0e0e0e;
  --ink: #e4e4e4;
  --strong: #ffffff;
  --muted: #8a8a8a;
  --faint: #555555;
  --chip: #1e1e1e;
  --line: #2f2f2f;
  --hover: #1c1c1c;
  --glass: rgba(26, 26, 26, 0.72);
  --shadow: rgba(0, 0, 0, 0.55);
  --card: #171717;
}

[data-version="v2"] {
  --bg: #1b17b5;
  --ink: #fbf7ed;
  --strong: #ffffff;
  --muted: #c9c6ff;
  --faint: #8d89ea;
  --chip: #2d29cf;
  --line: #4a46d8;
  --hover: #2824c4;
  --glass: rgba(40, 36, 200, 0.72);
  --shadow: rgba(5, 3, 60, 0.45);
  --accent: #fb9f6d;
  --card: #2622c2;
}

[data-version="v2"][data-theme="night"] {
  --bg: #050509;
  --ink: #f6ff5a;
  --strong: #fbffb0;
  --muted: #afaeb9;
  --faint: #5d5c69;
  --chip: #17171e;
  --line: #26262f;
  --hover: #15151c;
  --glass: rgba(18, 18, 24, 0.72);
  --shadow: rgba(0, 0, 0, 0.6);
  --accent: #fb9f6d;
  --card: #111117;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; transition: background 450ms ease, color 450ms ease; }
::selection { background: var(--accent); color: #000; }
button, a { color: inherit; }
button { font: inherit; }
a { text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }

/* Magnetic hover: elements drift slightly toward the pointer (values set in script.js). */
[data-magnet] { translate: var(--mx, 0px) var(--my, 0px); transition: translate 150ms ease, scale 200ms ease, opacity 200ms ease, color 140ms ease, background-color 140ms ease, box-shadow 140ms ease; will-change: translate; }

/* Page load fade-in */
.js .main-content { opacity: 0; transition: opacity 600ms ease-out; }
.js .main-content.loaded { opacity: 1; }

/* ---------- Top navigation ---------- */
.site-frame { width: 100%; }
.top-nav { position: relative; z-index: 100; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 30px 60px 0; }
.nav-name { font-size: 16px; font-weight: 400; color: var(--ink); }
.nav-name:hover { opacity: .6; scale: 1.06; }
.tab-nav { position: absolute; left: 50%; top: 30px; transform: translateX(-50%); display: flex; gap: 10px; }
.tab-button { appearance: none; border: 0; padding: 10px 16px; border-radius: 12px; background: var(--bg); color: var(--faint); font-size: 16px; font-weight: 700; cursor: pointer; }
.tab-button:hover { box-shadow: 0 6px 16px rgba(0, 0, 0, .08); scale: 1.05; color: var(--muted); }
.tab-button.is-active { background: var(--chip); color: var(--muted); cursor: default; box-shadow: none; scale: 1; translate: 0 0; }
.nav-right { display: flex; align-items: center; gap: 22px; }
.nav-cta { display: flex; align-items: center; gap: 6px; padding: 10px 0; border: 0; background: transparent; color: var(--ink); font-size: 16px; font-weight: 500; cursor: pointer; }
.nav-cta:hover { scale: 1.1; opacity: .6; }
.nav-cta-icon { font-size: 18px; font-weight: 400; line-height: 1; transition: rotate 300ms var(--ease-out); }
.version-switch:hover .nav-cta-icon { rotate: 90deg; }
[data-version="v2"] .nav-cta-icon { rotate: 45deg; }
.theme-icon { font-size: 15px; color: var(--muted); }
.theme-track { width: 32px; height: 18px; padding: 2px; border-radius: 20px; background: var(--chip); }
.theme-track span { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); transition: transform 240ms var(--ease-out); }
[data-theme="night"] .theme-track span { transform: translateX(14px); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: clamp(40px, 8vw, 120px); align-items: center; width: min(100% - 60px, 1080px); margin: 0 auto; padding: 150px 0 110px; }
.eyebrow { margin: 0 0 18px; color: var(--faint); font-size: 16px; font-weight: 700; }
h1 { margin-bottom: 24px; color: var(--ink); font-size: clamp(42px, 6vw, 80px); font-weight: 400; line-height: 1.05; letter-spacing: -.02em; }
.hero-lede { max-width: 600px; margin: 0; font-size: 18px; line-height: 30px; color: var(--ink); }
.interest-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 36px; font-size: 13px; }
.interest-line > span { color: var(--muted); font-weight: 700; }
.interest-line ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.interest-line li { padding: 2px 8px; border-radius: 6px; background: var(--chip); color: var(--muted); font-size: 11px; font-weight: 600; line-height: 18px; }
.interest-line li:has(a) { padding: 0; }
.interest-line li a { display: block; padding: 2px 8px; border-radius: 6px; color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 2px; transition: background-color 140ms ease, color 140ms ease; }
.interest-line li a:hover { background: var(--accent); color: #000; text-decoration-color: transparent; }
[data-version="v2"] h1 { font-style: italic; }

/* ---------- Profile card (tilt, glare and depth driven by script.js) ---------- */
.portrait-block { width: 100%; margin: 0; justify-self: end; perspective: 1200px; }
.js .portrait-block { animation: profile-focus 1100ms var(--ease-out) 200ms both; }
.profile-card {
  --rx: 0deg; --ry: 0deg; --lift: 0;
  --gx: 50%; --gy: 50%;
  --ix: 0px; --iy: 0px;
  --sx: 0px; --sy: 0px;
  position: relative; aspect-ratio: 4 / 5; border-radius: 30px; outline: none;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) scale(calc(1 + var(--lift) * .025));
  transform-style: preserve-3d; will-change: transform;
  -webkit-tap-highlight-color: transparent;
}
.profile-card-surface {
  position: absolute; inset: 0; overflow: hidden; border-radius: inherit; border: .5px solid var(--line); background: var(--card);
  box-shadow: var(--sx) calc(14px + var(--sy)) calc(30px + var(--lift) * 26px) rgba(0, 0, 0, calc(.06 + var(--lift) * .1));
  -webkit-transform: translateZ(0);
}
[data-theme="night"] .profile-card-surface { box-shadow: var(--sx) calc(14px + var(--sy)) calc(30px + var(--lift) * 26px) var(--shadow); }
.profile-image { position: absolute; inset: -5%; transform: translate3d(var(--ix), var(--iy), 0) scale(calc(1 + var(--lift) * .04)); will-change: transform; }
.profile-image img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 30%; user-select: none; pointer-events: none; }
.profile-glare { position: absolute; inset: 0; pointer-events: none; opacity: calc(var(--lift) * .9); background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 255, 255, .55), rgba(255, 255, 255, .12) 30%, transparent 60%); mix-blend-mode: soft-light; }
.profile-caption {
  position: absolute; left: 18px; bottom: 18px; display: grid; gap: 4px; padding: 10px 18px; border-radius: 20px;
  background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--strong); font-size: 16px; line-height: 20px;
  transform: translate3d(calc(var(--ix) * -.6), calc(var(--iy) * -.6), 40px) scale(calc(1 + var(--lift) * .04));
  filter: drop-shadow(0 calc(var(--lift) * 10px) calc(var(--lift) * 20px) rgba(0, 0, 0, calc(var(--lift) * .15)));
}
.profile-caption .title, .project-overlay .title { font-weight: 700; opacity: .92; }
.profile-caption .meta, .project-overlay .meta { display: flex; align-items: center; gap: 8px; }
.profile-caption .year, .project-overlay .year { color: var(--muted); font-weight: 700; }
.pill { padding: 0 7px; border-radius: 6px; background: var(--chip); color: var(--muted); font-size: 11px; font-weight: 600; }
.profile-caption .pill { background: var(--accent); color: #000; }
.profile-card:focus-visible .profile-card-surface { outline: 2px solid var(--accent); outline-offset: 6px; }
.portrait-note { margin: 18px 0 0; color: var(--faint); font-size: 11px; font-weight: 700; text-align: center; }
.portrait-note code { font: inherit; }
@keyframes profile-focus {
  from { opacity: 0; filter: blur(10px); transform: translateY(18px) scale(.97); }
  to { opacity: 1; filter: blur(0); transform: none; }
}

/* ---------- Sections ---------- */
.section-block { width: min(100% - 60px, 1000px); margin: 0 auto; padding: 60px 0 100px; }
.section-kicker { margin: 0 0 10px; color: var(--faint); font-size: 13px; font-weight: 700; }
h2 { margin-bottom: 0; color: var(--ink); font-size: 32px; font-weight: 400; line-height: 1.2; }
[data-version="v1"] .v2-only, [data-version="v2"] .v1-only { display: none; }

/* Moments carousel (v2): wide cards fill the section; blurred neighbours peek at the edges */
.snapshot-carousel { --snap-w: 100cqw; min-width: 0; margin-top: 30px; container-type: inline-size; outline: none; }
.snapshot-carousel:focus-visible .snapshot-card.is-active .snapshot-placeholder { outline: 2px solid var(--accent); outline-offset: 6px; }
.snapshot-stage { position: relative; width: 100vw; height: calc(var(--snap-w) * .5625 + 44px); margin-left: calc(50% - 50vw); overflow: hidden; }
.snapshot-card { position: absolute; top: 0; left: 50%; width: var(--snap-w); margin: 0; opacity: 0; pointer-events: none; transform: translateX(-50%) scale(.9); filter: blur(6px); transition: transform 700ms var(--ease-out), opacity 500ms ease, filter 500ms ease; will-change: transform, opacity, filter; }
.snapshot-card.is-active { z-index: 3; opacity: 1; pointer-events: auto; transform: translateX(-50%) scale(1); filter: blur(0); }
.snapshot-card.is-prev, .snapshot-card.is-next { opacity: .2; pointer-events: auto; cursor: pointer; }
.snapshot-card.is-prev { z-index: 1; transform: translateX(calc(-150% - 24px)) scale(.92); }
.snapshot-card.is-next { z-index: 2; transform: translateX(calc(50% + 24px)) scale(.92); }
.snapshot-card.is-prev:hover, .snapshot-card.is-next:hover { opacity: .4; filter: blur(3px); }
.snapshot-placeholder { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border: .5px solid var(--line); border-radius: 30px; background: var(--card); }
.snapshot-placeholder img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.snapshot-placeholder::before { content: ""; position: absolute; inset: 0; opacity: .5; background: radial-gradient(circle at 30% 30%, var(--chip) 0 22%, transparent 22.5%), radial-gradient(circle at 70% 75%, var(--hover) 0 30%, transparent 30.5%); }
.snapshot-two::before { transform: scaleX(-1); }
.snapshot-three::before { transform: scaleY(-1); }
.snapshot-four::before { transform: scale(-1); }
.snapshot-placeholder span { position: relative; z-index: 1; padding: 0 7px; border-radius: 6px; background: var(--chip); color: var(--muted); font-size: 11px; font-weight: 600; line-height: 18px; }
.snapshot-placeholder strong { position: absolute; z-index: 1; right: 26px; bottom: 18px; color: var(--faint); font-size: 32px; font-weight: 400; }
.snapshot-card p { margin: 14px 0 0; color: var(--muted); font-size: 14px; font-weight: 700; text-align: center; }

/* Education, publications, teaching: list rows that lift into a soft pill on hover */
.section-block + .section-block { padding-top: 20px; }
.section-heading-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 30px; }
.section-heading-row > p { max-width: 280px; margin: 0; color: var(--faint); font-size: 13px; font-weight: 700; line-height: 1.5; text-align: right; }
.entry-list { margin: 0; padding: 0; list-style: none; }
.entry-list a { display: block; padding: 14px 0; border-radius: 18px; background-color: transparent; color: var(--muted); transition: background-color .5s ease, scale .5s ease, color .5s ease, translate .15s ease; }
.entry-content { display: grid; grid-template-columns: 1fr auto; gap: 2px 20px; margin: 0; transition: margin .5s ease; }
.entry-title { grid-column: 1; grid-row: 1; font-size: 18px; line-height: 28px; }
.entry-year { grid-column: 2; grid-row: 1; color: var(--faint); font-size: 18px; line-height: 28px; transition: color .5s ease; }
.entry-meta { grid-column: 1 / -1; color: var(--faint); font-size: 14px; transition: color .5s ease; }
.entry-list a:hover { background-color: var(--hover); color: var(--strong); scale: 1.04; transition: background-color .15s ease, scale .15s ease, color .15s ease, translate .15s ease; }
.entry-list a:hover .entry-content { margin: 0 18px; transition: margin .15s ease; }
.entry-list a:hover .entry-year { color: var(--muted); transition: color .15s ease; }
.entry-list a:hover .entry-meta { color: var(--accent); transition: color .15s ease; }

/* ---------- Projects ---------- */
.lab-intro { width: min(100% - 60px, 1000px); margin: 0 auto; padding: 150px 0 0; }
.lab-intro h1 { margin-bottom: 18px; }
.lab-intro > p:last-child { max-width: 600px; margin: 0; color: var(--muted); font-size: 18px; line-height: 30px; }
.project-carousel { --card-w: min(900px, 100vw - 160px); position: relative; margin: 100px 0; overflow-x: clip; }
.project-track { display: flex; align-items: center; gap: 40px; padding-left: calc((100% - var(--card-w)) / 2); }
.project-card { position: relative; flex: 0 0 var(--card-w); }
.project-visual { display: block; aspect-ratio: 16 / 10; overflow: hidden; border: .5px solid var(--line); border-radius: 30px; background: var(--card); -webkit-transform: translateZ(0); outline: none; }
.project-visual:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.project-image-layer { position: absolute; inset: 0; display: block; }
.project-image-layer img { width: 100%; height: 100%; display: block; object-fit: cover; user-select: none; pointer-events: none; }
[data-theme="night"] .project-image-layer img, [data-version="v2"] .project-image-layer img { filter: saturate(.6) brightness(.85); }

.project-overlay {
  position: absolute; z-index: 3; left: 40px; top: 50%; width: max-content; max-width: 300px;
  padding: 10px 18px; border-radius: 20px; color: var(--strong); font-size: 16px; line-height: 20px;
  background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transform: translateY(-50%);
  transition: transform 200ms ease, filter 200ms ease, padding 180ms ease, width 300ms var(--ease-out);
}
.project-overlay:hover, .project-overlay.is-open { transform: translateY(-50%) scale(1.05); filter: drop-shadow(0 10px 20px var(--shadow)); }
.project-overlay.is-open { width: 300px; padding: 22px 18px; border-radius: 24px; }
.project-overlay-toggle { display: grid; gap: 4px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font-size: inherit; line-height: inherit; text-align: left; cursor: pointer; }
.overlay-desc { display: grid; grid-template-rows: 0fr; opacity: 0; transform: translateY(6px); transition: grid-template-rows 500ms cubic-bezier(.2, .6, .2, 1), opacity 240ms ease, transform 240ms ease; }
.overlay-desc > div { min-height: 0; overflow: hidden; }
.project-overlay.is-open .overlay-desc { grid-template-rows: 1fr; opacity: 1; transform: none; transition: grid-template-rows 500ms cubic-bezier(.2, .6, .2, 1), opacity 1000ms var(--ease-out) 100ms, transform 420ms var(--ease-out) 100ms; }
.overlay-desc p { margin: 28px 0 16px; color: var(--ink); font-size: 14px; line-height: 21px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.project-tags li { padding: 0 7px; border-radius: 6px; background: var(--chip); color: var(--muted); font-size: 11px; font-weight: 600; line-height: 18px; }
.project-links { display: flex; flex-wrap: wrap; gap: 8px; }
.launch-link { display: inline-flex; gap: 8px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; font-weight: 500; line-height: 30px; }
.launch-link:hover { background: var(--hover); border-color: transparent; scale: 1.05; }

/* Tool buttons under the carousel: left-aligned with the "Projects." heading, no border until hover. */
.lab-tools { display: flex; flex-wrap: wrap; gap: 8px; width: min(100% - 60px, 1000px); margin: -40px auto 100px; }
.lab-tools .launch-link { margin-left: -16px; border-color: transparent; color: var(--muted); font-weight: 700; }
.lab-tools .launch-link:hover { background: var(--hover); color: var(--ink); }

.coming-next { opacity: .2; filter: blur(6px); }
.coming-next-surface { display: grid; align-content: center; gap: 8px; aspect-ratio: 16 / 10; padding: 40px; border: .5px solid var(--line); border-radius: 30px; background: var(--card); }
.coming-next span { color: var(--faint); font-size: 32px; }
.coming-next p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 700; }
.coming-next strong { color: var(--ink); font-size: 24px; font-weight: 400; }

/* ---------- Pending page (v2 "Know about me"): frosted glass card on the page background ---------- */
.pending { display: grid; place-items: center; width: min(100% - 60px, 1200px); min-height: max(520px, calc(100vh - 260px)); margin: 110px auto 100px; }
.pending-glass {
  display: grid; justify-items: center; gap: 4px; width: min(100%, 640px); padding: 48px 40px 44px; border-radius: 30px; text-align: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .06));
  backdrop-filter: blur(28px) saturate(150%); -webkit-backdrop-filter: blur(28px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 30px 60px var(--shadow);
}
.pending-glass h1 { margin: 10px 0 12px; color: var(--strong); font-size: clamp(42px, 6vw, 72px); }
.pending-glass p:last-child { max-width: 360px; margin: 0; color: var(--ink); font-size: 16px; line-height: 24px; opacity: .85; }
.pending-status { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 2px 10px; border-radius: 8px; background: rgba(255, 255, 255, .16); color: var(--strong); font-size: 11px; font-weight: 700; line-height: 20px; }
.pending-status span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pending-pulse 1.8s ease-in-out infinite; }
@keyframes pending-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }

/* ---------- Footer ---------- */
.site-footer { width: calc(100% - 90px); margin: 0 auto; padding: 22px 0 26px; font-size: 11px; }
.footer-inner { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; }
.footer-left, .footer-right { display: flex; align-items: center; gap: 4px; }
.footer-left { justify-self: start; }
.footer-right { justify-self: end; }
.footer-label, .footer-center { color: var(--faint); font-weight: 700; }
.footer-center { margin: 0; justify-self: center; text-align: center; }
.footer-links { display: flex; align-items: center; }
.footer-link { display: inline-block; padding: 0 5px; color: var(--muted); font-weight: 700; }
.footer-link:hover { color: var(--strong); }
.footer-credit { margin: 14px 0 0; color: var(--faint); font-size: 10px; text-align: center; }
.footer-credit a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; transition: color 140ms ease; }
.footer-credit a:hover { color: var(--strong); }

/* ---------- Custom cursor (fine pointers only, enabled in script.js) ---------- */
.custom-cursor {
  position: fixed; z-index: 10001; top: 0; left: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 1); background: rgba(255, 255, 255, .7);
  box-shadow: 0 3px 6px 3px rgba(9, 9, 2, .1); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  pointer-events: none; opacity: 0; display: none;
  transition: width 150ms ease, height 150ms ease, margin 150ms ease, opacity 150ms ease, background 150ms ease;
  will-change: transform;
}
[data-theme="night"] .custom-cursor, [data-version="v2"] .custom-cursor { border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .22); }
.has-cursor .custom-cursor { display: block; }
.custom-cursor.is-visible { opacity: 1; }
.custom-cursor.is-hover { width: 56px; height: 56px; margin: -28px 0 0 -28px; background: rgba(255, 255, 255, .35); }
.custom-cursor.is-pressing { width: 34px; height: 34px; margin: -17px 0 0 -17px; }
.has-cursor, .has-cursor * { cursor: none !important; }

/* ---------- Version switch transition ---------- */
.version-wipe { position: fixed; z-index: 50; inset: 0; pointer-events: none; background: var(--accent); transform: translateY(-101%); }
.version-wipe.is-running { animation: version-wipe 850ms cubic-bezier(.76, 0, .24, 1); }
.version-toast { position: fixed; z-index: 45; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 10px 18px; border-radius: 20px; background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--strong); opacity: 0; font-size: 13px; font-weight: 700; box-shadow: 0 10px 20px var(--shadow); pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.version-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@keyframes version-wipe { 0% { transform: translateY(-101%); } 45%, 55% { transform: translateY(0); } 100% { transform: translateY(101%); } }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .top-nav { padding: 20px; }
  .tab-nav { top: 20px; }
  .hero { grid-template-columns: 1fr; gap: 60px; width: calc(100% - 40px); padding: 110px 0 80px; }
  .portrait-block { justify-self: center; max-width: 360px; }
  .section-block, .lab-intro, .lab-tools { width: calc(100% - 40px); }
  .project-carousel { --card-w: calc(100vw - 52px); margin: 60px 0 80px; }
  .project-track { gap: 20px; }
  .project-overlay, .project-overlay:hover, .project-overlay.is-open { position: static; width: auto; max-width: none; margin: 14px auto 0; transform: none; text-align: center; }
  .project-overlay { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .project-overlay.is-open { background: var(--chip); }
  .project-overlay-toggle { text-align: center; justify-items: center; }
  .coming-next { opacity: .1; filter: none; }
  .site-footer { width: auto; padding: 15px 14px 20px; margin-top: 20px; }
  .footer-inner { display: flex; flex-direction: column; gap: 10px; }
  .footer-label { display: none; }
  .footer-links { gap: 18px; }
}

@media (max-width: 640px) {
  .top-nav { flex-wrap: wrap; padding: 16px; }
  .tab-nav { position: static; order: 3; width: 100%; justify-content: center; transform: none; }
  .nav-right { gap: 14px; }
  .nav-cta { font-size: 14px; }
  .corner-label { display: none; }
  .theme-icon { display: none; }
  .hero { width: calc(100% - 32px); padding-top: 70px; }
  .section-block, .lab-intro, .lab-tools { width: calc(100% - 32px); }
  .lab-intro { padding-top: 70px; }
  .pending { width: calc(100% - 32px); margin-top: 60px; min-height: 480px; }
  .pending-glass { padding: 36px 24px; border-radius: 24px; }
  .project-carousel { --card-w: calc(100vw - 48px); }
  .project-visual, .coming-next-surface { aspect-ratio: 1; border-radius: 24px; }
  .section-heading-row { flex-direction: column; align-items: flex-start; }
  .section-heading-row > p { text-align: left; }
  .snapshot-stage { height: calc(var(--snap-w) * .75 + 44px); }
  .snapshot-carousel { --snap-w: 92cqw; }
  .snapshot-placeholder { aspect-ratio: 4 / 3; border-radius: 24px; }
  .snapshot-card.is-prev { transform: translateX(calc(-150% - 12px)) scale(.92); }
  .snapshot-card.is-next { transform: translateX(calc(50% + 12px)) scale(.92); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
