:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5d6270;
  --line: #e7e4dc;
  --accent: #b4532a;
  --accent-soft: #f6e9e1;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #161920;
    --text: #ecebe6;
    --muted: #9a9ea9;
    --line: #262a33;
    --accent: #e8875a;
    --accent-soft: #2a1d17;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

a { color: inherit; }

.mono { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.02em; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 24px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
}
.brand { font-family: var(--serif); font-size: 1.7rem; text-decoration: none; }
.brand span { color: var(--accent); }
.nav nav { display: flex; gap: 24px; align-items: center; }
.nav nav a { text-decoration: none; color: var(--muted); font-size: 0.93rem; }
.nav nav a:hover { color: var(--text); }
.nav .nav-cta { color: var(--accent); font-weight: 500; }

main { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* Hero */
.hero { padding: 96px 0 72px; }
.eyebrow { color: var(--accent); text-transform: uppercase; margin-bottom: 20px; }
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.4rem, 10vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.lede {
  max-width: 640px;
  margin-top: 28px;
  font-size: 1.22rem;
  color: var(--muted);
}
.lede em { font-style: normal; color: var(--text); }

.cta-row { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--text); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.big { font-size: 1.1rem; padding: 16px 30px; }

.namedrop {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 22px;
  margin-top: 40px;
}
.namedrop .mono { color: var(--muted); text-transform: uppercase; }
.namedrop strong { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 72px;
  border-top: 1px solid var(--line);
}
.stats div { padding: 22px 16px 0 0; }
.stats dt { font-family: var(--serif); font-size: 2.4rem; line-height: 1; }
.stats dd { color: var(--muted); font-size: 0.88rem; margin-top: 6px; }

/* Sections */
.section { padding: 72px 0; border-top: 1px solid var(--line); }
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.4rem;
  margin-bottom: 40px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.section-title .mono { color: var(--accent); }

/* Timeline */
.timeline { list-style: none; }
.timeline > li {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px dashed var(--line);
}
.timeline > li:last-child { border-bottom: none; }
.when { color: var(--muted); padding-top: 6px; }
.what h3 { font-size: 1.15rem; font-weight: 600; }
.org { color: var(--accent); font-size: 0.95rem; margin: 2px 0 12px; }
.what ul { padding-left: 18px; color: var(--muted); }
.what ul li { margin-bottom: 6px; }
.what ul strong { color: var(--text); font-weight: 500; }
.what > p:not(.org) { color: var(--muted); }
.earlier-list { display: grid; gap: 6px; margin-top: 8px; }
.earlier-list strong { color: var(--text); font-weight: 500; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.one { grid-template-columns: 1fr; max-width: 720px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}
.card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.95rem; }
.project h3 { font-family: var(--serif); font-weight: 400; font-size: 1.8rem; }
.project a { display: inline-block; margin-top: 14px; color: var(--accent); text-decoration: none; font-weight: 500; }
.tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

/* Education */
.edu { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 32px; }
.edu li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.edu strong { font-weight: 500; display: block; }
.edu em { font-style: normal; color: var(--muted); font-size: 0.88rem; }
.edu span { color: var(--muted); white-space: nowrap; }
.certs { color: var(--muted); margin-top: 28px; line-height: 1.9; }

/* Contact */
.contact { text-align: center; padding: 110px 0; }
.contact h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 1; }
.contact p { color: var(--muted); margin: 18px 0 36px; }

.footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.footer a { text-decoration: none; }
.footer-links { display: flex; gap: 20px; }

/* Contact dialog */
.contact-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(460px, calc(100% - 32px));
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.contact-dialog::backdrop { background: rgba(10, 11, 14, 0.55); backdrop-filter: blur(4px); }
.contact-dialog[open] { animation: pop 0.18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.contact-dialog h2 { font-family: var(--serif); font-weight: 400; font-size: 2.2rem; line-height: 1.1; margin-bottom: 22px; }
.contact-dialog .eyebrow { margin-bottom: 10px; }
.dialog-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.dialog-close:hover { background: var(--accent-soft); color: var(--text); }
.email-copy {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s;
}
.email-copy:hover { border-color: var(--accent); }
.email-address { font-weight: 500; word-break: break-all; }
.copy-label { color: var(--accent); white-space: nowrap; }
.email-copy.copied { border-color: var(--accent); }
.dialog-sub { color: var(--muted); font-size: 0.9rem; margin: 22px 0 12px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dialog-actions .btn { flex: 1; text-align: center; min-width: 110px; }

/* Responsive */
@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .timeline > li { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav { padding: 14px 16px; }
  .nav nav { gap: 16px; }
  .nav nav a:not(.nav-cta) { display: none; }
  main { padding: 0 16px; }
  .hero { padding: 56px 0 48px; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
  .grid, .grid.two, .edu { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .section-title { font-size: 2rem; }
  .footer { padding: 24px 16px 32px; }
}
