/* ========== GLOBAL RESET + THEME ========== */
:root {
  --bg: #05050a;
  --bg2: #09091a;
  --card: #101018;
  --muted: #a9a9b8;
  --accent: #9b5cff;
  --accent2: #6f3be6;
  --radius: 16px;
  --max-width: 1100px;
  --transition: 0.3s ease;
  font-family: Inter, system-ui, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: #f2f2ff;
  -webkit-font-smoothing: antialiased;
}

/* ========== LAYOUT ========== */
.container {
  max-width: var(--max-width);
  width: 92%;
  margin: 0 auto;
  padding: 0.5rem 0 2.5rem;
  position: relative;
  z-index: 3;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 1 !important;
  pointer-events: none;
}

/* ========== NAVIGATION ========== */
.nav {
  position: sticky;
  top: 0;
  z-index: 999;
  padding: 1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(8px);
  background: rgba(5, 5, 10, 0.65);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo {
  font-weight: 800;
  font-size: 1.1rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
}

.nav-links li {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
}
.nav-links li.active {
  background: linear-gradient(90deg, rgba(155,92,255,0.24),
                                    rgba(111,59,230,0.14));
  color: white;
}
/* Mobile Menu Button */
.menu-toggle { display: none; flex-direction: column; gap: 4px; cursor: pointer; }
.menu-toggle span { width: 24px; height: 3px; background: white; }

/* ========== PANELS ========== */
.panel { display: none; animation: fadeIn .28s ease both; }
.panel.active { display: block; }

.panel-title {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

/* HOME — forced visible on load */
#home.panel.active {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: calc(100vh - 80px);
}

/* HERO */
.hero {
  text-align: center;
  max-width: 700px;
  margin: 0.2rem auto 0;
}

.pfp {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.12);
  margin: 0.5rem auto 1rem;
  box-shadow: 0 4px 20px rgba(155,92,255,0.25);
}
.pfp img { width: 100%; height: 100%; object-fit: cover; }

.title { font-size: 2rem; margin: 0 0 .7rem; }
.lead {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: .75rem;
}


.typing {
  display: inline-block;
  min-height: 2.4rem; /* Reserve enough height for all phrases */
  white-space: nowrap; /* Prevent text from breaking to next line */
}

.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 0.6rem;
}
.btn {
  background: linear-gradient(90deg,var(--accent),var(--accent2));
  padding: .6rem 1rem;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  color: white;
  cursor: pointer;
}

/* EMPLOYMENT */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tcard {
  padding: 1rem;
  border-radius: 14px;
  line-height: 1.6;
  background: linear-gradient(180deg, rgba(255,255,255,0.05),
                                      rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.1);
}
.meta { font-size: .75rem; color: var(--muted); }

/* ACADEMIC */
.grid.two {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
  gap: 1rem;
}
.card {
  padding: 1rem;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.08);
}

/* PERSONAL */
.richtext h4 { margin-top: .75rem; }
.richtext p { line-height: 1.65; margin-bottom: .6rem; }

/* CONTACT */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
input, textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: white;
  padding: .75rem;
  font-size: 1rem;
}
textarea { min-height: 130px; resize: vertical; }

.status { font-size: .85rem; color: var(--muted); }

/* FOOTER */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
}

/* ANIMATION */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px) }
  to { opacity: 1; transform: none; }
}

/* ========== MOBILE ========= */
@media(max-width:820px){
  .nav-links {
    display: none;
    flex-direction: column;
    width: 200px;
    background: rgba(0,0,15,0.95);
    padding: 1rem;
    border-radius: 12px;
    position: absolute;
    top: 70px; right: 10px;
  }
  .nav-links.show { display: flex; }
  .menu-toggle { display: flex; }

  .title { font-size: 1.8rem; }
  .lead { font-size: .95rem; }
}

/* Contact section improvements */
#contact.panel.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#contact .panel-content {
  width: 100%;
}

.contact-form {
  width: 100%;
  max-width: 520px; /* wider & consistent on all screens */
  margin-top: 1rem;
  padding: 1.2rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  gap: 1.3rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  font-size: 1rem;
  padding: 0.85rem 1rem;
}

/* Better spacing for heading + helper text */
#contact .panel-title {
  margin-bottom: 0.5rem;
  text-align: center;
}

#contact p.muted {
  text-align: center;
  margin-bottom: 1rem;
  width: 100%;
}

/* Mobile tuning */
@media(max-width: 600px){
  .contact-form {
    padding: 1rem;
    gap: 1
  }
