/* ============================================================
   Somnonaut — Claude Albertario
   Light Theme
   Palette: #f2f4fb  #2d3c93  #4551a0  #6872c8  #13163a
   ============================================================ */

:root {
  /* Background scale — gradient depth dark */
  --bg:            #1e2040;
  --bg-card:       #272a5a;
  --bg-raised:     #1a1d3a;
  --bg-hover:      #2e3270;

  /* Brand palette */
  --primary:       #3d4faa;
  --deep:          #3040a0;
  --accent:        #5a68c0;
  --highlight:     #828de0;
  --neutral:       #9098cc;

  /* Text scale — light for dark background */
  --text:          #eef0ff;
  --text-sec:      #cdd5f8;
  --text-muted:    #9da8d8;
  --text-dim:      #6e78a8;

  /* Borders */
  --border:        rgba(100, 112, 200, 0.32);
  --border-subtle: rgba(100, 112, 200, 0.16);

  /* Shadows */
  --shadow-xs:     0 1px 6px rgba(0,0,0,0.3);
  --shadow-sm:     0 2px 16px rgba(0,0,0,0.4);
  --shadow-md:     0 4px 36px rgba(0,0,0,0.5);
  --shadow-lg:     0 8px 64px rgba(0,0,0,0.6);

  /* Border radius */
  --r:       6px;
  --r-md:    10px;
  --r-lg:    16px;
  --r-xl:    24px;
  --r-pill:  100px;

  /* Typography */
  --ff-head: 'Cormorant Garamond', Georgia, serif;
  --ff-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Transitions */
  --ease:      all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-fast: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);

  /* Hero photo — admin-editable, see admin.js's wireBackgroundImage */
  --hero-photo: url('NASAPHOTO.webp');
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; font-size: 16px; }
body  {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.78;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  animation: pageFadeIn 0.45s ease both;
}
@keyframes pageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
img  { max-width: 100%; display: block; }
a    { color: inherit; text-decoration: none; }
strong { font-weight: 600; color: var(--text); }
h1, h2, h3, h4 { font-family: var(--ff-head); line-height: 1.2; color: var(--text); }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.section   { padding: 6rem 0; }

/* ══════════════════════════════════════
   HERO BREATHING ANIMATION
══════════════════════════════════════ */
@keyframes breathe {
  0%, 100% { opacity: 0.12; }
  50%       { opacity: 1; }
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.7; }
  50%       { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

.scroll-arrow {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  animation: scrollBounce 2.2s ease-in-out infinite;
  z-index: 3;
  cursor: pointer;
  transition: color 0.2s ease;
  text-decoration: none;
}
.scroll-arrow:hover {
  color: #fff;
}

.scroll-arrow svg {
  width: 42px;
  height: 42px;
  stroke-width: 1.5;
}

/* ══════════════════════════════════════
   SCROLL FADE-IN
══════════════════════════════════════ */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.fade-in.visible        { opacity: 1; transform: none; }
.fade-in.delay-1        { transition-delay: 0.07s; }
.fade-in.delay-2        { transition-delay: 0.14s; }
.fade-in.delay-3        { transition-delay: 0.21s; }
.fade-in.delay-4        { transition-delay: 0.28s; }
.fade-in.delay-5        { transition-delay: 0.35s; }

/* ══════════════════════════════════════
   NAV
══════════════════════════════════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(19, 22, 58, 0.88);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              opacity  0.5s ease,
              background 0.4s ease,
              box-shadow 0.4s ease;
  will-change: transform, opacity;
}
.nav.scrolled {
  background: rgba(19, 22, 58, 0.97);
  border-bottom-color: rgba(255,255,255,0.12);
  box-shadow: 0 4px 40px rgba(0,0,0,0.4);
}

/* Hidden on hero page until user scrolls */
body.is-home .nav {
  transform: translateY(-100%);
  opacity: 0;
}
body.is-home .nav.nav-revealed {
  transform: translateY(0);
  opacity: 1;
}

.nav-inner {
  width: 100%; padding: 0 2.5rem;
  height: 66px;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
}
.nav-brand-moon {
  font-size: 1.15rem; color: var(--accent); line-height: 1; opacity: 0.9;
}
.nav-brand-name {
  font-family: var(--ff-head); font-size: 0.95rem; font-weight: 400;
  color: var(--text); letter-spacing: 0.22em; text-transform: uppercase;
}

.nav-links { display: flex; align-items: center; gap: 2.25rem; list-style: none; }
.nav-links a {
  font-size: 0.74rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted);
  position: relative; transition: color 0.22s;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -3px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 1px; background: var(--highlight);
  transition: width 0.25s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px;
  background: none; border: none; outline: none;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text-muted); border-radius: 0;
  transition: transform 0.25s ease, opacity 0.25s ease, background 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--text); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--text); }

/* Mobile menu overlay */
.nav-mobile {
  display: flex;
  flex-direction: column;
  position: fixed; top: 66px; left: 0; right: 0; z-index: 199;
  background: rgba(19, 22, 58, 0.98);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem 2rem;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-mobile.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.nav-mobile a {
  font-size: 0.86rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); padding: 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: color 0.2s;
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover, .nav-mobile a.active { color: var(--text); }
.nav-mobile-more {
  font-size: 0.86rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); padding: 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
  background: none; border-top: none; border-left: none; border-right: none;
  text-align: left; cursor: pointer; width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  transition: color 0.2s;
}
.nav-mobile-more::after { content: '+'; font-size: 1.1rem; opacity: 0.5; transition: transform 0.2s; }
.nav-mobile-more.open::after { transform: rotate(45deg); }
.nav-mobile-more:hover { color: var(--text); }
.nav-mobile-sub {
  display: none; flex-direction: column; padding-left: 1rem;
}
.nav-mobile-sub.open { display: flex; }
.nav-mobile-sub a {
  font-size: 0.82rem; padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* ══════════════════════════════════════
   HERO
══════════════════════════════════════ */
.hero {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 120% 70% at 50% 2%, rgba(18,24,88,0.55) 0%, transparent 58%),
    radial-gradient(ellipse 55% 38% at 78% 88%, rgba(8,10,44,0.45) 0%, transparent 55%),
    var(--hero-photo) center 30% / cover no-repeat;
  background-attachment: scroll, scroll, fixed;
  display: flex; align-items: center;
  position: relative; overflow: hidden;
}

/* Ambient glow orb */
.hero-glow {
  position: absolute; width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(45,60,147,0.18) 0%, transparent 68%);
  top: -150px; right: -150px; pointer-events: none;
}
.hero-glow-2 {
  position: absolute; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(84,92,172,0.1) 0%, transparent 70%);
  bottom: -100px; left: 10%; pointer-events: none;
}

/* Background EEG wave */
.hero-bg-wave {
  position: absolute; bottom: 0; left: 0; right: 0; opacity: 0.16;
  pointer-events: none;
}
.hero-bg-wave svg { width: 100%; height: 120px; display: block; }

.hero-inner {
  position: relative; z-index: 2;
  max-width: 900px; margin: 0 auto; padding: 0 2rem;
  padding-top: 66px;
  padding-bottom: 55vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
  min-height: 100vh;
}

.hero-text { color: var(--text); width: 100%; }

.hero-badge {
  display: inline-flex; align-items: center;
  background: rgba(84,92,172,0.13);
  border: 1px solid rgba(84,92,172,0.32);
  color: var(--highlight);
  font-size: 0.69rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 5px 14px; border-radius: var(--r-pill);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--ff-head);
  font-size: clamp(3rem, 9vw, 7.5rem);
  font-weight: 400;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow: 0 0 100px rgba(200,210,255,0.22);
  line-height: 1;
}

.hero-name {
  font-family: var(--ff-head);
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  font-weight: 300;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1.1;
  margin-top: 0.3rem;
  text-shadow: 0 0 80px rgba(153,163,223,0.35);
}

.hero-tagline {
  font-family: var(--ff-head);
  font-style: italic;
  font-size: clamp(0.9rem, 1.7vw, 1.15rem);
  color: rgba(255,255,255,0.28);
  letter-spacing: 0.1em;
  margin-top: 0.6rem;
  line-height: 1.7;
}

.hero-davinci {
  font-family: var(--ff-head);
  font-style: italic;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.22);
  margin-top: 1.4rem;
  letter-spacing: 0.05em;
  line-height: 1.85;
  text-align: center;
}
.hero-davinci-attr {
  display: block;
  font-style: normal;
  font-family: var(--ff-body);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-top: 0.4rem;
}

.hero-role  { font-size: 1.05rem; font-weight: 400; color: var(--highlight); margin-bottom: 0.2rem; }
.hero-inst  { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.7rem; line-height: 1.55; }

.hero-divider {
  width: 32px; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin: 1.5rem auto 2.2rem;
}

.hero-cta { display: flex; gap: 0.9rem; flex-wrap: wrap; justify-content: center; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0.72rem 1.6rem; border-radius: var(--r-md);
  font-family: var(--ff-body); font-size: 0.84rem; font-weight: 600;
  letter-spacing: 0.02em; cursor: pointer; border: none;
  transition: var(--ease);
}
.btn-primary {
  background: var(--accent); color: #fff;
  border: 1px solid transparent;
}
.btn-primary:hover {
  background: var(--highlight); color: #141424;
  transform: translateY(-2px); box-shadow: 0 8px 28px rgba(84,92,172,0.45);
}
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--accent); color: var(--highlight);
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent; color: var(--highlight);
  border: 1px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent); color: #fff;
  transform: translateY(-2px); box-shadow: 0 6px 20px rgba(84,92,172,0.35);
}

/* ── PSG Monitor Visual ── */
.hero-visual { display: flex; align-items: center; justify-content: center; }

.psg-monitor {
  width: 100%; max-width: 460px;
  background: rgba(10, 11, 24, 0.92);
  border: 1px solid rgba(84,92,172,0.28);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 0 80px rgba(45,60,147,0.28), var(--shadow-lg);
}

.monitor-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(36,52,116,0.45);
  border-bottom: 1px solid rgba(84,92,172,0.22);
}
.monitor-dots { display: flex; gap: 5px; }
.monitor-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(84,92,172,0.35);
}
.monitor-dot.on { background: rgba(153,163,223,0.7); }
.monitor-label {
  font-size: 0.67rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim);
}
.monitor-stage {
  font-size: 0.67rem; font-weight: 700; letter-spacing: 0.1em;
  background: rgba(84,92,172,0.28); color: var(--highlight);
  padding: 2px 9px; border-radius: var(--r-pill);
}
.psg-svg { display: block; width: 100%; padding: 0.3rem 0; }

/* ══════════════════════════════════════
   SECTION LABELS & HEADINGS
══════════════════════════════════════ */
.label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--highlight); margin-bottom: 0.65rem;
  display: block;
}
.section-title {
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  color: var(--text); margin-bottom: 1rem; line-height: 1.18;
}
.section-lead {
  font-size: 1.05rem; color: var(--text-muted); max-width: 580px; line-height: 1.78;
}

/* ══════════════════════════════════════
   ABOUT SECTION
══════════════════════════════════════ */
.about-section { background: var(--bg); }

.about-grid {
  display: grid; grid-template-columns: 3fr 2fr;
  gap: 4rem; align-items: start; margin-top: 3rem;
}

.about-text p {
  font-size: 1.025rem; line-height: 1.9; color: var(--text-sec);
  margin-bottom: 1.3rem;
}
.about-text p strong { color: var(--text); }

.cv-btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: transparent; border: 1px solid var(--border);
  color: var(--highlight); font-weight: 600; font-size: 0.875rem;
  padding: 0.8rem 1.5rem; border-radius: var(--r-md);
  margin-top: 1.75rem; transition: var(--ease);
}
.cv-btn:hover {
  background: var(--accent); color: #fff;
  border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm);
}
.cv-btn svg { opacity: 0.8; flex-shrink: 0; }

/* Credentials sidebar */
.creds-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.75rem;
  margin-bottom: 1.25rem;
}
.creds-card-title {
  font-size: 0.73rem; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--text-dim); padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.6rem;
}
.cred-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 0.68rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.cred-row:last-child { border-bottom: none; }
.cred-dot {
  width: 5px; height: 5px; background: var(--accent); border-radius: 50%;
  margin-top: 0.48rem; flex-shrink: 0;
}
.cred-body { font-size: 0.875rem; color: var(--text-sec); line-height: 1.5; }
.cred-year { display: block; font-size: 0.77rem; color: var(--text-dim); margin-top: 2px; }

.position-card {
  background: linear-gradient(135deg, var(--deep) 0%, var(--primary) 100%);
  border-radius: var(--r-lg); padding: 1.75rem;
  border: 1px solid rgba(45,60,147,0.5);
}
.pos-label  { font-size: 0.69rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--highlight); margin-bottom: 0.55rem; opacity: 0.8; display: block; }
.pos-title  { font-family: var(--ff-head); font-size: 1.05rem; font-weight: 600; color: #fff; margin-bottom: 0.4rem; }
.pos-inst   { font-size: 0.875rem; color: var(--neutral); line-height: 1.55; margin-bottom: 0.25rem; }
.pos-loc    { font-size: 0.82rem; color: rgba(153,163,223,0.6); }

/* ══════════════════════════════════════
   CAREER TIMELINE
══════════════════════════════════════ */
.timeline-section { background: var(--bg-raised); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.timeline {
  position: relative;
  margin-top: 3.5rem;
  padding-left: 2.5rem;
}
.timeline::before {
  content: '';
  position: absolute; left: 0; top: 10px; bottom: 10px;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border) 8%, var(--border) 92%, transparent);
}

.tl-item {
  position: relative;
  padding: 0 0 2.75rem 2rem;
}
.tl-item:last-child { padding-bottom: 0; }

.tl-dot {
  position: absolute; left: -6px; top: 8px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg-card); border: 2px solid var(--border);
  transition: border-color 0.3s cubic-bezier(0.4,0,0.2,1),
              background   0.3s cubic-bezier(0.4,0,0.2,1),
              box-shadow   0.3s cubic-bezier(0.4,0,0.2,1),
              transform    0.3s cubic-bezier(0.4,0,0.2,1);
  will-change: transform, box-shadow;
}
.tl-item:hover .tl-dot {
  border-color: var(--accent); background: var(--accent);
  box-shadow: 0 0 14px rgba(84,92,172,0.5);
}
/* Dot has scrolled past screen center — stays lit */
.tl-dot.active {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 10px rgba(84,92,172,0.4);
}
/* Dot currently nearest screen center — largest glow */
.tl-dot.tl-current {
  border-color: var(--highlight);
  background: var(--highlight);
  box-shadow: 0 0 22px rgba(153,163,223,0.7), 0 0 6px rgba(153,163,223,0.4);
  transform: scale(1.35);
}

.tl-year {
  font-size: 0.71rem; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.3rem; display: block;
}
.tl-title {
  font-family: var(--ff-head); font-size: 1.05rem; color: var(--text);
  margin-bottom: 0.35rem; font-weight: 500;
}
.tl-body {
  font-size: 0.9rem; color: var(--text-muted); line-height: 1.72; max-width: 620px;
}

/* ══════════════════════════════════════
   HIGHLIGHTS GRID
══════════════════════════════════════ */
.highlights-section { background: var(--bg); }

.highlights-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem; margin-top: 3rem;
}
.hl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.9rem;
  position: relative; overflow: hidden;
  transition: var(--ease);
}
.hl-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--highlight));
  opacity: 0; transition: opacity 0.3s;
}
.hl-card:hover {
  transform: translateY(-3px);
  border-color: rgba(84,92,172,0.4);
  box-shadow: var(--shadow-md);
}
.hl-card:hover::before { opacity: 1; }

.hl-num {
  font-family: var(--ff-head); font-size: 2.8rem; font-weight: 700;
  color: var(--highlight); opacity: 0.4; line-height: 1;
  margin-bottom: 0.65rem; letter-spacing: -0.03em;
  display: block;
}
.hl-card h3 { font-size: 0.96rem; color: var(--text); margin-bottom: 0.5rem; font-weight: 600; }
.hl-card p  { font-size: 0.875rem; color: var(--text-muted); line-height: 1.72; }

/* ══════════════════════════════════════
   PAGE HERO (inner pages)
══════════════════════════════════════ */
.page-hero {
  padding: 9rem 0 5.5rem;
  background: linear-gradient(150deg, #1a1e40 0%, #252a60 40%, #1e2550 100%);
  color: #e8ecff;
  position: relative; overflow: hidden;
}
.page-hero .label { color: var(--accent); margin-bottom: 0.8rem; }
.page-hero h1     {
  font-size: clamp(2.1rem, 4vw, 3.1rem); color: #fff; margin-bottom: 0.9rem;
}
.page-hero p      { color: var(--text-muted); max-width: 560px; font-size: 1.025rem; line-height: 1.76; }

.page-hero-wave {
  position: absolute; bottom: 0; left: 0; right: 0; opacity: 0.13; pointer-events: none;
}
.page-hero-wave svg { width: 100%; height: 80px; display: block; }

/* ══════════════════════════════════════
   PROJECTS PAGE
══════════════════════════════════════ */
.projects-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem; margin-top: 3rem;
}
.proj-card {
  background: var(--bg-card); border-radius: var(--r-lg); padding: 2rem;
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: var(--ease); cursor: pointer;
  position: relative; overflow: hidden;
}
.proj-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.proj-card:hover {
  transform: translateY(-3px);
  border-color: rgba(84,92,172,0.4);
  box-shadow: var(--shadow-md);
}
.proj-card:hover::after { opacity: 1; }

.proj-tag {
  display: inline-block;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase;
  background: rgba(84,92,172,0.13); color: var(--accent);
  border: 1px solid rgba(84,92,172,0.25);
  padding: 3px 10px; border-radius: var(--r-pill); margin-bottom: 0.9rem;
}
.proj-card h3 { font-size: 1.12rem; color: var(--text); margin-bottom: 0.65rem; font-weight: 500; line-height: 1.3; }
.proj-card p  { font-size: 0.9rem; color: var(--text-muted); line-height: 1.75; flex-grow: 1; margin-bottom: 1.5rem; }

.proj-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 600; color: var(--accent);
  transition: var(--ease);
}
.proj-card:hover .proj-arrow { gap: 10px; color: var(--highlight); }

/* ══════════════════════════════════════
   VIDEO SECTION
══════════════════════════════════════ */
.video-section { background: var(--bg-card); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }

.video-frame {
  background: #08090f;
  border-radius: var(--r-lg); overflow: hidden;
  aspect-ratio: 16/9; position: relative;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  margin-top: 2.5rem;
}
.video-frame video, .video-frame iframe {
  width: 100%; height: 100%; object-fit: contain; border: none;
}
.video-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.75rem; color: var(--text-dim);
}
.video-placeholder-icon { font-size: 2.5rem; opacity: 0.28; }
.video-placeholder p    { font-size: 0.875rem; opacity: 0.4; }

/* ══════════════════════════════════════
   RESOURCES
══════════════════════════════════════ */
.resources-grid {
  display: flex; flex-direction: column;
  gap: 1.25rem; margin-top: 2.5rem;
}
.res-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden;
  display: grid; grid-template-columns: 1fr 300px;
  transition: var(--ease);
}
.res-card:hover { border-color: rgba(84,92,172,0.4); box-shadow: var(--shadow-sm); }
.res-card-info {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.5rem;
}
.res-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  background: rgba(84,92,172,0.12); border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--accent);
  border: 1px solid rgba(84,92,172,0.2);
}
.res-body h4 { font-size: 0.9rem; color: var(--text); margin-bottom: 0.2rem; font-weight: 600; }
.res-body p  { font-size: 0.8rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 0.5rem; }
.res-dl      { font-size: 0.78rem; font-weight: 600; color: var(--accent); transition: color 0.2s; }
.res-dl:hover { color: var(--highlight); }

.res-preview {
  border-left: 1px solid var(--border);
  background: var(--bg-raised);
  overflow: hidden;
  min-height: 180px;
  position: relative;
}
.res-preview-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 160%;
  height: 160%;
  transform: translate(-50%, -50%);
  border: none;
  display: block;
  pointer-events: none;
}
.res-preview--placeholder {
  display: flex; align-items: center; justify-content: center;
}
.res-preview-inner {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.res-preview-icon { font-size: 1.8rem; opacity: 0.25; }
.res-preview-label {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-dim);
}

/* ══════════════════════════════════════
   PUBLICATIONS
══════════════════════════════════════ */
.pub-section-head {
  font-size: 0.9rem; color: var(--text);
  margin-bottom: 1.25rem; padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--ff-head); font-weight: 500;
}

.pub-list { margin-top: 0.5rem; }
.pub-item {
  padding: 1rem 0 1rem 1.25rem;
  border-left: 2px solid rgba(84,92,172,0.22);
  margin-bottom: 0.5rem;
  transition: border-color 0.22s;
}
.pub-item:hover { border-left-color: var(--accent); }
.pub-item p {
  font-size: 0.92rem !important;
  line-height: 1.78 !important;
  color: var(--text-sec) !important;
  margin-bottom: 0 !important;
}
.pub-item em  { font-style: italic; color: var(--text-muted); }
.pub-attachment { display: inline-block; margin-top: 0.5rem; font-size: 0.78rem; color: var(--highlight); text-decoration: none; }
.pub-attachment:hover { text-decoration: underline; }
.pub-attachment[href="#"] { display: none; }

/* Presentations timeline */
.pres-list { margin-top: 1.25rem; }
.pres-item {
  display: flex; gap: 1.5rem; align-items: flex-start;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.pres-item:last-child { border-bottom: none; }
.pres-year {
  font-size: 0.77rem; font-weight: 700; color: var(--accent);
  letter-spacing: 0.07em; min-width: 38px; margin-top: 0.1rem;
  flex-shrink: 0;
}
.pres-body  { font-size: 0.9rem; color: var(--text-sec); line-height: 1.65; }
.pres-venue { display: block; font-size: 0.81rem; color: var(--text-dim); margin-top: 2px; }

/* ══════════════════════════════════════
   CONTACT STRIP
══════════════════════════════════════ */
.contact-strip {
  background: var(--bg-raised);
  border-top: 1px solid var(--border-subtle);
  padding: 5.5rem 0; text-align: center;
  position: relative; overflow: hidden;
}
.contact-strip::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(45,60,147,0.16) 0%, transparent 68%);
  pointer-events: none;
}
.contact-strip .label    { color: var(--accent); }
.contact-strip h2        { font-size: clamp(1.9rem, 3vw, 2.5rem); color: var(--text); margin-bottom: 0.7rem; }
.contact-strip .lead-txt { color: var(--text-muted); margin: 0 auto 2rem; font-size: 1rem; max-width: 480px; }

.email-pill {
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text); font-size: 1rem; font-weight: 500;
  font-family: inherit; cursor: pointer;
  padding: 0.85rem 2rem; border-radius: var(--r-pill);
  transition: var(--ease);
}
.email-pill:hover {
  border-color: var(--accent); color: var(--highlight);
  transform: translateY(-2px); box-shadow: 0 8px 28px rgba(84,92,172,0.22);
}

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
footer {
  background: #0c0d1c;
  padding: 3.5rem 0 2rem; text-align: center;
  border-top: 1px solid var(--border-subtle);
}
.foot-logo  { font-family: var(--ff-head); font-size: 1.1rem; color: var(--text); margin-bottom: 0.3rem; }
.foot-creds { font-size: 0.77rem; color: var(--text-dim); letter-spacing: 0.1em; margin-bottom: 1.75rem; }
.foot-links { display: flex; justify-content: center; gap: 2.5rem; margin-bottom: 2rem; list-style: none; }
.foot-links a   { font-size: 0.75rem; font-weight: 600; color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; transition: color 0.2s; }
.foot-links a:hover { color: var(--text); }
.foot-divider { width: 28px; height: 1px; background: var(--border); margin: 0 auto 1.5rem; }
.foot-cta     { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 1rem; }
.foot-cta a   { color: var(--highlight); text-decoration: underline; }
.foot-cta a:hover { color: var(--text); }
.foot-copy    { font-size: 0.75rem; color: rgba(107,117,160,0.5); }

/* ══════════════════════════════════════
   DETAIL PAGE
══════════════════════════════════════ */
.detail-section { background: var(--bg); }
.detail-wrap    { max-width: 820px; margin: 0 auto; }

.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
  margin-bottom: 2.5rem; transition: var(--ease);
}
.back-btn:hover { color: var(--highlight); }

.detail-meta {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  background: var(--bg-card); border-radius: var(--r-lg);
  padding: 1.5rem 2rem; margin: 2rem 0;
  border: 1px solid var(--border);
}
.meta-item { font-size: 0.875rem; }
.meta-key  {
  font-weight: 700; font-size: 0.69rem;
  color: var(--text-dim); letter-spacing: 0.11em; text-transform: uppercase;
  display: block; margin-bottom: 3px;
}
.meta-val  { color: var(--text-sec); font-size: 0.9rem; }

.detail-body h2 { font-size: 1.45rem; color: var(--text); margin: 2.5rem 0 0.85rem; }
.detail-body p  { font-size: 1.025rem; line-height: 1.9; color: var(--text-sec); margin-bottom: 1.3rem; }
.detail-body strong { color: var(--text); }

.detail-divider {
  width: 40px; height: 1px;
  background: var(--border);
  margin: 2.5rem 0;
}

.quote-block {
  background: var(--bg-card);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 1.5rem 2rem; margin: 2.2rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
}
.quote-block p {
  font-family: var(--ff-head);
  font-size: 1.1rem !important;
  font-style: italic;
  color: var(--text) !important;
  margin-bottom: 0 !important;
  line-height: 1.7;
}

/* Z-ratio visual */
.zratio-visual {
  margin: 2.5rem 0;
  background: var(--bg-card);
  border-radius: var(--r-lg); padding: 2.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.zratio-label {
  font-size: 0.69rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 1.25rem; display: block;
}
.zratio-svg { display: block; width: 100%; }

/* pub-cols used on projects page */
.pub-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 3rem; }

/* ══════════════════════════════════════
   DOWNLOAD CARDS (hover preview)
══════════════════════════════════════ */
.dl-section { background: var(--bg-raised); border-top: 1px solid var(--border); }

.dl-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 3rem;
}

/* Wrapper needs position:relative so the popup can anchor to it */
.dl-card {
  position: relative;
  flex: 0 0 320px;
  max-width: 380px;
}

.dl-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: var(--ease);
  text-decoration: none;
  color: inherit;
}
.dl-card-inner:hover {
  transform: translateY(-3px);
  border-color: rgba(84,92,172,0.45);
  box-shadow: var(--shadow-md);
}

.dl-card-icon {
  width: 40px; height: 40px;
  background: rgba(84,92,172,0.12);
  border: 1px solid rgba(84,92,172,0.22);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--accent);
  margin-bottom: 1rem; flex-shrink: 0;
}

.dl-card-title {
  font-size: 0.93rem; font-weight: 600;
  color: var(--text); margin-bottom: 0.5rem; line-height: 1.38;
  font-family: var(--ff-body);
}

.dl-card-desc {
  font-size: 0.83rem; color: var(--text-muted);
  line-height: 1.68; flex-grow: 1; margin-bottom: 1.25rem;
}

.dl-card-footer {
  display: flex; align-items: center; justify-content: space-between;
}

.dl-card-type {
  font-size: 0.67rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-dim);
  background: rgba(84,92,172,0.1);
  border: 1px solid rgba(84,92,172,0.2);
  padding: 2px 9px; border-radius: var(--r-pill);
}

.dl-card-cta {
  font-size: 0.78rem; font-weight: 600;
  color: var(--accent); letter-spacing: 0.02em;
  transition: color 0.2s;
}
.dl-card-inner:hover .dl-card-cta { color: var(--highlight); }

/* ── Hover popup (desktop only) ── */
.dl-popup {
  position: absolute;
  top: 0;
  z-index: 200;
  width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  /* Smooth entrance */
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
  /* left / right set by JS */
}
.dl-popup.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s;
}

.dl-popup-header {
  display: flex; align-items: center; gap: 8px;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--text-dim);
}
.dl-popup-dot {
  width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent); flex-shrink: 0;
}
.dl-popup-frame {
  display: block;
  width: 100%; height: 310px;
  border: none;
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 960px) {
  .hero-inner {
    padding-top: 90px;
    padding-bottom: 4rem;
    min-height: auto;
  }
  .about-grid    { grid-template-columns: 1fr; gap: 2.5rem; }
  .highlights-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: 1fr; }
  .res-card { grid-template-columns: 1fr 220px; }
  .pub-cols      { grid-template-columns: 1fr !important; gap: 2rem !important; }
  .dl-card       { flex: 0 0 280px; }
}

@media (max-width: 640px) {
  /* Mobile: full-width cards, no popup ever */
  .dl-card   { flex: 1 1 100%; max-width: 100%; }
  .dl-popup  { display: none !important; }
  .hero {
    background-attachment: scroll, scroll, scroll;
    background-position: center 30%, center 30%, center 30%;
  }
  .hero-inner {
    justify-content: flex-start;
    padding-top: 90px;
    padding-bottom: 0;
    min-height: 100vh;
  }
  .nav-links    { display: none; }
  .nav-toggle   { display: flex; }
  .highlights-grid { grid-template-columns: 1fr; }
  .res-card { grid-template-columns: 1fr; }
  .res-preview {
    border-left: none;
    border-top: 1px solid var(--border);
    height: 280px;
    overflow: hidden;
    position: relative;
  }
  .res-preview-frame {
    position: absolute;
    top: 0; left: 0;
    width: 200%;
    height: 100%;
    border: none;
    pointer-events: none;
  }
  .section      { padding: 4rem 0; }
  .detail-meta  { flex-direction: column; gap: 0.75rem; }
  .foot-links   { gap: 1.5rem; }
  .timeline     { padding-left: 1.5rem; }
}
/* ══════════════════════════════════════
   MOBILE VISUAL POLISH (≤ 640px)
   Supplements the responsive block above
══════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── Hero: let the space photo actually show ── */
  /* Lighter overlays so the NASA bg breathes on mobile */
  .hero {
    background:
      radial-gradient(ellipse 200% 60% at 50% 0%, rgba(10,14,60,0.35) 0%, transparent 68%),
      radial-gradient(ellipse 120% 55% at 50% 110%, rgba(6,8,36,0.42) 0%, transparent 62%),
      var(--hero-photo) center 38% / cover no-repeat;
    background-attachment: scroll, scroll, scroll;
  }

  /* Center content vertically — not jammed to the top */
  .hero-inner {
    justify-content: center;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
    min-height: 100svh;
    gap: 0;
  }

  /* Title: sized to fit the word in one line + atmospheric glow */
  .hero-title {
    font-size: clamp(2.6rem, 13vw, 3.6rem);
    color: rgba(255,255,255,0.9);
    text-shadow:
      0 2px 20px rgba(0,0,0,0.55),
      0 0 60px rgba(153,163,223,0.32),
      0 0 130px rgba(45,60,147,0.22);
  }

  .hero-name {
    font-size: clamp(0.68rem, 2.8vw, 0.88rem);
    letter-spacing: 0.26em;
    color: rgba(255,255,255,0.6);
    text-shadow: 0 1px 12px rgba(0,0,0,0.6);
    margin-top: 0.65rem;
  }

  .hero-tagline {
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.5);
    text-shadow: 0 1px 12px rgba(0,0,0,0.6);
    margin-top: 0.55rem;
    padding: 0 2.5rem;
  }

  /* Glow orb: centered, softer */
  .hero-glow {
    width: 120%; height: 520px;
    top: -100px; left: -10%; right: auto;
    background: radial-gradient(circle, rgba(45,60,147,0.28) 0%, transparent 68%);
    opacity: 0.9;
  }
  .hero-glow-2 {
    width: 260px; height: 260px;
    bottom: 18%; left: 50%;
    transform: translateX(-50%);
    opacity: 0.45;
  }

  /* ── Gradient accent lines between every section ── */
  /* Gives each section a clear visual entry point */
  .about-section,
  .timeline-section,
  .highlights-section,
  .contact-strip {
    position: relative;
  }

  .about-section::before,
  .timeline-section::before,
  .highlights-section::before,
  .contact-strip::before {
    content: '';
    position: absolute;
    top: 0; left: 12%; right: 12%;
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(100,112,200,0.5),
      transparent
    );
    pointer-events: none;
    z-index: 2;
  }

  /* Subtle entry glow on about section */
  .about-section::after {
    content: '';
    position: absolute;
    top: -1px; left: 50%;
    transform: translateX(-50%);
    width: 300px; height: 120px;
    background: radial-gradient(ellipse, rgba(61,79,170,0.12) 0%, transparent 72%);
    pointer-events: none;
    z-index: 1;
  }

  /* ── Section rhythm ── */
  .section { padding: 3rem 0; }
  .section-title { margin-bottom: 0.7rem; }
  .section-lead  { font-size: 0.95rem; line-height: 1.7; }

  /* Label: act as a clear visual anchor per section */
  .label { font-size: 0.67rem; letter-spacing: 0.19em; margin-bottom: 0.5rem; }

  /* Timeline section: replace hard border with gradient on mobile */
  .timeline-section { border-top-color: transparent; border-bottom-color: transparent; }

  /* Highlights section: subtle alternating bg for rhythm */
  .highlights-section { background: linear-gradient(to bottom, var(--bg) 0%, #1c1f3c 100%); }

  /* ── About ── */
  .about-text p { font-size: 0.94rem; line-height: 1.9; }
  .cv-btn { width: 100%; justify-content: center; }

  /* Cards with depth */
  .creds-card {
    padding: 1.25rem;
    box-shadow: 0 8px 36px rgba(0,0,0,0.55);
    margin-bottom: 0.9rem;
  }
  .position-card {
    box-shadow: 0 8px 36px rgba(0,0,0,0.55);
    position: relative;
    overflow: hidden;
  }
  /* Shimmer accent on top of position card */
  .position-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--highlight), transparent);
    opacity: 0.6;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    pointer-events: none;
  }
  .cred-body { font-size: 0.83rem; }
  .cred-year { font-size: 0.73rem; }

  /* ── Timeline ── */
  .timeline { padding-left: 1.1rem; }
  .tl-item  { padding-left: 1.3rem; padding-bottom: 2rem; }
  .tl-title { font-size: 0.98rem; }
  .tl-body  { font-size: 0.875rem; line-height: 1.72; max-width: 100%; }
  .tl-dot   { width: 11px; height: 11px; top: 5px; left: -5.5px; }

  /* ── Highlights ── */
  .highlights-grid { gap: 0.65rem; }
  .hl-card { padding: 1.4rem; }
  /* Alternating card backgrounds for visual cadence */
  .hl-card:nth-child(even) {
    background: var(--bg-raised);
    border-color: rgba(100,112,200,0.28);
  }
  .hl-num { font-size: 2rem; margin-bottom: 0.45rem; }
  .hl-card h3 { font-size: 0.93rem; }
  .hl-card p  { font-size: 0.85rem; line-height: 1.7; }

  /* ── Contact strip ── */
  .contact-strip { padding: 4rem 0; }
  .contact-strip h2 { font-size: clamp(1.6rem, 6vw, 2rem); }
  .email-pill {
    width: 100%; max-width: 300px;
    justify-content: center;
    font-size: 0.88rem;
    padding: 0.8rem 1.5rem;
  }

  /* ── Footer ── */
  .foot-links { gap: 1.25rem; flex-wrap: wrap; justify-content: center; }
}

/* Very small phones (≤ 380px) */
@media (max-width: 380px) {
  .container  { padding: 0 1.2rem; }
  .hero-title { font-size: clamp(2.9rem, 18vw, 3.6rem); }
}

/* ══════════════════════════════════════
   QUOTE OVERLAY (sits over EEG canvas)
══════════════════════════════════════ */
.quote-text {
  font-family: var(--ff-head);
  font-style: italic;
  font-size: clamp(1rem, 2vw, 1.45rem);
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.03em;
  line-height: 1.65;
  text-align: center;
  text-shadow: none;
  max-width: 640px;
  padding: 0 2rem;
  margin: 0;
}
.quote-attr {
  font-family: var(--ff-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  text-shadow: none;
  margin-top: 0.6rem;
}
