:root {
  --bg: #ffffff;
  --bg-alt: #f5f6f8;
  --text: #1a1d23;
  --text-muted: #5b6270;
  --accent: #2a5d9f;
  --accent-contrast: #ffffff;
  --border: #e3e5e9;
  --card-bg: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.08);
  --max-width: 960px;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --bg-alt: #1b1e24;
    --text: #e8eaed;
    --text-muted: #9aa1ac;
    --accent: #6fa3e0;
    --accent-contrast: #0c1116;
    --border: #2a2e36;
    --card-bg: #1b1e24;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.25;
  margin: 0 0 0.5em;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.nav-brand:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* Sections */
.section {
  padding: 4.5rem 0;
  scroll-margin-top: 64px;
}

.section.alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: 1.6rem;
  margin-bottom: 2rem;
}

/* Hero */
.hero {
  padding-top: 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(180px, auto) 1fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-photo img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}

.hero-photo-caption {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: center;
  color: var(--text-muted);
  white-space: nowrap;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.25rem;
}

.hero-text h1 {
  font-size: 2.4rem;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.bio {
  max-width: 60ch;
}

.interests {
  margin: 1rem 0 0;
}

.interests-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.interests-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.interest-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text);
}

.bio-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

.hero-links {
  display: flex;
  gap: 0.75rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  border: 1px solid var(--accent);
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-ghost {
  color: var(--accent);
  background: transparent;
}

.btn-ghost:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.social-row {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.social-row a {
  color: var(--text-muted);
  display: inline-flex;
}

.social-row a:hover {
  color: var(--accent);
}

#education.section,
#experience.section {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

#education .section-title,
#experience .section-title {
  margin-bottom: 1.25rem;
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding: 0 0 1rem 1.75rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -6.5px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timeline-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.15rem;
}

.timeline-content > p {
  margin: 0;
  color: var(--text-muted);
}

.timeline-courses {
  margin-top: 0.3rem !important;
  font-size: 0.85rem;
}

.timeline-courses strong {
  color: var(--text);
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.skill-card h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.skill-card .tag {
  background: var(--bg);
}

/* Projects */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-media {
  aspect-ratio: 16 / 9;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 0.5rem;
  position: relative;
}

.card-media::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--border);
  border-radius: 6px;
}

.card-media img,
.card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 1.1rem;
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.card-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem !important;
  color: var(--accent) !important;
  margin: 0 0 0.4rem !important;
}

.card-note {
  font-size: 0.8rem !important;
  font-style: italic;
  margin-top: 0.75rem !important;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text);
}

.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.btn-icon-pending {
  color: var(--text-muted);
  border-color: var(--border);
  border-style: dashed;
  opacity: 0.55;
  pointer-events: none;
  cursor: default;
}

/* Publications */
.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pub-list li {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.pub-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pub-list p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.pub-status {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

/* Activities */
.collapsible summary.section-title {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.collapsible summary.section-title::-webkit-details-marker {
  display: none;
}

.collapsible summary.section-title::before {
  content: "+";
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
  width: 1rem;
}

.collapsible[open] summary.section-title::before {
  content: "\2212";
}

.collapsible-body {
  padding-top: 0.5rem;
}

.collapsible-body h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.6rem;
}

.collapsible-body h3:first-child {
  margin-top: 0;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.activity-list li {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text-muted);
}

.activity-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Contact */
#contact.section {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

#contact .section-title {
  margin-bottom: 0.75rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.contact-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 1rem;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-photo {
    display: flex;
    justify-content: center;
  }

  .hero-links,
  .social-row {
    justify-content: center;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}
