:root{
  --bg:#0b1020;
  --bg-2:#070c1d;
  --card:rgba(255,255,255,.045);
  --card-hover:rgba(255,255,255,.07);
  --border:rgba(255,255,255,.09);
  --border-strong:rgba(125,211,252,.45);
  --text:#e7edf6;
  --muted:#9aa4b2;
  --accent:#7dd3fc;
  --accent-strong:#60a5fa;
  --radius-lg:18px;
  --radius-md:12px;
  --shadow:0 10px 30px rgba(0,0,0,.6);
  --max-width:1120px;
  --nav-h:60px;
  --font-display:'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:'Manrope', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme:dark;
}

*{box-sizing:border-box}

html{ scroll-behavior:smooth; }

body{
  margin:0;
  min-height:100vh;
  position:relative;
  color:var(--text);
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.6;
  background:
    radial-gradient(50vw 40vw at 12% 8%, rgba(124,58,237,.18), transparent 45%),
    radial-gradient(55vw 40vw at 82% 4%, rgba(34,211,238,.15), transparent 48%),
    radial-gradient(45vw 35vw at 40% 92%, rgba(59,130,246,.13), transparent 52%),
    radial-gradient(30vw 22vw at 88% 75%, rgba(236,72,153,.08), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 70%);
  background-attachment:fixed;
  overflow-x:hidden;
}

/* Animated star canvas sits behind everything */
#starfield{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  z-index:-1;
  pointer-events:none;
  display:block;
}

a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}

h1,h2,h3,h4{font-family:var(--font-display);font-weight:600;line-height:1.15}
h2{
  font-size:clamp(1.5rem, 1rem + 2.2vw, 2.1rem);
  margin:0 0 6px 0;
  letter-spacing:-.01em;
}

.skip-link{
  position:absolute;left:-999px;top:0;z-index:100;
  background:var(--accent);color:#04203a;padding:10px 16px;border-radius:0 0 10px 0;font-weight:700;
}
.skip-link:focus{left:0;text-decoration:none}

/* ================= NAV ================= */
.nav{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(8,12,24,.62);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  border-bottom:1px solid var(--border);
}
.nav-inner{
  max-width:var(--max-width);
  margin:0 auto;
  height:var(--nav-h);
  padding:0 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.nav-logo{
  font-family:var(--font-display);
  font-weight:700;
  font-size:1.3rem;
  color:var(--text);
  letter-spacing:.02em;
}
.nav-logo:hover{text-decoration:none}
.nav-logo span{color:var(--accent)}
.nav-links{display:flex;gap:4px;align-items:center}
.nav-links a{
  padding:8px 12px;border-radius:9px;color:var(--muted);
  font-weight:600;font-size:.94rem;transition:color .2s, background .2s;
}
.nav-links a:hover{color:var(--text);background:rgba(255,255,255,.06);text-decoration:none}
.nav-links a.active{color:var(--accent)}

.nav-toggle{
  display:none;
  flex-direction:column;
  gap:5px;
  width:42px;height:42px;
  align-items:center;justify-content:center;
  background:transparent;border:1px solid var(--border);border-radius:10px;cursor:pointer;
}
.nav-toggle span{display:block;width:20px;height:2px;background:var(--text);border-radius:2px;transition:transform .25s, opacity .2s}
.nav-toggle.open span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.nav-toggle.open span:nth-child(2){opacity:0}
.nav-toggle.open span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

/* ================= LAYOUT ================= */
.site{
  max-width:var(--max-width);
  margin:0 auto;
  padding:28px 20px 10px;
  position:relative;
  z-index:0;
}
.section{margin-bottom:clamp(40px, 6vw, 64px)}
section[id]{scroll-margin-top:calc(var(--nav-h) + 16px)}
.section-note{color:var(--muted);font-size:.92rem;margin:0 0 18px}

/* ================= HERO ================= */
.hero{
  background:linear-gradient(180deg,rgba(255,255,255,.04),transparent);
  padding:20px;
  border-radius:var(--radius-lg);
  margin:8px 0 48px;
}
.hero-card{
  display:flex;
  gap:26px;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:24px;
}
.avatar-wrapper{display:flex;flex-direction:column;align-items:center;flex-shrink:0}
.avatar-img{
  width:min(220px, 52vw);height:auto;aspect-ratio:23/24;
  border-radius:16px;object-fit:cover;box-shadow:var(--shadow);
}
.avatar-fallback{
  width:130px;height:130px;border-radius:16px;
  background:linear-gradient(135deg,#0ea5a5,#60a5fa);
  display:flex;align-items:center;justify-content:center;
  font-weight:800;font-size:32px;color:#03131e;
}
.avatar-credit{margin-top:.4em;font-size:.72rem;color:#cdd6e4;font-style:italic;text-align:center}
.hero-body h1{font-size:clamp(1.9rem, 1.2rem + 3vw, 3rem);margin:0 0 6px}
.role{color:var(--accent);font-weight:600;margin-bottom:12px}
.hero-body p{margin:0 0 16px;max-width:60ch;color:#d6deea}

.hero-tags{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:18px}
.hero-tags span{
  font-size:.8rem;font-weight:600;color:var(--accent);
  background:rgba(125,211,252,.12);border:1px solid rgba(125,211,252,.22);
  padding:5px 11px;border-radius:999px;
}

/* ================= SOCIAL LINKS ================= */
.social-links{display:flex;gap:10px;flex-wrap:wrap}
.social-links a{
  display:inline-flex;align-items:center;gap:8px;
  padding:9px 13px;border-radius:10px;
  background:rgba(255,255,255,.05);border:1px solid var(--border);
  font-weight:600;font-size:.92rem;color:var(--text);transition:background .2s, border-color .2s;
}
.social-links a:hover{background:var(--card-hover);border-color:var(--border-strong);text-decoration:none}
.cta-pill{
  background:linear-gradient(135deg,#2b2f77,#1b9aaa) !important;
  border:none !important;color:#fff !important;
  font-family:var(--font-display);font-style:italic;
}

/* ================= TIMELINE ================= */
.timeline{position:relative;padding-left:28px}
.timeline::before{
  content:"";position:absolute;left:8px;top:6px;bottom:6px;width:2px;
  background:linear-gradient(180deg, rgba(125,211,252,.5), rgba(255,255,255,.1));
}
.timeline-item{
  position:relative;margin-bottom:26px;
  opacity:0;transform:translateY(22px);
  transition:opacity .6s ease, transform .6s ease;
}
.timeline-item.visible{opacity:1;transform:none}
.timeline-item::before{
  content:"";position:absolute;left:0;top:26px;transform:translate(-50%,-50%);
  width:13px;height:13px;border-radius:50%;background:var(--accent);
  box-shadow:0 0 0 4px rgba(125,211,252,.15);z-index:1;
}
.timeline-card{
  background:var(--card);border:1px solid var(--border);
  border-radius:var(--radius-md);padding:16px 44px 16px 22px;
  position:relative;transition:border-color .25s, background .25s, transform .2s;
}
.timeline-item.has-expand .timeline-card{cursor:pointer}
.timeline-item.has-expand .timeline-card:hover{border-color:var(--border-strong);background:var(--card-hover)}

/* expand affordance chevron */
.timeline-item.has-expand .timeline-card::after{
  content:"";position:absolute;right:18px;top:22px;
  width:9px;height:9px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);
  transform:rotate(45deg);transition:transform .3s ease, border-color .3s ease;
}
.timeline-item.has-expand.open .timeline-card::after{transform:rotate(225deg);border-color:var(--accent)}

.timeline-header{display:flex;align-items:center;gap:14px}
.timeline-header img{width:48px;height:48px;object-fit:contain;flex-shrink:0}
.timeline-item.publication .timeline-header img{width:84px;height:84px}
.timeline-card strong{font-size:1.02rem;line-height:1.3}
.meta{font-size:.86rem;color:var(--muted);margin-top:3px}
.timeline-card p{margin:8px 0 0}
.timeline-card p em{color:var(--muted);font-size:.9rem}

/* ================= TIMELINE EXPAND ================= */
.timeline-expand{
  overflow:hidden;max-height:0;margin-top:0;padding:0 22px;
  transition:max-height .5s cubic-bezier(.4,0,.2,1), padding .4s ease, margin .4s ease;
}
.timeline-expand.open{
  max-height:3000px;margin-top:8px;padding:14px 22px;
  border-left:2px solid var(--accent);border-radius:0 0 var(--radius-md) var(--radius-md);
  background:linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.01));
}
.expand-body p{font-size:.95rem;line-height:1.7;color:var(--text);margin:10px 0 14px}
.expand-gallery{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap:14px;margin-top:14px;align-items:start;
}
.expand-gallery img{
  width:100%;
  height:auto;
  aspect-ratio:4 / 3;        /* equal size for images sitting side by side */
  object-fit:cover;
  display:block;
  border-radius:10px;
  box-shadow:
    0 0 0 1px rgba(125,211,252,.22),
    0 6px 20px rgba(0,0,0,.40),
    0 0 18px rgba(125,211,252,.18);   /* soft glow */
  transition:box-shadow .3s ease, transform .25s ease;
}
.expand-gallery img:hover{
  box-shadow:
    0 0 0 1px rgba(125,211,252,.40),
    0 8px 26px rgba(0,0,0,.50),
    0 0 26px rgba(125,211,252,.32);
  transform:translateY(-2px);
}

/* ================= EQUIPMENT ================= */
.equip-title{margin:20px 0 4px;font-size:1.05rem;color:var(--accent)}
.equip-tasks{font-size:.9rem;color:var(--muted);margin:4px 0 12px}
.equip-grid{
  display:grid;grid-template-columns:repeat(auto-fit, minmax(190px, 1fr));
  gap:14px 18px;margin:6px 0 16px;
}
.equip-cat h5{
  margin:0 0 8px;font-size:.72rem;font-weight:800;
  text-transform:uppercase;letter-spacing:.06em;color:var(--text);
  font-family:var(--font-body);
}

/* ================= KEYWORD CHIPS ================= */
.keywords{display:flex;flex-wrap:wrap;gap:8px}
.keywords span{
  background:rgba(125,211,252,.14);color:var(--accent);
  padding:5px 11px;border-radius:8px;font-size:.82rem;font-weight:600;
  border:1px solid rgba(125,211,252,.18);
}

/* ================= TUTORING ================= */
.tutoring-box{
  background:linear-gradient(135deg,#23276b,#178a98);
  border-radius:var(--radius-lg);padding:clamp(22px, 4vw, 36px);
  box-shadow:0 14px 40px rgba(0,0,0,.4);border:1px solid rgba(255,255,255,.08);
}
.tutoring-box p,.tutoring-box li{color:#eef4ff}
.tutoring-head{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.brand{
  font-family:var(--font-display);font-style:italic;font-weight:700;
  font-size:clamp(2rem, 1.2rem + 4vw, 3.1rem);margin:0;color:#fff;
}
.lang-badge{
  font-size:.82rem;font-weight:700;color:#cdeeff;
  background:rgba(255,255,255,.14);padding:6px 12px;border-radius:999px;white-space:nowrap;
}
.tutoring-cta-text{
  font-family:var(--font-display);font-style:italic;color:#a9ecff;
  font-size:clamp(1.3rem, 1rem + 1.6vw, 1.9rem);margin-top:22px;
}
.tutoring-actions{display:flex;gap:14px;flex-wrap:wrap;margin-top:20px}

/* ================= BUTTONS ================= */
.btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:11px 20px;border-radius:999px;
  background:linear-gradient(90deg,var(--accent),var(--accent-strong));
  color:#04203a;border:none;cursor:pointer;font-weight:700;font-size:1rem;
  transition:filter .2s, transform .1s;
}
.btn:hover{filter:brightness(1.06);text-decoration:none}
.btn:active{transform:translateY(1px)}
.btn.ghost{background:transparent;border:1px solid rgba(255,255,255,.4);color:#fff}

/* ================= FOOTER ================= */
.footer{
  border-top:1px solid var(--border);
  margin-top:40px;background:rgba(7,12,29,.5);
}
.footer-inner{
  max-width:var(--max-width);margin:0 auto;padding:24px 20px;
  display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;
}
.footer-social{display:flex;gap:16px;flex-wrap:wrap}
.footer-social a{color:var(--muted);font-weight:600;font-size:.9rem}
.footer-social a:hover{color:var(--accent)}
.footer-copy{color:var(--muted);font-size:.86rem;margin:0}

/* ================= SCROLL-TO-TOP BUTTON ================= */
.scroll-top-btn{
  position:fixed;right:24px;bottom:24px;z-index:60;
  display:inline-flex;align-items:center;gap:8px;
  padding:12px 18px;border:none;border-radius:999px;
  font-family:var(--font-body);font-weight:700;font-size:.95rem;color:#04203a;
  background:linear-gradient(90deg,var(--accent),var(--accent-strong));
  box-shadow:var(--shadow);cursor:pointer;
  opacity:0;transform:translateY(20px);pointer-events:none;
  transition:opacity .35s ease, transform .35s ease, filter .2s ease;
}
.scroll-top-btn.show{opacity:1;transform:translateY(0);pointer-events:auto}
.scroll-top-btn:hover{filter:brightness(1.06);text-decoration:none}

/* ================= REVEAL ================= */
.reveal{opacity:0;transform:translateY(20px);transition:opacity .6s ease, transform .6s ease}
.reveal.visible{opacity:1;transform:none}

/* ================= FOCUS ================= */
a:focus-visible,button:focus-visible,.timeline-card[role="button"]:focus-visible{
  outline:2px solid var(--accent);outline-offset:3px;border-radius:10px;
}

/* ================= RESPONSIVE ================= */
@media (max-width:820px){
  .nav-toggle{display:flex}
  .nav-links{
    position:absolute;top:var(--nav-h);left:0;right:0;
    flex-direction:column;gap:2px;align-items:stretch;
    background:rgba(8,12,24,.97);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
    border-bottom:1px solid var(--border);padding:10px 16px;
    transform:translateY(-12px);opacity:0;pointer-events:none;
    transition:opacity .25s ease, transform .25s ease;
  }
  .nav-links.open{opacity:1;transform:none;pointer-events:auto}
  .nav-links a{padding:13px 12px;font-size:1rem}
}

@media (max-width:760px){
  .hero{padding:14px;margin-bottom:32px}
  .hero-card{flex-direction:column;align-items:center;text-align:center;padding:22px 18px;gap:18px}
  .hero-body p{margin-left:auto;margin-right:auto}
  .hero-tags,.social-links{justify-content:center}
  .timeline{padding-left:22px}
  .timeline-card{padding:14px 40px 14px 18px}
  .timeline-item.publication .timeline-header img{width:60px;height:60px}
  .equip-grid{grid-template-columns:1fr 1fr}
}

@media (max-width:520px){
  .equip-grid{grid-template-columns:1fr}
  .expand-gallery{grid-template-columns:1fr}
  .footer-inner{flex-direction:column;align-items:flex-start}
  .scroll-top-btn{right:14px;bottom:14px;padding:10px 14px;font-size:.88rem}
  .timeline-header{gap:10px}
  .timeline-header img{width:40px;height:40px}
}

/* ================= REDUCED MOTION ================= */
@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  .timeline-item,.reveal{opacity:1;transform:none;transition:none}
  .scroll-top-btn{transition:none}
  .timeline-expand{transition:max-height .01s linear, padding .01s linear}
}

/* ================================================================
   ENHANCEMENTS — buttons, interactions, publication sync states
   ================================================================ */

/* --- Button polish: sheen on hover + ripple container --- */
.btn,
.cta-pill{
  position:relative;
  overflow:hidden;
  background-size:200% 100%;
  background-position:0 0;
  transition:filter .2s, transform .12s, box-shadow .25s, background-position .5s ease;
}
.btn:hover{
  background-position:100% 0;
  transform:translateY(-2px);
  box-shadow:0 8px 22px rgba(96,165,250,.35);
}
.btn:active{transform:translateY(0)}
.btn.ghost:hover{box-shadow:0 8px 22px rgba(255,255,255,.10)}
.cta-pill:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(27,154,170,.4)}

/* Click ripple (added by script.js) */
.btn-ripple{
  position:absolute;
  border-radius:50%;
  pointer-events:none;
  background:rgba(255,255,255,.45);
  transform:scale(0);
  opacity:.6;
  animation:btnRipple .6s ease-out forwards;
}
@keyframes btnRipple{to{transform:scale(2.4);opacity:0}}

/* --- Social links: gentle lift --- */
.social-links a:hover{transform:translateY(-2px)}
.social-links a{transition:background .2s, border-color .2s, transform .15s}

/* --- Active nav link underline --- */
.nav-links a.active{position:relative}
.nav-links a.active::after{
  content:"";position:absolute;left:12px;right:12px;bottom:5px;height:2px;
  background:var(--accent);border-radius:2px;
}

/* --- Timeline card hover lift --- */
.timeline-item.has-expand .timeline-card:hover{transform:translateY(-2px)}

/* --- Publication sync status note --- */
.pub-status{
  color:var(--muted);
  font-size:.92rem;
  font-style:italic;
  margin:0 0 16px;
  padding:11px 16px;
  border:1px dashed var(--border);
  border-radius:var(--radius-md);
  background:rgba(255,255,255,.02);
}

/* --- Tutoring flag spacing (new tutoring-head markup) --- */
.tutoring-head .lang-flag{flex-shrink:0;box-shadow:0 2px 8px rgba(0,0,0,.3)}

@media (prefers-reduced-motion: reduce){
  .btn,.cta-pill{transition:none}
  .btn:hover,.cta-pill:hover,
  .social-links a:hover,.timeline-item.has-expand .timeline-card:hover{transform:none}
  .btn-ripple{display:none}
}

/* ================================================================
   SCROLL-TO-TOP ("Slides up") — horizontally centered, translucent
   so it floats over content without obscuring it. Overrides the
   earlier corner-anchored rules via cascade order.
   ================================================================ */
.scroll-top-btn{
  position:fixed;
  left:50%;
  right:auto;
  bottom:28px;
  transform:translate(-50%, 20px);
  overflow:hidden;
  opacity:0;
  pointer-events:none;
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
  box-shadow:0 8px 24px rgba(0,0,0,.30);
  transition:opacity .35s ease, transform .35s ease, filter .2s ease, box-shadow .25s ease;
}
.scroll-top-btn.show{
  opacity:.55;                 /* slightly transparent at rest */
  transform:translate(-50%, 0);
  pointer-events:auto;
}
.scroll-top-btn:hover{
  opacity:.95;                 /* becomes solid on hover */
  filter:brightness(1.05);
  transform:translate(-50%, -2px);
}
.scroll-top-btn:active{transform:translate(-50%, 0)}

@media (max-width:520px){
  .scroll-top-btn{left:50%;right:auto;bottom:18px}
}
@media (prefers-reduced-motion: reduce){
  .scroll-top-btn{transition:opacity .2s ease}
  .scroll-top-btn.show,
  .scroll-top-btn:hover,
  .scroll-top-btn:active{transform:translate(-50%, 0)}
}

/* ================================================================
   LIGHTBOX — full-image viewer
   ================================================================ */
.expand-gallery img,
.avatar-img{ cursor:zoom-in; }

.lightbox{
  position:fixed; inset:0; z-index:1000;
  display:flex; align-items:center; justify-content:center;
  padding:24px;
  background:rgba(4,8,20,.86);
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
  opacity:0; visibility:hidden; pointer-events:none;
  transition:opacity .25s ease, visibility .25s ease;
}
.lightbox.open{ opacity:1; visibility:visible; pointer-events:auto; }

.lightbox-fig{
  margin:0; display:flex; flex-direction:column; align-items:center; gap:12px;
  max-width:94vw; max-height:92vh;
}
.lightbox img{
  max-width:94vw; max-height:84vh; width:auto; height:auto;
  aspect-ratio:auto;            /* show the FULL image, not the cropped thumb */
  object-fit:contain;
  border-radius:12px; cursor:default; background:rgba(0,0,0,.3);
  box-shadow:
    0 0 0 1px rgba(125,211,252,.25),
    0 20px 60px rgba(0,0,0,.6),
    0 0 40px rgba(125,211,252,.18);
  transform:scale(.96); transition:transform .25s ease;
}
.lightbox.open img{ transform:scale(1); }
.lightbox figcaption{
  color:#cdd6e4; font-size:.9rem; text-align:center; max-width:80ch; line-height:1.5;
}
.lightbox-close{
  position:absolute; top:18px; right:20px;
  width:44px; height:44px; border-radius:50%;
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.08); color:#fff;
  font-size:1.6rem; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:background .2s ease, transform .15s ease;
}
.lightbox-close:hover{ background:rgba(255,255,255,.18); transform:scale(1.06); }

@media (prefers-reduced-motion: reduce){
  .lightbox,
  .lightbox img,
  .lightbox-close{ transition:none; }
  .lightbox img{ transform:none; }
}

/* ================================================================
   ACADEMIC TREE — graph layout (academictree-style, our styling)
   Mentors rise above the focal person via a vertical flip; node
   content is flipped back upright. Horizontally scrollable.
   ================================================================ */
.at-wrap{
  overflow-x:auto; overflow-y:hidden;
  padding:6px 2px 16px;
  -webkit-overflow-scrolling:touch;
}
.at-tree{
  display:inline-block;
  min-width:100%;
  transform:scaleY(-1);              /* flip so mentors sit ABOVE the focal node */
}
.at-tree ul{
  display:flex; justify-content:center; position:relative;
  list-style:none; margin:0; padding:36px 0 0;
}
.at-tree li{
  position:relative; padding:36px 8px 0; text-align:center;
}
/* connector lines */
.at-tree li::before,
.at-tree li::after{
  content:""; position:absolute; top:0; right:50%;
  width:50%; height:36px; border-top:2px solid rgba(125,211,252,.40);
}
.at-tree li::after{ right:auto; left:50%; border-left:2px solid rgba(125,211,252,.40); }
.at-tree li:only-child::before,
.at-tree li:only-child::after{ display:none; }
.at-tree li:only-child{ padding-top:36px; }
.at-tree li:first-child::before,
.at-tree li:last-child::after{ border:0 none; }
.at-tree li:last-child::before{ border-right:2px solid rgba(125,211,252,.40); border-radius:0 7px 0 0; }
.at-tree li:first-child::after{ border-radius:7px 0 0 0; }
.at-tree ul ul::before{
  content:""; position:absolute; top:0; left:50%;
  width:0; height:36px; border-left:2px solid rgba(125,211,252,.40);
}

.at-node{
  position:relative;
  display:inline-flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:6px;
  width:164px; height:178px; padding:12px 10px; box-sizing:border-box; text-align:center;
  background:var(--card); border:1px solid var(--border); border-radius:var(--radius-md);
  transform:scaleY(-1);              /* un-flip the content */
  transition:border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.at-node:hover{ border-color:var(--border-strong); background:var(--card-hover); box-shadow:0 8px 22px rgba(0,0,0,.32); }
.at-self{
  border-color:var(--border-strong);
  background:linear-gradient(135deg, rgba(43,47,119,.55), rgba(27,154,170,.30));
}
.at-avatar{
  position:relative; flex-shrink:0;
  width:54px; height:54px; border-radius:50%; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,#0ea5a5,#60a5fa);
  box-shadow:0 0 0 1px var(--border), 0 0 14px rgba(125,211,252,.22);
}
.at-avatar img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.at-initials{ font-weight:800; font-size:1rem; color:#03131e; }
.at-name{ font-weight:700; font-size:.85rem; line-height:1.22; color:var(--text); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.at-name:hover{ color:var(--accent); }
.at-role{ font-size:.67rem; color:var(--accent); line-height:1.25; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.at-inst{ font-size:.69rem; color:var(--muted); line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.at-inst:hover{ color:var(--accent); }

.at-hint{ color:var(--muted); font-size:.82rem; margin:0 0 6px; }

@media (max-width:520px){
  .at-node{ width:140px; height:170px; padding:10px 8px; }
  .at-avatar{ width:46px; height:46px; }
  .at-tree ul{ padding-top:30px; }
  .at-tree li{ padding:30px 5px 0; }
  .at-tree li::before, .at-tree li::after{ height:30px; }
  .at-tree ul ul::before{ height:30px; }
}

@media (prefers-reduced-motion: reduce){
  .at-node{ transition:none; }
}

/* ================================================================
   v2 FEATURES — theme toggle, progress, metrics, news, filter,
   heading icons, map, language/theme controls
   ================================================================ */

/* ---- Light theme ---- */
html[data-theme="light"]{
  --bg:#eef2f8; --bg-2:#ffffff;
  --card:rgba(15,23,42,.045); --card-hover:rgba(15,23,42,.08);
  --border:rgba(15,23,42,.12); --border-strong:rgba(37,99,168,.5);
  --text:#1b2330; --muted:#586072;
  --accent:#2563a8; --accent-strong:#1d4ed8;
  color-scheme:light;
}
html[data-theme="light"] body{
  background:
    radial-gradient(50vw 40vw at 12% 8%, rgba(124,58,237,.06), transparent 45%),
    radial-gradient(55vw 40vw at 82% 4%, rgba(34,211,238,.07), transparent 48%),
    linear-gradient(180deg,#ffffff,#eef2f8 70%);
}
/* starfield stays visible in light mode (stars/meteors recolour via JS) */
html[data-theme="light"] .nav{ background:rgba(255,255,255,.72); }
html[data-theme="light"] .footer{ background:rgba(255,255,255,.6); }
html[data-theme="light"] .avatar-credit{ color:#586072; }
html[data-theme="light"] .hero{ background:linear-gradient(180deg, rgba(0,0,0,.03), transparent); }
html[data-theme="light"] .icon-btn:hover{ background:rgba(15,23,42,.05); }

/* ---- Scroll progress ---- */
.scroll-progress{
  position:fixed; top:0; left:0; height:3px; width:0; z-index:80;
  background:linear-gradient(90deg,var(--accent),var(--accent-strong));
  transition:width .08s linear;
}

/* ---- Nav tools (lang + theme + hamburger) ---- */
.nav-tools{ display:flex; align-items:center; gap:8px; }
.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px; border:1px solid var(--border); border-radius:10px;
  background:transparent; color:var(--text); cursor:pointer; font-weight:700; font-size:.82rem;
  transition:background .2s, border-color .2s;
}
.icon-btn:hover{ background:rgba(255,255,255,.06); border-color:var(--border-strong); }
.icon-btn svg{ width:18px; height:18px; }

/* ---- Metrics strip ---- */
.metrics{ display:flex; gap:28px; margin:18px 0 4px; flex-wrap:wrap; }
.metric{ display:flex; flex-direction:column; }
.metric-num{ font-family:var(--font-display); font-weight:700; font-size:1.55rem; color:var(--accent); line-height:1; }
.metric-label{ font-size:.72rem; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; margin-top:4px; }

/* ---- Section heading icons ---- */
.section > h2{ display:flex; align-items:center; }
.h2-ico{ flex:none; width:22px; height:22px; color:var(--accent); margin-right:10px; }

/* ---- News window ---- */
.news-window{
  border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden;
  background:var(--card); box-shadow:var(--shadow);
}
.news-titlebar{
  display:flex; align-items:center; gap:10px; padding:10px 14px;
  background:rgba(255,255,255,.05); border-bottom:1px solid var(--border);
}
.news-dots{ display:inline-flex; gap:6px; }
.news-dots i{ width:11px; height:11px; border-radius:50%; background:#ff5f57; display:block; }
.news-dots i:nth-child(2){ background:#febc2e; }
.news-dots i:nth-child(3){ background:#28c840; }
.news-title{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.85rem; color:var(--muted); }
.news-linkedin{ margin-left:auto; font-size:.82rem; font-weight:600; }
.news-body{ padding:6px 16px 14px; }
.news-list{ list-style:none; margin:0; padding:0; }
.news-list li{ padding:11px 2px; border-bottom:1px solid var(--border); font-size:.95rem; line-height:1.55; }
.news-list li:last-child{ border-bottom:0; }
.news-date{
  display:inline-block; min-width:76px; margin-right:10px; font-weight:700; color:var(--accent);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.78rem;
}

/* ---- Publication filter ---- */
.pub-filter{ display:flex; flex-wrap:wrap; gap:8px; margin:0 0 18px; }
.pub-filter button{
  border:1px solid var(--border); background:rgba(255,255,255,.04); color:var(--muted);
  padding:5px 13px; border-radius:999px; font-weight:600; font-size:.82rem; cursor:pointer;
  font-family:var(--font-body); transition:color .2s, border-color .2s, background .2s;
}
.pub-filter button:hover{ color:var(--text); border-color:var(--border-strong); }
.pub-filter button.active{
  background:linear-gradient(90deg,var(--accent),var(--accent-strong)); color:#04203a; border-color:transparent;
}
.timeline-item.pub-hidden{ display:none; }

/* ---- Presentation map ---- */
.preso-map{
  height:420px; border:1px solid var(--border); border-radius:var(--radius-lg);
  overflow:hidden; box-shadow:var(--shadow); background:#aadaff;
}
.preso-map .leaflet-popup-content{ font-family:var(--font-body); }
@media (max-width:520px){ .preso-map{ height:340px; } }

@media (prefers-reduced-motion: reduce){
  .scroll-progress{ transition:none; }
}

/* ---- Light-mode text legibility fixes ---- */
html[data-theme="light"] .hero-body p{ color:var(--text); }
html[data-theme="light"] .avatar-credit{ color:#586072; }
html[data-theme="light"] .nav-links a{ color:#3f4757; }
html[data-theme="light"] .equip-tasks{ color:var(--muted); }

/* ---- Map legend + reset control ---- */
.map-legend{
  background:rgba(11,16,32,.9); border:1px solid rgba(255,255,255,.22); border-radius:10px;
  padding:8px 11px; font-size:.8rem; color:#e7edf6; line-height:1.7;
  box-shadow:0 4px 14px rgba(0,0,0,.45); backdrop-filter:blur(6px);
}
.map-legend .dot{ display:inline-block; width:12px; height:12px; border-radius:50%; margin-right:7px; vertical-align:-1px; }
.map-reset{
  background:rgba(11,16,32,.9); border:1px solid rgba(255,255,255,.22); color:#e7edf6;
  width:34px; height:34px; border-radius:8px; cursor:pointer; font-size:1.1rem; line-height:1;
  display:flex; align-items:center; justify-content:center;
}
.map-reset:hover{ border-color:var(--border-strong); color:var(--accent); }

/* h-index tile links to Google Scholar */
.metric-link{ text-decoration:none; color:inherit; }
.metric-link:hover .metric-num{ color:var(--accent-strong); }
.metric-link:hover{ text-decoration:none; }

/* ================================================================
   v3 — accessibility, print, subtle polish (palette unchanged)
   ================================================================ */

/* ---- Subtle hover lift for content cards (no colour change) ---- */
.timeline-item:hover > .timeline-card{ box-shadow:0 8px 22px rgba(0,0,0,.26); }
.timeline-item.publication:hover > .timeline-card{ box-shadow:0 8px 22px rgba(0,0,0,.26); }

/* ---- Keyboard accessibility: visible focus ring ---- */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible,
.icon-btn:focus-visible, .timeline-item:focus-visible{
  outline:2px solid var(--accent); outline-offset:2px; border-radius:8px;
}

/* ---- Print: clean CV-style output ---- */
@media print{
  #starfield, .nav, .scroll-progress, .nav-tools, .map-reset, .map-legend,
  .preso-map, .scroll-top-btn, .at-hint, .news-linkedin, .skip-link, noscript{ display:none !important; }
  html, body{ background:#fff !important; color:#000 !important; }
  .site{ margin:0 auto; max-width:none; padding:0 12px; }
  a{ color:#000 !important; text-decoration:underline; }
  .section{ break-inside:avoid; margin-bottom:22px; }
  .timeline-expand{ max-height:none !important; padding:6px 0 0 !important; border:0 !important; background:none !important; }
  .hero-card, .timeline-card, .news-window, .card, .at-node{
    box-shadow:none !important; border:1px solid #ccc !important; background:#fff !important;
  }
  .metric-num, .role, .at-role, .at-name{ color:#000 !important; }
}
