:root {
  --bg: #10110f;
  --bg-elev: #181916;
  --bg-soft: #1f211c;
  --ink: #ece7dc;
  --muted: #b4ad9e;
  --faint: #7c7668;
  --line: rgba(236, 231, 220, 0.1);
  --copper: #d07a3a;
  --copper-2: #e8b07a;
  --paper: #f3eee4;
  --paper-ink: #1a1916;
  --ok: #8fb37a;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  --max: 1120px;
  --nav-h: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { background: var(--bg); color: var(--ink); }
body {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: 0.01em;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
.skip {
  position: absolute; left: -999px; top: 8px;
}
.skip:focus {
  left: 12px; z-index: 80; background: var(--paper); color: var(--paper-ink);
  padding: 8px 12px; border-radius: 8px;
}

.wrap { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }
.eyebrow {
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--copper-2); font-weight: 600;
}
h1, h2, h3, .serif { font-family: Newsreader, Georgia, serif; font-weight: 500; letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.1; }
h3 { font-size: 1.35rem; line-height: 1.25; }

.nav {
  position: sticky; top: 0; z-index: 40;
  height: var(--nav-h);
  display: flex; align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(16,17,15,0.82);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }
.brand img { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 14px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-cta {
  background: var(--paper); color: var(--paper-ink);
  text-decoration: none; border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600;
}
.menu-btn {
  display: none; background: none; border: 1px solid var(--line); color: var(--ink);
  width: 42px; height: 42px; border-radius: 10px;
}

.hero { padding: 72px 0 40px; }
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center;
}
.kicker { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.pill {
  border: 1px solid var(--line); background: var(--bg-elev);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--muted);
}
.hero h1 { font-size: clamp(3rem, 8vw, 6.2rem); line-height: 0.92; margin: 8px 0 18px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 38rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; border-radius: 999px; padding: 12px 18px; font-weight: 600;
  border: 1px solid transparent; transition: transform .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--copper); color: #1a120b; }
button.btn { -webkit-appearance: none; appearance: none; }
.btn-ghost,
button.btn-ghost {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--paper-ink);
  cursor: pointer;
}
.btn-ghost:hover,
button.btn-ghost:hover {
  background: #fff;
  border-color: #fff;
  color: var(--paper-ink);
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.stat { border-top: 1px solid var(--line); padding-top: 12px; }
.stat b { display: block; font-size: 1.4rem; font-family: Newsreader, serif; }
.stat span { color: var(--faint); font-size: 13px; }
.portrait {
  position: relative; border-radius: 28px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.portrait img { width: 100%; height: 560px; object-fit: cover; object-position: 50% 18%; }
.portrait figcaption {
  position: absolute; left: 16px; bottom: 16px;
  background: rgba(16,17,15,0.78); backdrop-filter: blur(8px);
  padding: 10px 12px; border-radius: 12px; font-size: 13px; color: var(--muted);
}

section { padding: 88px 0; }
.section-head { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 36px; }
.section-head p { color: var(--muted); max-width: 34rem; }

.about-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 36px; }
.about-copy p + p { margin-top: 16px; color: var(--muted); }
.about-copy p:first-of-type { font-size: 1.2rem; color: var(--ink); }
.side-card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
}
.side-card li { list-style: none; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.side-card li:last-child { border-bottom: 0; }
.side-card strong { color: var(--ink); display: block; }

.timeline { display: grid; gap: 18px; }
.job {
  display: grid; grid-template-columns: 170px 1fr; gap: 20px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.job time { color: var(--faint); font-size: 13px; }
.job h3 { margin-bottom: 4px; }
.job .co { color: var(--copper-2); font-size: 14px; margin-bottom: 10px; }
.job ul { margin-left: 18px; color: var(--muted); }
.job li + li { margin-top: 6px; }

.skill-groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skill {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.skill h3 { font-size: 1.05rem; margin-bottom: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 13px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 10px; background: var(--bg-soft);
}

.project-grid { display: grid; gap: 22px; }
.project.featured {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 0;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 24px; overflow: hidden;
}
.project.featured .media { min-height: 320px; background: #0c0d0b; }
.project.featured img { width: 100%; height: 100%; object-fit: cover; }
.project-body { padding: 28px; }
.live {
  display: inline-block; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: #1a120b; background: var(--ok); border-radius: 999px; padding: 4px 8px; font-weight: 700; margin-bottom: 10px;
}
.project-body p { color: var(--muted); margin: 10px 0 16px; }
.links { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.mini {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.mini img { height: 150px; width: 100%; object-fit: cover; }
.mini .pad { padding: 16px; }
.mini p { color: var(--muted); font-size: 14px; margin-top: 6px; }

.edu { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.edu article, .certs article {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
}
.certs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.certs a { text-decoration: none; }
.certs a:hover { border-color: var(--copper); }

.contact-box {
  background: var(--paper); color: var(--paper-ink); border-radius: 28px; padding: 40px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
}
.contact-box h2 { color: var(--paper-ink); }
.contact-box p { color: #4d4942; }
.contact-actions { display: flex; flex-direction: column; gap: 10px; }
.contact-actions a {
  text-decoration: none; background: #1a1916; color: var(--paper);
  border-radius: 14px; padding: 14px 16px; font-weight: 600;
}

footer { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--faint); font-size: 14px; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.62); display: none;
  align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.modal.open { display: flex; }
.modal-card {
  width: min(840px, 100%); max-height: 86vh; overflow: auto;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 20px; padding: 24px;
}
.modal-card h3 { margin-bottom: 8px; }
.modal-card p, .modal-card li { color: var(--muted); }
.modal-card ul { margin: 10px 0 0 18px; }
.close {
  float: right; background: none; border: 0; color: var(--ink); font-size: 22px; cursor: pointer;
}

@media (max-width: 900px) {
  .hero-grid, .about-grid, .job, .project.featured, .skill-groups, .mini-grid, .edu, .certs, .contact-box {
    grid-template-columns: 1fr;
  }
  .portrait img { height: 420px; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: #151612; border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 16px 20px 20px; align-items: flex-start;
  }
  .nav-links.open { display: flex; }
  .stats { grid-template-columns: 1fr 1fr; }
  section { padding: 64px 0; }
}
