/* =====================================================================
   Shylaja D N — Academic Portfolio
   Theme tokens: edit colours here only.
   ===================================================================== */
:root,
[data-theme="dark"] {
  --background: #050816;
  --surface: #0B1020;
  --card: #111827;
  --foreground: #E8ECF5;
  --muted: #9AA6BD;
  --faint: #7E8AA6;
  --border: #1C2640;
  --line: #2A3A60;
  --primary: #3452E6;        /* royal blue — buttons, core node */
  --primary-text: #8FA6FF;
  --secondary: #A78BFA;      /* soft violet */
  --accent: #38D6F0;         /* cyan */
  --chip: #0F1A33;
  --glow: rgba(56, 214, 240, .28);
  --shadow: rgba(0, 0, 0, .6);
  --nav-bg: rgba(5, 8, 22, .78);
  --error: #FF8A7A;
  --success: #4ADE80;
  --card-face: linear-gradient(180deg, #162036 0%, #0F1625 100%);
  --depth: inset 0 1px 0 rgba(255,255,255,.07), 0 2px 0 rgba(0,0,0,.35), 0 30px 60px -30px rgba(0,0,0,.9);
  --keycap: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 0 #070C1C, 0 7px 0 #1C2640, 0 22px 34px -14px rgba(0,0,0,.85);
  --stack: 9px 9px 0 -1px var(--card), 9px 9px 0 0 var(--border), 18px 18px 0 -1px var(--card), 18px 18px 0 0 var(--border), var(--depth);
  color-scheme: dark;
}
[data-theme="light"] {
  --background: #F6F8FC;
  --surface: #FFFFFF;
  --card: #FFFFFF;
  --foreground: #0A1533;
  --muted: #4A5674;
  --faint: #5F6A87;
  --border: #DCE2EE;
  --line: #C3CDE2;
  --primary: #2B47D6;
  --primary-text: #2B47D6;
  --secondary: #6A4ED6;
  --accent: #0B7A93;
  --chip: #EEF2FB;
  --glow: rgba(43, 71, 214, .18);
  --shadow: rgba(10, 21, 51, .22);
  --nav-bg: rgba(246, 248, 252, .86);
  --error: #B42318;
  --success: #15803D;
  --card-face: linear-gradient(180deg, #FFFFFF 0%, #F4F7FC 100%);
  --depth: inset 0 1px 0 #FFFFFF, 0 1px 2px rgba(10,21,51,.06), 0 26px 50px -28px rgba(10,21,51,.32);
  --keycap: inset 0 1px 0 #FFFFFF, 0 6px 0 #D3DBEA, 0 7px 0 #C3CDE2, 0 20px 30px -14px rgba(10,21,51,.3);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.page-404 { min-height: 100svh; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 20px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -.03em; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
button { font: inherit; color: inherit; }
.mono, .eyebrow, .label, .kicker, .pill, .tag, .quals, .pub-meta, .brand-text { font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 10px;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 20px; }
@media (min-width: 768px) { .container { padding-inline: 32px; } }
@media (min-width: 1280px) { .container { padding-inline: 20px; } }

section[id] { scroll-margin-top: 72px; }
.section { padding-block: clamp(56px, 7vw, 96px); }
.section + .section { padding-top: 0; }

h2 { font-size: clamp(32px, 4.2vw, 48px); }
.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px 32px; margin-bottom: clamp(24px, 3.5vw, 40px);
}
.sub { margin-top: 10px; color: var(--muted); font-size: clamp(15px, 1.4vw, 17px); max-width: 560px; }
.label { font-size: 11px; letter-spacing: .14em; color: var(--faint); }
.note { font-size: 13px; line-height: 1.6; color: var(--muted); }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- Surfaces with depth ---------- */
.card { background: var(--card-face); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--depth); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--depth); }
.keycap { background: var(--card-face); border: 1px solid var(--border); box-shadow: var(--keycap); }
.stack { box-shadow: var(--stack); }
.lift { transition: translate .28s ease, border-color .28s ease; }
@media (hover: hover) {
  .lift:hover, .js .lift.reveal.in:hover { translate: 0 -6px; border-color: var(--accent); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px; border-radius: 14px; border: 1px solid transparent;
  font-size: 15px; font-weight: 500; cursor: pointer; transition: translate .2s ease, background-color .2s ease;
}
.btn .icon { transition: translate .2s ease; width: 16px; height: 16px; }
.btn:hover .icon { translate: 4px 0; }
.btn:hover { translate: 0 -2px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 12px 28px -12px var(--primary); }
.btn-ghost { border-color: var(--line); background: transparent; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 14px; border-radius: 12px; }
.icon-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--border); background: transparent; cursor: pointer;
}
.icon-btn:hover { border-color: var(--line); }
.btn:disabled { opacity: .6; cursor: progress; translate: none; }

/* theme-dependent visibility */
[data-theme="dark"] .i-when-light, [data-theme="light"] .i-when-dark { display: none !important; }
[data-theme="dark"] .logo-light, [data-theme="light"] .logo-dark { display: none !important; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background-color .25s ease, border-color .25s ease, height .25s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav-row { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; transition: height .25s ease; }
.site-header.scrolled .nav-row { height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }
.brand img { width: auto; height: 40px; }
.brand-text { font-size: 14px; font-weight: 500; letter-spacing: .18em; }
.nav-links { display: none; gap: 26px; font-size: 14px; color: var(--muted); }
.nav-links a { position: relative; padding: 10px 0; transition: color .2s ease; }
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--foreground); }
.nav-links a[aria-current="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent);
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-cta { display: none; }
@media (min-width: 1100px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .menu-toggle { display: none; }
}
@media (max-width: 420px) { .brand-text { font-size: 12px; letter-spacing: .14em; } .brand img { height: 36px; } }

/* Drawer */
.drawer {
  position: fixed; inset: 0; z-index: 60; background: var(--background);
  display: flex; flex-direction: column; overflow-y: auto;
  animation: drawerIn .28s cubic-bezier(.2,.7,.2,1);
}
.drawer[hidden] { display: none; }
@keyframes drawerIn { from { opacity: 0; translate: 0 -12px; } to { opacity: 1; translate: 0 0; } }
.drawer-head { height: 64px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.drawer-head .brand img { height: 36px; }
.drawer-links { flex: 1; display: flex; flex-direction: column; padding-top: 12px; }
.drawer-links a {
  display: flex; align-items: baseline; gap: 14px; min-height: 58px; padding: 12px 0;
  border-bottom: 1px solid var(--border); font-size: 26px; letter-spacing: -.02em;
}
.drawer-links a span { font-family: "Geist Mono", monospace; font-size: 11px; color: var(--faint); letter-spacing: 0; }
.drawer-links a[aria-current="true"] { color: var(--accent); font-weight: 600; }
.drawer-foot { padding-block: 20px 32px; }
.drawer-theme { width: 100%; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 96px 0 48px; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero-floor {
  position: absolute; left: -20%; right: -20%; bottom: -30px; height: 340px; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  transform: perspective(420px) rotateX(62deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 85%);
  mask-image: linear-gradient(to top, #000 0%, transparent 85%);
  opacity: .55;
}
.hero-grid { position: relative; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; }
.eyebrow { font-size: 11px; line-height: 1.7; letter-spacing: .16em; color: var(--accent); }
h1 { white-space: nowrap; font-size: clamp(46px, 6.2vw, 90px); line-height: .96; letter-spacing: -.045em; }
.tagline { margin-top: 16px; font-size: clamp(21px, 2.3vw, 30px); line-height: 1.28; font-weight: 300; color: var(--muted); }
.tagline strong { color: var(--foreground); font-weight: 500; }
.focus { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.focus .label { font-size: 10.5px; }
.focus p { color: var(--muted); font-size: 16px; line-height: 1.65; }
.quals { font-size: 13px; letter-spacing: .08em; }
.quals span { color: var(--accent); }
.cta-row { display: flex; flex-direction: column; gap: 12px; }

.hero-visual { display: flex; justify-content: center; }
.sphere-stage { position: relative; width: min(340px, 88vw); aspect-ratio: 1; }
.sphere-canvas { position: absolute; inset: -8%; width: 116%; height: 116%; }
.hero-portrait {
  position: absolute; left: 50%; top: 50%; width: 36%; aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; overflow: hidden; border: 2px solid var(--accent); background: var(--surface);
  box-shadow: 0 0 0 7px var(--background), 0 0 56px var(--glow);
  animation: floatY 7s ease-in-out infinite;
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.sphere-fallback { position: absolute; inset: 6%; }
.sphere-fallback span { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--accent); opacity: .5; }
.sphere-fallback span:nth-child(2) { inset: 0 22%; opacity: .25; }
.sphere-fallback span:nth-child(3) { inset: 40% -8%; border-color: var(--secondary); opacity: .4; }
.js-sphere .sphere-fallback { display: none; }

@media (min-width: 640px) { .cta-row { flex-direction: row; flex-wrap: wrap; } }
@media (min-width: 1024px) {
  .hero { padding: 120px 0 64px; min-height: min(100svh, 880px); display: flex; align-items: center; }
  .hero-copy {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; row-gap: 26px; align-items: start;
  }
  .hero-copy > * { grid-column: 1; }
  .hero-visual { grid-column: 2; grid-row: 1 / span 5; align-self: center; }
  .sphere-stage { width: min(520px, 40vw); }
  .eyebrow { font-size: 12px; }
}

/* ---------- Statistics ---------- */
.stats-band { padding-block: clamp(40px, 5vw, 64px); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tile { border-radius: 18px; padding: 20px 16px; display: flex; flex-direction: column; gap: 8px; }
.tile .num { font-size: clamp(34px, 3.4vw, 46px); font-weight: 600; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.tile > span:last-child { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } .tile { padding: 24px 22px; } }
@media (min-width: 1200px) { .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---------- About ---------- */
.about-grid { display: grid; gap: 40px; }
.portrait-3d { position: relative; height: 380px; perspective: 1400px; animation: floatY 10s ease-in-out infinite; }
.portrait-3d .plate, .portrait-frame {
  position: absolute; inset: 0; border-radius: 24px; border: 1px solid var(--line);
  transform: rotateX(4deg) rotateY(-9deg);
}
.portrait-3d .plate-2 { transform: rotateX(4deg) rotateY(-9deg) translate3d(-14px, 16px, -80px); opacity: .5; }
.portrait-3d .plate-1 { border-color: var(--accent); background: var(--surface); transform: rotateX(4deg) rotateY(-9deg) translate3d(-7px, 8px, -40px); opacity: .6; }
.portrait-frame { padding: 10px; background: var(--surface); box-shadow: var(--depth), 0 0 70px -20px var(--glow); }
.portrait-frame picture, .portrait-frame img { width: 100%; height: 100%; border-radius: 16px; object-fit: cover; object-position: 50% 30%; }
.about-body { display: flex; flex-direction: column; gap: 24px; }
.lead { font-size: clamp(19px, 1.8vw, 23px); line-height: 1.55; font-weight: 300; }
.facts { display: grid; border-top: 1px solid var(--border); }
.facts > div { padding: 16px 0; border-bottom: 1px solid var(--border); }
.facts dt { font-family: "Geist Mono", monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.facts dd { margin-top: 6px; font-size: 17px; font-weight: 500; }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; } }
@media (min-width: 1024px) {
  .about-grid { grid-template-columns: 400px minmax(0, 1fr); gap: 72px; align-items: center; }
  .portrait-3d { height: 480px; }
  .portrait-3d .plate, .portrait-frame { border-radius: 28px; transform: rotateY(12deg); }
  .portrait-3d .plate-2 { transform: rotateY(12deg) translate3d(46px, 20px, -120px); }
  .portrait-3d .plate-1 { transform: rotateY(12deg) translate3d(23px, 10px, -60px); }
  .portrait-frame { padding: 14px; }
  .portrait-frame picture, .portrait-frame img { border-radius: 18px; }
}

/* ---------- Split layout (Education, Projects) ---------- */
.split { display: grid; gap: 28px; }
@media (min-width: 1024px) { .split { grid-template-columns: 380px minmax(0, 1fr); gap: 72px; align-items: center; } }

/* ---------- Education ---------- */
.edu-timeline { position: relative; display: flex; flex-direction: column; gap: 14px; }
.edu-timeline::before { content: ""; position: absolute; left: 15px; top: 24px; bottom: 24px; width: 2px; background: var(--line); }
.edu-timeline li { position: relative; display: flex; align-items: center; gap: 16px; }
.edu-timeline .node {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--accent); background: var(--background);
  display: grid; place-items: center;
}
.edu-timeline .node::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.edu-timeline .current .node { box-shadow: 0 0 0 6px var(--glow); animation: pulseRing 2.8s ease-in-out infinite; }
@keyframes pulseRing { 0%, 100% { box-shadow: 0 0 0 4px var(--glow); } 50% { box-shadow: 0 0 0 11px transparent; } }
.edu-card { flex: 1; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.edu-card h3 { font-size: 22px; letter-spacing: -.02em; }
.edu-card p { margin-top: 4px; font-size: 14px; color: var(--muted); }
.pill { font-size: 12px; letter-spacing: .06em; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.pill-accent { color: var(--accent); border-color: var(--accent); }
@media (min-width: 768px) {
  .edu-timeline { gap: 18px; }
  .edu-timeline::before { left: 19px; }
  .edu-timeline li { gap: 26px; }
  .edu-timeline .node { width: 40px; height: 40px; }
  .edu-card { padding: 22px 26px; }
  .edu-card h3 { font-size: 26px; }
}

/* ---------- Teaching ---------- */
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chips li { font-size: 12.5px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.cat-chips b { font-family: "Geist Mono", monospace; font-weight: 500; color: var(--accent); margin-left: 4px; }
.course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.course { border-radius: 16px; padding: 16px; min-height: 128px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.cicon {
  width: 38px; height: 38px; padding: 9px; border-radius: 10px; background: var(--chip); color: var(--accent);
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.course h3 { font-size: 16px; letter-spacing: -.015em; line-height: 1.2; }
.course > span { font-family: "Geist Mono", monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: -8px; }
.course-total { border: 1px dashed var(--line); justify-content: flex-end; gap: 2px; }
.course-total b { font-size: 32px; color: var(--accent); letter-spacing: -.03em; line-height: 1; }
.course-total span { font-size: 12.5px; color: var(--muted); }
@media (min-width: 768px) { .course-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1024px) {
  .course-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .course { min-height: 156px; padding: 22px; border-radius: 20px; }
  .cicon { width: 44px; height: 44px; padding: 11px; border-radius: 12px; }
  .course h3 { font-size: 21px; }
  .course > span { font-size: 11px; }
}

/* ---------- Research ---------- */
.research-grid { display: grid; gap: 20px; }
.network-stage { padding: 12px; perspective: 1200px; display: flex; align-items: center; justify-content: center; }
.network-tilt { width: 100%; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .3s ease-out; }
.network { width: 100%; height: auto; overflow: visible; }
.network-wide { display: none; }
.network .disc { fill: none; stroke: var(--accent); stroke-opacity: .18; }
.network .disc-2 { stroke: var(--secondary); stroke-opacity: .28; stroke-dasharray: 2 6; }
.network .spokes { stroke: var(--accent); stroke-opacity: .45; stroke-width: 1.2; fill: none; }
.network .links { stroke: var(--secondary); stroke-opacity: .5; stroke-dasharray: 3 5; fill: none; animation: dashFlow 2.4s linear infinite; }
@keyframes dashFlow { to { stroke-dashoffset: -32; } }
.network .core-glow { fill: var(--accent); fill-opacity: .08; transform-origin: 320px 230px; animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.88); } 50% { transform: scale(1.12); } }
.network .chip rect { fill: var(--card); stroke: var(--line); filter: url(#chipShadow); transition: stroke .2s ease, fill .2s ease; }
.network .chip text { fill: var(--foreground); font: 13px "Geist", system-ui, sans-serif; text-anchor: middle; }
.network .small .chip text { font-size: 11px; }
.network .chip:hover rect { stroke: var(--accent); }
.network .chip-core rect { fill: var(--primary); stroke: none; }
.network .chip-core text { fill: #fff; font-weight: 600; font-size: 14px; }
.network .small .chip-core text { font-size: 12px; }
.themes { padding: 4px 20px 0; background: var(--card-face); }
.themes li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 500; }
.themes b { font-family: "Geist Mono", monospace; font-weight: 400; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.themes .note { padding: 14px 0 16px; }
@media (min-width: 640px) {
  .network-wide { display: block; }
  .network-narrow { display: none; }
  .themes { padding: 4px 26px 0; }
  .themes li { flex-direction: row; justify-content: space-between; align-items: center; gap: 16px; font-size: 16px; }
}
@media (min-width: 1024px) {
  .research-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px; }
  .network-stage { padding: 24px; }
}

/* ---------- Publications ---------- */
.pub-count { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-radius: 18px; }
.pub-count b { font-size: clamp(38px, 3.6vw, 50px); line-height: 1; letter-spacing: -.03em; color: var(--accent); }
.pub-count span { font-size: 14px; line-height: 1.35; max-width: 180px; }
.pub-grid { display: grid; gap: 28px; padding-right: 18px; }
.pub { padding: 24px; border-radius: 20px; display: flex; flex-direction: column; gap: 16px; }
.pub-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); }
.pub-meta span:last-child { color: var(--foreground); }
.pub h3 { font-size: clamp(19px, 1.8vw, 22px); line-height: 1.38; letter-spacing: -.01em; }
.venue { font-size: 14px; color: var(--muted); line-height: 1.6; }
.tags { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 5px 9px; border-radius: 8px; background: var(--chip); color: var(--muted); }
.tag-accent { color: var(--accent); }
.pub-note { margin-top: 28px; max-width: 720px; }
@media (min-width: 900px) { .pub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; } .pub { padding: 32px; } }

/* ---------- Patents ---------- */
.patent-grid { display: grid; gap: 20px; perspective: 1800px; }
.patent { position: relative; overflow: hidden; padding: 24px; display: flex; flex-direction: column; gap: 18px; background: var(--card-face); }
.patent-art { position: absolute; right: -24px; top: -24px; width: 180px; height: 160px; fill: none; stroke: var(--line); pointer-events: none; }
.patent-top { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.kicker { font-size: 12px; letter-spacing: .12em; color: var(--accent); }
.badge { font-size: 12px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: var(--surface); }
.patent h3 { position: relative; font-size: clamp(20px, 2vw, 27px); line-height: 1.3; letter-spacing: -.01em; }
.patent-meta { position: relative; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border); display: grid; gap: 14px; }
.patent-meta dt { font-family: "Geist Mono", monospace; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.patent-meta dd { margin-top: 6px; font-family: "Geist Mono", monospace; font-size: 15px; }
.patent-meta .wrap { word-break: break-all; }
@media (min-width: 900px) {
  .patent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .patent { padding: 36px; min-height: 340px; }
  .patent:first-child { transform: rotateY(6deg); }
  .patent:last-child { transform: rotateY(-6deg); }
  .patent-meta { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 20px; }
}

/* ---------- Projects ---------- */
.big-stat { display: flex; align-items: baseline; gap: 14px; margin-top: 24px; }
.big-stat b { font-size: clamp(110px, 12vw, 160px); line-height: .85; letter-spacing: -.06em; color: var(--accent); }
.big-stat span { font-size: 19px; font-weight: 500; line-height: 1.3; }
.theme-cards { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.theme-card { border-radius: 16px; padding: 16px; min-height: 120px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.theme-card svg { width: 100%; height: 36px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-opacity: .75; }
.theme-card svg circle { fill: var(--accent); stroke: none; }
.theme-card span { font-size: 15px; font-weight: 600; line-height: 1.25; }
@media (min-width: 768px) {
  .theme-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .theme-card { min-height: 170px; padding: 22px; border-radius: 20px; }
  .theme-card svg { height: 56px; stroke-width: 1.5; }
  .theme-card span { font-size: 18px; }
}

/* ---------- Book ---------- */
.book-grid { display: grid; gap: 28px; align-items: center; }
.book-stage { position: relative; overflow: hidden; height: 400px; display: flex; flex-direction: column; align-items: center; justify-content: center; perspective: 1300px; }
.stage-floor {
  position: absolute; left: -30%; right: -30%; bottom: -10px; height: 220px; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 52px 52px; transform: perspective(360px) rotateX(64deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000, transparent 90%); mask-image: linear-gradient(to top, #000, transparent 90%);
  opacity: .5;
}
.book {
  --bw: 200px; --bh: 278px; --bd: 28px;
  position: relative; width: var(--bw); height: var(--bh); transform-style: preserve-3d;
  transform: rotateY(-30deg) rotateX(8deg); animation: bookFloat 9s ease-in-out infinite;
}
@keyframes bookFloat { 0%, 100% { translate: 0 0; rotate: y 0deg; } 50% { translate: 0 -12px; rotate: y 7deg; } }
.book > div { position: absolute; }
.book-back { inset: 0; transform: translateZ(calc(var(--bd) / -2)); border-radius: 3px 10px 10px 3px; background: #0A1230; }
.book-pages { top: 5px; left: calc(var(--bw) - var(--bd)); width: var(--bd); height: calc(var(--bh) - 10px); transform: rotateY(90deg); background: repeating-linear-gradient(90deg, #E4E8F2 0 2px, #C9D0E0 2px 3px); }
.book-spine { top: 0; left: calc(var(--bd) / -2); width: var(--bd); height: var(--bh); transform: rotateY(-90deg); background: #08102A; display: grid; place-items: center; }
.book-spine span { rotate: 90deg; white-space: nowrap; font-family: "Geist Mono", monospace; font-size: 9px; letter-spacing: .2em; color: #8FA6FF; }
.book-cover {
  inset: 0; transform: translateZ(calc(var(--bd) / 2)); border-radius: 3px 10px 10px 3px;
  background: #0B1638; border: 1px solid #22346E; padding: 20px 18px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 0 50px rgba(56,214,240,.2);
}
.book-cover svg { width: 82%; }
.nn-lines { stroke: #38D6F0; stroke-opacity: .45; fill: none; }
.nn-dots { fill: #38D6F0; }
.nn-out { fill: #A78BFA; }
.cover-title { color: #F2F5FB; font-size: 20px; line-height: 1.12; font-weight: 600; }
.cover-title i { display: block; width: 32px; height: 2px; background: #38D6F0; margin-bottom: 8px; }
.book-shadow { position: relative; width: 210px; height: 20px; margin-top: 36px; border-radius: 50%; background: radial-gradient(closest-side, var(--shadow), transparent); }
.book-name { margin-top: 14px; font-family: "Geist Mono", monospace; font-size: 14px; letter-spacing: .12em; }
@media (min-width: 1024px) {
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 72px; }
  .book-stage { height: 500px; border-radius: 28px; }
  .book { --bw: 250px; --bh: 346px; --bd: 34px; }
  .book-cover { padding: 26px 22px; }
  .cover-title { font-size: 25px; }
}

/* ---------- Professional development ---------- */
.dev-grid { display: grid; gap: 16px; }
.dev { padding: 22px; display: flex; flex-direction: column; gap: 22px; }
.dev-stat { display: flex; align-items: baseline; gap: 14px; }
.dev-stat b { font-size: clamp(60px, 6vw, 84px); line-height: .9; letter-spacing: -.05em; }
.dev-stat span { font-size: 14px; line-height: 1.4; color: var(--muted); }
.dots { position: relative; display: flex; justify-content: space-between; align-items: center; }
.dots::before { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 2px; margin-top: -1px; background: var(--line); }
.dots li {
  position: relative; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--accent); background: var(--card);
  display: grid; place-items: center; font-family: "Geist Mono", monospace; font-size: 9px; color: var(--accent);
}
.dots-violet { width: 50%; }
.dots-violet li { border-color: var(--secondary); color: var(--secondary); }
@media (min-width: 900px) {
  .dev-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .dev { padding: 32px; gap: 30px; }
  .dev-stat span { font-size: 16px; }
  .dots li { width: 36px; height: 36px; font-size: 10px; }
}

/* ---------- Academic status ---------- */
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.status-grid > div { padding: 16px; border-radius: 14px; min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.status-grid .none { border: 1px solid var(--border); }
.status-grid dt { font-family: "Geist Mono", monospace; font-size: 9.5px; letter-spacing: .1em; line-height: 1.5; text-transform: uppercase; color: var(--faint); }
.status-grid dd { font-size: 15px; line-height: 1.3; font-weight: 600; }
.status-grid .none dd { font-weight: 400; color: var(--muted); }
@media (min-width: 900px) {
  .status-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .status-grid > div { padding: 22px; border-radius: 18px; min-height: 124px; }
  .status-grid dt { font-size: 11px; }
  .status-grid dd { font-size: 18px; }
}

/* ---------- Milestones ---------- */
.scroll-btns { display: none; gap: 10px; }
.miles { position: relative; overflow: hidden; padding: 8px 20px; }
.miles-track { position: relative; display: flex; flex-direction: column; gap: 22px; padding: 18px 0; }
.miles-track::before { content: ""; position: absolute; left: 17px; top: 36px; bottom: 36px; width: 2px; background: var(--line); box-shadow: 0 0 12px var(--glow); }
.miles-track li { position: relative; display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 18px; align-items: center; }
.miles-track .year { grid-column: 2; font-family: "Geist Mono", monospace; font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.miles-track .orb { grid-column: 1; grid-row: 1 / span 2; }
.miles-track .what { grid-column: 2; font-size: 18px; font-weight: 600; }
.miles-track .now .year { color: var(--accent); text-transform: uppercase; }
.orb {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFFFFF 0%, var(--primary-text) 45%, var(--background) 100%);
  box-shadow: 0 10px 22px -6px var(--shadow);
}
.orb-accent { background: radial-gradient(circle at 35% 30%, #FFFFFF 0%, var(--accent) 45%, var(--background) 100%); }
.orb-now { background: radial-gradient(circle at 35% 30%, #FFFFFF 0%, var(--secondary) 45%, var(--background) 100%); animation: pulseRing 2.8s ease-in-out infinite; }
@media (min-width: 900px) {
  .scroll-btns.has-overflow { display: flex; }
  .miles { padding: 0 32px; border-radius: 28px; }
  .miles-track { flex-direction: row; gap: 0; padding: 44px 0 40px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
  .miles-track::before { left: 10%; right: 10%; top: 100px; bottom: auto; width: auto; height: 2px; }
  .miles-track li { flex: 1 0 190px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
  .miles-track .what { font-size: 18px; }
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 28px; }
.contact-links { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.contact-links a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.contact-form { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.field-row { display: grid; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 500; }
.field input, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--background); color: var(--foreground); font: inherit; font-size: 16px;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field [aria-invalid="true"] { border: 1.5px solid var(--error); }
.err[hidden] { display: none; }
.err { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--error); }
.err .icon { width: 14px; height: 14px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-direction: column-reverse; gap: 14px; }
.form-foot .btn { width: 100%; }
.form-status { font-size: 14px; min-height: 1.4em; display: flex; align-items: center; gap: 8px; }
.form-status.ok { color: var(--success); }
.form-status.bad { color: var(--error); }
@media (min-width: 640px) {
  .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-foot { flex-direction: row; align-items: center; justify-content: space-between; }
  .form-foot .btn { width: auto; }
}
@media (min-width: 1024px) {
  .contact-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; align-items: start; }
  .contact-form { padding: 36px; border-radius: 26px; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 40px 0 28px; }
.foot-row { display: flex; flex-direction: column; gap: 28px; }
.foot-logo img { width: 260px; height: auto; }
.foot-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; font-size: 15px; color: var(--muted); }
.foot-links a { min-height: 44px; display: flex; align-items: center; }
.foot-links a:hover { color: var(--foreground); }
.copy { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--faint); }
@media (min-width: 900px) {
  .foot-row { flex-direction: row; justify-content: space-between; align-items: center; }
  .foot-logo img { width: 300px; }
  .foot-links { grid-template-columns: repeat(4, auto); column-gap: 40px; }
}

/* ---------- Motion: load + reveal ---------- */
.rise { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.d1 { animation-delay: .08s; } .d2 { animation-delay: .16s; } .d3 { animation-delay: .22s; } .d4 { animation-delay: .28s; } .d5 { animation-delay: .34s; }
@keyframes rise { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
.js .reveal { opacity: 0; translate: 0 22px; transition: opacity .7s ease, translate .7s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; translate: 0 0; }
.js .lift.reveal.in { transition: opacity .7s ease, translate .28s ease, border-color .28s ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; translate: none; }
  .lift:hover, .js .lift.reveal.in:hover, .btn:hover, .btn:hover .icon { translate: none; }
}

@media print {
  .site-header, .drawer, .hero-floor, .sphere-canvas, .contact-form, .scroll-btns { display: none !important; }
  .js .reveal { opacity: 1; translate: none; }
}
