/* ---------- Base ---------- */
:root{
  --bg: #0b0d10;
  --bg-alt: #101318;
  --text: #e7ecf3;
  --muted: #9aa5b1;
  --accent: #7c9cff;
  --card: #151a21;
  --border: #212733;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:Inter,system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  color:var(--text);
  background:radial-gradient(1200px 800px at 80% -100px, #223 0%, #0b0d10 70%) fixed, var(--bg);
  line-height:1.6;
  padding-top: var(--header-h);
}

.container{
  width:min(1100px, 92%);
  margin-inline:auto;
}

.section{padding:5rem 0}
.section.alt{background:var(--bg-alt)}

.section-title{
  font-size:clamp(1.5rem, 2.5vw + 1rem, 2.2rem);
  margin:0 0 1.25rem;
}

/* ---------- Header ---------- */
.site-header{
  position:fixed; top:0; inset-inline:0;
  backdrop-filter:saturate(140%) blur(8px);
  background:color-mix(in oklab, var(--bg), transparent 35%);
  border-bottom:1px solid var(--border);
  z-index:50;
}
.nav{
  display:flex; align-items:center; justify-content:space-between;
  padding:0.75rem 0;
}
.brand{
  display:inline-flex; align-items:center; justify-content:center;
  width:40px; height:40px; border-radius:12px;
  background:linear-gradient(135deg, var(--accent), #a3b8ff);
  color:#0b0d10; font-weight:800; letter-spacing:.5px; text-decoration:none;
  box-shadow:var(--shadow);
}
.nav-links{display:flex; gap:1.2rem}
.nav-links a{color:var(--muted); text-decoration:none; font-weight:500}
.nav-links a.active, .nav-links a:hover{color:var(--text)}

.nav-toggle{display:none; background:none; border:0; width:40px; height:40px; position:relative}
.nav-toggle span{position:absolute; left:8px; right:8px; height:2px; background:var(--text); transition:.3s}
.nav-toggle span:nth-child(1){top:12px}
.nav-toggle span:nth-child(2){top:19px}
.nav-toggle span:nth-child(3){top:26px}
.theme-toggle{margin-left:.5rem; background:none; border:1px solid var(--border); color:var(--text); padding:.4rem .6rem; border-radius:10px; cursor:pointer}

/* ---------- Hero ---------- */
.hero{padding:9rem 0 6rem; position:relative; overflow:hidden}
.hero-inner{display:grid; grid-template-columns:1.2fr .8fr; gap:2rem; align-items:center}
.hero-copy h1{font-size:clamp(2rem, 3vw + 1.2rem, 3rem); margin:0 0 .5rem}
.lead{font-size:1.125rem; color:var(--muted); max-width:60ch}
.accent{color:var(--accent)}
.cta{margin-top:1.25rem; display:flex; gap:.8rem; flex-wrap:wrap}

.btn{
  display:inline-block; padding:.8rem 1rem; border-radius:12px;
  border:1px solid var(--border); color:var(--text); text-decoration:none; font-weight:600;
}
.btn.primary{
  background:var(--accent);
  /* padding:.8rem 1rem;  */
  /* color:#0b0d10;  */
  color:#f5f5f5; 
  border-color:transparent
}

.hero-art{min-height:280px; position:relative}
.blob{position:absolute; inset:auto 0 0 auto; width:240px; height:240px; border-radius:30% 70% 60% 40% / 40% 30% 70% 60%;
  background:radial-gradient(circle at 30% 30%, #a3b8ff, var(--accent));
  filter:blur(6px); opacity:.7; animation:float 10s ease-in-out infinite alternate}
.blob.b2{top:40px; left:40px; width:180px; height:180px; opacity:.5; animation-duration:12s}
.blob.b3{top:-20px; left:120px; width:120px; height:120px; opacity:.35; animation-duration:14s}
@keyframes float{to{transform:translateY(-18px) translateX(-6px) rotate(4deg)}}

/* ---------- Cards / Grid ---------- */
.cards{display:grid; gap:1rem; grid-template-columns:repeat(3, 1fr)}
.card{
  background:var(--card); border:1px solid var(--border); border-radius:16px; padding:1rem 1.1rem;
  box-shadow:var(--shadow);
}
.card h3{margin:.2rem 0 .3rem; font-size:1.1rem}
.card p{margin:0; color:var(--muted)}
.card .link{display:inline-block; margin-top:.6rem; text-decoration:none; color:var(--accent)}

.projects .card{min-height:160px}

/* ---------- About ---------- */
.grid-2{display:grid; gap:1.25rem; grid-template-columns:1.2fr .8fr}
.about-card{background:var(--card); border:1px solid var(--border); border-radius:16px; padding:1rem 1.1rem; box-shadow:var(--shadow)}
.about-card ul{list-style:none; padding:0; margin:0}
.about-card li{padding:.3rem 0; border-bottom:1px dashed var(--border)}
.about-card li:last-child{border-bottom:0}

/* ---------- Publications ---------- */
.pubs{list-style:none; padding:0; margin:0; display:grid; gap:.8rem}
.pubs li{background:var(--card); border:1px solid var(--border); border-radius:12px; padding:.8rem 1rem}
.pub-title{display:block; font-weight:600}
.pub-venue{color:var(--muted); margin-right:.5rem}
.pub-meta{color:var(--muted); font-style:italic}

/* ---------- Footer ---------- */
.site-footer{padding:2rem 0; border-top:1px solid var(--border); background:var(--bg-alt)}
.site-footer .container{display:flex; align-items:center; justify-content:space-between}
.back-to-top{
  text-decoration:none; border:1px solid var(--border); padding:.35rem .6rem; border-radius:10px; color:var(--text);
}

/* ---------- Reveal animations ---------- */
.reveal{opacity:0; transform:translateY(12px); transition:opacity .6s ease, transform .6s ease}
.reveal.visible{opacity:1; transform:none}
.delay-1{transition-delay:.12s}
.delay-2{transition-delay:.24s}
.delay-3{transition-delay:.36s}

/* ---------- Responsive ---------- */
@media (max-width: 900px){
  .hero-inner{grid-template-columns:1fr}
  .cards{grid-template-columns:repeat(2, 1fr)}
  .grid-2{grid-template-columns:1fr}
}
@media (max-width: 640px){
  .cards{grid-template-columns:1fr}
  .nav-links{position:fixed; right:1rem; top:64px; background:var(--bg-alt); border:1px solid var(--border); padding:1rem; border-radius:12px; box-shadow:var(--shadow); display:none; flex-direction:column}
  .nav-links.open{display:flex}
  .nav-toggle{display:inline-block}
}
/* ---------- Light Theme ---------- */
.light{
  --bg:#f6f8fb;
  --bg-alt:#fff;
  --text:#101318;
  --muted:#4c5766;
  --accent:#355cff;
  --card:#f2f4f8;
  --border:#dce2eb;
  background:radial-gradient(1200px 800px at 80% -100px, #eef1ff 0%, #f6f8fb 70%) fixed, var(--bg);
}

/* ---------- Global links ---------- */
a { color: var(--accent); }
a:hover { text-decoration: underline; }

/* ---------- Contact section polish ---------- */
.contact-form{
  max-width: 780px;
  margin-top: 1.25rem;
}
.contact-form .row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.contact-form label{
  display: grid;
  gap: .45rem;
}
.contact-form label > span{
  font-weight: 600;
  color: var(--muted);
  font-size: 0.95rem;
}
.contact-form input,
.contact-form textarea{
  width: 100%;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .8rem .9rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.contact-form textarea{
  min-height: 160px;
  resize: vertical;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder{
  color: color-mix(in oklab, var(--muted), var(--text) 10%);
}
.contact-form input:focus,
.contact-form textarea:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), transparent 75%);
}

/* Tame autofill contrast in dark mode */
.contact-form input:-webkit-autofill{
  -webkit-box-shadow: 0 0 0 30px var(--card) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}

/* Stack fields on small screens */
@media (max-width: 640px){
  .contact-form .row{ grid-template-columns: 1fr; }
}

/* Space above the Send button */
.contact-form button[type="submit"]{
  margin-top: 12px;   /* tweak to 16px or 20px if you want more */
  color:#e7ecf3;
}

/* ---------- Timeline (for Education, etc.) ---------- */
.timeline{
  list-style:none; margin:0; padding:0; position:relative;
}
.timeline::before{
  content:""; position:absolute; left:12px; top:0; bottom:0;
  width:2px; background:var(--border);
}
.timeline > li{
  position:relative; padding-left:2.5rem; margin:0 0 1.25rem;
}
.timeline > li::before{
  content:""; position:absolute; left:6px; top:.5rem;
  width:14px; height:14px; border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 3px color-mix(in oklab, var(--accent), transparent 70%);
}
.t-title{ margin:.1rem 0 .2rem; font-size:1.05rem; }
.t-meta{ color:var(--muted); font-weight:600; font-size:.95rem; }
.t-desc{ color:var(--muted); margin:.2rem 0 0; }

/* Spacing tweak so the first dot isn't too close to title */
#education .section-title{ margin-bottom: 1rem; }

/* Mobile: give it more room */
@media (max-width: 640px){
  .timeline::before{ left:10px; }
  .timeline > li{ padding-left:2.25rem; }
  .timeline > li::before{ left:4px; }
}

/* Optional bullets styling for timeline items */
.t-bullets{
  margin:.35rem 0 0;
  color:var(--muted);
  padding-left:1.1rem;
}
.t-bullets li{ margin:.2rem 0; }

/* ---------- Publications: inline citation style ---------- */
.pubs{
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0;
  display: grid;
  gap: .9rem;
}
.pubs li{
  margin: 0;
  line-height: 1.6;
}

/* keep everything inline so it reads like one sentence */
.pub-authors,
.pub-title,
.pub-venue,
.pub-actions{ display: inline; }

/* highlight your name */
.pub-authors .me{
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 2px;
}

/* underline the title (linked or not) */
.pub-title,
.pub-title a{
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--text); /* keeps title color consistent in dark mode */
}

/* venue/meta text */
.pub-venue{ color: var(--muted); }

/* tiny action icons */
.pub-actions{
  display: inline-flex;
  gap: .5rem;
  margin-left: .4rem;
  vertical-align: middle;
}
.pub-actions a{
  color: var(--accent);
  text-decoration: none;
  line-height: 1;
  transform: translateY(1px);
}

/* /* (Optional) remove bullets: */
.pubs{ list-style:none; padding-left:0; }

/* Hero photo */
.hero-art{
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-photo{
  position: relative;
  z-index: 2;            /* above blobs */
  display: block;
  width: min(320px, 80%);
  aspect-ratio: 1 / 1;
  border-radius: 24px;   /* change to 50% for a circle */
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 1px var(--border) inset;
}
.hero-photo img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* keep blobs behind the image */
.blob{ z-index: 1; }

/* Optional: make the photo circular */
.hero-photo{ border-radius: 60%; }


/* Optional: hide blobs entirely */
.hero-art .blob{ display: none; }




