/* ============================================================
   Rahul Shah — personal site
   Design: "Deep Field" — deep-space ground, redshift accent
   Type:   Fraunces (display) · Inter (body) · Space Mono (labels)
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ---------- Tokens ---------- */
:root {
  --bg:        #09080f;
  --bg-2:      #0c0b15;
  --surface:   #131120;
  --surface-2: #1a1728;
  --line:      rgba(255,255,255,0.08);
  --line-2:    rgba(255,255,255,0.14);

  --text:  #eceaf4;
  --muted: #a6a2b8;
  --faint: #706a80;

  --hot:    #6d86ff;   /* young / hot universe — blue */
  --violet: #b07cff;   /* mid */
  --cool:   #f2a35e;   /* redshifted / cool — amber */
  --grad: linear-gradient(90deg, var(--hot), var(--violet) 52%, var(--cool));

  --maxw: 1120px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-y: clamp(4.5rem, 10vw, 8.5rem);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;

  --ff-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ff-body: 'Inter', system-ui, -apple-system, sans-serif;
  --ff-mono: 'Space Mono', 'SFMono-Regular', ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* theme-dependent (these are the DARK values; the
     [data-theme="light"] block far below overrides them) */
  --text-2:        #cdc8df;   /* soft display text */
  --nav-bg:        rgba(9,8,15,0.72);
  --menu-bg:       rgba(12,11,21,0.97);
  --btn-pri-bg:    var(--text);
  --btn-pri-fg:    #0a0912;
  --ink-grad:      linear-gradient(180deg, #fff 0%, #d8d3ec 100%);
  --card-grad:     linear-gradient(180deg, rgba(26,23,40,0.78), rgba(19,17,32,0.78));
  --card-shadow:   0 24px 60px -28px rgba(0,0,0,0.8);
  --grain-opacity: 0.5;
}

/* ---------- Base ---------- */
body {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  letter-spacing: 0.005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(176,124,255,0.32); color: #fff; }

/* ---------- Background layers ---------- */
#cosmos {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: -3;
  display: block;
}
.bg-glow {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(70% 55% at 78% 8%, rgba(109,134,255,0.16), transparent 60%),
    radial-gradient(60% 50% at 12% 22%, rgba(176,124,255,0.13), transparent 62%),
    radial-gradient(75% 60% at 50% 108%, rgba(242,163,94,0.10), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 50%, var(--bg) 100%);
}
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--grain-opacity);
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: 50%; top: -60px; transform: translateX(-50%);
  background: var(--surface-2); color: var(--text);
  padding: 0.6rem 1rem; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  z-index: 200; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.35s var(--ease), border-color 0.35s, backdrop-filter 0.35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0.9rem var(--gutter);
  display: flex; align-items: center; gap: 1.5rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; margin-right: auto; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--violet); position: relative; flex: none;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 5px; height: 5px; border-radius: 50%; background: var(--cool);
}
.brand-name {
  font-family: var(--ff-display);
  font-weight: 600; font-size: 1.15rem; letter-spacing: 0.01em;
}
.nav-links { display: flex; gap: 1.4rem; }
.nav-links a {
  font-size: 0.83rem; color: var(--muted); position: relative;
  padding: 0.3rem 0; transition: color 0.25s; letter-spacing: 0.01em;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 0;
  background: var(--grad); transition: width 0.3s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-cv {
  font-family: var(--ff-mono); font-size: 0.74rem; letter-spacing: 0.02em;
  padding: 0.5rem 0.9rem; border: 1px solid var(--line-2); border-radius: 100px;
  color: var(--text); white-space: nowrap; transition: border-color 0.25s, background 0.25s, transform 0.25s;
}
.nav-cv:hover { border-color: var(--violet); background: rgba(176,124,255,0.08); transform: translateY(-1px); }

.nav-toggle { display: none; width: 40px; height: 40px; flex-direction: column; justify-content: center; gap: 5px; align-items: center; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.3s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0 0 0 auto; z-index: 99; width: min(320px, 84vw);
  background: var(--menu-bg); backdrop-filter: blur(16px);
  border-left: 1px solid var(--line); padding: 6rem 2rem 2rem;
  transform: translateX(100%); transition: transform 0.4s var(--ease);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu nav { display: flex; flex-direction: column; gap: 0.3rem; }
.mobile-menu a {
  font-family: var(--ff-display); font-size: 1.4rem; padding: 0.55rem 0;
  color: var(--muted); border-bottom: 1px solid var(--line); transition: color 0.2s, padding-left 0.2s;
}
.mobile-menu a:hover { color: var(--text); padding-left: 0.4rem; }
.mobile-cv { font-family: var(--ff-mono) !important; font-size: 0.85rem !important; color: var(--cool) !important; border-bottom: none !important; margin-top: 0.8rem; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(7rem, 14vh, 11rem) var(--gutter) 5rem;
  max-width: var(--maxw); margin: 0 auto; overflow: hidden;
}
/* expanding-shell signature (BAO / cosmic expansion) */
.hero-rings { position: absolute; top: 42%; right: -8%; width: 60vmin; height: 60vmin; pointer-events: none; opacity: 0.55; }
.hero-rings span {
  position: absolute; inset: 0; margin: auto; border-radius: 50%;
  border: 1px solid rgba(176,124,255,0.30);
  animation: shell 9s var(--ease) infinite;
}
.hero-rings span:nth-child(1) { animation-delay: 0s; }
.hero-rings span:nth-child(2) { animation-delay: 2.25s; }
.hero-rings span:nth-child(3) { animation-delay: 4.5s; }
.hero-rings span:nth-child(4) { animation-delay: 6.75s; }
@keyframes shell {
  0%   { transform: scale(0.05); opacity: 0; border-color: rgba(109,134,255,0.55); }
  18%  { opacity: 0.8; }
  100% { transform: scale(1); opacity: 0; border-color: rgba(242,163,94,0.10); }
}

.hero-grid {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.55fr 0.95fr; gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.eyebrow {
  font-family: var(--ff-mono); font-size: 0.78rem; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--cool); margin-bottom: 1.1rem;
}
.hero-name {
  font-family: var(--ff-display);
  font-weight: 600; font-optical-sizing: auto;
  font-size: clamp(3.4rem, 11vw, 8.5rem);
  line-height: 0.92; letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  background: var(--ink-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-tag {
  font-family: var(--ff-display); font-weight: 400;
  font-size: clamp(1.25rem, 2.6vw, 1.95rem); line-height: 1.32;
  color: var(--text-2); max-width: 30ch; margin-bottom: 2.2rem;
}
.hero-tag em { font-style: italic; color: var(--cool); }
.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-style: italic;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-bottom: 2.8rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--ff-mono); font-size: 0.82rem; letter-spacing: 0.02em;
  padding: 0.8rem 1.4rem; border-radius: 100px; transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s, border-color 0.25s;
}
.btn-primary { background: var(--btn-pri-bg); color: var(--btn-pri-fg); font-weight: 700; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(176,124,255,0.6); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--violet); background: rgba(176,124,255,0.08); transform: translateY(-2px); }

.hero-facts { display: grid; gap: 0.9rem; border-top: 1px solid var(--line); padding-top: 1.6rem; max-width: 30rem; }
.hero-facts div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; align-items: baseline; }
.hero-facts dt { font-family: var(--ff-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.hero-facts dd { font-size: 0.92rem; color: var(--muted); }

/* Profile card */
.profile-card {
  background: var(--card-grad);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 2rem 1.75rem; text-align: center;
  backdrop-filter: blur(8px);
  box-shadow: var(--card-shadow);
}
.profile-photo {
  width: 132px; height: 132px; margin: 0 auto 1.25rem; position: relative;
  border-radius: 50%; padding: 3px;
  background: var(--grad);
}
.profile-photo img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--surface); position: relative; z-index: 2; background: var(--surface-2);
}
.profile-monogram {
  position: absolute; inset: 3px; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--surface-2);
  font-family: var(--ff-display); font-size: 2.6rem; font-weight: 600; color: var(--violet);
  border: 3px solid var(--surface);
}
.profile-photo img.img-failed { display: none; }
.profile-name { font-family: var(--ff-display); font-size: 1.5rem; font-weight: 600; margin-bottom: 0.3rem; }
.profile-role { font-size: 0.92rem; color: var(--text); }
.profile-role span { color: var(--muted); }
.profile-affil { font-size: 0.85rem; color: var(--muted); margin-top: 0.15rem; }
.profile-email {
  display: inline-block; font-family: var(--ff-mono); font-size: 0.74rem; color: var(--cool);
  margin: 0.9rem 0 1.2rem; word-break: break-all; transition: color 0.2s;
}
.profile-email:hover { color: var(--text); }

.social-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.social-row a {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); font-family: var(--ff-mono); font-size: 0.72rem;
  color: var(--muted); position: relative; transition: color 0.2s, border-color 0.2s, transform 0.2s, background 0.2s;
}
.social-row a:hover {
  color: var(--text); border-color: var(--violet); transform: translateY(-3px);
  background: rgba(176,124,255,0.1);
}
.social-row a::before {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  font-size: 0.62rem; letter-spacing: 0.04em; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line-2); padding: 0.2rem 0.5rem; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.social-row a:hover::before { opacity: 1; }

/* scroll cue */
.scroll-cue {
  position: absolute; bottom: 1.8rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem; z-index: 3;
}
.scroll-cue-dot {
  width: 22px; height: 36px; border: 1.5px solid var(--line-2); border-radius: 100px; position: relative;
}
.scroll-cue-dot::after {
  content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 7px; border-radius: 4px; background: var(--cool);
  animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translate(-50%, 0); } 40% { opacity: 1; } 80% { opacity: 0; transform: translate(-50%, 12px); } 100% { opacity: 0; } }
.scroll-cue-label { font-family: var(--ff-mono); font-size: 0.62rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--faint); }

/* ============================================================
   SECTION SCAFFOLD
   ============================================================ */
.section {
  max-width: var(--maxw); margin: 0 auto;
  padding-top: var(--section-y); padding-bottom: var(--section-y);
  padding-left: var(--gutter); padding-right: var(--gutter);
  position: relative;
}
/* spectral divider between sections (redshift line) */
.section::before {
  content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(109,134,255,0.5), rgba(176,124,255,0.6), rgba(242,163,94,0.5), transparent);
  opacity: 0.5;
}
.section-head { margin-bottom: clamp(2.2rem, 4vw, 3.4rem); max-width: 42rem; }
.section-eyebrow {
  font-family: var(--ff-mono); font-size: 0.74rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--violet); display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.9rem;
}
.section-eyebrow .num { color: var(--faint); }
.section-title {
  font-family: var(--ff-display); font-weight: 500; font-optical-sizing: auto;
  font-size: clamp(1.9rem, 4.3vw, 3.2rem); line-height: 1.06; letter-spacing: -0.015em;
  color: var(--text);
}
.section-note { margin-top: 0.9rem; color: var(--muted); font-size: 0.95rem; }
.section-note a, .research-intro a { color: var(--cool); border-bottom: 1px solid rgba(242,163,94,0.4); transition: color 0.2s, border-color 0.2s; }
.section-note a:hover, .research-intro a:hover { color: var(--text); border-color: var(--text); }

/* ---------- About ---------- */
.about-body { max-width: 64rem; }
.lead {
  font-family: var(--ff-display); font-weight: 400; font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  line-height: 1.4; color: var(--text-2); margin-bottom: 2.2rem; letter-spacing: -0.005em;
}
.about-cols { columns: 2; column-gap: 3rem; }
.about-cols p { break-inside: avoid; margin-bottom: 1.2rem; color: var(--muted); }
.about-cols p:last-child { margin-bottom: 0; }

/* ---------- Research ---------- */
.research-intro { max-width: 52rem; margin-bottom: 3rem; }
.research-intro p { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--text-2); }
.research-intro strong { color: var(--text); font-weight: 600; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.theme {
  background: var(--bg-2); padding: 1.8rem 1.6rem; position: relative; transition: background 0.3s;
}
.theme:hover { background: var(--surface); }
.theme-id {
  font-family: var(--ff-mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--cool);
  display: inline-block; margin-bottom: 1.1rem; padding: 0.25rem 0.6rem;
  border: 1px solid rgba(242,163,94,0.3); border-radius: 6px;
}
.theme h3 { font-family: var(--ff-display); font-weight: 600; font-size: 1.3rem; margin-bottom: 0.5rem; line-height: 1.15; }
.theme p { font-size: 0.92rem; color: var(--muted); }

/* ---------- Publications ---------- */
.pub-list { counter-reset: pub; border-top: 1px solid var(--line); }
.pub {
  counter-increment: pub;
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.5rem;
  padding: 1.8rem 0; border-bottom: 1px solid var(--line);
  transition: padding-left 0.3s var(--ease);
}
.pub:hover { padding-left: 0.6rem; }
.pub-meta { display: flex; flex-direction: column; gap: 0.4rem; padding-top: 0.2rem; }
.pub-venue {
  font-family: var(--ff-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--text);
  align-self: start; padding: 0.2rem 0.55rem; border-radius: 6px;
  background: rgba(176,124,255,0.12); border: 1px solid rgba(176,124,255,0.25);
}
.pub-year { font-family: var(--ff-mono); font-size: 0.78rem; color: var(--faint); }
.pub-main h3 { font-family: var(--ff-display); font-weight: 600; font-size: clamp(1.15rem, 1.9vw, 1.5rem); line-height: 1.2; margin-bottom: 0.5rem; }
.pub-main h3 a { background-image: linear-gradient(var(--grad)); background-size: 0% 1.5px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size 0.35s var(--ease), color 0.2s; padding-bottom: 2px; }
.pub-main h3 a:hover { background-size: 100% 1.5px; }
.pub-main p { color: var(--muted); font-size: 0.95rem; max-width: 60ch; }

/* ---------- Network link grid ---------- */
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }
.link-grid a {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.05rem 1.2rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg-2); transition: border-color 0.25s, background 0.25s, transform 0.25s;
}
.link-grid a span { font-weight: 500; font-size: 0.95rem; }
.link-grid a em { font-style: normal; font-family: var(--ff-mono); color: var(--faint); transition: color 0.25s, transform 0.25s; }
.link-grid a:hover { border-color: var(--violet); background: var(--surface); transform: translateY(-2px); }
.link-grid a:hover em { color: var(--cool); transform: translate(2px, -2px); }

/* ---------- Collaborators ---------- */
.collab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.75rem; }
.collab a {
  display: block; height: 100%; padding: 1.4rem 1.5rem;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-2);
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
  position: relative; overflow: hidden;
}
.collab a::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad);
  transform: scaleY(0); transform-origin: top; transition: transform 0.3s var(--ease);
}
.collab a:hover { border-color: var(--line-2); background: var(--surface); transform: translateY(-3px); }
.collab a:hover::before { transform: scaleY(1); }
.collab h3 { font-family: var(--ff-display); font-weight: 600; font-size: 1.2rem; margin-bottom: 0.4rem; }
.collab p { font-size: 0.86rem; color: var(--muted); line-height: 1.5; }

/* ---------- Skills ---------- */
.skills-wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem, 5vw, 4rem); }
.skills-label { font-family: var(--ff-mono); font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cool); margin-bottom: 1.3rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chips li {
  font-size: 0.88rem; color: var(--text);
  padding: 0.55rem 1rem; border: 1px solid var(--line); border-radius: 100px; background: var(--bg-2);
  transition: border-color 0.2s, transform 0.2s, color 0.2s;
}
.chips li:hover { border-color: var(--violet); transform: translateY(-2px); }
.chips-lang li { font-family: var(--ff-display); font-size: 1rem; }

/* ---------- Education timeline ---------- */
.timeline { position: relative; max-width: 46rem; padding-left: 1.5rem; }
.timeline::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 1.5px; background: linear-gradient(180deg, var(--hot), var(--violet), var(--cool)); opacity: 0.45; }
.tl-item { position: relative; display: grid; grid-template-columns: 6rem 1fr; gap: 1.5rem; padding: 0.9rem 0 1.5rem; }
.tl-item::before {
  content: ""; position: absolute; left: -1.5rem; top: 1.4rem; transform: translateX(-45%);
  width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--violet);
  box-shadow: 0 0 0 4px var(--bg);
}
.tl-item:first-child::before { background: var(--cool); border-color: var(--cool); box-shadow: 0 0 0 4px var(--bg), 0 0 14px 2px rgba(242,163,94,0.5); }
.tl-year { font-family: var(--ff-mono); font-size: 0.82rem; color: var(--cool); padding-top: 0.2rem; letter-spacing: 0.02em; }
.tl-body h3 { font-family: var(--ff-display); font-weight: 600; font-size: 1.18rem; line-height: 1.2; margin-bottom: 0.25rem; }
.tl-body p { font-size: 0.92rem; color: var(--muted); }

/* ---------- Personal ---------- */
.personal-body { max-width: 60rem; }
.personal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; margin: 0.5rem 0 2.8rem; }
.interest { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-2); transition: border-color 0.25s, transform 0.25s; }
.interest:hover { border-color: var(--line-2); transform: translateY(-3px); }
.interest h3 { font-family: var(--ff-display); font-weight: 600; font-size: 1.25rem; margin-bottom: 0.4rem; }
.interest p { font-size: 0.9rem; color: var(--muted); }
.follow-label { font-family: var(--ff-mono); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); margin-bottom: 1rem; }
.follow-row { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.follow-row a {
  font-family: var(--ff-mono); font-size: 0.8rem; color: var(--muted);
  padding: 0.5rem 0.95rem; border: 1px solid var(--line); border-radius: 100px;
  transition: color 0.2s, border-color 0.2s, transform 0.2s, background 0.2s;
}
.follow-row a:hover { color: var(--text); border-color: var(--violet); background: rgba(176,124,255,0.08); transform: translateY(-2px); }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact-inner { max-width: 44rem; margin: 0 auto; }
.contact .section-eyebrow { justify-content: center; }
.contact-title {
  font-family: var(--ff-display); font-weight: 500; letter-spacing: -0.02em;
  font-size: clamp(2.4rem, 6vw, 4.5rem); line-height: 1; margin-bottom: 1rem;
  background: var(--ink-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.contact-sub { color: var(--muted); font-size: 1.05rem; margin-bottom: 2rem; }
.contact-mail {
  display: inline-block; font-family: var(--ff-display); font-style: italic;
  font-size: clamp(1.3rem, 3.2vw, 2.1rem); color: var(--cool);
  margin-bottom: 2.4rem; padding-bottom: 4px;
  background-image: linear-gradient(var(--grad)); background-size: 100% 1.5px; background-repeat: no-repeat; background-position: 0 100%;
  transition: color 0.2s;
}
.contact-mail:hover { color: var(--text); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; justify-content: center; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 2rem; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 2rem var(--gutter);
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.footer-mark { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--violet); position: relative; }
.footer-mark::after { content: ""; position: absolute; inset: 0; margin: auto; width: 4px; height: 4px; border-radius: 50%; background: var(--cool); }
.footer-inner p { font-family: var(--ff-mono); font-size: 0.8rem; color: var(--muted); margin-right: auto; }
.footer-top { font-family: var(--ff-mono); font-size: 0.78rem; color: var(--muted); transition: color 0.2s; }
.footer-top:hover { color: var(--cool); }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .nav-links, .nav-cv { display: none; }
  .nav-toggle { display: flex; }
  .hero { justify-content: flex-start; min-height: auto; padding-top: clamp(6.5rem, 16vh, 9rem); padding-bottom: 4rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .profile-card { max-width: 380px; margin: 0 auto; }
  .hero-rings { opacity: 0.3; top: 10%; right: -20%; }
  .scroll-cue { display: none; }
  .about-cols { columns: 1; }
  .skills-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pub { grid-template-columns: 1fr; gap: 0.7rem; }
  .pub-meta { flex-direction: row; align-items: center; gap: 0.7rem; }
  .tl-item { grid-template-columns: 4.5rem 1fr; gap: 1rem; }
  .hero-facts div { grid-template-columns: 5.5rem 1fr; gap: 0.6rem; }
  .contact-actions, .hero-actions { width: 100%; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-rings { display: none; }
}

/* Keyboard focus */
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 4px; }

/* ============================================================
   LIGHT THEME  (overrides the dark token defaults in :root)
   ============================================================ */
:root[data-theme="light"] {
  --bg:        #f6f4fb;
  --bg-2:      #eeeaf7;
  --surface:   #ffffff;
  --surface-2: #f1edf9;
  --line:      rgba(24,18,48,0.10);
  --line-2:    rgba(24,18,48,0.18);

  --text:   #1a1726;
  --text-2: #3a3550;
  --muted:  #595370;
  --faint:  #8a85a0;

  --hot:    #2f49d6;   /* deepened for contrast on light */
  --violet: #7a37d8;
  --cool:   #b8621f;

  --nav-bg:        rgba(246,244,251,0.80);
  --menu-bg:       rgba(255,255,255,0.97);
  --btn-pri-bg:    #1a1726;
  --btn-pri-fg:    #ffffff;
  --ink-grad:      linear-gradient(180deg, #241f37, #4b4366);
  --card-grad:     linear-gradient(180deg, rgba(255,255,255,0.92), rgba(244,240,250,0.88));
  --card-shadow:   0 24px 60px -30px rgba(60,40,110,0.22);
  --grain-opacity: 0.22;
}
:root[data-theme="light"] ::selection { background: rgba(122,55,216,0.20); color: #1a1726; }
:root[data-theme="light"] .grain { mix-blend-mode: multiply; }
:root[data-theme="light"] .bg-glow {
  background:
    radial-gradient(70% 55% at 78% 8%, rgba(47,73,214,0.08), transparent 60%),
    radial-gradient(60% 50% at 12% 22%, rgba(122,55,216,0.08), transparent 62%),
    radial-gradient(75% 60% at 50% 108%, rgba(184,98,31,0.07), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 50%, var(--bg) 100%);
}
/* a couple of "near-white on dark" accents read better a touch stronger on light */
:root[data-theme="light"] .pub-venue { background: rgba(122,55,216,0.10); border-color: rgba(122,55,216,0.30); }

/* ============================================================
   THEME TOGGLE BUTTON
   ============================================================ */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); color: var(--muted);
  transition: color .25s, border-color .25s, background .25s, transform .25s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--violet); transform: translateY(-1px); background: rgba(176,124,255,0.10); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .ti { display: inline-flex; }
.theme-toggle .ti-moon { display: none; }
:root[data-theme="light"] .theme-toggle .ti-sun  { display: none; }
:root[data-theme="light"] .theme-toggle .ti-moon { display: inline-flex; }

/* ============================================================
   ICONS — shared (brand glyphs + lettermark tiles)
   ============================================================ */
.ic { display: inline-flex; align-items: center; justify-content: center; flex: none; line-height: 0; }
.ic svg { width: 100%; height: 100%; display: block; }
.ic-brand { width: 18px; height: 18px; }
.ic-mono {
  width: 22px; height: 22px; border-radius: 6px; line-height: 1;
  border: 1px solid var(--line-2); background: var(--surface-2);
  font-family: var(--ff-mono); font-weight: 700; font-size: 0.52rem;
  letter-spacing: 0.01em; color: var(--muted);
}

/* Academic link grid now: [icon] [label] ........ [↗] */
.link-grid a { justify-content: flex-start; gap: 0.8rem; }
.link-grid a .ic { color: var(--muted); transition: color .25s, transform .25s; }
.link-grid a .lg-label { font-weight: 500; font-size: 0.95rem; margin-right: auto; }
.link-grid a .ic-mono { font-size: 0.52rem; font-weight: 700; color: var(--muted); }
.link-grid a:hover .ic { color: var(--cool); transform: translateY(-1px); }

/* Hero profile-card social row — brand icons inherit the link colour */
.social-row a .ic-brand { width: 17px; height: 17px; }

/* "Feel free to stalk" follow row — icon + label pills */
.follow-row a { display: inline-flex; align-items: center; gap: 0.5rem; }
.follow-row a .ic-brand { width: 15px; height: 15px; }
.follow-row a .fr-label { font-family: var(--ff-mono); font-size: 0.8rem; }

/* ============================================================
   COLLABORATORS — with photos (initials fallback)
   ============================================================ */
.collab a { display: flex; align-items: center; gap: 1rem; }
.collab-photo {
  width: 54px; height: 54px; flex: none; position: relative;
  border-radius: 50%; padding: 2px; background: var(--grad);
}
.collab-photo img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
  border: 2px solid var(--surface); background: var(--surface-2); position: relative; z-index: 2;
}
.collab-photo img.img-failed { display: none; }
.collab-mono {
  position: absolute; inset: 2px; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--surface-2); border: 2px solid var(--surface);
  font-family: var(--ff-display); font-weight: 600; font-size: 1.05rem; color: var(--violet);
}
.collab-info { min-width: 0; }
.collab-info h3 { font-family: var(--ff-display); font-weight: 600; font-size: 1.12rem; line-height: 1.15; margin-bottom: 0.2rem; }
.collab-info p { font-size: 0.82rem; color: var(--muted); line-height: 1.45; }

/* ============================================================
   HOBBIES GRID
   ============================================================ */
.hobby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.75rem; margin: 0.5rem 0 2.8rem; }
.hobby {
  display: flex; align-items: flex-start; gap: 0.9rem;
  padding: 1.25rem 1.3rem; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-2); transition: border-color .25s, transform .25s, background .25s;
}
.hobby:hover { border-color: var(--line-2); transform: translateY(-3px); background: var(--surface); }
.hobby-ic {
  width: 40px; height: 40px; flex: none; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(176,124,255,0.10); border: 1px solid rgba(176,124,255,0.24); color: var(--violet);
}
.hobby-ic svg { width: 21px; height: 21px; display: block; }
.hobby-tx h3 { font-family: var(--ff-display); font-weight: 600; font-size: 1.12rem; margin-bottom: 0.2rem; }
.hobby-tx p { font-size: 0.85rem; color: var(--muted); line-height: 1.45; }

/* ============================================================
   BLOG
   ============================================================ */
.blog-wrap { display: grid; gap: 1.5rem; }
.blog-head { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.blog-head p { color: var(--muted); font-size: 0.98rem; max-width: 48ch; }
.blog-head .btn { flex: none; }
.blog-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; }
.blog-post a {
  display: flex; flex-direction: column; height: 100%;
  padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-2); transition: border-color .25s, transform .25s, background .25s;
}
.blog-post a:hover { border-color: var(--violet); transform: translateY(-3px); background: var(--surface); }
.bp-meta { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.bp-cat {
  font-family: var(--ff-mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--cool); padding: 0.18rem 0.5rem; border: 1px solid rgba(242,163,94,0.38); border-radius: 100px;
}
.bp-date { font-family: var(--ff-mono); font-size: 0.7rem; color: var(--faint); }
.blog-post h3 { font-family: var(--ff-display); font-weight: 600; font-size: 1.2rem; line-height: 1.22; margin-bottom: 0.5rem; }
.blog-post p { font-size: 0.9rem; color: var(--muted); line-height: 1.5; margin-bottom: 1rem; }
.bp-more { margin-top: auto; font-family: var(--ff-mono); font-size: 0.74rem; color: var(--violet); transition: color .2s; }
.blog-post a:hover .bp-more { color: var(--cool); }

/* ============================================================
   RESPONSIVE additions for new components
   ============================================================ */
@media (max-width: 560px) {
  .blog-head { flex-direction: column; align-items: flex-start; }
  .collab a { gap: 0.85rem; }
}

/* ============================================================
   STANDALONE PAGES (paper / hobby / blog post / blog index)
   ============================================================ */
/* solid header on subpages (content scrolls beneath it) */
.nav-sub { background: var(--nav-bg); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--line); }
.nav-sub .brand { margin-right: 1.25rem; }
.back-link { margin-right: auto; font-family: var(--ff-mono); font-size: 0.8rem; letter-spacing: 0.02em; color: var(--muted); transition: color .2s, transform .2s; }
.back-link:hover { color: var(--text); transform: translateX(-2px); }

.page { max-width: 760px; margin: 0 auto; padding: clamp(6.5rem, 12vh, 9rem) var(--gutter) 4.5rem; position: relative; z-index: 1; }

.art-head { margin-bottom: 2.4rem; padding-bottom: 1.7rem; border-bottom: 1px solid var(--line); }
.art-eyebrow { font-family: var(--ff-mono); font-size: 0.74rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--violet); margin-bottom: 1rem; }
.art-dot { color: var(--faint); }
.art-head h1 { font-family: var(--ff-display); font-weight: 600; font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.08; letter-spacing: -0.02em; color: var(--text); }
.art-h1-icon { display: flex; align-items: center; gap: 0.85rem; }
.art-icon { width: 46px; height: 46px; flex: none; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(176,124,255,0.10); border: 1px solid rgba(176,124,255,0.24); color: var(--violet); }
.art-icon svg { width: 25px; height: 25px; }
.art-standfirst { margin-top: 1rem; font-family: var(--ff-display); font-weight: 400; font-size: clamp(1.1rem, 2vw, 1.35rem); color: var(--text-2); line-height: 1.4; }
.art-actions { margin-top: 1.6rem; }

/* prose */
.article p { color: var(--text-2); margin: 1.15rem 0; line-height: 1.78; }
.article h2 { font-family: var(--ff-display); font-weight: 600; font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.15; letter-spacing: -0.01em; margin: 2.5rem 0 0.8rem; color: var(--text); }
.article h3 { font-family: var(--ff-display); font-weight: 600; font-size: 1.25rem; margin: 1.9rem 0 0.6rem; color: var(--text); }
.article a { color: var(--cool); border-bottom: 1px solid rgba(242,163,94,0.4); transition: color .2s, border-color .2s; }
.article a:hover { color: var(--text); border-color: var(--text); }
.article strong { color: var(--text); font-weight: 700; }
.article em { font-style: italic; }
.article ul, .article ol { margin: 1.15rem 0 1.15rem 1.4rem; color: var(--text-2); }
.article li { margin: 0.4rem 0; line-height: 1.7; }
.article li::marker { color: var(--violet); }
.article blockquote { margin: 1.7rem 0; padding: 0.7rem 1.2rem; border-left: 3px solid var(--violet); background: var(--bg-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--muted); font-style: italic; }
.article blockquote p { color: var(--muted); margin: 0.4rem 0; }
.article hr { border: 0; height: 1px; background: var(--line-2); margin: 2.6rem 0; }
.article code { font-family: var(--ff-mono); font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0.1rem 0.4rem; }
.article pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.1rem 1.25rem; overflow-x: auto; margin: 1.6rem 0; }
.article pre code { background: none; border: 0; padding: 0; font-size: 0.85rem; }
.article figure { margin: 2rem 0; }
.article figure img, .article img { width: 100%; max-width: 100%; border-radius: var(--r-md); border: 1px solid var(--line); display: block; background: var(--surface-2); }
.article figcaption { margin-top: 0.7rem; text-align: center; font-size: 0.85rem; color: var(--faint); font-family: var(--ff-mono); }
.article table { width: 100%; border-collapse: collapse; margin: 1.7rem 0; font-size: 0.92rem; }
.article th, .article td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); }
.article th { font-family: var(--ff-mono); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.article > *:first-child { margin-top: 0; }

.blog-list-page { margin-top: 2.2rem; }

/* ============================================================
   Homepage detail-page link affordances
   ============================================================ */
.pub-links { display: flex; flex-wrap: wrap; gap: 1.1rem; margin-top: 0.7rem; }
.pub-summary { font-family: var(--ff-mono); font-size: 0.78rem; color: var(--violet); transition: color .2s, transform .2s; }
.pub-summary:hover { color: var(--cool); transform: translateX(2px); }
.pub-doi { font-family: var(--ff-mono); font-size: 0.78rem; color: var(--faint); transition: color .2s; }
.pub-doi:hover { color: var(--text); }
.hobby-link { color: inherit; }
.hobby-more { display: inline-block; margin-top: 0.6rem; font-family: var(--ff-mono); font-size: 0.72rem; color: var(--violet); transition: color .2s, transform .2s; }
.hobby-link:hover .hobby-more { color: var(--cool); transform: translateX(2px); }
