:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece4;
  --text: #141821;
  --muted: #5d6472;
  --line: #e2ddd1;
  --accent: #9a7433;
  --accent-soft: rgba(154, 116, 51, 0.12);
  --navy: #101828;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 40px rgba(16, 24, 40, 0.08);

  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17;
    --surface: #121826;
    --surface-2: #182032;
    --text: #e8e6e1;
    --muted: #98a0ae;
    --line: #242d40;
    --accent: #d4b073;
    --accent-soft: rgba(212, 176, 115, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 20px 50px rgba(0, 0, 0, 0.35);
  }
}

:root[data-theme="dark"] {
  --bg: #0b0f17;
  --surface: #121826;
  --surface-2: #182032;
  --text: #e8e6e1;
  --muted: #98a0ae;
  --line: #242d40;
  --accent: #d4b073;
  --accent-soft: rgba(212, 176, 115, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 20px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

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

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

a { color: inherit; }

main, .topbar, footer {
  width: min(1040px, 100% - 32px);
  margin-inline: auto;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 12px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.monogram {
  font-family: var(--serif);
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.topbar nav { display: flex; gap: 20px; margin-left: auto; }
.topbar nav a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}
.topbar nav a:hover { color: var(--text); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle svg { width: 16px; height: 16px; fill: currentColor; }
.theme-toggle:hover { color: var(--accent); }

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

.card {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: center;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
}

.photo-wrap {
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-2);
}
.photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.eyebrow {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.role {
  margin: 10px 0 0;
  font-size: 18px;
  font-weight: 500;
}

.lead {
  margin: 16px 0 0;
  color: var(--muted);
  max-width: 52ch;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: transform .15s, border-color .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.socials {
  display: flex;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.socials a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  transition: color .2s, background .2s;
}
.socials a:hover { color: var(--accent); background: var(--accent-soft); }
.socials svg { width: 18px; height: 18px; fill: currentColor; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 24px 0 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.stats div { padding: 20px 22px; background: var(--surface); }
.stats dt {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--accent);
}
.stats dd { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- Sections ---------- */
.section {
  padding: 64px 0 8px;
}

h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 28px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.01em;
}
h2 .num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--accent);
}

.prose p { margin: 0 0 16px; max-width: 68ch; font-size: 17px; }
.muted { color: var(--muted); font-size: 15px !important; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 28px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.timeline > li:last-child { border-bottom: 1px solid var(--line); }
.when {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  padding-top: 4px;
}
.what h3 { margin: 0; font-size: 19px; font-weight: 600; }
.org { margin: 4px 0 12px; color: var(--accent); font-size: 14px; font-weight: 500; }
.what ul { margin: 0; padding-left: 18px; color: var(--muted); }
.what ul li { margin: 6px 0; }
.what ul li::marker { color: var(--accent); }

/* Domains */
.domains {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.domains article {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.domains h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.domains p { margin: 0; color: var(--muted); font-size: 14px; }

.skills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 32px;
  margin-top: 32px;
}
h4 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tags li {
  padding: 5px 11px;
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* Education */
.edu {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.edu > div {
  padding: 20px 22px;
  border-left: 2px solid var(--accent);
  background: var(--surface);
  border-radius: 0 12px 12px 0;
}
.edu h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.edu p { margin: 0; color: var(--muted); font-size: 14px; }

.sub { margin-top: 36px; }
.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.langs li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
}
.langs em { font-style: normal; font-size: 12px; color: var(--muted); }

/* Contact */
.contact { padding-bottom: 48px; }
.big {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.2;
  max-width: 22ch;
}
.email {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .card { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
  .photo-wrap { width: 180px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .domains, .edu { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .topbar nav { display: none; }
  .topbar .theme-toggle { margin-left: auto; }
  .hero { padding-top: 32px; }
  .timeline > li { grid-template-columns: 1fr; gap: 6px; }
  .skills { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
