@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

/* ═══════════════════════════════════════════════════════
   TOKENS
═══════════════════════════════════════════════════════ */
:root {
  --bg: #f5f0e8;
  --bg-nav: #ede8df;
  --text: #2c2825;
  --text-muted: #7a6f68;
  --link: #8b2020;
  --link-hover: #6b1818;
  --border: #d4c8b8;
  --nav-h: 56px;

  /* spacing system — every section uses these */
  --section-pad-v: 5rem; /* top/bottom of every section  */
  --section-pad-h: 2.5rem; /* left/right of every section  */
  --content-max: 860px; /* max-width for all content     */
  --gap-entry: 2rem; /* gap between list entries      */
}

[data-theme="dark"] {
  --bg: #1a1614;
  --bg-nav: #221e1c;
  --text: #ede8e0;
  --text-muted: #9a8f88;
  --link: #c0614a;
  --link-hover: #d4725a;
  --border: #3a3230;
}

/* ═══════════════════════════════════════════════════════
   RESET
═══════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Georgia", serif;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* ═══════════════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background-color: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--section-pad-h);
  z-index: 100;
  transition:
    background-color 0.3s,
    border-color 0.3s;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  font-family: "Inter", system-ui, sans-serif;
  opacity: 0.7;
  transition:
    opacity 0.2s,
    color 0.2s;
}
.nav-links a:hover {
  opacity: 1;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}
.theme-toggle:hover {
  border-color: var(--text);
}

/* ═══════════════════════════════════════════════════════
   SHARED SECTION SHELL
   Every section gets this — padding, border-top, centred inner
═══════════════════════════════════════════════════════ */
main {
  padding-top: var(--nav-h);
}

.site-section {
  padding: var(--section-pad-v) var(--section-pad-h);
  border-top: 1px solid var(--border);
}

/* first section (about) has no top border */
.site-section:first-child {
  border-top: none;
}

.section-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

.section-heading {
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
  font-family: "Inter", system-ui, sans-serif;
}

/* shared link style — apply wherever needed */
a.styled-link,
.section-inner a {
  color: var(--link);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s;
}
.section-inner a:hover {
  color: var(--link-hover);
}

/* shared divider */
.entry-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════
   ABOUT
═══════════════════════════════════════════════════════ */
.about-inner {
  display: flex;
  gap: 3.5rem;
  align-items: flex-start;
}

/* ── Profile card ── */
.about-profile {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 180px;
}

.profile-photo-wrap {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background-color: var(--border);
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-name {
  font-size: 0.95rem;
  font-weight: bold;
  text-align: center;
  margin-top: 0.4rem;
}

.profile-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  text-align: center;
  word-break: break-all;
  transition: color 0.2s;
}
.profile-email:hover {
  color: var(--text);
}

.profile-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.4rem;
}
.profile-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}
.profile-links a:hover {
  color: var(--text);
}

/* ── Bio ── */
.about-bio {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.2rem;
}

.about-bio p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
}
.about-bio strong {
  font-weight: bold;
}

/* ═══════════════════════════════════════════════════════
   EDUCATION
═══════════════════════════════════════════════════════ */
.edu-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap-entry);
}

.edu-entry {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.edu-institution {
  font-size: 1.02rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.edu-degree {
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
}

.edu-detail {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.edu-right {
  flex-shrink: 0;
  text-align: right;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-variant-numeric: lining-nums tabular-nums;
}

.edu-gpa {
  font-size: 0.92rem;
  color: var(--text);
  margin-top: 0.2rem;
  font-variant-numeric: lining-nums tabular-nums;
}

/* ═══════════════════════════════════════════════════════
   RESEARCH
═══════════════════════════════════════════════════════ */
.research-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap-entry);
}

.research-entry {
  display: flex;
  gap: 1.6rem;
  align-items: flex-start;
}

.research-thumb {
  flex-shrink: 0;
  width: 180px;
  height: 140px;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background-color: var(--border);
}

.research-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.research-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.1rem;
}

.research-title {
  font-size: 0.97rem;
  font-weight: bold;
  line-height: 1.45;
}

.research-authors {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.research-venue {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-style: italic;
}

.research-desc {
  font-size: 0.88rem;
  line-height: 1.7;
  margin-top: 0.4rem;
}

/* ═══════════════════════════════════════════════════════
   PROJECTS & INTERNSHIPS
═══════════════════════════════════════════════════════ */
.project-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap-entry);
}

.project-entry {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.project-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.project-title {
  font-size: 1.02rem;
  font-weight: bold;
}

.project-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.project-date {
  font-size: 0.84rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-variant-numeric: lining-nums tabular-nums;
}

.project-desc {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text);
}

/* Resume link — right side of navbar next to toggle */
.resume-link {
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s;
  margin-right: 0.8rem;
}
.resume-link:hover {
  opacity: 1;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ═══════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.8rem var(--section-pad-h);
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.footer-inner a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-inner a:hover {
  color: var(--text);
}

.footer-dot {
  opacity: 0.4;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Active nav link on scroll */
.nav-links a.active {
  opacity: 1;
  font-weight: 500;
}

/* Institution and project titles — Inter for crispness */
.edu-institution,
.project-title,
.research-title,
.profile-name {
  font-family: "Inter", system-ui, sans-serif;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — phones & small tablets
═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --section-pad-v: 3rem;
    --section-pad-h: 1.25rem;
    --gap-entry: 1.5rem;
  }

  .site-section {
    scroll-margin-top: var(--nav-h);
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.8rem;
  }

  .section-heading {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
  }

  .about-inner {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }

  .about-bio {
    padding-top: 0;
  }

  .edu-entry {
    flex-direction: column;
    gap: 0.5rem;
  }

  .edu-right {
    text-align: left;
  }

  .research-entry {
    flex-direction: column;
    gap: 1rem;
  }

  .research-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

@media (max-width: 480px) {
  .nav-links {
    gap: 0.55rem;
  }

  .nav-links a {
    font-size: 0.72rem;
  }

  .resume-link {
    font-size: 0.8rem;
    margin-right: 0.4rem;
  }

  .nav-right {
    gap: 0.5rem;
  }

  .theme-toggle {
    padding: 5px 6px;
  }
}
