/* ============================================================
   baakhoff.com: one stylesheet for every page.
   No framework, no build step. The WebGL particle field lives in
   assets/js/scene.js; everything here sits on top of it.

   Sections
     1. Fonts + tokens      6. Work + research     11. CV page
     2. Base                7. About               12. 404 page
     3. Scene layers        8. Services            13. Cookie banner
     4. Nav + menu          9. Contact + footer    14. Responsive
     5. Hero + shared UI   10. Article pages       15. Motion, low-fx, print
   ============================================================ */

/* ── 1. Fonts + tokens ─────────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/SpaceGrotesk-var.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono-var.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #05060a;
  --glass: rgba(12, 15, 24, 0.56);
  --glass-strong: rgba(9, 11, 18, 0.84);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);
  --text: #eef1f6;
  --text-2: #a9b2c3;
  --text-3: #7f899b;
  --blue: #3b9dff;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --green: #34d399;
  --grad: linear-gradient(100deg, #6cb8ff 0%, #22d3ee 45%, #a78bfa 100%);
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-lg: 22px;
  --r-md: 14px;
  --wrap: 1240px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── 2. Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 6rem;
  background: var(--bg);
  color-scheme: dark;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video, canvas, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
p, figure, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong { font-weight: 600; }

::selection { background: rgba(59, 157, 255, 0.45); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.i { width: 1em; height: 1em; flex-shrink: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 200;
  padding: .7rem 1.1rem; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 600;
  transition: top .2s;
}
.skip:focus { top: 1rem; }

.wrap {
  position: relative;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

main, .footer { position: relative; z-index: 2; }

/* ── 3. Scene layers ───────────────────────────────────────── */
.scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.scene.is-ready { opacity: 1; }
.no-webgl .scene { display: none; }

/* Soft colour wash + vignette over the particles (and the fallback when WebGL is off) */
.atmos {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(1100px 700px at 85% -15%, rgba(59, 157, 255, 0.10), transparent 60%),
    radial-gradient(900px 620px at -10% 110%, rgba(167, 139, 250, 0.08), transparent 60%),
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  height: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--grad);
  pointer-events: none;
}

/* ── 4. Nav + menu ─────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  z-index: 60;
  width: min(calc(100% - 2rem), 1120px);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .5rem .5rem .5rem 1.25rem;
  border-radius: 999px;
  background: rgba(9, 11, 18, 0.5);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  transform: translateX(-50%);
  transition: transform .5s var(--ease), background-color .3s, border-color .3s;
}
.nav.is-scrolled { background: rgba(7, 9, 15, 0.78); border-color: var(--line-2); }
.nav.is-hidden { transform: translate(-50%, calc(-100% - 1.5rem)); }

.logo {
  font: 600 .8rem/1 var(--font-mono);
  letter-spacing: .22em;
  color: var(--text);
  margin-right: auto;
  padding: .5rem 0;
}
.logo b { color: var(--cyan); font-weight: 600; }

.nav-links { display: flex; gap: .15rem; }
.nav-links a {
  position: relative;
  padding: .55rem .9rem;
  border-radius: 999px;
  font-size: .88rem;
  color: var(--text-2);
  transition: color .2s, background-color .2s;
}
@media (hover: hover) {
  .nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
}
.nav-links a.is-active { color: var(--text); background: rgba(255, 255, 255, 0.08); }

.menu-btn {
  display: none;
  width: 2.75rem; height: 2.75rem;
  border-radius: 50%;
  align-items: center; justify-content: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}
.menu-btn .i { width: 1.25rem; height: 1.25rem; }

.menu {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding: 6rem var(--pad) 3rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(5, 6, 10, 0.94);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s;
}
/* visibility flips instantly on open (so focus can move in), fades out on close */
.menu.is-open { opacity: 1; visibility: visible; transition: opacity .35s ease, visibility 0s; }
/* Auto margins centre the menu when it fits, and let it scroll from the top when it doesn't */
.menu > :first-child { margin-top: auto; }
.menu > :last-child { margin-bottom: auto; }
.menu-links { display: grid; gap: .35rem; }
.menu-links a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font: 600 clamp(2.1rem, 10vw, 3.2rem)/1.1 var(--font-display);
  letter-spacing: -.04em;
  translate: 0 18px;
  opacity: 0;
  transition: translate .6s var(--ease), opacity .6s var(--ease), color .2s;
}
.menu-links a span { font: 500 .75rem var(--font-mono); letter-spacing: .16em; color: var(--text-3); }
.menu.is-open .menu-links a { translate: 0 0; opacity: 1; }
.menu.is-open .menu-links a:nth-child(2) { transition-delay: .04s; }
.menu.is-open .menu-links a:nth-child(3) { transition-delay: .08s; }
.menu.is-open .menu-links a:nth-child(4) { transition-delay: .12s; }
.menu.is-open .menu-links a:nth-child(5) { transition-delay: .16s; }
.menu.is-open .menu-links a:nth-child(6) { transition-delay: .20s; }
.menu-foot { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ── 5. Hero + shared UI ───────────────────────────────────── */
.btn {
  --tx: 0px; --ty: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  height: 3.1rem;
  padding: 0 1.55rem;
  border-radius: 999px;
  font: 500 .95rem/1 var(--font-sans);
  white-space: nowrap;
  transform: translate(var(--tx), var(--ty));
  transition: transform .5s var(--ease), background-color .25s, border-color .25s, color .25s, box-shadow .3s;
}
.btn .i { width: 1.05em; height: 1.05em; transition: transform .4s var(--ease); }
@media (hover: hover) {
  .btn:hover .i { transform: translateX(3px); }
}
.btn-primary {
  color: #03050a;
  font-weight: 600;
  background: linear-gradient(100deg, #86c5ff 0%, #22d3ee 55%, #b9a2ff 100%);
  box-shadow: 0 12px 40px -12px rgba(34, 211, 238, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
@media (hover: hover) {
  .btn-primary:hover { box-shadow: 0 18px 56px -10px rgba(34, 211, 238, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
}
.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
@media (hover: hover) {
  .btn-ghost:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.3); }
}
.btn-sm { height: 2.5rem; padding: 0 1.1rem; font-size: .86rem; }

/* A soft dark halo keeps body text legible where particles pass behind it */
.hero-lead, .lead, .prose p, .availability, .expect li, .article-head, .cv-contact, .nf p {
  text-shadow: 0 0 18px rgba(5, 6, 10, 0.95), 0 0 5px rgba(5, 6, 10, 0.8);
}

.grad {
  background: var(--grad);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--green);
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
}

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 7.5rem 0 5rem;
}
.hero-copy { max-width: 58rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(9, 11, 18, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font: 500 .72rem/1 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-2);
}

.hero-title {
  margin-top: 1.6rem;
  font-size: clamp(3.6rem, 11vw, 9.5rem);
  line-height: .94;
  letter-spacing: -.055em;
}
.hero-title .line { display: block; overflow: hidden; padding: 0 .02em .08em 0; }
.hero-title .line > span {
  display: inline-block;
  translate: 0 110%;
  animation: lineUp 1.25s var(--ease) forwards;
}
.hero-title .line:nth-child(2) > span { animation-delay: .14s; }
.hero-title .grad { animation: shimmer 9s linear infinite; }
@keyframes lineUp { to { translate: 0 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }

.rise { opacity: 0; translate: 0 24px; animation: rise 1.1s var(--ease) forwards; }
.d1 { animation-delay: .1s; }
.d2 { animation-delay: .45s; }
.d3 { animation-delay: .6s; }
.d4 { animation-delay: .75s; }
.d5 { animation-delay: .9s; }
.d6 { animation-delay: 1.3s; }
@keyframes rise { to { opacity: 1; translate: 0 0; } }

.hero-lead {
  max-width: 36rem;
  margin-top: 1.8rem;
  font-size: clamp(1.05rem, 1.55vw, 1.22rem);
  color: var(--text-2);
}
.hero-lead strong { color: var(--text); font-weight: 500; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.4rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  max-width: 36rem;
  margin-top: 3.4rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--line);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1.1rem 1.2rem;
  background: rgba(8, 10, 16, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.stat-num { font: 600 2.2rem/1 var(--font-display); letter-spacing: -.04em; }
.stat-num em { font-style: normal; color: var(--cyan); }
.stat-label {
  font: 500 .66rem/1.35 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.hero-hint {
  position: absolute;
  right: var(--pad);
  bottom: 2.2rem;
  font: 500 .68rem/1 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.hero-hint b { color: var(--text-2); font-weight: 500; }
.touch .hero-hint .mouse-only, .hero-hint .touch-only { display: none; }
.touch .hero-hint .touch-only { display: inline; }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  width: 45px;
  height: 3.2rem;
  overflow: hidden;
  background: linear-gradient(var(--line-2), var(--line-2)) 50% 0 / 1px 100% no-repeat;
  translate: -50% 0;
}
.scroll-cue::after {
  content: "";
  position: absolute;
  left: 22px; top: -40%;
  width: 1px; height: 40%;
  background: linear-gradient(transparent, var(--cyan));
  animation: drip 2.2s var(--ease) infinite;
}
@keyframes drip { to { top: 110%; } }

.section { position: relative; padding: clamp(5.5rem, 12vw, 10rem) 0; }
.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head.is-right { margin-left: auto; max-width: 44rem; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  font: 500 .74rem/1 var(--font-mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cyan);
}
.kicker .k-n { color: var(--text-3); }
.kicker::after {
  content: "";
  width: 2.6rem;
  height: 1px;
  background: linear-gradient(90deg, currentColor, transparent);
}

.title {
  max-width: 17ch;
  margin-top: 1.1rem;
  font-size: clamp(2.3rem, 5.4vw, 4.4rem);
  line-height: 1;
  letter-spacing: -.045em;
}
.lead {
  max-width: 40rem;
  margin-top: 1.3rem;
  font-size: clamp(1rem, 1.3vw, 1.14rem);
  color: var(--text-2);
}

.card {
  --mx: 50%; --my: 0%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--glass);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  transition: border-color .35s, background-color .35s, transform .6s var(--ease);
}
/* Spotlight that follows the cursor (position comes from site.js) */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(480px circle at var(--mx) var(--my), rgba(59, 157, 255, 0.13), transparent 45%);
  opacity: 0;
  transition: opacity .4s;
}
/* Border that lights up under the cursor */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(34, 211, 238, 0.8), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
@media (hover: hover) {
  .card:hover { border-color: var(--line-2); }
  .card:hover::before, .card:hover::after { opacity: 1; }
}

.tilt { transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.magnetic { transform: translate(var(--tx, 0px), var(--ty, 0px)); }
.js .tilt.is-tilting { transition: opacity 1s var(--ease), translate 1s var(--ease), filter 1s var(--ease), border-color .35s, background-color .35s, transform .12s linear; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tags li {
  padding: .45rem .62rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  font: 500 .66rem/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* Reveal-on-scroll: only hidden when JS is running (head.js adds .js) */
.js [data-reveal] {
  opacity: 0;
  translate: 0 30px;
  filter: blur(6px);
  transition: opacity 1s var(--ease), translate 1s var(--ease), filter 1s var(--ease),
    border-color .35s, background-color .35s, transform .6s var(--ease);
}
.js [data-reveal].is-in { opacity: 1; translate: 0 0; filter: none; }
.js [data-reveal].r2 { transition-delay: .08s, .08s, .08s, 0s, 0s, 0s; }
.js [data-reveal].r3 { transition-delay: .16s, .16s, .16s, 0s, 0s, 0s; }
.js [data-reveal].r4 { transition-delay: .24s, .24s, .24s, 0s, 0s, 0s; }
/* Never leave a keyboard-focused control invisible while its block waits to be revealed */
.js [data-reveal]:focus-within { opacity: 1; translate: none; filter: none; }

/* "Now" strip */
.now-strip { position: relative; padding: 0 0 2rem; }
.now {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem 2.4rem;
  max-width: 62rem;
  padding: 1.6rem 1.9rem;
}
.now-label { font: 500 .72rem/1 var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); }
.now-date { display: block; margin-top: .55rem; font: .7rem var(--font-mono); letter-spacing: .06em; color: var(--text-3); }
.now-main { color: var(--text); font-size: 1.02rem; }
.now-side { margin-top: .6rem; color: var(--text-2); font-size: .94rem; }
.now a, .availability a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: rgba(34, 211, 238, 0.35);
  text-underline-offset: 3px;
}

/* ── 6. Work + research ────────────────────────────────────── */
.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.project { display: flex; flex-direction: column; gap: 1rem; padding: 1.9rem; min-height: 21rem; }
.project-top { display: flex; align-items: center; justify-content: space-between; }
.project h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); letter-spacing: -.04em; }
.project p { color: var(--text-2); font-size: .98rem; }
.project p strong { color: var(--text); font-weight: 500; }
.project-arrow { width: 1.4rem; height: 1.4rem; color: var(--text-3); transition: transform .45s var(--ease), color .3s; }
@media (hover: hover) {
  .project:hover .project-arrow { color: var(--cyan); transform: translate(3px, -3px); }
}
.project-url {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font: .78rem var(--font-mono);
  color: var(--text-3);
}
.project-url .i { width: .95rem; height: .95rem; }
.project.is-private { cursor: default; }

.status {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .7rem;
  border-radius: 999px;
  border: 1px solid;
  font: 600 .66rem/1 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.status-live { color: var(--green); border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.08); }
.status-public { color: var(--cyan); border-color: rgba(34, 211, 238, 0.3); background: rgba(34, 211, 238, 0.08); }
.status-oss { color: var(--violet); border-color: rgba(167, 139, 250, 0.3); background: rgba(167, 139, 250, 0.08); }
.status-private { color: var(--text-3); border-color: var(--line-2); background: rgba(255, 255, 255, 0.03); }
.status-private::before { box-shadow: none; }


.research { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.rcard { display: flex; flex-direction: column; }
.rcard-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); background: #0b0d14; }
.rcard-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.85) brightness(.82);
  transition: transform 1s var(--ease), filter .5s;
}
@media (hover: hover) {
  .rcard:hover .rcard-media img { transform: scale(1.05); filter: saturate(1.05) brightness(1); }
}
.rcard-play {
  position: absolute;
  left: 1rem; bottom: 1rem;
  display: grid;
  place-items: center;
  width: 3rem; height: 3rem;
  border-radius: 50%;
  color: #03050a;
  background: linear-gradient(120deg, #86c5ff, #22d3ee);
  box-shadow: 0 10px 30px -8px rgba(34, 211, 238, 0.7);
  transition: transform .45s var(--ease);
}
.rcard-play .i { width: 1.1rem; height: 1.1rem; margin-left: .15rem; }
@media (hover: hover) {
  .rcard:hover .rcard-play { transform: scale(1.1); }
}
.rcard-body { display: flex; flex-direction: column; gap: .75rem; flex: 1; padding: 1.5rem 1.6rem 1.7rem; }
.rcard h3 { font-size: 1.4rem; line-height: 1.18; letter-spacing: -.03em; }
.rcard h3 span { color: var(--text-3); }
.rcard p { color: var(--text-2); font-size: .94rem; }
.rcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: auto; padding-top: .6rem; }
.more {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font: 500 .76rem var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cyan);
  white-space: nowrap;
}
.more .i { transition: transform .4s var(--ease); }
@media (hover: hover) {
  .rcard:hover .more .i { transform: translateX(4px); }
}

/* ── 7. About ──────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}
.prose p { margin-top: 1.1rem; color: var(--text-2); font-size: 1.05rem; }
.prose p:first-child { margin-top: 1.4rem; }
.prose strong { color: var(--text); font-weight: 500; }
.facts { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.8rem; }
.facts li {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  font-size: .86rem;
  color: var(--text-2);
}
.facts .i { color: var(--cyan); }

.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  max-width: 440px;
  width: 100%;
  justify-self: end;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.9), 0 0 80px -30px rgba(59, 157, 255, 0.45);
}
.portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(.35) contrast(1.06) brightness(.92);
  transition: filter .7s, transform 1.2s var(--ease);
}
.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, rgba(59, 157, 255, 0.35), transparent 40%, transparent 60%, rgba(167, 139, 250, 0.35));
  mix-blend-mode: soft-light;
  transition: opacity .7s;
  pointer-events: none;
}
@media (hover: hover) {
  .portrait:hover img { filter: none; transform: scale(1.03); }
  .portrait:hover::after { opacity: .3; }
}
.portrait figcaption {
  position: absolute;
  left: 1rem; bottom: 1rem;
  z-index: 1;
  padding: .5rem .8rem;
  border-radius: 999px;
  background: rgba(5, 6, 10, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font: 500 .68rem/1 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #fff;
}

.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: clamp(3.5rem, 7vw, 6rem); }
.principle { padding: 1.7rem; }
.num { font: 500 .72rem/1 var(--font-mono); letter-spacing: .18em; color: var(--cyan); }
.principle h3 { margin: 1rem 0 .55rem; font-size: 1.3rem; letter-spacing: -.03em; }
.principle p { color: var(--text-2); font-size: .95rem; }

.exp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  margin-top: clamp(3.5rem, 7vw, 6rem);
  align-items: start;
}
.sub {
  margin-bottom: 1.6rem;
  font: 500 .74rem/1 var(--font-mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-3);
}

.timeline { position: relative; margin-left: .3rem; border-left: 1px solid var(--line-2); }
.tl-item { position: relative; padding: 0 0 1.7rem 1.7rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -5px; top: .4rem;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--blue);
}
.tl-item.is-current::before { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 0 5px rgba(34, 211, 238, 0.15), 0 0 16px rgba(34, 211, 238, 0.8); }
.tl-date { font: 500 .7rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); }
.tl-role { margin-top: .45rem; font: 600 1.12rem/1.3 var(--font-display); letter-spacing: -.02em; }
.tl-org { margin-top: .15rem; font-size: .9rem; color: var(--text-3); }
.cv-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2.2rem; }

.stack {
  position: relative;
  height: clamp(320px, 38vw, 460px);
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.stack.is-live { cursor: grab; }
.stack.is-live:active { cursor: grabbing; }
.stack ul { display: flex; flex-wrap: wrap; gap: .45rem; }
.stack li {
  padding: .45rem .75rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(9, 11, 18, 0.72);
  font: 500 .8rem/1 var(--font-mono);
  color: var(--text);
  white-space: nowrap;
}
.stack.is-live ul { position: absolute; inset: 0; display: block; }
.stack.is-live li { position: absolute; left: 50%; top: 50%; will-change: transform, opacity; }
.stack li.is-hot { border-color: rgba(34, 211, 238, 0.55); color: var(--cyan); }
.stack-hint { margin-top: .8rem; font: .68rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.stack:not(.is-live) + .stack-hint { display: none; }

/* ── 8. Services ───────────────────────────────────────────── */
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.service { display: flex; flex-direction: column; gap: .85rem; padding: 1.8rem; }
.service-ico {
  display: grid;
  place-items: center;
  width: 2.9rem; height: 2.9rem;
  border-radius: 13px;
  color: var(--cyan);
  background: linear-gradient(140deg, rgba(59, 157, 255, 0.18), rgba(167, 139, 250, 0.12));
  border: 1px solid rgba(59, 157, 255, 0.28);
}
.service-ico .i { width: 1.35rem; height: 1.35rem; }
.service h3 { font-size: 1.25rem; letter-spacing: -.025em; }
.service p { color: var(--text-2); font-size: .95rem; }
.service .kw { margin-top: auto; padding-top: .5rem; font: .72rem/1.5 var(--font-mono); color: var(--text-3); }

.models-head { margin: clamp(3rem, 6vw, 4.5rem) 0 1.4rem; }
.models {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--line);
}
.model {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 1.7rem;
  background: rgba(8, 10, 16, 0.8);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.model.is-featured { background: linear-gradient(160deg, rgba(34, 211, 238, 0.12), rgba(8, 10, 16, 0.85) 60%); }
.dur { font: 500 .7rem/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.model h4 { font-size: 1.15rem; letter-spacing: -.02em; }
.model p { color: var(--text-2); font-size: .9rem; }
.badge {
  align-self: flex-start;
  padding: .35rem .6rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  font: 600 .6rem/1 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green);
}

/* ── 9. Contact + footer ───────────────────────────────────── */
.contact { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; }
.contact-title {
  max-width: 13ch;
  margin-top: 1.2rem;
  font-size: clamp(2.8rem, 7.4vw, 6.4rem);
  line-height: .96;
  letter-spacing: -.055em;
}
.contact .lead { max-width: 36rem; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 2.6rem; }
.email {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  padding: 1.15rem 1.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font: 600 clamp(1.2rem, 3vw, 2.2rem)/1 var(--font-display);
  letter-spacing: -.03em;
  transition: border-color .3s, box-shadow .3s, transform .5s var(--ease);
}
.email .i { width: .9em; height: .9em; color: var(--cyan); transition: transform .45s var(--ease); }
@media (hover: hover) {
  .email:hover { border-color: rgba(34, 211, 238, 0.6); box-shadow: 0 0 70px -14px rgba(34, 211, 238, 0.55); }
  .email:hover .i { transform: translate(3px, -3px); }
}
.copy {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  height: 3.3rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font-size: .92rem;
  transition: color .2s, border-color .2s, background-color .2s;
}
@media (hover: hover) {
  .copy:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.3); }
}
.copy.is-done { color: var(--green); border-color: rgba(52, 211, 153, 0.5); }

.expect { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 2rem; margin-top: 3.4rem; max-width: 44rem; }
.expect li { padding-top: 1rem; border-top: 1px solid var(--line-2); color: var(--text-2); font-size: .92rem; }
.expect b { display: block; margin-bottom: .3rem; color: var(--text); font-weight: 500; }

.availability { display: flex; align-items: baseline; gap: .8rem; max-width: 44rem; margin-top: 2.4rem; color: var(--text-2); }
.availability .live-dot { translate: 0 -1px; }
.availability strong { color: var(--text); font-weight: 500; }

.socials { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2.2rem; }
.social {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  height: 2.75rem;
  padding: 0 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font-size: .9rem;
  transition: color .2s, border-color .2s, background-color .2s, transform .4s var(--ease);
}
.social .i { width: 1rem; height: 1rem; }
@media (hover: hover) {
  .social:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.32); background: rgba(255, 255, 255, 0.07); transform: translateY(-2px); }
}

.footer { border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(5, 6, 10, 0), rgba(5, 6, 10, 0.9)); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.5rem var(--pad) 1.9rem;
  font: 500 .72rem/1.4 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.footer-inner b { color: var(--cyan); font-weight: 500; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 1.6rem; }
.footer-links a, .footer-links button { margin: 0 -.3rem; padding: .55rem .3rem; }
@media (hover: hover) {
  .footer-links a:hover, .footer-links button:hover { color: var(--text); }
}
.footer-links button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }

/* Section read-out, bottom left (desktop only) */
.hud {
  position: fixed;
  left: 1.85rem;
  bottom: 2rem;
  z-index: 40;
  transform: rotate(-90deg);
  transform-origin: 0 100%;
  display: flex;
  align-items: center;
  gap: .9rem;
  font: 500 .66rem/1 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s;
}
.hud.is-on { opacity: 1; }
.hud b { color: var(--text); font-weight: 500; min-width: 7ch; }
.hud i { width: 1.6rem; height: 1px; background: var(--line-2); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 90;
  padding: .75rem 1.2rem;
  border-radius: 999px;
  background: rgba(10, 13, 20, 0.92);
  border: 1px solid var(--line-2);
  font-size: .9rem;
  translate: -50% 180%;
  transition: translate .5s var(--ease);
  pointer-events: none;
}
.toast.is-on { translate: -50% 0; }

/* ── 10. Article pages (research) ──────────────────────────── */
.article-wrap { padding-top: 8.5rem; padding-bottom: 5rem; }
.article { max-width: 820px; }
.crumb { display: inline-flex; align-items: center; gap: .5rem; font-size: .92rem; color: var(--text-2); transition: color .2s; }
@media (hover: hover) {
  .crumb:hover { color: var(--text); }
}
.crumb .i { transition: transform .4s var(--ease); }
@media (hover: hover) {
  .crumb:hover .i { transform: translateX(-3px); }
}
.article-head .kicker { display: flex; width: fit-content; margin-top: 2rem; }
.article-title { margin-top: 1rem; font-size: clamp(2.3rem, 5.6vw, 4.2rem); line-height: 1.02; letter-spacing: -.045em; }
.article-sub { display: block; margin-top: .7rem; font-size: .48em; letter-spacing: -.02em; color: var(--text-3); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: 1.8rem; }
.meta-time { display: inline-flex; align-items: center; gap: .45rem; font: 500 .72rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }

.video {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 2.6rem 0;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: #000;
  box-shadow: 0 60px 140px -50px rgba(59, 157, 255, 0.45);
}
.video img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease), filter .5s; }
@media (hover: hover) {
  .video:hover img { transform: scale(1.03); filter: brightness(.78); }
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play {
  position: absolute;
  left: 50%; top: 50%;
  display: grid;
  place-items: center;
  width: 5.4rem; height: 5.4rem;
  border-radius: 50%;
  color: #03050a;
  background: linear-gradient(120deg, #86c5ff, #22d3ee);
  box-shadow: 0 0 0 12px rgba(34, 211, 238, 0.14), 0 24px 70px -12px rgba(34, 211, 238, 0.7);
  translate: -50% -50%;
  transition: transform .45s var(--ease);
}
.play .i { width: 1.9rem; height: 1.9rem; margin-left: .25rem; }
@media (hover: hover) {
  .video:hover .play { transform: scale(1.08); }
}

.article-body { padding: clamp(1.6rem, 4.5vw, 3.2rem); background: var(--glass-strong); }
.article-body h2 { margin: 2.6rem 0 1rem; font-size: 1.6rem; letter-spacing: -.03em; }
.article-body h2:first-child { margin-top: 0; }
.article-body p { color: var(--text-2); font-size: 1.06rem; line-height: 1.8; }
.article-body a { color: var(--cyan); text-decoration: underline; text-decoration-color: rgba(34, 211, 238, 0.35); text-underline-offset: 3px; }
.bullets { display: grid; gap: .75rem; }
.bullets li { position: relative; padding-left: 1.6rem; color: var(--text-2); font-size: 1.02rem; line-height: 1.7; }
.bullets li::before {
  content: "";
  position: absolute;
  left: .15rem; top: .68em;
  width: 7px; height: 7px;
  border-radius: 2px;
  background: var(--blue);
  rotate: 45deg;
}
.bullets.findings li::before { background: var(--green); box-shadow: 0 0 10px rgba(52, 211, 153, 0.6); }
.article-body .tags { margin-top: .2rem; }
.callout {
  margin-top: 2.6rem;
  padding: 1.3rem 1.5rem;
  border-radius: var(--r-md);
  border: 1px solid rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.06);
}
.callout .num { display: block; margin-bottom: .5rem; }
.callout p { font-size: .98rem; }

.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 3rem; }
.pager a { display: block; padding: 1.4rem 1.6rem; }
.dir { display: flex; align-items: center; gap: .5rem; font: 500 .7rem/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.pager .t { display: block; margin-top: .6rem; font: 600 1.08rem/1.3 var(--font-display); letter-spacing: -.02em; }
.pager .next { text-align: right; }
.pager .next .dir { justify-content: flex-end; }

/* ── 11. CV page ───────────────────────────────────────────── */
.cv-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 2rem; padding-top: 8.5rem; }
.cv-name { margin-top: .9rem; font-size: clamp(3rem, 8vw, 6rem); line-height: .95; letter-spacing: -.055em; }
.cv-role { margin-top: 1rem; font: 500 .8rem var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); }
.cv-contact { margin-top: .5rem; color: var(--text-2); }
.cv-contact a, .kv dd a { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.28); text-underline-offset: 3px; }
@media (hover: hover) {
  .cv-contact a:hover { color: var(--text); }
}
.cv-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.cv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; margin-top: 2.8rem; padding-bottom: 5rem; }
.cv-main { padding: clamp(1.6rem, 4vw, 2.8rem); background: var(--glass-strong); }
.cv-block + .cv-block { margin-top: 3rem; }
.cv-h { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.4rem; font: 500 .74rem/1 var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); }
.cv-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cv-summary { color: var(--text-2); font-size: 1.04rem; line-height: 1.75; }
.job + .job { margin-top: 2.1rem; padding-top: 2.1rem; border-top: 1px solid var(--line); }
.job-date { font: 500 .7rem/1.5 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); }
.job h3 { margin-top: .4rem; font-size: 1.3rem; letter-spacing: -.025em; }
.job-org { margin-top: .2rem; font-size: .92rem; color: var(--text-3); }
.job > ul:not(.tags) { display: grid; gap: .55rem; margin-top: 1rem; }
.job > ul:not(.tags) > li { position: relative; padding-left: 1.2rem; color: var(--text-2); font-size: .96rem; }
.job > ul:not(.tags) > li::before { content: ""; position: absolute; left: 0; top: .78em; width: .5rem; height: 1px; background: var(--blue); }
.job > p:not([class]) { margin-top: .9rem; color: var(--text-2); font-size: .96rem; }
.job .tags { margin-top: 1.1rem; }
.edu + .edu { margin-top: 1.3rem; }
.edu h3 { margin-top: .4rem; font-size: 1.1rem; letter-spacing: -.02em; }
.edu p:not([class]) { color: var(--text-3); font-size: .92rem; margin-top: .2rem; }
/* Taller than most screens, so it scrolls with the page until its last card is in view, then holds */
.cv-side { position: sticky; bottom: 1.5rem; align-self: end; display: grid; gap: 1rem; }
@media (min-height: 1600px) { .cv-side { top: 6rem; bottom: auto; align-self: start; } }
.side-card { padding: 1.5rem; background: var(--glass-strong); }
.side-card .cv-h { margin-bottom: 1.1rem; }
.kv { display: grid; gap: .9rem; }
.kv dt { font: 500 .66rem/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.kv dd { margin-top: .3rem; color: var(--text); font-size: .95rem; overflow-wrap: anywhere; }
@media (hover: hover) {
  .kv dd a:hover { color: var(--cyan); }
}
.kv dd span { color: var(--text-3); }
.numbers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border-radius: var(--r-md); background: var(--line); }
.numbers div { padding: 1rem; background: rgba(8, 10, 16, 0.9); }
.numbers b { display: block; font: 600 1.8rem/1 var(--font-display); letter-spacing: -.04em; }
.numbers span { display: block; margin-top: .45rem; font: 500 .62rem/1.35 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.side-card .btn { width: 100%; margin-top: 1.1rem; }
.side-card > p { color: var(--text-2); font-size: .94rem; }

/* ── 12. 404 page ──────────────────────────────────────────── */
.nf {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 var(--pad) 11vh;
  text-align: center;
}
.nf h1 { margin-top: 1rem; font-size: clamp(2.1rem, 5vw, 3.6rem); }
.nf p { max-width: 32rem; margin-top: 1rem; color: var(--text-2); }
.nf-row { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: 2rem; }

/* ── 13. Cookie banner ─────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  right: 1rem; bottom: 1rem;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  width: min(400px, calc(100% - 2rem));
  padding: 1.2rem 1.3rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: rgba(10, 12, 19, 0.94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  animation: rise .7s var(--ease) both;
}
.cookie-text { flex: 1 1 100%; color: var(--text-2); font-size: .86rem; line-height: 1.55; }
.cookie-title { display: block; margin-bottom: .25rem; color: var(--text); font: 600 .95rem var(--font-display); }
.cookie-btns { display: flex; gap: .5rem; width: 100%; }
.cookie-btns .btn { flex: 1; }
.cookie-btns .btn { height: 2.6rem; }

/* ── 14. Responsive ────────────────────────────────────────── */
@media (max-width: 1100px) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projects > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .models { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cv-grid { grid-template-columns: minmax(0, 1fr); }
  .cv-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .nav-links, .nav-cta { display: none; }
  .menu-btn { display: inline-flex; }
  .nav { padding: .45rem .45rem .45rem 1.15rem; }
  .hero { align-items: flex-end; padding-top: 42vh; padding-bottom: 5.5rem; }
  .hero-hint { display: none; }
  .principles { grid-template-columns: minmax(0, 1fr); }
  .about-grid, .exp-grid { grid-template-columns: minmax(0, 1fr); }
  .portrait { justify-self: start; max-width: 380px; }
  .now { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
  .project { min-height: 0; }
  .hud { display: none; }
}

@media (max-width: 720px) {
  .projects, .research { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .hide-sm { display: none; }
  .services, .models, .expect { grid-template-columns: minmax(0, 1fr); }
  .cv-side { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { text-align: left; }
  .pager .next .dir { justify-content: flex-start; }
  .project, .service, .principle { padding: 1.5rem; }
  .rcard-body { padding: 1.3rem 1.35rem 1.5rem; }
  .email { width: 100%; justify-content: space-between; padding: 1rem 1.3rem; font-size: 1.15rem; }
  .copy { width: 100%; justify-content: center; }
  .btn { height: 3rem; padding: 0 1.3rem; }
  .hero-cta .btn { flex: 1 1 auto; }
  .stat { padding: 1rem .9rem; }
  .stat-label { letter-spacing: .1em; }
  .cookie-banner { right: .5rem; bottom: .5rem; width: calc(100% - 1rem); }
}

@media (max-height: 520px) {
  .menu { gap: 1.2rem; padding-top: 5rem; padding-bottom: 1.5rem; }
  .menu-links { gap: .1rem; }
  .menu-links a { font-size: clamp(1.5rem, 7vh, 2.1rem); }
}

/* ── 15. Motion, low-fx, print ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js [data-reveal] { opacity: 1; translate: none; filter: none; }
  .scroll-cue::after, .live-dot { animation: none; }
}

/* "Pause motion" in the footer (html.still, remembered per visitor) does the same as the OS setting */
.still *, .still *::before, .still *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}
.js.still [data-reveal] { opacity: 1; translate: none; filter: none; }
.still .scroll-cue::after, .still .live-dot { animation: none; }
.still .tilt, .still .magnetic { transform: none !important; }

/* Set by scene.js when the device is struggling: drop the expensive blur */
.lowfx .card, .lowfx .nav, .lowfx .stat, .lowfx .model, .lowfx .eyebrow,
.lowfx .btn-ghost, .lowfx .email {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.lowfx .card, .lowfx .stat, .lowfx .model { background: var(--glass-strong); }

@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #111 !important; }
  .scene, .atmos, .progress, .nav, .menu, .hud, .toast, .skip, .footer,
  .cv-actions, .cookie-banner, .side-card .btn { display: none !important; }
  .card, .model, .stat {
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
  }
  .card::before, .card::after { display: none !important; }
  .js [data-reveal] { opacity: 1 !important; translate: none !important; filter: none !important; transition: none !important; }
  *, .grad { color: #111 !important; -webkit-text-fill-color: #111; }
  .cv-head { padding-top: 0; }
  .cv-grid { grid-template-columns: minmax(0, 1fr) 32%; gap: 8mm; margin-top: 6mm; }
  .cv-side { position: static; align-self: start; grid-template-columns: minmax(0, 1fr); }
  .job { break-inside: avoid; }
  .tags li { border-color: #bbb !important; background: none !important; }
}
