/* ==========================================================================
   Mohiuddin Masum — site styles
   Forest analogous palette: moss → olive → sage → lichen, on cream & deep green
   ========================================================================== */

:root {
  --forest-900: #141a12;
  --forest-800: #1c2419;
  --forest-700: #26311f;
  --moss: #3e4b2e;
  --olive: #6b7440;
  --olive-gold: #a59a52;
  --sage: #93a179;
  --lichen: #c4c79c;
  --cream: #eee9d8;
  --paper: #f6f2e6;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.22, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 48px);

  /* default theme = light (academic) */
  --bg: var(--paper);
  --bg-2: var(--cream);
  --surface: #fbf8ef;
  --text: var(--forest-800);
  --text-soft: #4b5641;
  --muted: #7a8468;
  --line: rgba(38, 49, 31, .14);
  --accent: var(--olive);
  --accent-2: var(--moss);
  --accent-soft: rgba(107, 116, 64, .12);
  --header-bg: rgba(246, 242, 230, .72);
}

body.theme-dark {
  --bg: var(--forest-900);
  --bg-2: var(--forest-800);
  --surface: #1f281b;
  --text: var(--cream);
  --text-soft: #c9cbb3;
  --muted: #8f9a78;
  --line: rgba(196, 199, 156, .14);
  --accent: var(--lichen);
  --accent-2: var(--sage);
  --accent-soft: rgba(196, 199, 156, .1);
  --header-bg: rgba(20, 26, 18, .68);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  opacity: 0;
  transition: opacity .6s var(--ease);
}
body.ready { opacity: 1; }
body.leaving { opacity: 0; transition-duration: .35s; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--olive); color: var(--paper); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
h1 { font-size: clamp(2.6rem, 7vw, 5.6rem); }
h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); letter-spacing: -.01em; }
p { margin: 0 0 1.1em; }
em { font-style: italic; }
.serif-italic { font-family: var(--font-display); font-style: italic; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: .8em;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .6; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--text-soft); max-width: 60ch; }
.muted { color: var(--muted); }

/* ---------- analogue grain ---------- */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 100;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
body.theme-dark .grain { opacity: .09; }
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
}

/* ---------- abstract organic blobs ---------- */
.blobs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.blob {
  position: absolute;
  border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
  filter: blur(40px);
  opacity: .55;
  animation: morph 18s var(--ease) infinite alternate, drift 26s ease-in-out infinite alternate;
}
.blob.b1 { width: 46vmax; height: 46vmax; background: radial-gradient(circle at 30% 30%, var(--sage), transparent 65%); top: -18vmax; right: -12vmax; }
.blob.b2 { width: 34vmax; height: 34vmax; background: radial-gradient(circle at 60% 40%, var(--olive-gold), transparent 65%); bottom: -14vmax; left: -10vmax; animation-delay: -6s, -9s; opacity: .35; }
.blob.b3 { width: 22vmax; height: 22vmax; background: radial-gradient(circle, var(--olive), transparent 70%); top: 40%; left: 45%; animation-delay: -3s, -14s; opacity: .25; }
body.theme-dark .blob { opacity: .32; }
body.theme-dark .blob.b2 { opacity: .22; }
@keyframes morph {
  0% { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; }
  50% { border-radius: 61% 39% 38% 62% / 55% 61% 39% 45%; }
  100% { border-radius: 37% 63% 51% 49% / 37% 35% 65% 63%; }
}
@keyframes drift {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { transform: translate(4vmax, 3vmax) rotate(40deg) scale(1.08); }
}

/* contour-line art (anatomical fascicles / topography) */
.contours { position: absolute; pointer-events: none; z-index: 0; color: var(--accent); opacity: .5; }
.contours path { fill: none; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.draw path { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: draw 3.6s var(--ease-out) forwards; }
.draw path:nth-child(2) { animation-delay: .12s; } .draw path:nth-child(3) { animation-delay: .24s; }
.draw path:nth-child(4) { animation-delay: .36s; } .draw path:nth-child(5) { animation-delay: .48s; }
.draw path:nth-child(6) { animation-delay: .6s; }  .draw path:nth-child(7) { animation-delay: .72s; }
.draw path:nth-child(8) { animation-delay: .84s; } .draw path:nth-child(9) { animation-delay: .96s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ==========================================================================
   LANDING — the split
   ========================================================================== */
body.landing { background: var(--forest-900); overflow: hidden; }
.split {
  position: relative;
  display: flex;
  height: 100vh;
  height: 100svh;
  width: 100%;
}
.door {
  position: relative;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(28px, 6vw, 80px);
  transition: flex 1s var(--ease-out);
  isolation: isolate;
  cursor: pointer;
}
.door:hover, .door:focus-visible { flex: 1.45; outline: none; }
.split:hover .door:not(:hover) .door-inner { opacity: .55; }
.door-academic { background: var(--paper); color: var(--forest-800); --accent: var(--olive); }
.door-visual { background: var(--forest-900); color: var(--cream); --accent: var(--lichen); }
.door .contours { inset: 0; width: 100%; height: 100%; }
.door-academic .contours { color: var(--olive); opacity: .38; }
.door-visual .contours { color: var(--sage); opacity: .3; }
.door .blob { opacity: .45; }
.door-visual .blob { opacity: .28; }

.door-inner { position: relative; z-index: 2; transition: opacity .6s var(--ease), transform 1s var(--ease-out); max-width: 520px; }
.door:hover .door-inner { transform: translateY(-10px); }
.door-index { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .2em; opacity: .6; margin-bottom: 1.2rem; display: block; }
.door-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6.4vw, 6.2rem);
  line-height: .95;
  letter-spacing: -.035em;
  margin: 0 0 1.2rem;
}
.door-title em { font-style: italic; color: var(--accent); }
.door-visual .door-title em { color: var(--lichen); }
.door-desc { font-size: 1rem; opacity: .78; max-width: 38ch; margin-bottom: 1.8rem; }
.door-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.door-tags span {
  font-size: .72rem; font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid currentColor; border-radius: 99px; padding: .35em .9em; opacity: .55;
}
.door-cta {
  display: inline-flex; align-items: center; gap: .8rem;
  font-weight: 600; font-size: .95rem; letter-spacing: .02em;
}
.door-cta .circle {
  width: 54px; height: 54px; border-radius: 50%;
  border: 1px solid currentColor;
  display: grid; place-items: center;
  transition: background .5s var(--ease), color .5s var(--ease), transform .7s var(--ease-out);
}
.door:hover .door-cta .circle { transform: rotate(-45deg); }
.door-academic:hover .door-cta .circle { background: var(--forest-800); color: var(--paper); }
.door-visual:hover .door-cta .circle { background: var(--lichen); color: var(--forest-900); }

.landing-brand {
  position: absolute; z-index: 10; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px clamp(20px, 4vw, 48px);
  pointer-events: none;
  mix-blend-mode: difference;
  color: #fff;
}
.landing-brand .mark { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: -.01em; }
.landing-brand .mark b { font-weight: 500; }
.landing-brand .meta { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; }

.landing-center {
  position: absolute; z-index: 9; left: 50%; top: 32%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  text-align: center;
  transition: left 1s var(--ease-out);
}
.monogram {
  width: clamp(120px, 14vw, 180px); aspect-ratio: 1;
  border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(from 200deg, var(--moss), var(--olive), var(--olive-gold), var(--sage), var(--lichen), var(--sage), var(--moss));
  box-shadow: 0 30px 80px -20px rgba(20, 26, 18, .55);
  position: relative;
  animation: spin 40s linear infinite;
}
.monogram::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  background: var(--forest-900);
}
.monogram span {
  position: relative; z-index: 1;
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(2.4rem, 4vw, 3.4rem); color: var(--cream);
  animation: spin 40s linear infinite reverse;
}
.monogram-ring { position: absolute; inset: -26px; animation: spin 30s linear infinite reverse; }
.monogram-ring text { font-family: var(--font-mono); font-size: 8.4px; letter-spacing: 3.3px; text-transform: uppercase; fill: var(--olive-gold); }
@keyframes spin { to { transform: rotate(360deg); } }

.landing-name {
  position: absolute; z-index: 10; bottom: 22px; left: 0; right: 0;
  text-align: center; pointer-events: none;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .25em; text-transform: uppercase;
  mix-blend-mode: difference; color: #fff; opacity: .8;
}

/* intro sequence */
.intro .door { transform: translateY(100%); }
.intro .door-visual { transform: translateY(-100%); }
.intro .landing-center { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
.split .door, .landing-center { transition: flex 1s var(--ease-out), transform 1.4s var(--ease-out), opacity 1s var(--ease); }
.door-visual { transition-delay: 0s, .1s, 0s; }
.landing-center { transition-delay: 0s, .7s, .7s; }

@media (max-width: 760px) {
  body.landing { overflow: auto; }
  .split { flex-direction: column; height: auto; min-height: 100svh; }
  .door { min-height: 50svh; padding: 88px 24px 40px; }
  .door:hover, .door:focus-visible { flex: 1; }
  .landing-brand { mix-blend-mode: normal; color: var(--forest-800); padding-top: 20px; }
  .landing-brand .meta { display: none; }
  .door-academic { order: 0; padding-top: 96px; padding-bottom: 64px; }
  .door-visual { order: 2; padding-top: 72px; }
  .landing-center { order: 1; position: relative; left: auto !important; top: auto; transform: none; height: 0; display: flex; justify-content: center; align-items: center; }
  .intro .landing-center { transform: scale(.6); }
  .monogram { width: 92px; }
  .monogram span { font-size: 1.9rem; }
  .monogram-ring { display: none; }
  .landing-name { display: none; }
  .door-title { font-size: 2.9rem; }
  .intro .door, .intro .door-visual { transform: translateY(40px); opacity: 0; }
}

/* ==========================================================================
   SECTION SHELL — header / footer
   ========================================================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: transform .5s var(--ease), background .4s var(--ease), border-color .4s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { background: var(--header-bg); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); border-color: var(--line); }
.site-header.hidden { transform: translateY(-100%); }
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-style: italic; font-size: 1.15rem;
  background: var(--text); color: var(--bg);
  transition: transform .6s var(--ease-out);
}
.brand:hover .brand-mark { transform: rotate(-12deg) scale(1.05); }
.brand-text { line-height: 1.1; }
.brand-text b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; letter-spacing: -.01em; }
.brand-text small { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

.nav-links { display: flex; align-items: center; gap: .2rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  position: relative; display: block;
  padding: .5rem .9rem; border-radius: 99px;
  font-size: .9rem; font-weight: 500; color: var(--text-soft);
  transition: color .3s, background .3s;
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); transform: translateX(-50%);
}
.switch-side {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 600;
  padding: .55rem 1rem; border-radius: 99px;
  border: 1px solid var(--line);
  transition: border-color .3s, background .3s;
  white-space: nowrap;
}
.switch-side:hover { border-color: var(--accent); background: var(--accent-soft); }
.switch-side .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.menu-toggle { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); position: relative; }
.menu-toggle span { position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--text); transition: transform .4s var(--ease), top .4s var(--ease); }
.menu-toggle span:nth-child(1) { top: 18px; } .menu-toggle span:nth-child(2) { top: 25px; }
.menu-open .menu-toggle span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .menu-toggle { display: block; z-index: 2; }
  .nav-right { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2rem; padding: 0 28px; clip-path: circle(0 at calc(100% - 44px) 38px); transition: clip-path .8s var(--ease-out); }
  .menu-open .nav-right { clip-path: circle(150% at calc(100% - 44px) 38px); }
  .nav-links { flex-direction: column; align-items: flex-start; gap: .2rem; }
  .nav-links a { font-family: var(--font-display); font-size: 2.2rem; padding: .2rem 0; color: var(--text); background: none !important; }
  .nav-links a.active::after { left: -14px; top: 50%; bottom: auto; }
  .menu-open .site-header { background: transparent; border-color: transparent; backdrop-filter: none; }
}
.nav-right { display: flex; align-items: center; gap: 1rem; }

.site-footer { position: relative; padding: 90px 0 36px; border-top: 1px solid var(--line); margin-top: 120px; overflow: hidden; }
.footer-big { font-family: var(--font-display); font-size: clamp(2.4rem, 8vw, 7rem); line-height: .95; letter-spacing: -.04em; margin-bottom: 2.4rem; }
.footer-big em { color: var(--accent); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-grid h4 { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; font-weight: 400; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: .4rem; }
.footer-grid a { color: var(--text-soft); transition: color .3s; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ==========================================================================
   SHARED SECTION COMPONENTS
   ========================================================================== */
main { position: relative; }
.hero { position: relative; min-height: 92vh; display: flex; align-items: center; padding: 140px 0 80px; overflow: hidden; }
.hero .container { position: relative; z-index: 2; }
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(32px, 6vw, 90px); align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 .line { display: block; overflow: hidden; padding: 0 .06em .12em 0; margin-bottom: -.12em; }
.hero h1 .line > span { display: inline-block; transform: translateY(105%); transition: transform 1.2s var(--ease-out); }
.ready .hero h1 .line > span { transform: none; }
.hero h1 .line:nth-child(2) > span { transition-delay: .12s; }
.hero h1 .line:nth-child(3) > span { transition-delay: .24s; }
.hero h1 em { color: var(--accent); }

.page-head { position: relative; padding: 170px 0 70px; overflow: hidden; }
.page-head .container { position: relative; z-index: 2; }
.page-head h1 { font-size: clamp(2.8rem, 8vw, 6.4rem); margin: .4em 0 .3em; }
.page-head h1 em { color: var(--accent); }

.section { position: relative; padding: clamp(60px, 9vw, 120px) 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-bottom: 3rem; flex-wrap: wrap; }
.section-head h2 { margin: .35em 0 0; }

.portrait {
  position: relative; aspect-ratio: 4 / 5; border-radius: 200px 200px var(--radius) var(--radius);
  overflow: hidden; background: var(--bg-2);
  box-shadow: 0 40px 80px -40px rgba(20, 26, 18, .45);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait-wrap { position: relative; }
.portrait-wrap .orbit {
  position: absolute; inset: -18px; border: 1px dashed var(--line); border-radius: 220px 220px 28px 28px;
  pointer-events: none;
}
.portrait-badge {
  position: absolute; left: -22px; bottom: 34px; z-index: 2;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px; padding: .8rem 1rem;
  box-shadow: 0 20px 40px -20px rgba(20, 26, 18, .35);
  font-size: .82rem; line-height: 1.35;
  animation: float 6s ease-in-out infinite;
}
.portrait-badge b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 1rem; }
@keyframes float { 50% { transform: translateY(-8px); } }

.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .85rem 1.4rem; border-radius: 99px;
  font-weight: 600; font-size: .92rem;
  background: var(--text); color: var(--bg);
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease), background .3s;
  position: relative; overflow: hidden;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(20, 26, 18, .5); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn svg { width: 16px; height: 16px; transition: transform .4s var(--ease-out); }
.btn:hover svg { transform: translate(3px, -3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

.profile-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.8rem; }
.plink {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .45rem 1rem .45rem .45rem; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: .86rem; font-weight: 500;
  transition: border-color .3s, transform .4s var(--ease-out), background .3s;
}
.plink:hover { border-color: var(--accent); transform: translateY(-2px); }
.plink .ico {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: .68rem; font-weight: 700;
  background: var(--accent-soft); color: var(--accent-2);
}
body.theme-dark .plink .ico { color: var(--lichen); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  padding: .45rem 1rem; border-radius: 99px;
  border: 1px solid var(--line); font-size: .85rem; color: var(--text-soft);
  background: transparent; transition: all .3s var(--ease);
}
button.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .6s var(--ease-out), box-shadow .6s var(--ease), border-color .4s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -36px rgba(20, 26, 18, .45); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 960px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.sample-flag {
  display: inline-block; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .2em .6em; border-radius: 4px; background: var(--accent-soft); color: var(--muted); vertical-align: middle;
}

/* reveal on scroll */
[data-reveal] { opacity: 0; transform: translateY(36px); transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal="fade"] { transform: none; }
[data-reveal="scale"] { transform: scale(.94); }

/* marquee */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 22px 0; white-space: nowrap; }
.marquee-track { display: inline-flex; gap: 3rem; animation: marquee 38s linear infinite; }
.marquee span { font-family: var(--font-display); font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-style: italic; color: var(--text-soft); display: inline-flex; align-items: center; gap: 3rem; }
.marquee span::after { content: "✦"; font-style: normal; font-size: .6em; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ==========================================================================
   ACADEMIC
   ========================================================================== */
.interest-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.interest { background: var(--bg); padding: 28px; transition: background .4s; }
.interest:hover { background: var(--surface); }
.interest .num { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); }
.interest h3 { margin: 1.4rem 0 .4rem; font-size: 1.35rem; }
.interest p { font-size: .9rem; color: var(--text-soft); margin: 0; }

.pub-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-bottom: 2.4rem; align-items: center; }
.search {
  display: flex; align-items: center; gap: .6rem;
  border: 1px solid var(--line); border-radius: 99px; padding: .55rem 1.1rem; min-width: min(320px, 100%);
  background: var(--surface);
}
.search input { border: 0; outline: 0; background: none; font: inherit; font-size: .92rem; color: var(--text); width: 100%; }
.search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }

.pub-year { display: grid; grid-template-columns: 140px 1fr; gap: 2rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.pub-year > h3 { font-family: var(--font-display); font-size: 2.4rem; color: var(--accent); position: sticky; top: 100px; align-self: start; margin: 0; }
@media (max-width: 700px) { .pub-year { grid-template-columns: 1fr; gap: .5rem; } .pub-year > h3 { position: static; font-size: 1.8rem; } }
.pub { padding: 1.2rem 0 1.4rem; border-bottom: 1px dashed var(--line); display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: start; }
.pub:last-child { border-bottom: 0; }
.pub-type { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pub h4 { font-family: var(--font-display); font-size: 1.28rem; font-weight: 400; line-height: 1.3; margin: .35rem 0 .45rem; letter-spacing: -.01em; }
.pub .authors { font-size: .9rem; color: var(--text-soft); margin: 0; }
.pub .authors b { color: var(--text); font-weight: 600; }
.pub .venue { font-size: .88rem; color: var(--muted); font-style: italic; margin: .2rem 0 0; }
.pub-link {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; flex: none;
  transition: all .4s var(--ease-out);
}
.pub-link:hover { background: var(--text); color: var(--bg); transform: rotate(-45deg); }
.pub-link svg { width: 16px; height: 16px; }
.empty { padding: 3rem 0; text-align: center; color: var(--muted); }

.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 2rem; }
.tl-item::before { content: ""; position: absolute; left: -28px; top: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.tl-item .when { font-family: var(--font-mono); font-size: .74rem; color: var(--muted); letter-spacing: .08em; }
.tl-item h4 { font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; margin: .2rem 0 .2rem; }
.tl-item p { font-size: .92rem; color: var(--text-soft); margin: 0; }

.writing-card { display: flex; flex-direction: column; min-height: 300px; }
.writing-card .kind { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); }
.writing-card h3 { margin: 1rem 0 .6rem; }
.writing-card p { font-size: .94rem; color: var(--text-soft); flex: 1; }
.writing-card .foot { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.writing-card .foot .go { color: var(--text); font-weight: 600; display: inline-flex; gap: .4rem; align-items: center; }
.writing-card.book { background: linear-gradient(160deg, var(--moss), var(--forest-800)); color: var(--cream); border-color: transparent; }
.writing-card.book p, .writing-card.book .foot { color: var(--lichen); border-color: rgba(196, 199, 156, .2); }
.writing-card.book .kind { color: var(--olive-gold); }
.writing-card.book .foot .go { color: var(--cream); }

.quote-block { font-family: var(--font-display); font-size: clamp(1.6rem, 3.4vw, 2.6rem); line-height: 1.25; letter-spacing: -.015em; max-width: 26ch; }
.quote-block em { color: var(--accent); }

/* ==========================================================================
   VISUAL ARTIST
   ========================================================================== */
.v-hero-title { font-size: clamp(3.2rem, 11vw, 9.5rem); line-height: .88; letter-spacing: -.045em; }
.v-hero-title em { font-style: italic; color: var(--lichen); }
.aperture { position: absolute; right: -8vw; top: 50%; width: min(70vw, 720px); aspect-ratio: 1; transform: translateY(-50%); z-index: 1; opacity: .5; pointer-events: none; }
.aperture circle { fill: none; stroke: var(--sage); stroke-width: .5; }
.aperture .spin-slow { transform-origin: center; animation: spin 80s linear infinite; }
.aperture .spin-rev { transform-origin: center; animation: spin 60s linear infinite reverse; }
@media (max-width: 900px) { .aperture { right: -40vw; opacity: .3; } }

.album-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.album-card { grid-column: span 4; position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; display: block; background: var(--surface); }
.album-card:nth-child(5n + 1) { grid-column: span 7; aspect-ratio: 16 / 11; }
.album-card:nth-child(5n + 2) { grid-column: span 5; aspect-ratio: auto; }
@media (max-width: 900px) { .album-card, .album-card:nth-child(n) { grid-column: span 6; aspect-ratio: 4 / 5; } }
@media (max-width: 560px) { .album-card, .album-card:nth-child(n) { grid-column: span 12; aspect-ratio: 4 / 4.4; } }
.album-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease-out), filter .8s; filter: saturate(.85); }
.album-card:hover img { transform: scale(1.06); filter: saturate(1.05); }
.album-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(14, 18, 12, .88), rgba(14, 18, 12, 0) 55%); }
.album-meta { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 26px; color: var(--cream); display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.album-meta h3 { margin: .2rem 0 .2rem; font-size: clamp(1.5rem, 2.4vw, 2.2rem); }
.album-meta p { margin: 0; font-size: .86rem; color: var(--lichen); max-width: 36ch; }
.album-meta .count { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--lichen); }
.album-meta .open {
  width: 48px; height: 48px; flex: none; border-radius: 50%; border: 1px solid rgba(238, 233, 216, .4);
  display: grid; place-items: center; transition: all .5s var(--ease-out);
}
.album-card:hover .open { background: var(--lichen); color: var(--forest-900); transform: rotate(-45deg); border-color: var(--lichen); }

.masonry { columns: 3 300px; column-gap: 18px; }
.masonry figure { margin: 0 0 18px; break-inside: avoid; position: relative; border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--surface); }
.masonry img { width: 100%; height: auto; transition: transform 1.2s var(--ease-out); }
.masonry figure:hover img { transform: scale(1.04); }
.masonry figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 14px;
  background: linear-gradient(to top, rgba(14, 18, 12, .85), transparent);
  color: var(--cream); font-size: .84rem; opacity: 0; transform: translateY(10px); transition: all .5s var(--ease-out);
}
.masonry figure:hover figcaption { opacity: 1; transform: none; }

.film-card { display: block; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: transform .6s var(--ease-out), border-color .4s; }
.film-card:hover { transform: translateY(-6px); border-color: rgba(196, 199, 156, .35); }
.film-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.film-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.film-card:hover .film-thumb img { transform: scale(1.06); }
.play {
  position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; transform: translate(-50%, -50%);
  border-radius: 50%; background: rgba(238, 233, 216, .14); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(238, 233, 216, .45); display: grid; place-items: center; color: var(--cream);
  transition: transform .6s var(--ease-out), background .4s;
}
.film-card:hover .play { transform: translate(-50%, -50%) scale(1.12); background: var(--lichen); color: var(--forest-900); }
.play svg { width: 22px; height: 22px; margin-left: 3px; }
.platform { position: absolute; top: 14px; left: 14px; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; padding: .35em .8em; border-radius: 99px; background: rgba(14, 18, 12, .6); color: var(--cream); backdrop-filter: blur(6px); }
.duration { position: absolute; bottom: 12px; right: 12px; font-family: var(--font-mono); font-size: .7rem; padding: .2em .55em; border-radius: 4px; background: rgba(14, 18, 12, .7); color: var(--cream); }
.film-body { padding: 20px 22px 24px; }
.film-body h3 { margin: 0 0 .4rem; font-size: 1.3rem; }
.film-body p { margin: 0; font-size: .88rem; color: var(--text-soft); }
.film-body .meta { font-family: var(--font-mono); font-size: .7rem; color: var(--muted); letter-spacing: .08em; margin-top: .8rem; display: block; }

.app-card { display: flex; flex-direction: column; gap: 1rem; }
.app-icon {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  font-family: var(--font-display); font-style: italic; font-size: 1.7rem; color: var(--forest-900);
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, .6);
}
.app-card h3 { margin: 0; }
.app-card p { color: var(--text-soft); font-size: .92rem; margin: 0; flex: 1; }
.app-card .tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.app-card .tags span { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; padding: .3em .7em; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.store-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.store-links a { font-size: .8rem; font-weight: 600; padding: .5rem .9rem; border-radius: 99px; background: var(--accent-soft); border: 1px solid var(--line); transition: all .3s; }
.store-links a:hover { background: var(--lichen); color: var(--forest-900); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.stat { background: var(--bg); padding: 28px; }
.stat b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 2.6rem; line-height: 1; color: var(--accent); }
.stat span { font-size: .84rem; color: var(--muted); }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.strip { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: thin; }
.strip > * { scroll-snap-align: start; flex: 0 0 min(78vw, 360px); }


/* Visual hero portrait — duotone, vignetted into the dark page */
.v-portrait {
  position: absolute; top: 0; right: 0; bottom: 0; margin: 0;
  width: min(56vw, 840px); z-index: 1; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 58% 68% at 60% 38%, #000 18%, rgba(0,0,0,.7) 34%, rgba(0,0,0,.3) 52%, rgba(0,0,0,.08) 64%, transparent 74%);
          mask-image: radial-gradient(ellipse 58% 68% at 60% 38%, #000 18%, rgba(0,0,0,.7) 34%, rgba(0,0,0,.3) 52%, rgba(0,0,0,.08) 64%, transparent 74%);
}
.v-portrait img {
  width: 100%; height: 100%; object-fit: cover; object-position: 45% 22%;
  filter: grayscale(1) sepia(.45) hue-rotate(28deg) saturate(.8) contrast(1.18) brightness(.74);
  opacity: 0; transform: scale(1.08);
  transition: opacity 2s var(--ease), transform 3s var(--ease-out);
}
.ready .v-portrait img { opacity: .92; transform: none; }
.v-portrait::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, var(--moss) 0%, rgba(62,75,46,.35) 45%, rgba(165,154,82,.18) 100%);
  mix-blend-mode: multiply;
}
.v-portrait::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(circle at 70% 30%, rgba(196,199,156,.18), transparent 50%);
  mix-blend-mode: soft-light;
}
@media (max-width: 900px) {
  .v-portrait { width: 100%; opacity: .45;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.6) 45%, transparent 80%);
            mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.6) 45%, transparent 80%); }
}

/* ---------- lightbox / slideshow ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(10, 13, 9, .96);
  display: grid; grid-template-rows: auto 1fr auto; color: var(--cream);
  opacity: 0; pointer-events: none; transition: opacity .5s var(--ease);
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; }
.lb-actions { display: flex; gap: .5rem; }
.lb-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(238, 233, 216, .25); display: grid; place-items: center; color: var(--cream); transition: all .3s; }
.lb-btn:hover { background: var(--lichen); color: var(--forest-900); border-color: var(--lichen); }
.lb-btn svg { width: 18px; height: 18px; }
.lb-stage { position: relative; display: grid; place-items: center; overflow: hidden; padding: 0 76px; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 190px); object-fit: contain; border-radius: 6px; box-shadow: 0 40px 100px -20px #000; transition: opacity .45s var(--ease), transform .7s var(--ease-out); }
.lb-stage img.swap { opacity: 0; transform: scale(.97); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 16px; } .lb-next { right: 16px; }
.lb-bottom { padding: 16px 22px 22px; text-align: center; }
.lb-caption { font-family: var(--font-display); font-size: 1.15rem; font-style: italic; color: var(--cream); min-height: 1.6em; }
.lb-progress { height: 2px; background: rgba(238, 233, 216, .12); margin: 14px auto 0; max-width: 420px; border-radius: 2px; overflow: hidden; }
.lb-progress i { display: block; height: 100%; width: 0; background: var(--lichen); }
.lb-progress.running i { animation: progress var(--slide-ms, 4500ms) linear forwards; }
@keyframes progress { to { width: 100%; } }
.lb-thumbs { display: flex; gap: 6px; justify-content: center; margin-top: 14px; overflow-x: auto; padding-bottom: 4px; }
.lb-thumbs button { width: 54px; height: 40px; flex: none; border-radius: 4px; overflow: hidden; opacity: .4; transition: opacity .3s, outline-color .3s; outline: 1px solid transparent; outline-offset: 2px; }
.lb-thumbs button.on { opacity: 1; outline-color: var(--lichen); }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .lb-stage { padding: 0 8px; } .lb-nav { display: none; } .lb-thumbs { justify-content: flex-start; } }

/* cursor follower (desktop only) */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 150; pointer-events: none;
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  transform: translate(-50%, -50%); transition: width .35s var(--ease-out), height .35s var(--ease-out), background .3s, opacity .3s;
  mix-blend-mode: difference; opacity: 0;
}
.cursor.on { opacity: 1; }
.cursor.big { width: 64px; height: 64px; background: var(--lichen); }
@media (hover: none) { .cursor { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .grain { animation: none; }
}
