:root{
  --bg: #050712;
  --text: #e8ecf1;
  --text-dim: #b8c0cc;
  --mustard: #f6c547;
  --card-bg: rgba(7, 25, 50, 0.92);
  --card-border: #243654;
  --rail-bg: rgba(2, 4, 11, 0.95);
  --panel-bg: rgba(3, 8, 20, 0.86);
  --shadow: 0 1px 0 rgba(255,255,255,0.02), 0 10px 28px rgba(0,0,0,0.7);
}

*{box-sizing:border-box}
html,body{height:100%}
html{scroll-behavior:smooth}
@media (prefers-reduced-motion: reduce){ html{scroll-behavior:auto} }

/* ===== Animated background GIF ===== */
body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
  line-height:1.6;
  color:var(--text);
  background-color:#000;
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  background:#000 url("pics/Neural-Networks.gif") center/contain no-repeat;
  opacity:0.9;
  z-index:-2;
}
body::after{
  content:"";
  position:fixed;
  inset:0;
  background:
    radial-gradient(900px 700px at 0% 0%, rgba(124,124,255,0.25), transparent 55%) no-repeat,
    radial-gradient(700px 500px at 100% 10%, rgba(23,209,255,0.18), transparent 55%) no-repeat,
    linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6));
  z-index:-1;
}

/* ===== Layout ===== */
.wrap{ padding-left:104px }
.layout{
  max-width:1300px;
  margin:0 auto;
  padding:32px 32px 32px 24px;
  display:grid;
  gap:32px;
  grid-template-columns:460px 1fr; /* ← LEFT COLUMN WIDTH (profile card) */
}
@media (max-width:1024px){
  .wrap{ padding-left:0 }
  .layout{ grid-template-columns:1fr; padding:20px; }
}

/* ===== Left rail ===== */
.left-rail{
  position:fixed; top:0; left:0; bottom:0; width:104px;
  background:var(--rail-bg);
  backdrop-filter:blur(10px) saturate(150%);
  border-right:1px solid rgba(11,20,40,0.9);
  display:flex; align-items:center; justify-content:center;
  z-index:20;
}
@media (max-width:1024px){ .left-rail{ display:none } }

.side-nav{
  display:grid; gap:14px;
}
.nav-item{
  position:relative;
  width:72px; height:72px;
  display:flex; align-items:center; justify-content:center;
  border-radius:22px;
  color:var(--text-dim);
  border:1px solid transparent;
  text-decoration:none;
  cursor:pointer;
  transition:transform .15s, background-color .15s, color .15s, border-color .15s;
}
.nav-icon svg{
  width:32px; height:32px;
  stroke:currentColor;
  fill:none;
}
.nav-label{
  position:absolute;
  left:100%;
  margin-left:10px;
  padding:6px 12px;
  border-radius:999px;
  background:rgba(7,12,25,0.98);
  color:var(--text);
  font-size:.85rem;
  white-space:nowrap;
  opacity:0;
  transform:translateX(-6px);
  pointer-events:none;
  transition:opacity .15s ease, transform .15s ease;
}
.nav-item:hover,
.nav-item:focus-visible{
  transform:translateY(-2px);
  color:#000;
  background:var(--mustard);
  border-color:transparent;
}
.nav-item:hover .nav-label,
.nav-item:focus-visible .nav-label{
  opacity:1;
  transform:translateX(0);
}
.nav-item.active{
  color:#000;
  background:var(--mustard);
  border-color:transparent;
}
.nav-item.active .nav-label{
  opacity:0;
  transform:translateX(-6px);
}

/* ===== Left column & sticky profile card ===== */
.left-column{
  display:flex;
  flex-direction:column;
}
.profile-card{
  position:sticky;        /* ← makes it stay visible on scroll */
  top:16px;               /* distance from top when stuck */
  background:var(--card-bg);
  border:1px solid var(--card-border);
  border-radius:24px;
  box-shadow:var(--shadow);
  min-height:calc(100vh - 32px); /* ← how tall it wants to be */
  padding:24px 24px 20px;        /* internal padding */
  display:flex;
  flex-direction:column;
}
.profile-main{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
}
.avatar{ display:flex; justify-content:center; margin-bottom:18px; }
.avatar-img{
  width:270px; height:270px;
  border-radius:26px;
  object-fit:cover;
  box-shadow:0 0 0 4px rgba(246,197,71,0.9);
}
.profile-card h1{
  font-family:"Space Grotesk",Inter,sans-serif;
  font-size:clamp(2.4rem,3.4vw,3.3rem);
  margin:4px 0 6px;
  color:var(--mustard);
}
.tagline{
  margin:0 0 14px;
  color:var(--text-dim);
  font-size:1.05rem;
}
.profile-contact{
  list-style:none;
  padding:0;
  margin:0 0 16px;
  font-size:.85rem;
  color:var(--text-dim);
}
.profile-contact li{ margin:2px 0; }
.profile-contact a{
  color:var(--mustard);
  text-decoration:none;
}

/* social icons */
.social-icons{
  display:flex;
  gap:14px;
  margin-bottom:18px;
  justify-content:center;
}
.icon-btn{
  width:52px; height:52px;
  border-radius:999px;
  border:1px solid rgba(34,48,90,0.9);
  background:rgba(2,8,20,0.9);
  display:grid; place-items:center;
  color:var(--text-dim);
  text-decoration:none;
  transition:background .15s, transform .15s, color .15s, border-color .15s, box-shadow .15s;
}
.icon-btn svg{
  width:26px; height:26px;
  stroke:currentColor;
  fill:none;
}
.icon-btn:hover{
  transform:translateY(-1px);
  background:var(--mustard);
  color:#000;
  border-color:transparent;
  box-shadow:0 0 0 3px rgba(246,197,71,0.65);
}

/* buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 20px;
  border-radius:999px;
  border:1px solid transparent;
  font-weight:600;
  text-decoration:none;
  font-size:0.95rem;
  cursor:pointer;
}
.btn.primary{
  background:var(--mustard);
  color:#000;
  border-color:transparent;
  box-shadow:0 0 0 2px rgba(246,197,71,0.35);
}
.contact-btn{
  position:relative;
  padding:8px 16px;
}
.contact-btn .btn-icon{
  font-size:1.4rem;
  line-height:1;
}
.contact-btn .btn-tooltip{
  position:absolute;
  left:50%;
  bottom:calc(100% + 6px);
  transform:translateX(-50%) translateY(4px);
  padding:4px 10px;
  border-radius:999px;
  background:rgba(7,12,25,0.98);
  color:var(--text);
  font-size:.8rem;
  white-space:nowrap;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s ease, transform .15s ease;
}
.contact-btn:hover .btn-tooltip,
.contact-btn:focus-visible .btn-tooltip{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

.cv-btn{
  margin-bottom:6px;         /* was 12px */
}
.cv-btn .btn-icon{
  margin-right:6px;          /* a bit tighter */
  font-size:0.95rem;         /* slightly smaller */
}

/* cat */
.profile-cat{
  margin-top:auto;
  display:flex;
  justify-content:center;
  padding-top:8px;
}
.profile-cat-gif{
  max-width:275px;
  width:130%;
  height:auto;
}

/* mobile section nav */
.section-nav{ display:none }
@media (max-width:1024px){
  .section-nav{
    display:flex; flex-wrap:wrap; gap:8px; margin-top:16px;
  }
  .section-nav a{
    padding:6px 10px;
    border-radius:10px;
    border:1px solid var(--card-border);
    text-decoration:none;
    color:var(--text-dim);
    font-size:.85rem;
  }
  .section-nav a.active{
    background:var(--mustard); color:#000; border-color:transparent;
  }
}

/* ===== Right column content ===== */
.content{ padding:4px 0 36px; }

/* glass cards on right side */
.section-card{
  background:var(--panel-bg);
  border-radius:24px;
  border:1px solid rgba(20,32,60,0.9);
  box-shadow:var(--shadow);
  padding:24px 26px 26px;
  margin-bottom:24px;

  opacity:0;
  transform:translateY(30px);
  transition:opacity .45s ease-out, transform .45s ease-out;
}
.section-card.in-view{
  opacity:1;
  transform:none;
}

/* headings */
.section h2{
  font-family:"Space Grotesk",Inter,sans-serif;
  font-size:clamp(1.5rem,2.2vw,2.3rem);
  margin:0 0 8px;
  color:var(--mustard);
}
section{ scroll-margin-top:24px }

.facts{ margin:6px 0 0; padding-left:18px }
.facts li{ margin:4px 0 }

.exp-block{ margin-bottom:18px; }
.exp-meta{
  margin:0 0 6px;
  font-size:.9rem;
  color:var(--text-dim);
}

/* publications */
.pub-legend{
  margin:0 0 10px;
  font-size:.85rem;
  color:var(--text-dim);
}
.pub-filters{ display:flex; gap:8px; flex-wrap:wrap; margin:8px 0 12px }
.chip{
  background:#0a1020;
  color:var(--text);
  border:1px solid rgba(43,61,100,0.9);
  border-radius:999px;
  padding:6px 12px;
  cursor:pointer;
  font-size:.9rem;
}
.chip[aria-selected="true"]{
  outline:2px solid var(--mustard);
}
.pub-list-simple{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap:8px;
}
.pub-list-simple .pub{
  background:#050e20;
  border:1px solid rgba(36,54,84,0.9);
  border-radius:10px;
  padding:8px 10px;
  font-size:.95rem;
}
.pub-year{
  color:var(--mustard);
  font-weight:600;
}

/* projects */
.project-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:18px;
}
@media (max-width:980px){ .project-grid{ grid-template-columns:1fr } }
.project{
  background:#050e20;
  border:1px solid rgba(36,54,84,0.9);
  border-radius:16px;
  box-shadow:var(--shadow);
}
.project-body{ padding:16px 14px 18px; }

/* contact */
.contact-card{ max-width:900px; }
.contact-subtitle{
  margin:4px 0 18px;
  color:var(--text-dim);
}
.contact-form{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.contact-row{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}
.contact-row label{ flex:1 1 0; }
.contact-form label span{
  display:block;
  font-size:.85rem;
  margin-bottom:4px;
  color:var(--text-dim);
}
.contact-form input,
.contact-form textarea{
  width:100%;
  border-radius:12px;
  border:1px solid rgba(43,61,100,0.9);
  background:rgba(3,8,20,0.95);
  padding:10px 12px;
  color:var(--text);
  font-family:inherit;
  font-size:.95rem;
}
.contact-form input:focus,
.contact-form textarea:focus{
  outline:none;
  border-color:var(--mustard);
  box-shadow:0 0 0 2px rgba(246,197,71,0.35);
}
.contact-message{ display:block; }
.contact-btn{ align-self:flex-start; margin-top:6px; }
.contact-note{
  margin:6px 0 0;
  font-size:.8rem;
  color:var(--text-dim);
}

/* back-to-top arrow */
.scroll-top{
  position:fixed;
  right:24px;
  bottom:24px;
  width:44px;
  height:44px;
  border-radius:999px;
  border:1px solid transparent;
  background:var(--mustard);
  color:#000;
  display:grid;
  place-items:center;
  font-size:1.2rem;
  text-decoration:none;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(0,0,0,0.5);
  opacity:0;
  transform:translateY(10px);
  pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
  z-index:30;
}
.scroll-top.show{
  opacity:1;
  transform:translateY(0);
  pointer-events:auto;
}

/* cursor ring */
#cursor-ring{
  position:fixed; top:0; left:0;
  width:28px; height:28px;
  margin-left:-14px; margin-top:-14px;
  border:2px solid var(--mustard);
  border-radius:50%;
  pointer-events:none;
  opacity:0;
  transition:opacity .2s,width .2s,height .2s,border-width .2s,border-color .2s;
  z-index:9999;
  mix-blend-mode:difference;
}
#cursor-ring.hover{
  width:40px; height:40px;
  margin-left:-20px; margin-top:-20px;
}
#cursor-ring.down{ border-width:3px }

/* reduced motion */
@media (prefers-reduced-motion: reduce){
  #cursor-ring{ display:none !important; }
  .section-card{ opacity:1; transform:none; }
  .scroll-top{ opacity:1; transform:none; pointer-events:auto; }
}
