:root {
  --purple: #F48024;
  --lavender: #FF9900;
  --bg-dark: #0d0d0f;
  --panel: #18181c;
  --text-light: #f3f3f3;

  --topbar-h: 64px;
  --bottombar-h: 56px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Source Sans 3', sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  overflow-x: hidden;
  overflow-y: auto; /* IMPORTANT: allows scrolling + anchor links */
}

/* =============================
   Landing overlay (one-time)
   ============================= */
#landing.landing-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background: var(--bg-dark);
}

#typed-name {
  font-family: 'Poppins', sans-serif;
  font-size: 2.8rem;
  color: var(--purple);
  border-right: 2px solid var(--lavender);
  white-space: nowrap;
}

body.landing-done #landing.landing-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 450ms ease;
}

body.landing-removed #landing.landing-overlay {
  display: none;
}

/* =============================
   Top navigation bar
   ============================= */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 0 16px;
}

.topnav .nav-link {
  cursor: pointer;
  text-decoration: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.95rem;
  color: #111;
  opacity: 0.9;
}

.topnav .nav-link:hover { opacity: 1; }

.topnav .nav-link.active {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* Hide bars during landing (optional) */
body:not(.landing-done) .topbar,
body:not(.landing-done) .bottombar {
  opacity: 0;
  pointer-events: none;
}

body.landing-done .topbar,
body.landing-done .bottombar {
  opacity: 1;
  transition: opacity 350ms ease;
}

/* =============================
   Bottom contact bar
   ============================= */
.bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottombar-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.bottom-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.bottom-links a {
  font-size: 1.15rem;
  opacity: 0.9;
  color: #111;
}

.bottom-links a:hover { opacity: 1; }

/* =============================
   Main content layout (one-page)
   ============================= */
#main-content {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 18px) 18px calc(var(--bottombar-h) + 18px);
}

/* ALL sections must be in normal flow (no display:none) */
#main-content section {
  display: block;
  opacity: 1;
  transform: none;
  position: relative;
  padding-top: 12px;
  scroll-margin-top: 90px; /* offsets fixed top bar for anchors */
}

/* Typography */
h2 {
  font-family: 'Poppins', sans-serif;
  color: var(--lavender);
  margin: 2.2rem 0 1rem;
}
p, li { color: #ddd; line-height: 1.6; }

.btn {
  display: inline-block;
  background: var(--purple);
  color: white;
  padding: .6rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background .3s;
}
.btn:hover { background: var(--lavender); }

/* --- About Section --- */
.about-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-top: 2rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.about-text {
  width: 100%;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.25rem;
  line-height: 2.2;
  color: #e0e0e0;
  text-align: justify;
  letter-spacing: 0.6px;
  max-width: 900px;
  margin: 0 auto;
}

.about-photo img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--lavender);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
  transition: transform 0.3s ease;
}
.about-photo img:hover { transform: scale(1.05); }

.letter {
  background: linear-gradient(to bottom, rgba(255,255,255,0.02), rgba(255,255,255,0.04));
  border-left: 3px solid var(--lavender);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  font-weight: 400;
  font-family: "IBM Plex Mono", monospace;
}
.letter::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 2rem;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.15), transparent);
}

/* --- Handwritten Hi There --- */
.handwrite-container {
  text-align: center;
  margin-bottom: 1rem;
  overflow: visible;
}
.handwrite-svg {
  width: 100%;
  max-width: 700px;
  height: 250px;
  overflow: visible;
}
.handwrite-container, .handwrite-svg { pointer-events: none; }

.handwrite-text {
  font-family: "Great Vibes", cursive;
  font-size: 7rem;
  fill: none;
  stroke: var(--text-light);
  stroke-width: 2px;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: drawText 3s ease forwards;
  filter: drop-shadow(0 0 10px rgba(192,132,252,0.8));
}
@keyframes drawText {
  0% { stroke-dashoffset: 600; fill: none; }
  90% { stroke-dashoffset: 0; fill: none; }
  100% { stroke-dashoffset: 0; fill: var(--lavender); }
}

/* --- Research section --- */
.intro {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 850px;
  margin-bottom: 2rem;
}

.research-area {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--lavender);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.8rem;
  border-radius: 8px;
  transition: transform 0.3s ease, background 0.3s ease;
}
.research-area:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.05);
}
.research-area h3 {
  color: var(--purple);
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.research-area p {
  color: #ddd;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
.research-area ul {
  list-style-type: square;
  padding-left: 1.5rem;
  margin-top: 0.6rem;
}

/* --- Expandable research cards --- */
.expandable { cursor: pointer; position: relative; }

.expandable .expand-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.5s ease;
  margin-top: 0.5rem;
}
.expandable.active .expand-content {
  max-height: 500px;
  opacity: 1;
}
.expand-content a {
  color: var(--lavender);
  text-decoration: none;
}
.expand-content a:hover { text-decoration: underline; }

/* --- Publications section --- */
.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.pub-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  transition: transform 0.3s ease, background 0.3s ease;
}
.pub-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.06);
}
.pub-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.pub-card h3 {
  color: var(--lavender);
  font-size: 1rem;
  padding: 0.8rem;
  margin: 0;
}
.pub-links {
  margin-top: 1rem;
  font-size: 0.95rem;
  text-align: left;
}
.pub-links a {
  color: var(--lavender);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.pub-links a:hover {
  color: var(--purple);
  text-decoration: underline;
}
.pub-links span { color: #aaa; margin: 0 0.5rem; }

/* --- Projects Section --- */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.8rem;
  margin-top: 2rem;
}
.proj-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
  padding-bottom: 0.8rem;
}
.proj-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.06);
}
.proj-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.proj-card h3 {
  color: var(--lavender);
  margin: 0.8rem 1rem 0.4rem;
  font-size: 1.05rem;
}
.proj-card p {
  margin: 0 1rem;
  font-size: 0.95rem;
  color: #ccc;
}

/* --- Modals --- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 999;
}
.modal-content {
  background: #1c1c22;
  color: #fff;
  padding: 2rem;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
  position: relative;
  animation: fadeIn 0.3s ease;
}
.modal-content h3 {
  color: var(--lavender);
  margin-top: 0;
}
.close-btn {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  font-size: 1.3rem;
  color: #ccc;
  cursor: pointer;
  transition: color 0.2s;
}
.close-btn:hover { color: var(--lavender); }

.inline-link {
  color: var(--lavender);
  text-decoration: none;
  margin-left: 0.4rem;
  white-space: nowrap;
  font-weight: 500;
}
.inline-link i { margin-right: 0.3rem; font-size: 0.9rem; }
.inline-link:hover {
  color: var(--purple);
  text-decoration: underline;
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* Lightbox for posters */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  cursor: zoom-out;
}

/* --- Contact Section --- */
#contact { max-width: 700px; }

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}
.form-group { display: flex; flex-direction: column; }

label {
  font-weight: 500;
  color: var(--lavender);
  margin-bottom: 0.3rem;
}
input, textarea {
  background: #121216;
  border: 1px solid #333;
  color: #fff;
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  transition: border 0.3s;
}
input:focus, textarea:focus {
  border-color: var(--purple);
  outline: none;
}
button.btn {
  align-self: flex-start;
  background: var(--purple);
  color: #fff;
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s;
}
button.btn:hover { background: var(--lavender); }

/* =============================
   Responsive tweaks
   ============================= */
@media (max-width: 768px) {
  :root {
    --topbar-h: 58px;
    --bottombar-h: 52px;
  }

  #typed-name { font-size: 2.2rem; }

  #main-content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .handwrite-text { font-size: 5.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body.landing-done #landing.landing-overlay,
  body.landing-done .topbar,
  body.landing-done .bottombar {
    transition: none;
  }
}