:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --muted: #5f5b54;
  --line: #e2ddd3;
  --accent: #c8102e;
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #1c1c1c;
    --ink: #ece9e3;
    --muted: #a39e95;
    --line: #2e2c29;
    --accent: #ff4d5e;
    --accent-ink: #121212;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 14px max(16px, calc((100vw - var(--max)) / 2));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; text-decoration: none; }
.nav { display: flex; gap: 20px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); font-size: .92rem; }
.nav a:hover { color: var(--ink); }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.lang button {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font: 600 .8rem var(--sans); letter-spacing: .04em;
  padding: 6px 11px; border-radius: 999px;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* Hero */
main { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.hero {
  display: grid; grid-template-columns: 1fr 1.25fr; gap: 48px; align-items: center;
  padding: 64px 0 56px;
}
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; margin: 0 0 12px; }
.hero h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
.lede { color: var(--muted); font-size: 1.1rem; margin: 18px 0 28px; max-width: 44ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); text-decoration: none; font-weight: 500; font-size: .95rem;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.facts { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: .92rem; }
.hero-video { margin: 0; }
.hero-video video {
  display: block; width: 100%; aspect-ratio: 16 / 9; background: #000;
  border-radius: 16px; box-shadow: var(--shadow);
}
.hero-video figcaption { color: var(--muted); font-size: .85rem; margin-top: 10px; }

/* Sections */
.section { padding: 56px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 28px; }
.section h3 { font-size: 1.15rem; margin-bottom: 10px; }
.prose { max-width: 72ch; font-size: 1.05rem; margin: 0; }
.muted, .note { color: var(--muted); }
.note { font-size: .9rem; margin-top: 20px; overflow-wrap: anywhere; }

/* Experience */
.timeline { display: grid; gap: 20px; }
.job {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px 28px;
}
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; }
.job-company { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.job-dates { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.job-role { color: var(--muted); margin: 2px 0 14px; }
.job ul { margin: 0; padding-left: 20px; }
.job li { margin: 6px 0; }

/* Education */
.edu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.edu {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px;
}
.edu-years { color: var(--accent); font-weight: 600; font-size: .85rem; }
.edu h3 { margin: 6px 0 6px; }
.edu p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Projects */
.projects { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 32px; }
.projects li { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.projects .yr { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; padding-top: 1px; }
.projects a { color: var(--accent); overflow-wrap: anywhere; }

/* Skills */
.chips { list-style: none; padding: 0; margin: 0 0 36px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 13px; font-size: .9rem; }
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.lang-grid p { margin: 0; color: var(--muted); }

/* Documents */
.doc-group { margin-top: 32px; }
.doc-group h3 { font-family: var(--sans); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.doc {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.doc:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.doc-thumb { display: block; aspect-ratio: 3 / 4; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.doc-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.doc-title { font-weight: 600; line-height: 1.3; }
.doc-meta { color: var(--muted); font-size: .85rem; }
.doc-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; }
.doc-actions a { flex: 1; text-align: center; font-size: .85rem; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; }
.doc-actions a:first-child { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Contact */
.contact-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; max-width: 520px; }
.contact-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact-list span { color: var(--muted); }
.contact-list a { text-decoration: none; font-weight: 500; overflow-wrap: anywhere; text-align: right; }
.contact-list a:hover { color: var(--accent); }

.footer {
  max-width: var(--max); margin: 0 auto; padding: 28px 16px 40px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line);
}

@media (max-width: 920px) {
  .nav { display: none; }
  .lang { margin-left: auto; }
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 36px; }
  .hero-video { order: -1; }
  .edu-grid, .projects, .lang-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .job { padding: 20px; }
  .doc-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .doc-actions { flex-direction: column; }
}
