:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b111c;
  --bg-2: #121a2b;
  --ink: #eee6d8;
  --muted: #9aa4b8;
  --gold: #e4b76a;
  --gold-soft: rgba(228, 183, 106, 0.16);
  --sea: #7eb8d4;
  --line: rgba(238, 230, 216, 0.1);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(11, 17, 28, 0.72);
  --nav-bg: #10182a;
  --link-hover: #f3d39a;
  --btn-ink: #1a1408;
  --tag-ink: #f0d7a6;
  --glow-1: rgba(228, 183, 106, 0.14);
  --glow-2: rgba(126, 184, 212, 0.1);
  --card-shine: rgba(255, 255, 255, 0.02);
  --serif: "Fraunces", "Times New Roman", serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --wrap: 1080px;
  --radius: 22px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4efe6;
  --bg-2: #fffdf8;
  --ink: #1c2434;
  --muted: #5a6476;
  --gold: #8d5f1c;
  --gold-soft: rgba(141, 95, 28, 0.12);
  --sea: #3d7a94;
  --line: rgba(28, 36, 52, 0.1);
  --shadow: 0 18px 40px rgba(28, 36, 52, 0.08);
  --header-bg: rgba(244, 239, 230, 0.84);
  --nav-bg: #fffdf8;
  --link-hover: #6d4814;
  --btn-ink: #1a1408;
  --tag-ink: #6d4814;
  --glow-1: rgba(228, 183, 106, 0.28);
  --glow-2: rgba(126, 184, 212, 0.16);
  --card-shine: rgba(255, 255, 255, 0.7);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

html, body { overflow-x: hidden; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 380;
  line-height: 1.6;
  background:
    radial-gradient(900px 480px at 85% -8%, var(--glow-1), transparent 55%),
    radial-gradient(700px 420px at -8% 18%, var(--glow-2), transparent 50%),
    var(--bg);
}

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

a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--link-hover); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.4em;
}

h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--gold);
  color: #1a1408;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
}

.skip-link:focus { top: 1rem; }

.wrap {
  width: min(var(--wrap), calc(100% - 2.4rem));
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lede {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 38rem;
  overflow-wrap: break-word;
}

.resume-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1em;
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 42rem;
}

.resume-meta li {
  white-space: nowrap;
}

.resume-meta li:not(:last-child)::after {
  content: "·";
  margin: 0 0.6rem;
  color: var(--muted);
}

.resume-meta a {
  color: inherit;
  text-decoration: none;
}

.resume-meta a:hover { color: var(--gold); }

.aside {
  margin-top: 1.8rem;
  color: var(--muted);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 1rem;
}

.wordmark {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.15rem;
  margin-right: auto;
}

.wordmark:hover { color: var(--gold); }

.site-nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  box-shadow: inset 0 -1px 0 var(--gold);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.theme-toggle,
.nav-toggle {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle {
  display: grid;
  place-items: center;
  padding: 0;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

html[data-theme="dark"] .icon-moon,
html[data-theme="light"] .icon-sun {
  display: none;
}

.nav-toggle {
  display: none;
  padding: 12px 10px;
}

.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--ink);
  margin: 6px 0;
  transition: transform 0.2s ease;
}

/* Hero */
.hero {
  padding: 4.5rem 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-grid > *,
.split > *,
.project-grid > * {
  min-width: 0;
}

.hero-copy h1 { margin-bottom: 0.5rem; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.6rem 0 1.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--gold);
  color: var(--btn-ink);
}

.btn-primary:hover { background: var(--link-hover); color: var(--btn-ink); }

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.hero-photo {
  margin: 0;
  position: relative;
}

.hero-photo::after {
  content: "";
  position: absolute;
  inset: 18px -16px -16px 18px;
  border: 1px solid var(--gold-soft);
  border-radius: 28px;
  z-index: -1;
}

.hero-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 18%;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

/* Social */
.social-row {
  display: flex;
  gap: 0.65rem;
}

.social-row a {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
}

.social-row a:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.social-row svg {
  width: 17px;
  height: 17px;
}

.social-row--compact a {
  width: 36px;
  height: 36px;
}

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

.section-lead {
  color: var(--muted);
  max-width: 40rem;
  margin-bottom: 2rem;
}

.split {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 3rem;
}

.prose { color: var(--muted); font-size: 1.05rem; }
.prose a { color: var(--ink); }
.prose a:hover { color: var(--gold); }

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 2.6rem;
}

.facts div {
  padding: 1.1rem 1rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.facts strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
}

.facts span {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.project-card {
  padding: 1.4rem 1.35rem 1.25rem;
  background: linear-gradient(180deg, var(--card-shine), transparent 40%), var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.project-card:hover { border-color: var(--gold); }

.project-meta {
  margin: 0 0 0.55rem;
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.project-card p { color: var(--muted); }

.project-card h3 a {
  color: inherit;
  text-decoration: none;
}

.project-card h3 a:hover { color: var(--gold); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.tags li {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--tag-ink);
  font-size: 0.78rem;
}

/* Experience */
.timeline {
  display: grid;
  gap: 2rem;
  margin-top: 1.8rem;
}

.job {
  padding-left: 1.2rem;
  border-left: 1px solid var(--line);
}

.job-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.8rem;
}

.job-head h3 { margin: 0; }

.job-head h3 a {
  color: inherit;
  text-decoration: none;
}

.job-head h3 a:hover { color: var(--gold); }

.job-note {
  color: var(--muted);
  margin: -0.3rem 0 0.9rem;
}

.job-place,
.dates {
  color: var(--muted);
  margin: 0;
  font-size: 0.92rem;
}

.role + .role { margin-top: 1.2rem; }

.role-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.role h4 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 560;
  margin: 0 0 0.45rem;
}

.role h4 span {
  display: block;
  color: var(--gold);
  font-weight: 450;
  font-size: 0.92rem;
  margin-top: 0.15rem;
}

.role ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.role li + li { margin-top: 0.35rem; }

/* Skills */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem 1rem;
  margin-top: 1.5rem;
}

.skill-groups h3 {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

/* Contact */
.contact { padding-bottom: 5rem; }

.contact-card {
  padding: clamp(1.8rem, 4vw, 3rem);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 28px;
}

.contact-card .lede,
.contact-card > p { color: var(--muted); max-width: 36rem; }

.contact-lines {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 1.4rem 0 1.5rem;
}

.contact-lines a {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.15rem;
}

.contact-lines a:hover { color: var(--gold); }

.contact-lines svg {
  width: 20px;
  height: 20px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.3rem 0 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Inner pages */
.page { padding: 3.2rem 0 5rem; }

.page-head { margin-bottom: 2.4rem; }

.resume-block { margin-bottom: 2.6rem; }

.resume-block h2,
.resume-split h2 {
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
}

.resume-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.6rem;
}

.edu-title { margin-bottom: 0.2rem; }

.plain-list {
  padding-left: 1.1rem;
  color: var(--muted);
}

.plain-list a { color: var(--ink); }

/* Older leftover pages */
.post-header,
.post-content,
.paginate {
  width: min(var(--wrap), calc(100% - 2.4rem));
  margin: 2rem auto;
  color: var(--muted);
}

@media (max-width: 860px) {
  .hero-grid,
  .split,
  .facts,
  .project-grid,
  .skill-groups,
  .resume-split,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .hero { padding-top: 2.2rem; }
  .hero-grid { gap: 2rem; }
  .hero-photo {
    order: -1;
    max-width: 280px;
    margin: 0 auto;
  }
  .hero-copy { text-align: center; width: 100%; }
  .hero-copy .lede {
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
  }
  .hero-actions, .hero-copy .social-row { justify-content: center; }
  .hero-photo::after { display: none; }

  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 68px;
    padding: 1rem 1.2rem 1.3rem;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
  }

  body.nav-open .site-nav { display: flex; }

  body.nav-open .nav-toggle span:first-of-type {
    transform: translateY(3.75px) rotate(45deg);
  }

  body.nav-open .nav-toggle span:last-of-type {
    transform: translateY(-3.75px) rotate(-45deg);
  }

  .role-meta,
  .job-head {
    flex-direction: column;
    gap: 0.2rem;
  }

  .facts { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .site-header,
  .site-footer,
  .hero-actions,
  .nav-toggle,
  .theme-toggle { display: none !important; }
  body { background: #fff; color: #111; }
  .page { padding: 0; }
}
