/* ---------- Tokens ---------- */
:root {
  --color-bg: #faf9f6;
  --color-bg-alt: #f2f0ea;
  --color-text: #1c1c1a;
  --color-text-muted: #55534c;
  --color-accent: #2c4a6e;
  --color-accent-hover: #1f3550;
  --color-rule: #ddd9cf;
  --color-card-bg: #ffffff;

  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --content-width: 760px;
  --radius: 4px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.5em;
  color: var(--color-text);
}

p { margin: 0 0 1em; }

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

ul { padding-left: 1.25em; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-rule);
}

.nav-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-text);
}
.nav-name:hover { text-decoration: none; color: var(--color-accent); }

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

.nav-links a {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--color-accent); text-decoration: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--color-text);
  display: block;
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
  scroll-margin-top: 80px;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: 2.75rem;
  margin-bottom: 0.25em;
}

.hero-title {
  font-size: 1.25rem;
  color: var(--color-accent);
  font-family: var(--font-serif);
  margin-bottom: 1.25em;
}

.hero-thesis {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 42em;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { background: var(--color-accent-hover); }

.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn-secondary:hover { background: var(--color-bg-alt); }

/* ---------- Sections ---------- */
.section {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
  border-top: 1px solid var(--color-rule);
  scroll-margin-top: 70px;
}

.section h2 {
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
}

.section-intro {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.section-body p { color: var(--color-text); }

/* ---------- Experience entries ---------- */
.entry { margin-bottom: 2.5rem; }
.entry:last-child { margin-bottom: 0; }

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

.entry-header h3 {
  font-size: 1.15rem;
  margin-bottom: 0.15em;
}

.entry-date {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.entry-org {
  font-style: italic;
  color: var(--color-text-muted);
  margin-bottom: 0.75em;
}

.entry-list li { margin-bottom: 0.4em; }

/* ---------- Academic Work cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

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

.card h3 {
  font-size: 1.02rem;
  margin-bottom: 0.5em;
}

.card p {
  font-size: 0.93rem;
  color: var(--color-text-muted);
  margin-bottom: 0.9em;
}

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

.tags span {
  font-size: 0.75rem;
  color: var(--color-accent);
  background: var(--color-bg-alt);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.card-link {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.skill-group h3 {
  font-size: 1rem;
  color: var(--color-accent);
  margin-bottom: 0.6em;
}

.skill-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.skill-group li {
  padding: 0.3em 0;
  border-bottom: 1px solid var(--color-rule);
  font-size: 0.93rem;
}
.skill-group li:last-child { border-bottom: none; }

/* ---------- Contact ---------- */
.contact-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--color-rule);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-top: 1px solid var(--color-rule); }
  .nav-links a {
    display: block;
    padding: 0.9rem 1.5rem;
  }
  .nav-toggle { display: flex; }

  .hero { padding: 3.5rem 1.25rem 2.75rem; }
  .hero h1 { font-size: 2.1rem; }

  .card-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
}
