:root {
  --bg: #ffffff;
  --bg-soft: #f5f7f9;
  --text: #16202a;
  --muted: #5b6876;
  --line: #e3e8ed;
  --accent: #2c4a5e;
  --accent-soft: #e8eef2;
  --radius: 12px;
  --max: 960px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px 0;
  background: var(--text);
  transition: transform 0.2s, opacity 0.2s;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--accent); background: var(--accent-soft); }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #213848; border-color: #213848; }

.btn[hidden] { display: none; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: center;
  padding-top: 88px;
  padding-bottom: 72px;
}

.hero-photo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 25%;
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.lead { color: var(--muted); font-size: 18px; margin: 18px 0 0; max-width: 60ch; }

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

/* ---------- Sections ---------- */
.section { padding-top: 56px; padding-bottom: 56px; border-top: 1px solid var(--line); }

.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.sub-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }

/* ---------- Projects ---------- */
.project {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.project-gallery {
  display: grid;
  grid-template-columns: 16fr 9fr;
  gap: 4px;
  background: var(--line);
}

.project-gallery figure { margin: 0; position: relative; background: var(--bg-soft); }

.project-gallery img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.project-gallery .tall img { object-position: 50% 45%; }

.project-gallery figcaption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(22, 32, 42, 0.72);
  color: #fff;
  font-size: 12px;
}

.project-body { padding: 28px 32px 32px; }
.project-body h3 { font-size: 22px; font-weight: 700; margin: 4px 0 12px; }
.project-body p { margin: 0 0 12px; }

.project-meta { color: var(--accent); font-size: 14px; font-weight: 600; margin: 0; }

.more-note { color: var(--muted); font-size: 15px; margin: 20px 0 0; }

/* ---------- Tags ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}
.tags li {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

/* ---------- Experience ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }

.role {
  position: relative;
  padding: 0 0 36px 28px;
  border-left: 2px solid var(--line);
}
.role:last-child { padding-bottom: 8px; }
.role::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.role-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  align-items: baseline;
}
.role-head h3 { font-size: 18px; font-weight: 600; }
.role-dates { color: var(--muted); font-size: 14px; white-space: nowrap; }
.role-org { color: var(--accent); font-weight: 500; margin: 2px 0 8px; }
.role ul { margin: 0; padding-left: 20px; color: var(--muted); }
.role li + li { margin-top: 4px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 48px;
}

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.plain-list li:first-child { padding-top: 0; }
.plain-list strong { display: block; font-weight: 600; }
.plain-list span { color: var(--muted); font-size: 15px; }

/* ---------- Skills ---------- */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.skill-group {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.skill-group h3 { font-size: 15px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.skill-group .tags { margin-top: 12px; }

/* ---------- Contact ---------- */
.contact .lead { margin-top: 0; }

.contact-list { list-style: none; margin: 28px 0 0; padding: 0; }
.contact-list li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.contact-list span { color: var(--muted); font-size: 15px; }
.contact-list a { font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 32px 0 40px;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--line);
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }

  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 16px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 10px 0; font-size: 16px; }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 48px;
    padding-bottom: 48px;
    text-align: center;
  }
  .hero-photo { width: 160px; height: 160px; margin: 0 auto; }
  .lead { margin-left: auto; margin-right: auto; }
  .actions { justify-content: center; }
  .contact .lead { text-align: left; }

  .section { padding-top: 44px; padding-bottom: 44px; }

  .project-gallery { grid-template-columns: 1fr; }
  .project-gallery .tall img { aspect-ratio: 4 / 3; }
  .project-body { padding: 22px 20px 24px; }

  .two-col, .skill-groups { grid-template-columns: 1fr; }
  .contact-list li { grid-template-columns: 1fr; gap: 2px; }
}

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