:root {
  --navy: #16325a;
  --navy-deep: #0e2240;
  --forest: #1f5d3a;
  --forest-deep: #143c26;
  --forest-soft: #d7eadf;
  --navy-soft: #d7e2f0;
  --bg: #eef3ef;
  --bg-2: #e4ece8;
  --bg-elev: #ffffff;
  --ink: #12201a;
  --muted: #4d5c55;
  --line: #c9d6cf;
  --accent: var(--forest);
  --accent-2: var(--navy);
  --accent-soft: var(--forest-soft);
  --shadow: 0 18px 40px rgba(14, 34, 64, 0.10);
  --header-bg: rgba(238, 243, 239, 0.86);
  --footer-bg: #e6eee9;
  --btn-primary-bg: var(--navy);
  --btn-primary-hover: var(--navy-deep);
  --portrait-ring: #ffffff;
  --radius: 18px;
  --font-serif: "Fraunces", "Playfair Display", Georgia, serif;
  --font-sans: "Source Sans 3", "Open Sans", system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: #0f1a16;
  --bg-2: #12241c;
  --bg-elev: #173026;
  --ink: #e8f1eb;
  --muted: #a3b5ab;
  --line: #2a4638;
  --accent: #7dce9e;
  --accent-2: #c9dcff;
  --accent-soft: #1d4a33;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(15, 26, 22, 0.86);
  --footer-bg: #0c1612;
  --btn-primary-bg: #7dce9e;
  --btn-primary-hover: #98dbb3;
  --portrait-ring: #1d3a2d;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 10% -10%, color-mix(in srgb, var(--forest) 18%, transparent) 0%, transparent 55%),
    radial-gradient(800px 380px at 95% 0%, color-mix(in srgb, var(--navy) 16%, transparent) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

a { color: var(--accent-2); }
a:hover { color: var(--accent); }

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  z-index: 20;
}
.skip-link:focus { top: 12px; }

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

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

.header-tools {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  border: 2px solid var(--portrait-ring);
  box-shadow: 0 0 0 1px var(--line);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 600; letter-spacing: 0.01em; }
.brand-sub { font-size: 0.78rem; color: var(--muted); }

.nav { display: flex; gap: 22px; }
.nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
}
.nav a:hover { color: var(--accent); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px 7px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-icon { display: none; line-height: 0; }
[data-theme="light"] .theme-icon-moon { display: block; }
[data-theme="dark"] .theme-icon-sun { display: block; }

.hero { padding: 56px 0 28px; }

.hero-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  align-items: center;
}

.hero-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-portrait img:first-of-type {
  width: 280px;
  height: 280px;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 50%;
  border: 6px solid var(--portrait-ring);
  box-shadow:
    var(--shadow),
    0 0 0 3px var(--forest),
    0 0 0 8px color-mix(in srgb, var(--navy) 35%, transparent);
}

.signature {
  width: min(220px, 80%);
  margin: 16px auto 0;
  filter: contrast(1.05);
}
[data-theme="dark"] .signature {
  filter: invert(1) sepia(0.2) saturate(0.4) brightness(1.15);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--forest);
  margin: 0 0 8px;
}
[data-theme="dark"] .eyebrow { color: var(--accent); }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.15; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin: 0 0 16px; color: var(--navy); }
[data-theme="dark"] h1 { color: #d6e4f7; }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 0 0 10px; }
h3 { font-size: 1.35rem; margin: 0 0 10px; }

.lede {
  font-size: 1.15rem;
  color: var(--ink);
  max-width: 42rem;
  margin: 0 0 24px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--btn-primary-bg);
  color: #fff;
}
[data-theme="dark"] .btn-primary { color: #0f1a16; }
.btn-primary:hover {
  background: var(--btn-primary-hover);
  color: #fff;
}
[data-theme="dark"] .btn-primary:hover { color: #0f1a16; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--bg-elev); color: var(--ink); }

.section-head { max-width: 40rem; margin-bottom: 28px; }
.section-head p { color: var(--muted); margin: 0; }

.projects { padding: 36px 0 20px; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--card-accent, var(--forest));
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.card-domain {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 999px;
}

.card h3 a {
  color: inherit;
  text-decoration: none;
}
.card h3 a:hover { color: var(--accent); }

.card-blurb { margin: 0 0 12px; flex: 1; }
.card-status {
  margin: 0 0 12px;
  font-style: italic;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
}
.card-actions a {
  font-weight: 600;
  text-decoration: none;
  color: var(--accent-2);
}
.card-actions a:hover { text-decoration: underline; }

.about { padding: 48px 0 72px; }
.about p { color: var(--ink); max-width: 42rem; }

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--footer-bg);
  padding: 32px 0 24px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.footer-name { font-family: var(--font-serif); font-size: 1.2rem; margin: 0 0 4px; }
.footer-note { margin: 0; color: var(--muted); }

.social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
}
.social-link:hover { color: var(--accent-2); }
.social-icon { flex-shrink: 0; }

.footer-copy { margin-top: 24px; color: var(--muted); font-size: 0.9rem; }
.footer-copy p { margin: 0; }

@media (max-width: 800px) {
  .hero-grid,
  .project-grid,
  .footer-inner {
    grid-template-columns: 1fr;
    display: grid;
  }
  .hero-grid { justify-items: center; text-align: center; gap: 28px; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .lede { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .nav { display: none; }
  .hero-portrait img:first-of-type { width: 200px; height: 200px; }
  .theme-label { display: none; }
  .theme-toggle { padding: 8px; }
}
