/* --- Variables --- */
:root {
  --bg: #f8f6f2;
  --bg-alt: #f0ede6;
  --surface: #ffffff;
  --text: #1c1917;
  --text-muted: #57534e;
  --accent: #1e3a5f;
  --accent-light: #2d5a87;
  --accent-soft: rgba(30, 58, 95, 0.08);
  --border: rgba(28, 25, 23, 0.1);
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.06), 0 8px 24px rgba(28, 25, 23, 0.06);
  --shadow-lg: 0 4px 6px rgba(28, 25, 23, 0.04), 0 20px 48px rgba(28, 25, 23, 0.1);
  --radius: 12px;
  --radius-lg: 20px;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --max-width: 1120px;
  --header-h: 64px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

img { max-width: 100%; display: block; }
a { color: var(--accent-light); text-decoration: none; }
a:hover { color: var(--accent); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #fff;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.container {
  width: min(100% - 2.5rem, var(--max-width));
  margin-inline: auto;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 246, 242, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.02em;
}

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  padding: 0.45rem 1rem !important;
  background: var(--accent) !important;
  color: #fff !important;
  border-radius: 999px;
}
.nav-cta:hover { background: var(--accent-light) !important; color: #fff !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

/* --- Hero --- */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: start;
  padding: 4.5rem 0 5rem;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin: 0 0 1rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 6vw, 4rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--text-muted);
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 36ch;
  margin: 0 0 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.btn:hover { transform: translateY(-1px); }

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

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.btn-secondary:hover { border-color: var(--accent-light); color: var(--accent); }

.btn-ghost {
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--accent); border-color: var(--accent-light); }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  padding-top: 1.75rem;
}

.hero-stats li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-stats strong {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.hero-stats span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-lg);
}

.hero-card dl {
  margin: 0;
  display: grid;
  gap: 1.25rem;
}

.hero-card dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.hero-card dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

/* --- Sections --- */
.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section-header {
  margin-bottom: 2.5rem;
  max-width: 32rem;
}

.section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.15;
}

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

.about-grid p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
}

/* --- Experience --- */
.timeline {
  display: grid;
  gap: 1.25rem;
}

.experience-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.experience-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.experience-card .org {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.experience-card time {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 0.25rem 0.75rem;
  background: var(--accent-soft);
  border-radius: 999px;
}

.experience-card ul {
  margin: 0 0 1.25rem;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.experience-card li { margin-bottom: 0.5rem; }
.experience-card strong { color: var(--accent); font-weight: 600; }

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

.tags span {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
}

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

.project-card.featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--surface) 0%, #f5f8fc 100%);
  border-color: rgba(30, 58, 95, 0.15);
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
}

.project-lang {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.project-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

.project-highlights {
  margin: 0 0 1.25rem;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.project-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}
.project-link:hover { text-decoration: underline; }

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

.skill-group h3 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin: 0 0 0.5rem;
}

.skill-group p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.coursework {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* --- Contact --- */
.contact-card {
  text-align: center;
  padding: 3rem 2rem;
  max-width: 640px;
  margin-inline: auto;
}

.contact-card .section-header {
  margin-inline: auto;
}

.contact-lead {
  color: var(--text-muted);
  margin: 0 0 2rem;
  font-size: 1.05rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
}

.contact-links a {
  font-weight: 600;
  font-size: 0.95rem;
}

/* --- Footer --- */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-inner p { margin: 0; }
.footer-inner a { color: var(--text-muted); font-weight: 500; }
.footer-inner a:hover { color: var(--accent); }

/* --- Mobile --- */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s, opacity 0.25s;
    box-shadow: var(--shadow-lg);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a {
    display: block;
    padding: 0.85rem 0.5rem;
  }

  .nav-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-7px) rotate(-45deg);
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 2.5rem;
    gap: 2rem;
  }

  .hero-stats { gap: 1.25rem; }

  .section { padding: 3.5rem 0; }

  .experience-card header { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}
