:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1c1f23;
  --muted: #5d6670;
  --line: #e4e2dc;
  --accent: #0f766e;
  --accent-soft: #e3f1ef;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121416;
    --surface: #1a1d20;
    --text: #e8e9ea;
    --muted: #9aa3ab;
    --line: #2a2e33;
    --accent: #5eead4;
    --accent-soft: #163330;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font: 17px/1.65 var(--sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
svg { width: 1.1em; height: 1.1em; fill: currentColor; flex-shrink: 0; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font: 700 1.35rem var(--serif); color: var(--text); letter-spacing: .02em; }
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--muted); font-size: .95rem; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1fr auto; gap: 4rem; align-items: center;
  padding: 6rem 0 4rem;
}
.eyebrow { margin: 0; color: var(--accent); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; }
h1 { font: 700 clamp(2.4rem, 6vw, 4rem)/1.08 var(--serif); margin: .4rem 0 .6rem; letter-spacing: -.01em; }
.role { margin: 0 0 1.5rem; font-size: 1.2rem; color: var(--muted); }
.lead { max-width: 60ch; margin: 0 0 1.25rem; }
.status {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .45rem .9rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--text); font-size: .9rem; margin: 0 0 1.75rem;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.socials { display: flex; flex-wrap: wrap; gap: .75rem; list-style: none; padding: 0; margin: 0; }
.socials a {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); font-weight: 500; font-size: .95rem;
  transition: border-color .2s, transform .2s;
}
.socials a:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }

.hero-photo { text-align: center; }
.hero-photo img {
  width: 240px; height: 240px; object-fit: cover; border-radius: 50%;
  border: 6px solid var(--surface); box-shadow: var(--shadow), 0 0 0 1px var(--line);
}
.avatar-fallback {
  width: 240px; height: 240px; border-radius: 50%; margin-inline: auto;
  display: grid; place-items: center; font: 700 4rem var(--serif); color: var(--accent);
  background: var(--accent-soft); border: 6px solid var(--surface); box-shadow: var(--shadow), 0 0 0 1px var(--line);
}
@media (max-width: 860px) { .avatar-fallback { width: 130px; height: 130px; font-size: 2.2rem; margin: 0; } }
.location { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .9rem; margin-top: 1rem; }

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stats div { padding: 1.4rem 1.5rem; border-left: 1px solid var(--line); }
.stats div:first-child { border-left: 0; }
.stats strong { display: block; font: 700 1.6rem/1.2 var(--serif); color: var(--accent); }
.stats span { color: var(--muted); font-size: .9rem; }

/* ---------- Sections ---------- */
.section { padding: 5rem 0 1rem; }
.section-title { font: 700 2rem var(--serif); margin: 0 0 2.5rem; display: flex; align-items: baseline; gap: .8rem; }
.section-title span { font: 600 .85rem var(--sans); color: var(--accent); letter-spacing: .1em; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 .75rem; font-size: 1.05rem; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: .9rem 0 0; }
.tags li {
  font-size: .8rem; padding: .2rem .65rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--text);
}

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 150px; top: .6rem; bottom: .6rem; width: 2px; background: var(--line);
}
.job { display: grid; grid-template-columns: 150px 1fr; gap: 2.5rem; padding-bottom: 2.75rem; position: relative; }
.job::before {
  content: ""; position: absolute; left: 144px; top: .5rem; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.job:first-child::before { background: var(--accent); }
.job-date { color: var(--muted); font-size: .9rem; font-weight: 600; padding-top: .15rem; text-align: right; padding-right: 1rem; }
.job-body h3 { margin: 0 0 .5rem; font-size: 1.15rem; }
.company { color: var(--accent); font-weight: 500; }
.job-body p { margin: 0 0 .6rem; color: var(--muted); max-width: 68ch; }
.bullets { margin: 0 0 .6rem; padding-left: 1.2rem; color: var(--muted); max-width: 68ch; }
.bullets li { margin-bottom: .25rem; }
.bullets li::marker { color: var(--accent); }
.job-current .job-body {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; box-shadow: var(--shadow); margin-top: -.6rem;
}

/* ---------- Skills / Edu ---------- */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 860px) { .skills { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .skills { grid-template-columns: 1fr; } }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.checklist li { position: relative; padding-left: 1.1rem; font-size: .93rem; color: var(--muted); line-height: 1.45; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.skill h3 { padding-bottom: .6rem; margin-bottom: .9rem; border-bottom: 1px solid var(--line); }
.skill .tags { margin-top: 0; }
.edu { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.edu-year { display: inline-block; font: 700 1.4rem var(--serif); color: var(--accent); margin-bottom: .5rem; }
.edu-item p { margin: 0; color: var(--muted); }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; align-items: start; }
.contact.no-form { grid-template-columns: 1fr; max-width: 640px; }
.contact-intro p { margin-top: 0; }
.muted { color: var(--muted); }
.contact-form { display: grid; gap: 1rem; }
.contact-form label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 600; }
.contact-form input, .contact-form textarea {
  font: inherit; font-weight: 400; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: .7rem .85rem; resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.hp { position: absolute; left: -9999px; }
.form-status { margin: 0; font-size: .9rem; min-height: 1.2em; }

.btn {
  display: inline-block; font: 600 1rem var(--sans); cursor: pointer;
  background: var(--accent); color: var(--surface); border: 0; border-radius: 10px; padding: .75rem 1.4rem;
  transition: opacity .2s;
}
.btn:hover { opacity: .9; text-decoration: none; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 5rem; border-top: 1px solid var(--line); padding: 2rem 0; color: var(--muted); font-size: .9rem; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.site-footer p { margin: 0; }

/* ---------- Reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
  .reveal.visible { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 3rem; }
  .hero-photo { order: -1; text-align: left; }
  .hero-photo img { width: 130px; height: 130px; border-width: 4px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div:nth-child(3) { border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: .85rem; }
  .timeline::before { left: 6px; }
  .job { grid-template-columns: 1fr; gap: .25rem; padding-left: 2rem; }
  .job::before { left: 0; }
  .job-date { text-align: left; padding: 0; }
}
@media (max-width: 420px) {
  .brand { display: none; }
  .nav { justify-content: center; }
}

@media print {
  .site-header, #contact, .socials, .status { display: none; }
  body { background: #fff; font-size: 12pt; }
  .card, .stats { box-shadow: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
