:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --text: #1c1c1a;
  --text-muted: #5a584f;
  --border: #e7e4dc;
  --accent: #8a4a2c;
  --accent-soft: #f1e6dc;
  --max-width: 760px;
  --font-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #161513;
  --surface: #1e1c19;
  --text: #ede9e1;
  --text-muted: #a8a396;
  --border: #322f29;
  --accent: #d99a6c;
  --accent-soft: #2b2420;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161513;
    --surface: #1e1c19;
    --text: #ede9e1;
    --text-muted: #a8a396;
    --border: #322f29;
    --accent: #d99a6c;
    --accent-soft: #2b2420;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

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

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.nav-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

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

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

.lang-switch {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.lang-switch:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* Layout */
main { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

.section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }

.section h2 {
  font-size: 1.5rem;
  margin-bottom: 24px;
}

/* Hero */
.hero {
  padding: 88px 0 56px;
}

.hero-eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 12px;
}

.hero h1 {
  font-size: 2.6rem;
  margin-bottom: 12px;
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--text);
  margin: 0 0 6px;
}

.hero-sub {
  color: var(--text-muted);
  margin: 0 0 28px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }

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

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

/* Timeline / experience & education */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { margin-bottom: 28px; }
.timeline li:last-child { margin-bottom: 0; }

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.timeline-head h3 { font-size: 1.05rem; }

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

.timeline-loc {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  margin: 2px 0 8px;
}

.timeline p:not(.timeline-loc) { margin: 6px 0 0; color: var(--text); }

/* Cards (projects) */
.cards { display: flex; flex-direction: column; gap: 20px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.card-head h3 { font-size: 1rem; }

.card p { margin: 0 0 6px; }
.card-loc { color: var(--text-muted); font-size: 0.85rem; font-style: italic; margin: 0 !important; }

.card-tech { list-style: none; margin: 12px 0 10px; padding: 0; display: flex; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; gap: 6px; }
.card-tech li {
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
}

.card-link { font-size: 0.88rem; font-weight: 500; display: inline-block; margin-top: 4px; }

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

.skill-group h3 {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

.tags li {
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.85rem;
}

/* Activities */
.activities-list { margin: 0; padding-left: 1.1em; }
.activities-list li { margin-bottom: 8px; color: var(--text); }
.activities-list li:last-child { margin-bottom: 0; }

/* Contact */
.contact-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 1.05rem;
}

/* Footer */
.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 56px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 56px 0 40px; }
  .hero h1 { font-size: 2rem; }
}
