:root{
  --bg: #0b0f17;
  --bg2: #0a1020;
  --card: rgba(255,255,255,0.08);
  --card2: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.88);
  --muted: rgba(255,255,255,0.68);
  --border: rgba(255,255,255,0.14);

  --accent: #7c5cff;
  --accent2: #21d4fd;
  --accent3: #ff4ecd;

  --shadow: 0 18px 45px rgba(0,0,0,0.35);
  --radius: 18px;
  --topbar-h: 74px;   /* CHANGE ONLY THIS if needed */
  --topbar-gap: 10px; /* small visual gap below header */
}

/* Light theme override */
[data-theme="light"]{
  --bg: #f6f7fb;
  --bg2: #ffffff;
  --card: rgba(0,0,0,0.04);
  --card2: rgba(0,0,0,0.06);
  --text: rgba(0,0,0,0.88);
  --muted: rgba(0,0,0,0.65);
  --border: rgba(0,0,0,0.10);
  --shadow: 0 18px 45px rgba(0,0,0,0.12);
}

*{ box-sizing:border-box; }

html, body{ height:100%; }

/* Skip link: hidden off-screen until keyboard-focused */
.skip-link{
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus{
  top: 12px;
}

/* Smooth scrolling */
html{
  scroll-behavior: smooth;
}

body{
  margin:0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1000px 700px at 20% 10%, rgba(124,92,255,0.25), transparent 55%),
              radial-gradient(1000px 700px at 80% 0%, rgba(33,212,253,0.18), transparent 55%),
              radial-gradient(1000px 700px at 40% 90%, rgba(255,78,205,0.18), transparent 55%),
              linear-gradient(180deg, var(--bg), var(--bg2));
  overflow-x: hidden;
}

.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 22px;
}

/* Background blobs */
.bg{ position: fixed; inset: 0; pointer-events:none; z-index:-1; }
.blob{
  position:absolute;
  filter: blur(60px);
  opacity: 0.65;
  transform: translate3d(0,0,0);
  animation: floaty 10s ease-in-out infinite;
}
.blob-1{
  width: 420px; height: 420px;
  left: -120px; top: 90px;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 65%);
}
.blob-2{
  width: 520px; height: 520px;
  right: -180px; top: -80px;
  background: radial-gradient(circle at 40% 40%, var(--accent2), transparent 65%);
  animation-delay: -2s;
}
.blob-3{
  width: 520px; height: 520px;
  left: 30%; bottom: -240px;
  background: radial-gradient(circle at 35% 35%, var(--accent3), transparent 65%);
  animation-delay: -4s;
}
@keyframes floaty{
  0%,100%{ transform: translateY(0px); }
  50%{ transform: translateY(-18px); }
}

/* =========================
   Topbar (ALWAYS visible)
   ========================= */
.topbar{
  position: fixed;   /* changed from sticky */
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;     /* ensure it never hides */

  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(0,0,0,0.65), rgba(0,0,0,0.20));
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .topbar{
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.72));
}
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.2px;
}
/* Logo before name */
.brand-logo{
  width: 34px;
  height: 34px;
  object-fit: contain;

  border-radius: 10px;
  padding: 4px;

  background: var(--card);
  border: 1px solid var(--border);

  transition: transform 0.18s ease, filter 0.25s ease, box-shadow 0.25s ease;
}
.brand-text{
  display:flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-title{
  font-weight: 900;
  letter-spacing: 0.3px;
}

.brand-subtitle{
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 3px;
}
/* Glow on hover */
.brand:hover .brand-logo{
  transform: translateY(-1px) scale(1.03);
  filter: brightness(1.08) saturate(1.15);

  box-shadow:
    0 0 0 6px rgba(124,92,255,0.10),
    0 0 22px rgba(33,212,253,0.25),
    0 0 30px rgba(255,78,205,0.18);
}

/* Accessibility: focus glow */
.brand:focus-visible .brand-logo{
  box-shadow:
    0 0 0 6px rgba(124,92,255,0.18),
    0 0 22px rgba(33,212,253,0.28),
    0 0 30px rgba(255,78,205,0.20);
}

/* (You can remove this if you no longer use the dot)
.brand-dot{
  width: 10px; height: 10px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 6px rgba(124,92,255,0.12);
}
*/

.nav{
  display:flex;
  gap: 16px;
}
.nav a{
  color: var(--muted);
  text-decoration:none;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 10px;
  border-radius: 12px;
}
.nav a:hover{
  color: var(--text);
  background: var(--card);
}

.topbar-actions{
  display:flex;
  gap: 10px;
  align-items:center;
}

.hide-sm{ display:inline; }
@media (max-width: 760px){
  .nav{ display:none; }
  .hide-sm{ display:none; }
}
@media (max-width: 768px) {
  .hero-narrative {
    font-size: 0.95rem;
    line-height: 1.5;
  }
}

/* =========================
   Buttons
   ========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  border-radius: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-decoration:none;
  font-weight: 700;
  cursor:pointer;
  transition: transform .08s ease, background .2s ease, border-color .2s ease;
  user-select:none;
}
.btn:active{ transform: scale(0.98); }

.btn-primary{
  color: white;
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  box-shadow: var(--shadow);
}
.btn-primary:hover{
  filter: saturate(1.05);
}
.btn-ghost{
  color: var(--text);
  background: var(--card);
}
.btn-ghost:hover{
  background: var(--card2);
}

/* =========================
   HERO
   ========================= */
.hero{
  display:grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 26px;
  padding: 16px 0 10px;
  align-items: start;
}
@media (max-width: 980px){
  .hero{ grid-template-columns: 1fr; }
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}
.pill-dot{
  width: 10px; height:10px; border-radius:999px;
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
}

.hero-title{
  margin: 16px 0 10px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.7px;
}
.grad{
  background: linear-gradient(135deg, var(--accent2), var(--accent3), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle{
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 60ch;
}

.hero-cta{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.hero-narrative {
  max-width: 720px;
  margin-top: 0.75rem;
  font-size: 0.95rem;
  opacity: 0.9;
}
.social-row{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.chip{
  display:inline-flex;
  align-items:center;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration:none;
  font-weight: 700;
  font-size: 13px;
}
.icon{
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.chip{
  gap: 8px;
}
.chip:hover{ background: var(--card2); }

.mini-stats{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}
@media (max-width: 560px){
  .mini-stats{ grid-template-columns: 1fr; }
}
.stat{
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}
.stat-num{
  font-weight: 900;
  letter-spacing: 0.4px;
}
.stat-label{
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

/* Right hero card */
.profile-card{
  position: relative;
  border-radius: 24px;
  background: linear-gradient(180deg, var(--card), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px;
  overflow: hidden;
}
.profile-ring{
  position:absolute;
  inset: -80px;
  background: radial-gradient(circle at 40% 40%, rgba(124,92,255,0.25), transparent 55%),
              radial-gradient(circle at 60% 40%, rgba(33,212,253,0.20), transparent 55%),
              radial-gradient(circle at 50% 60%, rgba(255,78,205,0.18), transparent 55%);
  filter: blur(10px);
}
.avatar{
  position: relative;
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}
.profile-meta{
  position: relative;
  margin-top: 14px;
}
.profile-name{
  font-size: 18px;
  font-weight: 900;
}
.profile-role{
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}
.profile-tags{
  margin-top: 10px;
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-affiliation {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 2px;
}
.tag{
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
}

.quote-card{
  margin-top: 14px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 16px 16px 18px;
}
.quote-mark{
  font-size: 34px;
  line-height: 1;
  opacity: 0.85;
}
.quote-text{
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 600;
}

/* =========================
   Sections
   ========================= */
.section{
  padding: 42px 0 6px;
}
.section-head h2{
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.3px;
}
.section-head p{
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

/* Fix anchor offset under fixed header */
section[id]{
  scroll-margin-top: calc(var(--topbar-h) + var(--topbar-gap));
}

/* =========================
   Cards + grid
   ========================= */
.grid{
  margin-top: 18px;
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
}
.card{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--card), rgba(255,255,255,0.02));
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.14);
  position: relative;
  min-height: unset !important;
}
.card h3{
  margin: 0 0 8px;
  font-size: 18px;
}
.card p{
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.55;
}
.card-footer{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items:center;
}
.badge{
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
}
.card-gradient{
  background:
    radial-gradient(900px 300px at 20% 0%, rgba(33,212,253,0.15), transparent 60%),
    radial-gradient(900px 300px at 80% 0%, rgba(255,78,205,0.16), transparent 60%),
    linear-gradient(180deg, var(--card), rgba(255,255,255,0.02));
}
.link{
  color: var(--text);
  font-weight: 900;
  text-decoration:none;
}
.link:hover{ text-decoration: underline; }

/* =========================
   Publication list
   ========================= */
.list{
  margin-top: 18px;
  display:flex;
  flex-direction: column;
  gap: 12px;
}
.list-item{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 14px 16px;
}
.list-title{
  font-weight: 900;
}
.list-sub{
  margin-top: 6px;
  color: var(--muted);
}
.list-sub a{ color: var(--text); font-weight: 800; }

/* =========================
   Contact
   ========================= */
.contact{
  margin-top: 18px;
  display:grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
}
@media (max-width: 980px){
  .contact{ grid-template-columns: 1fr; }
}
.contact-form{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 16px;
}
.contact-form label{
  display:block;
  margin-top: 10px;
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
}
.row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 680px){
  .row{ grid-template-columns: 1fr; }
}
input, textarea{
  width: 100%;
  margin-top: 7px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  outline: none;
}
[data-theme="light"] input,
[data-theme="light"] textarea{
  background: rgba(255,255,255,0.65);
}
input:focus, textarea:focus{
  border-color: rgba(124,92,255,0.55);
  box-shadow: 0 0 0 4px rgba(124,92,255,0.15);
}
.contact-hint{
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}
.form-status{
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  display: none;
}
.form-status.is-visible{ display: block; }
.form-status.is-success{
  background: rgba(46,204,113,0.12);
  border: 1px solid rgba(46,204,113,0.4);
  color: #2ecc71;
}
.form-status.is-error{
  background: rgba(255,78,205,0.10);
  border: 1px solid rgba(255,78,205,0.4);
  color: var(--text);
}
/* Honeypot field: positioned off-screen (not display:none) so bots that
   check computed visibility still fill it in and get caught. */
.hp-field{
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.contact-side .card{ margin-bottom: 14px; }
.side-links{ display:flex; gap: 10px; flex-wrap: wrap; }

/* Space below fixed topbar so content doesn't hide under it */
.main-content{
  padding-top: calc(var(--topbar-h) + var(--topbar-gap));
}
/* Contact action buttons */
.contact-actions{
  margin-top: 14px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Button icons */
.btn-icon{
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* WhatsApp brand hint */
.btn-ghost .whatsapp{
  fill: #25D366;
}
.fa{
  font-size: 15px;
  margin-right: 6px;
}
.chip i,
.btn i{
  font-size: 16px;
  margin-right: 6px;
}
.social-row .chip i{
  font-size: 16px;
  margin-right: 6px;
}

/* =========================
   Toasts
   ========================= */
.toast-wrap{
  padding-top: 18px;
}
.toast{
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.toast.success{ border-color: rgba(46, 204, 113, 0.35); }
.toast.error{ border-color: rgba(231, 76, 60, 0.40); }
.toast-title{ font-weight: 900; }
.toast-msg{ color: var(--muted); margin-top: 4px; }

/* =========================
   Footer
   ========================= */
.footer{
  margin-top: 36px;
  margin-bottom: 12px;   /* reduced */
  padding-bottom: 12px;  /* gives breathing room without pushing to edge */
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  text-align: center;
}
.footer-sep{
  margin: 0 8px;
  opacity: 0.5;
}

.footer-updated{
  opacity: 0.9;
}

/* ===== Project visuals (stable, centered, swap-safe) ===== */

.project-visual {
  margin: 18px auto 0;     /* center horizontally */
  width: 320px;
  height: 200px;

  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;     /* REQUIRED for swapping */
  overflow: hidden;

  border-radius: 14px;
  background: rgba(0,0,0,0.18);
  backdrop-filter: blur(2px);
}

/* Images */
.project-visual img {
  position: absolute;

  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;

  object-fit: contain;
  object-position: center;

  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

/* Active image */
.project-visual img.active {
  opacity: 1;
}

/* Mobile: hide cleanly */
@media (max-width: 768px) {
  .project-visual {
    display: none;
  }
}
/* --- Advanced Scientific Typography --- */

/* Use the elegant serif font for a "Published Paper" look in headers */
.hero-title, .section-head h2 {
  font-family: "Libre Baskerville", serif; 
  letter-spacing: -0.01em;
}

/* Increase line-height for better readability of research text */
.hero-narrative, .card p {
  font-family: "Inter", sans-serif; 
  line-height: 1.7;
  color: var(--muted);
}

/* Optional: Make the "About" text feel more like a journal abstract */
.section-head p {
  font-style: italic;
  font-family: "Libre Baskerville", serif;
  max-width: 800px;
}
/* ================================================= */
/* ADVANCED SCIENTIFIC VISUALS              */
/* ================================================= */

/* 1. Adds a technical coordinate grid over project images */
.project-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(124, 92, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 92, 255, 0.05) 1px, transparent 1px);
  background-size: 20px 20px; 
  pointer-events: none;
  z-index: 2;
}

/* 2. Adds a high-end glow to active research diagrams */
.project-visual img.active {
  opacity: 1;
  filter: drop-shadow(0 0 15px rgba(124, 92, 255, 0.2));
}

/* 3. Re-styles badges to look like data/terminal output */
.badge {
  font-family: 'Courier New', monospace; 
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
  border-radius: 4px; 
  background: var(--card2);
  border: 1px solid var(--accent);
  color: var(--accent2);
}

/* 4. Adds a subtle "film grain" texture to the background */
.bg::before {
  content: "";
  position: fixed;
  inset: 0;
  opacity: 0.03; 
  pointer-events: none;
  background-image: url("https://grainy-gradients.vercel.app/noise.svg");
  filter: contrast(150%) brightness(1000%);
  z-index: 1;
}
/* Ensure the grid and grain adapt to Light Mode */
[data-theme="light"] .project-visual::after {
  background-image: 
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

[data-theme="light"] .bg::before {
  opacity: 0.015; /* Even more subtle for white backgrounds */
}
.profile-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--accent) 0.5px, transparent 0.5px);
  background-size: 10px 10px; /* Micro-dot grid */
  opacity: 0.1;
  pointer-events: none;
}
/* Add this to your style.css around line 35 */
[data-theme="light"] .tag {
  border-color: rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text);
}
.tag:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}
/* --- News Section Consistency --- */

/* Ensures the featured item has a subtle highlight background */
.featured-news {
  border-left: 4px solid var(--accent) !important;
  background: linear-gradient(90deg, var(--card2), var(--card));
}

/* Standardizes the Featured Badge appearance */
.featured-tag {
  background: var(--accent) !important;
  color: #ffffff !important;
  font-size: 0.7em !important;
  vertical-align: middle;
  margin-left: 8px;
  padding: 4px 8px;
  border: none;
  font-weight: 700;
  text-transform: uppercase;
}

/* Matches the font of the list-titles to your serif header style */
.list-title {
  font-family: "Inter", sans-serif; /* Keep titles clean for readability */
  font-weight: 700;
  letter-spacing: -0.01em;
}
.chip[onclick] {
  transition: all 0.2s ease;
}

.chip[onclick]:hover {
  border-color: var(--accent);
  background: var(--card2);
  transform: translateY(-1px);
}

.chip[onclick]:active {
  transform: translateY(0);
}
/* --- High-Density Mini-Stats Styling --- */

.mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.stat-num {
  font-size: 1rem; /* Slightly smaller to fit technical titles */
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-family: "Inter", sans-serif;
}

.stat-label {
  font-size: 0.85rem; /* Compact font for technical bullets */
  line-height: 1.6;
  color: var(--text-dim); /* Subtle color so it doesn't fight with the title */
  text-align: left; /* Left align bullets for better scanning */
}

/* Ensure boxes are responsive on mobile */
@media (max-width: 768px) {
  .mini-stats {
    grid-template-columns: 1fr;
  }
}
/* Optimized Mini-Stats for the New Content */
.mini-stats {
  display: flex;
  flex-wrap: wrap; /* Allows wrapping on smaller screens */
  gap: 1rem;
  margin-top: 1.5rem;
  max-width: 600px; /* Keeps them from getting too wide and breaking the split view */
}

.stat {
  flex: 1;
  min-width: 180px; /* Ensures boxes don't get too squashed */
  padding: 1rem;
  background: var(--card); /* Subtle card background */
  border-radius: 8px;
  border: 1px solid var(--border);
}

.stat-num {
  font-size: 0.9rem; /* Slightly smaller title */
  color: var(--accent);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-label {
  font-size: 0.78rem; /* Professional compact size for technical bullets */
  line-height: 1.5;
  color: var(--text-dim);
  white-space: pre-line; /* Respects your line breaks without adding extra padding */
}
.hero-content {
  display: flex;
  align-items: flex-start; /* Keeps both sides aligned at the top */
  gap: 3rem;
}
/* --- FINAL HERO LAYOUT FIX --- */

/* 1. Manages the Side-by-Side View */
.hero-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3rem;
  width: 100%;
}

/* 2. Optimized Mini-Stats Box Alignment */
.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  max-width: 650px; /* Prevents text from stretching too far */
}

.stat {
  flex: 1;
  min-width: 180px;
  padding: 1.2rem;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: "Inter", sans-serif;
}

.stat-label {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: left;
}

/* 3. Mobile Responsiveness */
@media (max-width: 980px) {
  .hero-content {
    flex-direction: column;
    gap: 2rem;
  }
  .mini-stats {
    max-width: 100%;
  }
}
.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;       /* Reduced gap between the three boxes */
  margin-top: 1.2rem;
  max-width: 700px;
}

.stat {
  flex: 1 1 200px;    /* Allows boxes to sit tighter together */
  padding: 1rem;      /* Reduced internal padding to shrink the box size */
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.stat-label {
  font-size: 0.78rem;
  line-height: 1.4;   /* Tighter line height for the bullets */
  color: var(--muted);
  margin-top: 4px;
}
.hero-title {
  margin: 10px 0 15px;
  /* Use clamp to make it responsive: 
     minimum 32px, preferred 4.5vw, maximum 48px */
  font-size: clamp(32px, 4.5vw, 48px); 
  line-height: 1.1; /* Tight line height keeps it cohesive */
  letter-spacing: -0.02em; /* Slight tightening for a premium look */
  max-width: 15ch; /* Prevents the title from stretching too wide */
}
/* --- High-End Scientific Justification --- */

/* Targets the main hero text and every paragraph in your cards */
.hero-narrative, 
.card p, 
.section-head p {
  text-align: justify;
  text-justify: inter-word; /* Distributes space evenly between words */
  hyphens: auto;            /* Breaks long technical words like 'first-principles' */
}

/* Ensure the hero subtitle stays left-aligned for a modern look */
.hero-subtitle {
  text-align: left;
}

/* Mobile Tweak: Turn off justification on small screens to prevent weird gaps */
@media (max-width: 600px) {
  .hero-narrative, .card p, .section-head p {
    text-align: left;
  }
}
/* Placeholder and Status Styling */
.status-badge {
  background: transparent !important;
  border: 1px dashed var(--muted) !important; /* Visual cue for 'work in progress' */
  color: var(--muted) !important;
  font-style: italic;
  opacity: 0.8;
}

.muted-text {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  opacity: 0.8;
}
/* Styling for 'Under Review' and 'In Prep' work */
.status-under-review {
  border-left: 4px solid var(--muted) !important; /* Visual indicator of 'work in progress' */
  background: linear-gradient(90deg, var(--card), transparent) !important;
  opacity: 0.85; /* Makes it slightly secondary to published work */
}

/* Ensure the 'Coming Soon' text looks professional */
.muted-text {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  margin-left: 5px;
}
/* Status tag for journal submissions */
.status-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--card2);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent2);
  margin-left: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Ensure the Under Review item has a distinct visual appearance */
.status-under-review {
  border-left: 4px solid var(--accent) !important;
  background: linear-gradient(90deg, var(--card2), transparent) !important;
}
/* Highlights the most recent news item */
.featured-news {
  border-left: 4px solid var(--accent);
  background: rgba(var(--accent-rgb), 0.05); /* Very subtle tint */
  padding: 15px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 20px;
}

.news-date {
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-bottom: 5px;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.news-link {
  display: inline-block;
  margin-top: 5px;
  font-size: 0.9em;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.news-link:hover {
  text-decoration: underline;
}
.footer-methods {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

.footer-methods h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  color: var(--accent);
}

.method-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.m-tag {
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.m-tag:hover {
  background: var(--accent);
  color: #000;
  transform: translateY(-2px);
}
/* Space out the technical tags from the copyright */
.footer-bottom {
  margin-top: 45px;          /* Significant gap below the tags */
  padding-top: 25px;         /* Gap between the line and the text */
  border-top: 1px solid rgba(255, 255, 255, 0.15); /* Elegantly separates the sections */
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

/* This styles the bottom container specifically */
.footer-bottom {
    margin-top: 35px;           /* Pushes the copyright down away from the pills */
    padding-top: 20px;          /* Adds space between the new line and the text */
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Adds a subtle, elegant divider line */
    text-align: center;
    width: 100%;
}

/* Adjusts the pills to ensure they don't feel cramped */
.method-tags {
    margin-bottom: 10px;        /* Ensures tags have a small gap at the bottom */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;                  /* Horizontal and vertical gap between pills */
}
.footer-sep {
    margin: 0 15px; /* This adds a bit more horizontal space around the dot */
    color: var(--accent); /* Optional: makes the dot your brand color */
}
.nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
}
.conference-card {
  margin-top: 1.5rem;
  padding: 1.2rem;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.06),
    rgba(255,255,255,0.02)
  );
  backdrop-filter: blur(12px);
}

.conference-card h4 {
  margin: 0 0 0.6rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.conference-visual {
  position: relative;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
}

.conference-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
  filter: saturate(0.9) contrast(1.05);
}

.conference-visual img.active {
  opacity: 1;
}

.conference-caption {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.mini-stats .stat-num {
  text-align: center;
}
.mini-stats .stat-label {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}
.current-focus {
  margin-top: 2rem;
  padding: 1.4rem 1.6rem;
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.05),
    rgba(255,255,255,0.02)
  );
}

.current-focus h3 {
  margin-bottom: 0.8rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.current-focus ul {
  padding-left: 1.1rem;
}

.current-focus li {
  margin-bottom: 0.6rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.9);
}
.conference-visual {
  aspect-ratio: 3 / 2;   /* taller than before */
  height: auto;          /* let aspect-ratio control it */
}
.conference-visual {
  height: 240px;
}
/* Make Current Research Directions more compact */
.current-focus {
  padding-top: 1rem;      /* was ~1.4rem */
  padding-bottom: 1.2rem;
}

.current-focus h3 {
  margin-top: 0;          /* remove default top margin */
  margin-bottom: 0.6rem; /* tighten gap below heading */
}

.current-focus ul {
  margin-top: 0;
}

.current-focus li {
  margin-bottom: 0.45rem; /* slightly tighter list */
}
/* Conference image container */
.conference-visual {
  aspect-ratio: 4 / 3;          /* keep your chosen ratio */
  background: rgba(0,0,0,0.25); /* subtle letterbox background */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Conference images */
.conference-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;          /* SHOW FULL IMAGE */
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* Active image */
.conference-visual img.active {
  opacity: 1;
}
.conference-card h4 {
  text-align: center;
}

.conference-caption {
  text-align: center;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.75);
}
/* === Mobile scroll fix === */
html, body {
  height: auto;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .hero {
    min-height: auto;
    height: auto;
    overflow: visible;
  }
}

.main-content {
  overflow: visible;
}

.bg {
  pointer-events: none;
}
/* ===== Mobile navigation ===== */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px 0;
  background: #fff;
}

/* Mobile behavior */
/* ===== Mobile navigation ===== */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px 0;
  background: #fff;
}

/* Mobile behavior */
@media (max-width: 768px) {
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    right: 16px;
    background: rgba(0,0,0,0.95);
    border-radius: 10px;
    padding: 1rem;
    z-index: 1000;
  }

  .nav.open {
    display: block;
  }

  .nav-toggle {
    display: block;
  }
}
@media (max-width: 768px) {

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;

    display: none;
    flex-direction: column;

    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(12px);

    padding: 1rem 1.25rem;
    border-radius: 0 0 14px 14px;
    z-index: 1000;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 0.9rem 0;
    font-size: 1.05rem;
    text-align: left;
  }
}
/* ================================
   MOBILE NAV TOGGLE (FIX)
================================ */

/* Default: hide hamburger (desktop) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

/* Hamburger bars */
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 4px 0;
  background: white;
  border-radius: 2px;
}

/* Mobile ONLY */
@media (max-width: 768px) {

  .nav-toggle {
    display: block !important;
  }

}
@media (max-width: 768px) {

  /* Re-layout header on mobile */
  .topbar-inner {
    display: flex;
    align-items: center;
  }

  /* Keep brand on the left */
  .brand {
    flex: 1;
  }

  /* Group hamburger with actions */
  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  /* Place hamburger visually next to / under CTA */
  .nav-toggle {
    order: 2;
    margin-left: 0.4rem;
  }

}
@media (max-width: 768px) {

  .topbar-actions {
    gap: 0.35rem;   /* was probably ~0.6rem */
  }

  .nav-toggle {
    margin-left: 0.2rem;  /* reduce spacing */
  }

}
@media (max-width: 768px) {

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;

    display: none;
    flex-direction: column;

    max-height: 55vh;        /* 👈 key line */
    overflow-y: auto;        /* scroll if needed */

    background: rgba(10, 10, 15, 0.96);
    backdrop-filter: blur(12px);

    padding: 0.75rem 1.25rem;
    border-radius: 0 0 16px 16px;
    z-index: 1000;
  }

  .nav.open {
    display: flex;
  }

}
@media (max-width: 768px) {

  .nav {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0.75rem;
    left: auto;

    width: 55vw;          /* 👈 KEY: horizontal control */
    max-width: 320px;     /* prevents it from being too wide */
    min-width: 220px;

    max-height: 55vh;     /* 👈 reduced from 60vh */
    overflow-y: auto;

    display: none;
    flex-direction: column;

    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(14px);

    border-radius: 18px;
    padding: 0.75rem 1.25rem;

    box-shadow:
      0 20px 40px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255,255,255,0.06);

    z-index: 1000;
  }

  .nav.open {
    display: flex;
  }

}
/* Default (dark theme) */
.nav-toggle span {
  background: white;
}

/* Light theme override */
html[data-theme="light"] .nav-toggle span {
  background: #1a1a1a;
}
/* Light mode mobile menu */
html[data-theme="light"] .nav {
  background: rgba(245, 247, 250, 0.96);
  backdrop-filter: blur(10px);
}

html[data-theme="light"] .nav a {
  color: #1a1a1a;
}

html[data-theme="light"] .nav a[aria-current="page"] {
  color: #7c3aed; /* your accent purple */
}
@media (max-width: 768px) {
  .project-visual img {
    position: static;
    opacity: 1 !important;
    transform: none;
  }

  .project-visual img:not(:first-child) {
    display: none;
  }
}
/* ================================
   Light mode readability fixes
================================ */

html[data-theme="light"] .stat,
html[data-theme="light"] .card,
html[data-theme="light"] .current-focus {
  color: #1a1a1a;
}

html[data-theme="light"] .stat-label,
html[data-theme="light"] .current-focus li {
  color: #333;
}

html[data-theme="light"] .stat-num,
html[data-theme="light"] h2,
html[data-theme="light"] h3 {
  color: #6d28d9; /* accent purple */
}
/* ================================
   WCAG AA contrast-safe light mode
================================ */

html[data-theme="light"] {
  --text-primary: #1a1a1a;
  --text-secondary: #374151;
  --text-muted: #4b5563;
  --accent: #6d28d9;
}

/* Card & section text */
html[data-theme="light"] .stat,
html[data-theme="light"] .card,
html[data-theme="light"] .current-focus {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.92);
}

/* Secondary text */
html[data-theme="light"] .stat-label,
html[data-theme="light"] .current-focus li {
  color: var(--text-secondary);
}

/* Headings & highlights */
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] .stat-num {
  color: var(--accent);
}
/* =========================
   Light mode pill visibility fix
   ========================= */

html[data-theme="light"] .tag,
html[data-theme="light"] .badge,
html[data-theme="light"] .pill {
  background: rgba(109, 40, 217, 0.08);   /* soft purple tint */
  border: 1.5px solid #6d28d9;            /* strong accent border */
  color: #4c1d95;                         /* darker purple text */
  font-weight: 600;
}

/* Hover / active state */
html[data-theme="light"] .tag:hover,
html[data-theme="light"] .badge:hover,
html[data-theme="light"] .pill:hover {
  background: rgba(109, 40, 217, 0.14);
}



