/* ==========================================================================
   Adharsh Kirtan · portfolio
   Dark, glassy, minimal. Tokens first; components after.
   ========================================================================== */

:root {
  --bg: #060818;
  --bg-2: #0b1030;
  --ink: #f4f6ff;
  --ink-2: rgba(236, 240, 255, 0.78);
  --ink-3: rgba(226, 232, 255, 0.52);
  --line: rgba(255, 255, 255, 0.16);
  --line-2: rgba(255, 255, 255, 0.09);

  --blue: #6f9bff;
  --violet: #8a6bff;
  --pink: #ff7eb6;
  --amber: #ffc46b;
  --teal: #5fd6c0;

  --paper: #f7f8fc;
  --paper-ink: #151729;
  --paper-muted: #6b7088;

  --glass: linear-gradient(140deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035));
  --glass-dark: linear-gradient(160deg, rgba(28, 32, 64, 0.62), rgba(16, 18, 40, 0.48));
  --blur: saturate(150%) blur(22px);
  --edge: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 30px 80px -36px rgba(0, 0, 0, 0.7);

  --r-xl: 40px;
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 14px;

  /* Type roles: display (hero), head (section & project titles), body (everything read), mono (data only). */
  --font-display: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-head: "Space Grotesk", "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font: var(--font-body);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* No visible scrollbars anywhere (page, folder sheets, any inner scroller).
   Scrolling still works by wheel, trackpad, touch and keyboard. */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
button { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 8px; }

.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;
}

/* ---------- Atmosphere ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, #121a4a 0%, transparent 60%),
    radial-gradient(90% 70% at 50% 110%, #0d2a2a 0%, transparent 60%),
    linear-gradient(180deg, #080b22 0%, #060818 60%, #050716 100%);
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55;
  animation: drift 26s var(--ease) infinite alternate;
}
.b1 { width: 46vw; height: 46vw; left: -8vw; top: -10vw; background: #2a46c9; }
.b2 { width: 40vw; height: 40vw; right: -10vw; top: 8vh; background: #7a3cc9; animation-delay: -8s; }
.b3 { width: 36vw; height: 36vw; left: 30vw; top: 52vh; background: #c2457f; opacity: 0.32; animation-delay: -14s; }
.b4 { width: 34vw; height: 34vw; left: -6vw; bottom: -10vw; background: #136a5c; opacity: 0.38; animation-delay: -4s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vw, 3vh, 0) scale(1.12); }
}
/* Depth: soft diagonal light streaks over the gradient, then grain and an edge vignette.
   Kept faint on purpose; they should read as atmosphere, not decoration. */
.streak {
  position: absolute; z-index: 1; left: 50%; width: 170vmax; border-radius: 50%;
  /* --sy is set from scroll in main.js: streaks drift slower than the page, which reads as depth */
  translate: -50% calc(var(--sy, 0) * -1px); mix-blend-mode: screen; pointer-events: none;
  animation: sweep 40s ease-in-out infinite alternate;
}
.st1 {
  top: 18%; height: 22vmin; rotate: -24deg; filter: blur(46px); opacity: 0.4;
  background: linear-gradient(90deg, transparent 18%, rgba(110, 150, 255, 0.6) 44%, rgba(210, 222, 255, 0.45) 52%, transparent 78%);
}
.st2 {
  top: 58%; height: 15vmin; rotate: -30deg; filter: blur(52px); opacity: 0.34; animation-delay: -14s;
  background: linear-gradient(90deg, transparent 22%, rgba(160, 105, 255, 0.6) 48%, rgba(255, 140, 200, 0.35) 60%, transparent 82%);
}
.st3 {
  top: 40%; height: 2.6vmin; rotate: -26deg; filter: blur(12px); opacity: 0.26; animation-delay: -26s;
  background: linear-gradient(90deg, transparent 30%, rgba(225, 232, 255, 0.9) 50%, transparent 70%);
}
@keyframes sweep { from { transform: translateX(-5vw); } to { transform: translateX(5vw); } }
.backdrop::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.backdrop::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(130% 95% at 50% 42%, transparent 52%, rgba(3, 4, 14, 0.5) 100%);
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 6px; padding: 6px;
  border-radius: 999px; border: 1px solid var(--line);
  background: rgba(14, 18, 44, 0.42); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--edge);
}
.nav-mark {
  display: block; flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45); background: var(--bg-2);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}
.nav-mark img { width: 100%; height: 100%; object-fit: cover; }
.nav nav { display: flex; gap: 2px; }
.nav nav a {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--ink-2);
  transition: background 0.25s, color 0.25s;
}
.nav nav a:hover, .nav nav a.active { background: rgba(255, 255, 255, 0.12); color: var(--ink); }

/* ---------- Shared bits ---------- */
.panel {
  position: relative; padding: 32px; border-radius: var(--r-lg);
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--edge);
}
.eyebrow { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.label { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 16px; }
.label-gap { margin-top: 26px; margin-bottom: 8px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }

.pills { display: flex; gap: 8px; }
.pills.wrap { flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; padding: 5px 13px; border-radius: 999px; font-size: 13px; line-height: 1.3; white-space: nowrap; }
.pill-line { border: 1px solid rgba(255, 255, 255, 0.75); color: var(--ink); }
.pill-fill { background: rgba(255, 255, 255, 0.92); color: var(--paper-ink); }
.pill-soft { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line-2); color: var(--ink-2); }

.btn-glass, .btn-paper {
  display: inline-flex; align-items: center; gap: 14px; border-radius: 999px;
  font-size: 15px; font-weight: 500; transition: transform 0.3s var(--ease), background 0.3s;
}
.btn-glass {
  padding: 8px 8px 8px 22px;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn-glass .plus {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18); font-size: 16px; font-weight: 400;
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.22); }
.btn-paper { padding: 13px 24px; background: var(--paper); color: var(--paper-ink); }
.btn-glass:active, .btn-paper:active { transform: scale(0.97); }

/* ---------- Cursor light (set up in main.js for mouse/trackpad users) ---------- */
.cursor-glow {
  position: fixed; left: 0; top: 0; z-index: 40; width: 560px; height: 560px; margin: -280px 0 0 -280px;
  border-radius: 50%; pointer-events: none; mix-blend-mode: screen; opacity: 0;
  background: radial-gradient(circle, rgba(160, 178, 255, 0.22), rgba(150, 120, 255, 0.08) 38%, transparent 68%);
  transition: opacity 0.45s var(--ease); will-change: transform;
}
.cursor-glow.on { opacity: 1; }
/* Glass cards catch the light: a soft sheen on the surface and a brighter glint on the edge. */
.intro { position: relative; }
.spot::before, .spot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.spot::before { background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.11), transparent 65%); }
.spot::after {
  padding: 1px;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(220, 228, 255, 0.6), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.spot.lit::before, .spot.lit::after { opacity: 1; }

.float { animation: bob 7s ease-in-out infinite alternate; }
@keyframes bob { from { translate: 0 0; } to { translate: 0 -8px; } }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: max(940px, 100svh);
  overflow: hidden;
}
.stage {
  position: absolute; left: 4vw; right: 4vw; top: 132px; bottom: 44px;
  border-radius: var(--r-xl);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03) 55%, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--edge);
}
.receptor { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.receptor canvas { display: block; width: 100% !important; height: 100% !important; }
.no-webgl .receptor {
  background:
    radial-gradient(closest-side at 50% 48%, rgba(255, 196, 107, 0.6), transparent 9%),
    radial-gradient(closest-side at 50% 48%, rgba(138, 107, 255, 0.55), transparent 32%),
    radial-gradient(closest-side at 54% 52%, rgba(255, 126, 182, 0.35), transparent 44%);
}

/* Left column: name, then the profile card. Everything inside the card runs on one 30px rhythm. */
.hero-copy {
  position: absolute; z-index: 3; left: calc(4vw + 52px); top: 166px; width: min(410px, 29vw);
}
.hero-copy h1 {
  font-weight: 300; font-size: clamp(46px, 4.8vw, 76px); line-height: 0.95; letter-spacing: -0.045em;
  margin-bottom: 30px;
}
.intro {
  display: flex; flex-direction: column;
  padding: 34px 32px 32px; border-radius: var(--r-lg);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  border: 1px solid var(--line);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--edge);
}
.intro-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.intro-title { font-size: 22px; line-height: 1.24; letter-spacing: -0.02em; text-wrap: balance; }
.orb {
  flex: none; width: 56px; height: 56px; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.95) 0 5%, transparent 6%),
    radial-gradient(circle at 60% 64%, rgba(255, 196, 107, 0.9) 0 9%, transparent 10%),
    conic-gradient(from 210deg, #7fb1ff, #b79bff, #ff8fc0, #7fe0d0, #7fb1ff);
  box-shadow: 0 0 30px rgba(138, 107, 255, 0.55), inset 0 0 18px rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.intro .pills { flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.intro-sub { font-size: 14px; font-weight: 500; letter-spacing: 0.005em; margin-bottom: 12px; }
.intro-body { display: grid; gap: 12px; font-size: 14.5px; line-height: 1.65; color: var(--ink-2); margin-bottom: 32px; }
.intro .btn-glass { align-self: flex-start; gap: 18px; padding: 10px 10px 10px 26px; }
.intro .btn-glass .plus { width: 34px; height: 34px; font-size: 15px; }

/* Right column: a quiet EEG trace, then — clearly separated — the link row. Both share one right edge. */
.hero { --right-edge: calc(4vw + 48px); }
.eeg {
  position: absolute; z-index: 1; margin: 0;
  right: var(--right-edge); top: 34%; width: min(27vw, 390px); height: 180px;
}
.eeg svg { width: 100%; height: 100%; overflow: visible; }
.eeg-grid line { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; vector-effect: non-scaling-stroke; }
.eeg-cursor { stroke: rgba(255, 255, 255, 0.28); stroke-dasharray: 2 5; vector-effect: non-scaling-stroke; }
.eeg-wave { fill: none; stroke: url(#eegStroke); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: 0.85; }
.eeg-marker {
  position: absolute; width: 12px; height: 12px; border-radius: 50%; translate: -50% -50%;
  background: #6fc7ff; border: 2px solid #fff; box-shadow: 0 0 12px rgba(111, 199, 255, 0.6);
}
.eeg-label {
  position: absolute; left: 65.5%; top: -22px; translate: -50% 0;
  padding: 5px 11px; border-radius: 9px; background: rgba(248, 249, 255, 0.92); color: var(--paper-muted);
  font-size: 14px; letter-spacing: -0.01em; white-space: nowrap;
}
.eeg-label b { color: #2f5bff; font-weight: 500; }

/* floating external links: quiet dot-matrix glyphs, one evenly spaced row */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.socials {
  position: absolute; z-index: 5; right: var(--right-edge); top: calc(34% + 180px + 128px);
  display: flex; align-items: flex-start; gap: 26px;
  pointer-events: none;
}
.soc {
  --c: #fff;
  position: relative; display: flex; flex-direction: column; align-items: center; width: 36px;
  pointer-events: auto; opacity: 0.7; border-radius: 10px;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 38%, transparent));
  transition: opacity 0.35s var(--ease);
}
.soc:hover, .soc:focus-visible { opacity: 1; }
.soc-icon, .soc-reflect { display: block; }
.soc-icon { animation: socFloat var(--dur, 6s) ease-in-out var(--delay, 0s) infinite alternate; transition: scale 0.35s var(--ease); }
.soc-reflect {
  margin-top: 8px; opacity: 0.16;
  animation: socFloatR var(--dur, 6s) ease-in-out var(--delay, 0s) infinite alternate;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 70%);
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
.soc-reflect .soc-glyph { transform: scaleY(-1); }
.soc-glyph {
  display: block; width: 34px; height: 34px; overflow: visible;
  -webkit-mask: radial-gradient(circle, #000 0.9px, transparent 1.2px) 0 0 / 2.6px 2.6px;
  mask: radial-gradient(circle, #000 0.9px, transparent 1.2px) 0 0 / 2.6px 2.6px;
}
.soc-label {
  position: absolute; top: -30px; left: 50%; translate: -50% 4px; white-space: nowrap;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; color: var(--ink);
  background: rgba(14, 18, 44, 0.7); border: 1px solid var(--line);
  opacity: 0; transition: opacity 0.25s, translate 0.25s; pointer-events: none;
}
.soc:hover .soc-icon, .soc:focus-visible .soc-icon { scale: 1.08; }
.soc:hover .soc-label, .soc:focus-visible .soc-label { opacity: 1; translate: -50% 0; }
@keyframes socFloat  { from { translate: 0 0; } to { translate: 0 -6px; } }
@keyframes socFloatR { from { translate: 0 0; } to { translate: 0 6px; } }

/* ==========================================================================
   Sections
   ========================================================================== */
main { overflow-x: clip; } /* section glows bleed past the edges; never let them widen the page */
.section { position: relative; isolation: isolate; max-width: 1180px; margin: 0 auto; padding: 110px 20px 20px; }
/* Each section carries its own soft pools of light. They scroll with the content while the
   streaks behind move slower, so the page gains layers. Sides alternate section to section. */
.section::before {
  content: ""; position: absolute; z-index: -1; inset: -60px -12vw -80px; pointer-events: none;
  /* feather the box edges so neighbouring sections blend with no seam */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
  background:
    radial-gradient(38% 46% at 12% 14%, rgba(78, 110, 255, 0.22), transparent 70%),
    radial-gradient(34% 42% at 92% 46%, rgba(150, 82, 235, 0.18), transparent 72%),
    radial-gradient(30% 36% at 30% 96%, rgba(40, 170, 150, 0.12), transparent 70%);
}
.section:nth-of-type(odd)::before {
  background:
    radial-gradient(38% 46% at 88% 12%, rgba(150, 82, 235, 0.2), transparent 70%),
    radial-gradient(34% 42% at 8% 50%, rgba(78, 110, 255, 0.2), transparent 72%),
    radial-gradient(30% 36% at 70% 98%, rgba(255, 110, 170, 0.1), transparent 70%);
}
.section-head { margin-bottom: 40px; display: grid; gap: 14px; max-width: 760px; }
.section-head h2 {
  font-weight: 300; font-size: clamp(34px, 4.4vw, 58px); line-height: 1.02; letter-spacing: -0.035em;
}

.about-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
.statement { display: grid; gap: 18px; color: var(--ink-2); }
.statement .lead { font-size: clamp(20px, 2vw, 25px); line-height: 1.38; letter-spacing: -0.015em; color: var(--ink); font-weight: 300; }
.statement .aside { font-size: 14px; color: var(--ink-3); padding-top: 14px; border-top: 1px solid var(--line-2); }
.stack { display: grid; gap: 20px; }
.statement .label { margin-bottom: -4px; }
.statement .aside strong { font-weight: 500; color: var(--ink-2); }
.edu { display: grid; gap: 22px; }
.edu li { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 18px; align-items: start; }
.edu-text { display: grid; gap: 3px; min-width: 0; }
/* Institution marks: same dot-matrix treatment and tinted glow as the hero's link icons */
.edu-logo {
  --c: #fff; display: block; width: 48px; height: 48px; margin-top: -2px; opacity: 0.92;
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--c) 42%, transparent));
}
.edu-logo img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  -webkit-mask: radial-gradient(circle, #000 0.9px, transparent 1.2px) 0 0 / 2.6px 2.6px;
  mask: radial-gradient(circle, #000 0.9px, transparent 1.2px) 0 0 / 2.6px 2.6px;
}
.edu strong { font-weight: 500; line-height: 1.35; }
.edu span { font-size: 14px; color: var(--ink-2); }
.edu .meta { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tool-groups { display: grid; gap: 22px; }
.tool-label { font-size: 14px; font-weight: 500; margin-bottom: 10px; }


/* ---------- Folders ---------- */
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 26px 20px; }
.folder {
  --tint: var(--blue);
  position: relative; display: block; padding: 22px 0 0; border: 0; background: none;
  text-align: left; cursor: pointer; transition: transform 0.4s var(--ease);
}
.folder-tab {
  position: absolute; top: 0; left: 0; width: 44%; height: 34px; border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 62%, transparent), color-mix(in srgb, var(--tint) 36%, transparent));
  border: 1px solid rgba(255, 255, 255, 0.2); border-bottom: 0;
}
.folder-paper, .folder-paper::after {
  position: absolute; left: 16px; right: 16px; top: 8px; height: 70px; border-radius: 10px;
  background: rgba(250, 251, 255, 0.9); transform: translateY(18px) rotate(-2deg);
  transition: transform 0.45s var(--ease);
}
.folder-paper::after { content: ""; left: 10px; right: -6px; top: 4px; background: rgba(250, 251, 255, 0.55); transform: rotate(4deg); }
.folder-body {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 196px; padding: 22px;
  border-radius: 0 22px 22px 22px; border: 1px solid var(--line);
  background: linear-gradient(165deg, color-mix(in srgb, var(--tint) 34%, rgba(20, 24, 56, 0.55)), rgba(20, 24, 56, 0.5) 70%);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--edge);
}
.folder:hover { transform: translateY(-4px); }
.folder:hover .folder-paper { transform: translateY(-2px) rotate(-3deg); }
.folder:focus-visible { outline: none; }
.folder:focus-visible .folder-body { outline: 2px solid #fff; outline-offset: 3px; }
.folder-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: auto; padding-bottom: 26px; }
.folder-icon {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.2);
}
.folder-icon svg, .sheet-icon svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.folder-count { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.folder-title { font-size: 22px; letter-spacing: -0.02em; line-height: 1.15; }
.folder-blurb { font-size: 14px; color: var(--ink-2); line-height: 1.45; }

/* ---------- Folder sheet (dialog) ---------- */
.sheet {
  --tint: var(--blue);
  width: min(720px, calc(100vw - 32px)); max-width: none; max-height: none;
  padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible;
}
.sheet:focus, .sheet:focus-visible,
.sheet-inner:focus, .sheet-inner:focus-visible { outline: none; }
.sheet::backdrop { background: rgba(4, 6, 18, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sheet-inner {
  max-height: min(84vh, 840px); overflow: auto; overscroll-behavior: contain; padding: 28px;
  border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(165deg, color-mix(in srgb, var(--tint) 26%, #12163a), #0d1030 60%);
  box-shadow: var(--edge);
}
.sheet[open] .sheet-inner { animation: rise 0.45s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
.sheet-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.sheet-icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; flex: none;
  background: color-mix(in srgb, var(--tint) 45%, transparent); border: 1px solid rgba(255, 255, 255, 0.22);
}
.sheet-heading { flex: 1; min-width: 0; }
.sheet-count { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.sheet-head h3 { font-size: 30px; font-weight: 300; letter-spacing: -0.03em; line-height: 1.1; }
.sheet-close {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); cursor: pointer; transition: background 0.25s;
}
.sheet-close:hover { background: rgba(255, 255, 255, 0.16); }
.sheet-close svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; }
.sheet-group + .sheet-group { margin-top: 26px; }
.sheet-group h4 { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.sheet-group li { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.it-t { font-size: 16px; line-height: 1.35; }
.it-m { font-size: 14px; color: var(--ink-2); }

/* ---------- Contact: the closing page ----------
   No card. A large two-tone question on a hairline, and one clear action beside it. */
.contact { padding-bottom: 16px; }
.contact-end {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  column-gap: clamp(32px, 6vw, 96px); row-gap: 30px; align-items: end;
  padding-block: 64px 76px; border-top: 1px solid var(--line-2);
}
/* A faint light runs along the bottom hairline when the section is engaged */
.contact-end::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(220, 228, 255, 0.5), transparent);
  transform: scaleX(0.3); transition: transform 1.4s var(--ease);
}
.contact-end:hover::after, .contact-end:focus-within::after { transform: scaleX(1); }
.contact-end > .eyebrow { grid-column: 1 / -1; }
.contact-title {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(46px, 7.2vw, 108px);
  line-height: 0.96; letter-spacing: -0.042em; text-wrap: balance;
}
.contact-title span { display: block; color: var(--ink-3); transition: color 0.9s var(--ease); }
.contact-end:hover .contact-title span, .contact-end:focus-within .contact-title span { color: var(--ink-2); }
.contact-side {
  display: grid; gap: 18px; justify-items: start;
  padding: 6px 0 6px clamp(20px, 3vw, 36px); border-left: 1px solid var(--line-2);
}
/* A small round portrait, like a signature at the end of a letter */
.contact-me { display: flex; align-items: center; gap: 14px; }
.contact-photo {
  flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04), 0 10px 28px -10px rgba(111, 155, 255, 0.55);
}
.contact-me p { display: grid; gap: 2px; line-height: 1.35; }
.contact-me strong { font-weight: 600; font-size: 15px; color: var(--ink); }
.contact-me span { font-size: 13px; color: var(--ink-3); }
.contact-note { font-size: 16px; line-height: 1.7; color: var(--ink-2); max-width: 36ch; }
.mail-btn {
  display: inline-flex; align-items: center; gap: 12px; padding: 14px 24px 14px 18px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.04); color: var(--ink);
  font-weight: 600; font-size: 15px; letter-spacing: 0.004em;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.mail-btn:hover, .mail-btn:focus-visible { background: var(--paper); color: var(--paper-ink); border-color: var(--paper); }
.mail-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; overflow: visible; }
.mail-flap { transform-origin: 12px 6.5px; transition: transform 0.45s var(--ease); }
.mail-btn:hover .mail-flap, .mail-btn:focus-visible .mail-flap { transform: scaleY(-0.55); }
.contact-addr { margin-top: -8px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; color: var(--ink-3); user-select: all; }
.contact-place { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.place-sep { margin-inline: 4px; color: var(--ink-3); }
.place-dot { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.place-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--teal); animation: placePulse 2.8s ease-out infinite; }
@keyframes placePulse { from { transform: scale(1); opacity: 0.7; } to { transform: scale(3); opacity: 0; } }
.contact-resume { font-size: 13px; color: var(--ink-3); padding-bottom: 2px; border-bottom: 1px solid var(--line); transition: color 0.25s; }
.contact-resume:hover, .contact-resume:focus-visible { color: var(--ink); }

.footer {
  max-width: 1180px; margin: 0 auto; padding: 28px 20px 48px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-3);
}
.footer-sep { margin-inline: 10px; opacity: 0.6; }
.footer-credits {
  font: inherit; color: var(--ink-3); background: none; border: 0; padding: 0 0 1px; cursor: pointer;
  border-bottom: 1px solid var(--line); transition: color 0.25s, border-color 0.25s;
}
.footer-credits:hover, .footer-credits:focus-visible { color: var(--ink); border-color: var(--line-2); }
.to-top { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); transition: color 0.25s; }
.to-top:hover, .to-top:focus-visible { color: var(--ink); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   Typography system
   Instrument Sans · hero display and introductory statements
   Space Grotesk   · section headings and project titles
   Manrope         · paragraphs, navigation, cards, buttons
   IBM Plex Mono   · small technical labels, dates and numbers only
   Placed after the components so it owns family, size, leading and tracking;
   the responsive rules below still adjust sizes for small screens.
   ========================================================================== */
body { font-family: var(--font-body); line-height: 1.6; }

/* Display: light, large, tightly tracked */
.hero-copy h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(46px, 4.8vw, 76px); line-height: 0.95; letter-spacing: -0.032em;
}
.intro-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: 22px; line-height: 1.26; letter-spacing: -0.012em; text-wrap: pretty;
}
.statement .lead {
  font-family: var(--font-display); font-weight: 400; color: var(--ink);
  font-size: clamp(21px, 1.9vw, 25px); line-height: 1.42; letter-spacing: -0.012em;
}

/* Headings: Space Grotesk, never heavier than 500 */
.section-head h2 {
  font-family: var(--font-head); font-weight: 400;
  font-size: clamp(34px, 4.2vw, 56px); line-height: 1.06; letter-spacing: -0.03em; text-wrap: balance;
}
.folder-title { font-family: var(--font-head); font-weight: 500; font-size: 21px; line-height: 1.2; letter-spacing: -0.015em; }
.sheet-head h3 { font-family: var(--font-head); font-weight: 400; font-size: 28px; line-height: 1.12; letter-spacing: -0.025em; }
.edu strong { font-family: var(--font-head); font-weight: 500; font-size: 16.5px; line-height: 1.35; letter-spacing: -0.008em; }

/* Body: Manrope, generous leading inside the glass */
.statement > p:not(.lead):not(.label):not(.aside) { font-size: 15.5px; line-height: 1.75; }
.intro-body { font-size: 14.5px; line-height: 1.72; }
.statement .aside { font-size: 14px; line-height: 1.65; }
.intro-sub, .tool-label { font-weight: 600; font-size: 13.5px; letter-spacing: 0.004em; }
.edu .inst { font-size: 14px; }
.folder-blurb { font-size: 13.5px; line-height: 1.55; }
.it-t { font-weight: 500; font-size: 15.5px; line-height: 1.4; }
.it-m { font-size: 13.5px; line-height: 1.55; }
.nav nav a { font-weight: 500; font-size: 13.5px; letter-spacing: 0.005em; }
.btn-glass, .btn-paper { font-weight: 600; font-size: 14.5px; letter-spacing: 0.004em; }
.pill { font-weight: 500; font-size: 12.5px; letter-spacing: 0.01em; }
.soc-label { font-weight: 500; }

/* Technical: IBM Plex Mono, small and quiet */
.eyebrow, .label, .sheet-count, .sheet-group h4 {
  font-family: var(--font-mono); font-weight: 400;
  font-size: 11px; line-height: 1.4; letter-spacing: 0.16em; text-transform: uppercase;
}
.edu .meta, .folder-count {
  font-family: var(--font-mono); font-weight: 400; font-size: 12px; letter-spacing: 0.02em;
}
.eeg-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; }
.eeg-label b { font-weight: 500; }
.footer { font-size: 13px; }

/* ==========================================================================
   Work: a personal archive
   Four spaces with their own identities: one featured project, an image-led
   writing gallery, a quiet list of hypotheses, and modelling notes built around
   the real plots. Few boxes, lots of air.
   ========================================================================== */
.work { padding-top: 150px; }
.work-head { max-width: 860px; gap: 20px; margin-bottom: 72px; }
.work-head h2 { font-size: clamp(42px, 5.6vw, 78px); line-height: 1.02; letter-spacing: -0.036em; }
.work-lede {
  font-family: var(--font-display); font-size: clamp(19px, 1.8vw, 23px); line-height: 1.5;
  letter-spacing: -0.008em; color: var(--ink-2); max-width: 40ch;
}

.wblock { position: relative; padding-block: 104px; border-top: 1px solid var(--line-2); }
.wblock-head { display: grid; gap: 14px; max-width: 760px; margin-bottom: 60px; }
.wblock-title {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 4.4vw, 60px);
  line-height: 1.04; letter-spacing: -0.032em; text-wrap: balance;
}
.wblock-note { font-size: 16px; line-height: 1.65; color: var(--ink-2); max-width: 54ch; }

.note-open {
  justify-self: start; display: inline-flex; align-items: center; gap: 10px; padding: 4px 0 6px;
  background: none; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--tint, #6f9bff) 60%, transparent);
  font-weight: 600; font-size: 13.5px; letter-spacing: 0.004em; color: var(--ink); cursor: pointer;
}
.note-open span { transition: translate 0.35s var(--ease); }
.note-open:hover span, .note-open:focus-visible span { translate: 5px 0; }
.fig-cap { margin-top: 14px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- 1. Featured project ---------- */
.feat { --tint: var(--teal); display: grid; gap: 64px; padding-top: 8px; border-top: 0; }
.feat::before {
  content: ""; position: absolute; inset: -12% -10% 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(48% 52% at 78% 62%, color-mix(in srgb, var(--tint) 15%, transparent), transparent 70%),
    radial-gradient(38% 42% at 8% 18%, rgba(111, 155, 255, 0.12), transparent 70%);
}
.feat-head {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  column-gap: clamp(32px, 5vw, 88px); row-gap: 24px; align-items: end;
}
.feat-kicker {
  grid-column: 1 / -1; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: color-mix(in srgb, var(--tint) 80%, #fff);
}
.feat-title {
  grid-column: 1; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(40px, 5.4vw, 76px); line-height: 1.02; letter-spacing: -0.036em; text-wrap: balance;
}
.feat-summary { grid-column: 2; font-size: 17px; line-height: 1.72; color: var(--ink-2); max-width: 46ch; }
.feat-labels { grid-column: 1; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.feat-labels span { color: color-mix(in srgb, var(--tint) 60%, transparent); }
.feat-foot { grid-column: 2; display: grid; gap: 16px; justify-items: start; }
.feat-status { font-size: 14px; line-height: 1.6; color: var(--ink-3); }
.feat-figure {
  position: relative; padding: 52px clamp(16px, 3vw, 44px) 28px; border-radius: 28px; cursor: pointer;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line-2);
}

/* Workflow (featured and drawer) */
.flow { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding: 0; }
.flow::before {
  content: ""; position: absolute; left: 10%; right: 10%; top: 13px; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--tint) 75%, transparent) 15%, color-mix(in srgb, var(--tint) 75%, transparent) 85%, transparent);
}
.flow li { position: relative; display: grid; justify-items: center; align-content: start; gap: 8px; padding-inline: 8px; text-align: center; }
.flow li::before {
  content: ""; width: 10px; height: 10px; margin: 8px 0 6px; border-radius: 50%; background: var(--bg);
  border: 1.5px solid color-mix(in srgb, var(--tint) 85%, #fff); box-shadow: 0 0 14px color-mix(in srgb, var(--tint) 55%, transparent);
  transition: transform 0.4s var(--ease);
}
.flow li:nth-child(2)::before { transition-delay: 0.06s; }
.flow li:nth-child(3)::before { transition-delay: 0.12s; }
.flow li:nth-child(4)::before { transition-delay: 0.18s; }
.flow li:nth-child(5)::before { transition-delay: 0.24s; }
.feat-figure:hover .flow li::before, .pj .flow li::before { transform: scale(1.35); }
.flow i { font-style: normal; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: color-mix(in srgb, var(--tint) 85%, #fff); }
.flow b { font-family: var(--font-head); font-weight: 500; font-size: 15px; letter-spacing: -0.01em; }
.flow span { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.feat .flow::before { top: 15px; }
.feat .flow li::before { width: 14px; height: 14px; }
.feat .flow b { font-size: 20px; }
.feat .flow span { font-size: 13.5px; color: var(--ink-2); max-width: 18ch; }

/* ---------- 2. Things I've written ---------- */
.wr { --tint: var(--pink); }
.writing-section .wr { border-top: 0; padding-block: 0 24px; }
/* A compact horizontal strip: one row, full-bleed, scrolled by arrows, drag, swipe or keys.
   Photos drift inside their frames as the strip moves (js/work.js), which gives the parallax. */
.wblock-head.wr-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; max-width: none; }
.wr-head > div:first-child { display: grid; gap: 14px; max-width: 760px; }
.strip-ctrl { display: flex; flex: none; gap: 10px; }
.strip-btn {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--ink); font-size: 17px;
  transition: background 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.strip-btn:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.35); }
.strip-btn:active { transform: scale(0.94); }
.strip {
  position: relative; overflow-x: auto; overflow-y: hidden; cursor: grab;
  scroll-snap-type: x proximity; overscroll-behavior-x: contain;
  margin-inline: calc(50% - 50vw);
  padding-inline: max(20px, calc(50vw - 570px)); scroll-padding-inline: max(20px, calc(50vw - 570px));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.strip:focus-visible { outline: none; }
.strip:focus-visible .tile:first-child .tile-media { outline: 2px solid #fff; outline-offset: 4px; }
.strip.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.strip.is-dragging .tile { pointer-events: none; }
.strip-track { display: flex; gap: 28px; width: max-content; padding-block: 6px 12px; }
.tile { position: relative; flex: none; display: grid; gap: 16px; align-content: start; width: clamp(260px, 25vw, 330px); scroll-snap-align: start; }
.tile--wide { width: clamp(300px, 34vw, 460px); }
.tile-media { position: relative; overflow: hidden; border-radius: 16px; height: clamp(210px, 21vw, 280px); background: var(--bg-2); }
.tile-media::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 55%, rgba(6, 8, 24, 0.35)); }
.tile-zoom { width: 100%; height: 100%; transition: transform 1.2s var(--ease); }
.tile-zoom img {
  display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.18);
  filter: saturate(0.88) brightness(0.9); transition: filter 0.6s var(--ease);
  will-change: transform; user-select: none; -webkit-user-drag: none;
}
.tile:hover .tile-zoom, .tile:focus-within .tile-zoom { transform: scale(1.05); }
.tile:hover .tile-zoom img, .tile:focus-within .tile-zoom img { filter: saturate(1) brightness(1); }
.strip-progress { height: 1px; margin-top: 30px; overflow: hidden; background: var(--line-2); }
.strip-progress span {
  display: block; height: 100%; transform-origin: left center; transform: scaleX(0.08);
  background: color-mix(in srgb, var(--tint) 80%, #fff); transition: transform 0.2s linear;
}
.tile:focus-within .tile-media { outline: 2px solid #fff; outline-offset: 4px; }
.tile-body { display: grid; gap: 8px; }
.tile-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.tile-meta span:first-child { color: color-mix(in srgb, var(--tint) 75%, #fff); }
.tile-title { font-family: var(--font-head); font-weight: 400; font-size: 22px; line-height: 1.24; letter-spacing: -0.015em; text-wrap: balance; transition: color 0.3s; }
.tile--wide .tile-title { font-size: 24px; line-height: 1.2; }
.tile-stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.tile-stretch:focus-visible { outline: none; }
.tile:hover .tile-title { color: #fff; }
.tile-desc { font-size: 14.5px; line-height: 1.66; color: var(--ink-2); max-width: 52ch; }
.tile-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 18px; margin-top: 4px; }
.tile-link {
  position: relative; z-index: 2; font-weight: 600; font-size: 13.5px; padding-bottom: 3px;
  border-bottom: 1px solid color-mix(in srgb, var(--tint) 55%, transparent);
}
.tile-credit { position: relative; z-index: 2; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.03em; color: var(--ink-3); opacity: 0.7; transition: opacity 0.3s, color 0.3s; }
.tile-credit:hover, .tile-credit:focus-visible { opacity: 1; color: var(--ink-2); }

.also { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; margin-top: 88px; padding-top: 28px; border-top: 1px solid var(--line-2); }
.also-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); padding-top: 12px; }
.also-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin: 0; padding: 0; }
.also-list li > a, .also-list .also-item { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.also-t { font-family: var(--font-display); font-size: 16px; line-height: 1.4; color: var(--ink); transition: color 0.25s; }
.also-src { flex: none; max-width: 48%; text-align: right; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.also-list a:hover .also-t, .also-list a:focus-visible .also-t { color: #fff; }

/* ---------- 3. Project folders (Modelling & experiments, Hypotheses & ideas) ----------
   Rendered inside the shared sheet; each project is a row with a small thumbnail. */
.pf-note { margin-bottom: 6px; font-size: 13.5px; line-height: 1.6; color: var(--ink-3); }
.pf-list { display: grid; margin: 0; padding: 0; list-style: none; }
.pf-item {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 22px; align-items: start;
  padding-block: 24px; border-top: 1px solid var(--line-2);
}
.pf-item.no-thumb { grid-template-columns: minmax(0, 1fr); }
.pf-thumb {
  display: block; width: 112px; aspect-ratio: 1; overflow: hidden; padding: 0; border: 0; border-radius: 12px;
  background: var(--bg-2); box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.8);
}
.pf-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9); }
.pf-thumb--paper { padding: 5px; background: #eceef4; cursor: pointer; transition: transform 0.45s var(--ease); }
.pf-thumb--paper img { object-fit: contain; border-radius: 6px; }
.pf-thumb--paper:hover { transform: translateY(-3px); }
.pf-main { display: grid; gap: 10px; min-width: 0; }
.pf-title { font-family: var(--font-head); font-weight: 400; font-size: 20px; line-height: 1.28; letter-spacing: -0.012em; text-wrap: balance; }
.pf-text { font-size: 14.5px; line-height: 1.68; color: var(--ink-2); }
.pf-nature { color: color-mix(in srgb, var(--tint) 75%, #fff); }
.hy-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.hy-status { font-size: 13px; line-height: 1.55; color: var(--ink-3); }
.pj-back {
  justify-self: start; margin-bottom: -10px; padding: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); transition: color 0.25s;
}
.pj-back:hover, .pj-back:focus-visible { color: #fff; }
/* "More projects" call-out: a centred glass pill on a hairline */
.work-more { display: flex; align-items: center; gap: 22px; margin-top: 88px; }
.work-more::before, .work-more::after { content: ""; flex: 1; height: 1px; }
.work-more::before { background: linear-gradient(90deg, transparent, rgba(95, 214, 192, 0.45)); }
.work-more::after { background: linear-gradient(90deg, rgba(181, 140, 255, 0.45), transparent); }
.work-more a {
  position: relative; isolation: isolate; overflow: hidden; flex: none;
  display: inline-flex; align-items: center; gap: 14px; padding: 10px 22px 10px 10px; border-radius: 999px;
  color: var(--ink); text-decoration: none;
  background: linear-gradient(120deg, rgba(95, 214, 192, 0.16), rgba(111, 155, 255, 0.14) 50%, rgba(181, 140, 255, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 18px 44px -20px rgba(111, 155, 255, 0.7), 0 0 0 6px rgba(111, 155, 255, 0.05);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s;
}
.work-more a::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.16) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.9s var(--ease);
}
.work-more a:hover, .work-more a:focus-visible {
  transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 24px 54px -20px rgba(111, 155, 255, 0.9), 0 0 0 8px rgba(111, 155, 255, 0.08);
}
.work-more a:hover::after, .work-more a:focus-visible::after { transform: translateX(120%); }
.work-more a:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.wm-icon {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: linear-gradient(140deg, rgba(95, 214, 192, 0.55), rgba(111, 155, 255, 0.5));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.wm-icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; }
.wm-text { display: grid; gap: 2px; font-family: var(--font-head); font-weight: 500; font-size: 15px; letter-spacing: -0.005em; line-height: 1.25; }
.wm-text small { font-family: var(--font-mono); font-weight: 400; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.wm-arrow { font-size: 16px; color: color-mix(in srgb, var(--teal) 70%, #fff); animation: wmBob 1.8s var(--ease) infinite; }
@keyframes wmBob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }

/* Folder trails (Competitions, Leadership): the same path inside the sheet */
.trail.sheet-trail { --rail: 14px; --amp: 12px; --node-y: 11px; margin-top: 4px; padding-bottom: 8px; }
.sheet-trail .trail-list { gap: 18px; }
.sheet-trail .trail-list > li { gap: 3px; }
.sheet-trail .tr-group:not(:first-child) { margin-top: 14px; }
.sheet-trail .tr-k { line-height: 22px; font-size: 11.5px; }
.sheet-trail .tr-h { font-size: 17px; line-height: 22px; }
.sheet-trail .tr-h a:hover { color: #fff; }
.sheet-trail .tr-role { font-size: 14px; color: var(--ink-2); }
.sheet-trail .tr-win { color: color-mix(in srgb, var(--tint) 80%, #fff); }
.trail-node--group { stroke-width: 1.6; }

/* Shared project bits (folders and drawer) */
.mo-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.mo-results {
  font-family: var(--font-mono); font-size: 11px; line-height: 1.6; letter-spacing: 0.02em; color: var(--ink-3);
  padding-left: 10px; border-left: 1px solid color-mix(in srgb, var(--tint) 60%, transparent);
}
.mo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; margin-top: 6px; }
.mo-link { font-weight: 600; font-size: 13.5px; color: var(--ink-2); transition: color 0.25s; }
.mo-link:hover, .mo-link:focus-visible { color: #fff; }
.plate { margin: 0; display: grid; gap: 12px; }
.plate-paper {
  padding: 6px; border-radius: 10px; background: #f6f7fb; transform: rotate(-0.6deg);
  box-shadow: 0 30px 70px -36px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.35);
  transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease);
}
.plate-paper img { display: block; width: 100%; height: auto; border-radius: 6px; }
.plate figcaption { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
/* Docking photo in the drawer: a small paper frame, like the R plots */
.mo-photo { margin: 0; min-width: 0; }
.mo-photo-frame {
  aspect-ratio: 1; overflow: hidden; padding: 6px; border-radius: 10px; background: #dadada;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.mo-photo-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mo-photo figcaption { margin-top: 10px; font-size: 11px; line-height: 1.5; color: var(--ink-3); }
.mo-photo figcaption { display: grid; gap: 6px; }
.mo-photo figcaption .tile-credit { display: block; }
.pj-figure--photo { padding: 18px; }
.pj-figure--photo .mo-photo-frame { max-width: 320px; }

/* Second featured spread (EEG): blue tint, divided from the first */
.feat--eeg { --tint: var(--blue); padding-top: 104px; border-top: 1px solid var(--line-2); }
.feat--eeg::before { background: radial-gradient(48% 52% at 22% 62%, color-mix(in srgb, var(--tint) 14%, transparent), transparent 70%); }
.feat--eeg .feat-figure { padding: 32px clamp(16px, 3vw, 40px) 22px; }
.feat--eeg .feat-figure .ill-eeg { display: block; width: 100%; height: auto; }
.feat-foot .mo-results { margin: 0; }

/* Illustration strokes (EEG band) */
.ill { display: block; width: 100%; height: auto; overflow: visible; }
.ill-line { fill: none; stroke: rgba(222, 230, 255, 0.6); stroke-width: 1.2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ill-accent { stroke: color-mix(in srgb, var(--tint, #6f9bff) 85%, #fff); }
.ill-fill { fill: color-mix(in srgb, var(--tint, #6f9bff) 12%, transparent); stroke: none; }
.ill-text { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; fill: var(--ink-3); }
.apen { transition: transform 0.3s var(--ease); }
.apen rect {
  fill: color-mix(in srgb, var(--tint, #6f9bff) 12%, transparent); stroke: color-mix(in srgb, var(--tint, #6f9bff) 70%, transparent);
  stroke-dasharray: 3 4; vector-effect: non-scaling-stroke;
}

/* ---------- Trails: a wavy path, drawn as you scroll (main.js) ----------
   Used by "A little about me" and Research & experience. Each <li> is a point
   on the path; the SVG (path, nodes, a glowing head) is generated in main.js.
   --rail: x of the path, --amp: how far the waves swing, --node-y: node height in an item. */
.trail { --rail: 18px; --amp: 11px; --node-y: 9px; position: relative; }
.trail-svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.trail-track { fill: none; stroke: rgba(222, 230, 255, 0.14); stroke-width: 1; stroke-dasharray: 2 6; stroke-linecap: round; }
.trail-ink {
  fill: none; stroke: color-mix(in srgb, var(--tint) 80%, #fff); stroke-width: 1.6; stroke-linecap: round;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--tint) 70%, transparent));
}
.trail-node {
  fill: var(--bg); stroke: rgba(222, 230, 255, 0.28); stroke-width: 1.3;
  transform-box: fill-box; transform-origin: center; transition: fill 0.45s, stroke 0.45s, transform 0.45s var(--ease);
}
.trail-node.on { fill: color-mix(in srgb, var(--tint) 35%, var(--bg)); stroke: color-mix(in srgb, var(--tint) 85%, #fff); transform: scale(1.25); }
.trail-head { fill: #fff; opacity: 0; transition: opacity 0.3s; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--tint) 90%, #fff)); }
.trail-head.show { opacity: 1; }
.trail-list { display: grid; gap: 30px; margin: 0; padding: 0; list-style: none; }
.trail-list > li {
  position: relative; display: grid; gap: 6px; padding-left: calc(var(--rail) + var(--amp) + 18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.trail.is-live .trail-list > li:not(.on) { opacity: 0; transform: translateY(14px); }
.tr-k { font-family: var(--font-mono); font-size: 11px; line-height: 18px; letter-spacing: 0.14em; text-transform: uppercase; color: color-mix(in srgb, var(--tint) 75%, #fff); }
.tr-t { font-size: 15px; line-height: 1.6; color: var(--ink-2); max-width: 46ch; }
.tr-h { font-family: var(--font-head); font-weight: 400; font-size: 20px; line-height: 1.28; letter-spacing: -0.012em; }
.tr-role { font-size: 13.5px; line-height: 1.5; color: var(--ink-3); }
.about-trail { --tint: var(--teal); margin-top: 6px; }
.places-trail { --tint: var(--blue); }
.places .section-head h2 { font-size: clamp(28px, 3.2vw, 42px); }

/* Research & experience on wide screens: the path runs down the middle and
   the points alternate either side of it. */
@media (min-width: 861px) {
  .trail--split { --amp: 44px; --node-y: 9px; }
  .trail--split .trail-list { gap: 0; }
  .trail--split .trail-list > li { width: 50%; margin-left: 50%; padding: 0 0 0 64px; }
  .trail--split .trail-list > li + li { margin-top: -18px; }
  .trail--split .trail-list > li:nth-child(odd) { margin-left: 0; padding: 0 64px 0 0; text-align: right; justify-items: end; }
  .trail--split .trail-list > li:nth-child(n) .tr-t { max-width: 40ch; }
}

/* Detail drawer (the shared sheet, 'project' variant) */
.sheet[data-variant="project"] { width: min(840px, calc(100vw - 32px)); }
.sheet[data-variant="project"] .sheet-head h3 { font-size: clamp(22px, 2.4vw, 28px); text-wrap: balance; }
.sheet-inner.swap .sheet-head, .sheet-inner.swap .sheet-body { animation: swapIn 0.45s var(--ease); }
@keyframes swapIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pj { display: grid; gap: 28px; }
.pj-figure {
  margin: 0; padding: 28px 22px 16px; border-radius: 20px;
  background: radial-gradient(70% 80% at 50% 40%, color-mix(in srgb, var(--tint) 14%, transparent), transparent 75%), rgba(255, 255, 255, 0.025);
}
.pj-figure figcaption { margin-top: 10px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.pj-figure--plates { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; padding: 18px; }
.pj-figure--plates .plate-paper { transform: none; }
.pj-figure .ill, .pj-figure .flow { clip-path: inset(0 100% 0 0); transition: clip-path 1.5s var(--ease); }
.pj-figure.drawn .ill, .pj-figure.drawn .flow { clip-path: inset(0 0 0 0); }
.pj-lede { font-family: var(--font-display); font-size: 19px; line-height: 1.55; letter-spacing: -0.006em; color: var(--ink); }
.pj-block { display: grid; gap: 12px; }
.pj-block h4 { font-family: var(--font-mono); font-weight: 400; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.pj-list { display: grid; gap: 10px; margin: 0; padding: 0; }
.pj-list li { position: relative; padding-left: 20px; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.pj-list li::before { content: ""; position: absolute; left: 0; top: 0.82em; width: 9px; height: 1px; background: color-mix(in srgb, var(--tint) 80%, #fff); }
.pj-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px 28px; margin: 0; padding-top: 22px; border-top: 1px solid var(--line-2); }
.pj-facts dt { margin-bottom: 4px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.pj-facts dd { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink); }
.pj-facts dd.mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.01em; }
.pj-links { display: flex; flex-wrap: wrap; gap: 22px; }
.pj-links a { font-weight: 600; font-size: 14px; padding-bottom: 3px; border-bottom: 1px solid color-mix(in srgb, var(--tint) 60%, transparent); }
.pj-links a:hover { color: #fff; }
.pj-nav { display: flex; justify-content: space-between; gap: 16px; padding-top: 20px; border-top: 1px solid var(--line-2); }
.pj-nav button {
  display: grid; gap: 4px; max-width: 46%; padding: 4px 0; background: none; border: 0; cursor: pointer;
  text-align: left; font-size: 14px; line-height: 1.4; color: var(--ink-2); transition: color 0.25s;
}
.pj-nav button:last-child { margin-left: auto; text-align: right; }
.pj-nav button small { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.pj-nav button:hover { color: var(--ink); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1280px) {
  .hero { min-height: max(1020px, 100svh); }
}

@media (max-width: 1180px) {
  .eeg { display: none; }
  .hero-copy { width: min(400px, 40vw); }
  .socials { top: auto; bottom: 128px; gap: 28px; }
}

@media (max-width: 860px) {
  .hero {
    min-height: 0; display: flex; flex-direction: column; gap: 14px;
    padding: calc(58vh + 40px) 16px 28px;
  }
  .stage { display: none; }
  .receptor { inset: 64px 0 auto 0; height: 58vh; }
  .hero-copy { position: relative; left: auto; top: auto; width: auto; z-index: 3; }
  .hero-copy h1 { font-size: clamp(46px, 14vw, 64px); margin-bottom: 18px; }
  .intro { padding: 28px 24px 26px; }
  .socials {
    position: relative; right: auto; top: auto; bottom: auto;
    justify-content: center; flex-wrap: wrap; gap: 24px; padding-top: 40px;
  }
  .float { animation: none; }

  .section { padding: 80px 16px 8px; }
  .about-grid { grid-template-columns: 1fr; }
  .work { padding-top: 96px; }
  .work-head { margin-bottom: 48px; }
  .wblock { padding-block: 64px; }
  .wblock-head { margin-bottom: 36px; }
  .feat { gap: 36px; }
  .feat-head { grid-template-columns: 1fr; }
  .feat-title, .feat-summary, .feat-labels, .feat-foot { grid-column: 1; }
  .feat-figure { padding: 28px 18px 20px; border-radius: 20px; }
  .wblock-head.wr-head { flex-direction: column; align-items: flex-start; }
  .strip { padding-inline: 16px; scroll-padding-inline: 16px; }
  .tile, .tile--wide { width: 78vw; }
  .tile-media { height: 56vw; }
  .also { grid-template-columns: 1fr; gap: 8px; margin-top: 56px; }
  .also-list { grid-template-columns: 1fr; }
  .pf-item { grid-template-columns: 76px minmax(0, 1fr); gap: 16px; padding-block: 20px; }
  .pf-thumb { width: 76px; border-radius: 10px; }
  .pf-title { font-size: 18px; }
  .work-more { margin-top: 56px; gap: 12px; }
  .work-more a { padding-right: 16px; gap: 12px; }
  .wm-text { font-size: 14px; }
  .trail { --rail: 16px; --amp: 13px; }
  .trail-list { gap: 26px; }
  .feat--eeg { padding-top: 64px; }
  .flow { grid-template-columns: 1fr; gap: 14px; }
  .feat .flow::before { left: 15px; top: 14px; }
  .flow::before {
    left: 13px; right: auto; top: 12px; bottom: 12px; width: 1px; height: auto;
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--tint) 75%, transparent) 10%, color-mix(in srgb, var(--tint) 75%, transparent) 90%, transparent);
  }
  .flow li { grid-template-columns: 28px minmax(0, 1fr); justify-items: start; column-gap: 12px; row-gap: 2px; text-align: left; padding-inline: 0; }
  .flow li::before { grid-row: span 3; margin: 4px 0 0 8px; }
  .pj-nav button { max-width: 48%; }
  .panel { padding: 24px; }
  .contact-end { grid-template-columns: 1fr; padding-block: 44px 56px; }
  .contact-side { padding: 26px 0 0; border-left: 0; border-top: 1px solid var(--line-2); }
  .folders { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .folder-body { min-height: 170px; padding: 16px; }
  .folder-title { font-size: 18px; }
  .folder-blurb { display: none; }
  .nav nav a { padding: 8px 10px; font-size: 13px; }
  .sheet-inner { padding: 22px 18px; }
  .sheet-head h3 { font-size: 24px; }
}

@media (max-width: 380px) {
  .nav nav a { padding: 8px 7px; }
  .folders { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blob, .float, .soc-icon, .soc-reflect, .streak, .place-dot::after { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .sheet[open] .sheet-inner { animation: none; }
  .folder, .folder-paper { transition: none; }
  .pj-figure .ill, .pj-figure .flow { clip-path: none; transition: none; }
  .trail-list > li, .trail-node { transition: none; }
  .wm-arrow { animation: none; }
  .work-more a, .work-more a::after { transition: none; }
  .sheet-inner.swap .sheet-head, .sheet-inner.swap .sheet-body { animation: none; }
  .tile-zoom, .hy-media img, .plate-paper, .hy-item::before, .apen, .flow li::before, .strip-progress span { transition: none; }
}
