:root {
  --ink: #111318;
  --muted: #5f6673;
  --paper: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #fbfcff;
  --line: #dde3ec;
  --line-strong: #b8c3d1;
  --graphite: #171a21;
  --teal: #0f766e;
  --teal-soft: #e8f6f3;
  --blue: #1d4ed8;
  --rose: #be123c;
  --green: #3f7a1f;
  --white: #ffffff;
  --shadow: 0 22px 60px rgba(17, 19, 24, 0.11);
  --shadow-soft: 0 12px 34px rgba(17, 19, 24, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --container: min(1180px, calc(100% - 40px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: 88px;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-140%);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background: rgba(246, 247, 251, 0.88);
  border-bottom: 1px solid rgba(221, 227, 236, 0.8);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: var(--container);
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--white);
  font-weight: 850;
  letter-spacing: -0.03em;
}

.brand-text {
  display: grid;
}

.brand-text strong {
  font-size: 16px;
  line-height: 1.2;
}

.brand-text span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 650;
}

.nav-links a {
  border-radius: 999px;
  color: var(--muted);
  padding: 9px 12px;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active {
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.nav-links .nav-resume {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
  background: var(--ink);
  color: var(--white);
  padding-inline: 15px;
}

.nav-links .nav-resume:hover,
.nav-links .nav-resume:focus-visible {
  background: var(--teal);
  color: var(--white);
}

/* Hero */

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 82svh;
  padding: 128px 0 64px;
  overflow: hidden;
  background: #101216;
  color: var(--white);
}

#system-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 24%, rgba(15, 118, 110, 0.26), transparent 34%),
    linear-gradient(90deg, rgba(16, 18, 22, 0.96) 0%, rgba(16, 18, 22, 0.78) 48%, rgba(16, 18, 22, 0.4) 100%),
    linear-gradient(0deg, rgba(16, 18, 22, 0.9) 0%, rgba(16, 18, 22, 0) 44%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: var(--container);
  margin: 0 auto;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--teal);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #6ee7d8;
  margin-bottom: 16px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin-bottom: 24px;
  font-size: clamp(44px, 8vw, 82px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

p {
  margin-bottom: 18px;
}

main p {
  text-align: left;
}

.hero-copy {
  max-width: 780px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 19px;
  font-weight: 800;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.button.primary {
  background: var(--white);
  color: var(--ink);
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.11);
  color: var(--white);
}

.button.ghost {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

/* Impact metrics */

.impact-band {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.impact-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  width: var(--container);
  margin: 0 auto;
  padding: 1px;
  background: var(--line);
}

.impact-metrics div {
  min-height: 120px;
  padding: 24px;
  background: var(--surface);
}

.impact-metrics dt {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
}

.impact-metrics dd {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

/* Sections */

.section {
  padding: 98px 0;
}

.section:nth-of-type(odd):not(.hero) {
  background: var(--surface);
}

.section-heading,
.intro-grid,
.principle-grid,
.experience-card,
.project-grid,
.skill-grid,
.education-list,
.contact-wrap,
.site-footer {
  width: var(--container);
  margin-inline: auto;
}

.section-heading {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  margin-bottom: 46px;
}

.section-heading.compact {
  grid-template-columns: 240px minmax(0, 1fr);
}

.section-heading .section-kicker {
  padding-top: 9px;
  white-space: nowrap;
}

.section-heading h2 {
  max-width: 900px;
  text-align: left;
  text-wrap: balance;
}

/* About */

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: 64px;
  align-items: start;
}

.intro-copy {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.75;
}

.intro-copy p:last-child {
  margin-bottom: 0;
}

.focus-list {
  display: grid;
  gap: 14px;
}

.focus-list article,
.principle-grid article,
.experience-card,
.project-card,
.skill-grid section,
.education-list article {
  border-radius: var(--radius);
  background: var(--surface);
}

.focus-list article {
  border: 1px solid var(--line);
  padding: 26px;
  box-shadow: var(--shadow-soft);
}

.focus-list span {
  display: block;
  color: var(--blue);
  font-weight: 850;
  margin-bottom: 14px;
}

.focus-list p,
.principle-grid p,
.project-card p,
.project-card li,
.skill-grid p,
.education-list p,
.contact-wrap p {
  color: var(--muted);
}

/* Principles */

.principles-section {
  background: var(--teal-soft);
}

.principle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.principle-grid article {
  border: 1px solid rgba(15, 118, 110, 0.2);
  padding: 30px;
  box-shadow: var(--shadow-soft);
}

.principle-grid p {
  margin-bottom: 0;
}

/* Experience */

.experience-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
  gap: 44px;
  border: 1px solid var(--line);
  padding: 36px;
  box-shadow: var(--shadow);
}

.experience-meta {
  color: var(--muted);
}

.experience-meta p {
  margin-bottom: 8px;
}

.company {
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.role {
  color: var(--teal);
  font-weight: 900;
  margin-bottom: 16px;
}

.impact-list,
.project-card ul {
  margin: 0;
  padding-left: 20px;
}

.impact-list li,
.project-card li {
  color: var(--muted);
  line-height: 1.65;
}

.impact-list li + li,
.project-card li + li {
  margin-top: 12px;
}

/* Projects */

.projects-section {
  background: #f8fbff;
}

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

.project-card {
  display: flex;
  min-height: 540px;
  flex-direction: column;
  border: 1px solid var(--line);
  padding: 30px;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.project-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 28px;
}

.project-number {
  color: var(--rose);
}

.project-card p {
  line-height: 1.68;
}

.project-card ul {
  margin-top: 8px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 28px;
}

.tag-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--graphite);
  font-size: 13px;
  font-weight: 750;
  padding: 7px 10px;
}

/* Skills */

.skill-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.skill-grid section {
  min-height: 220px;
  border: 1px solid var(--line);
  padding: 27px;
  box-shadow: var(--shadow-soft);
}

.skill-grid h3 {
  color: var(--blue);
}

.skill-grid p {
  margin-bottom: 0;
}

/* Education */

.education-section {
  background: #f5f8f2;
}

.education-list {
  display: grid;
  gap: 14px;
}

.education-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  border: 1px solid rgba(63, 122, 31, 0.2);
  padding: 30px;
  box-shadow: var(--shadow-soft);
}

.education-list h3 {
  margin-bottom: 6px;
}

.education-list p {
  margin-bottom: 0;
}

.education-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.education-meta strong {
  color: var(--green);
}

/* Contact */

.section.contact-section:nth-of-type(odd),
.contact-section {
  background: var(--graphite);
  color: var(--white);
}

.contact-wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.6fr);
  gap: 64px;
  align-items: start;
}

.contact-wrap .section-kicker {
  color: #6ee7d8;
  margin-bottom: 14px;
}

.contact-wrap h2 {
  max-width: 760px;
}

.contact-wrap p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
}

.contact-actions {
  display: grid;
  gap: 11px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.contact-link:hover,
.contact-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(110, 231, 216, 0.68);
  background: rgba(255, 255, 255, 0.11);
  outline: none;
}

.contact-link span:first-child {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(110, 231, 216, 0.16);
  color: #6ee7d8;
  flex: 0 0 auto;
}

.copy-button {
  font-weight: 760;
}

.contact-primary {
  background: var(--white);
  color: var(--ink);
  font-weight: 900;
}

.contact-primary span:first-child {
  background: var(--ink);
  color: var(--white);
}

.contact-text {
  display: grid;
  gap: 2px;
}

.contact-text small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

/* Footer */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--ink);
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  transform: translateY(120%);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--white);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: transform 200ms ease, opacity 200ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive */

@media (max-width: 1000px) {
  .section-heading,
  .section-heading.compact,
  .intro-grid,
  .experience-card,
  .contact-wrap {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .section-heading.compact {
    gap: 12px;
  }

  .section-heading .section-kicker {
    padding-top: 0;
  }

  .project-grid,
  .skill-grid,
  .principle-grid {
    grid-template-columns: 1fr 1fr;
  }

  .project-card {
    min-height: 440px;
  }
}

@media (max-width: 780px) {
  :root {
    --container: min(100% - 28px, 1180px);
  }

  section[id] {
    scroll-margin-top: 76px;
  }

  .nav-shell {
    height: 66px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: fixed;
    inset: 66px 14px auto;
    display: grid;
    gap: 6px;
    max-height: calc(100svh - 82px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 10px;
    box-shadow: var(--shadow);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 46px;
    border-radius: var(--radius-sm);
  }

  .nav-links .nav-resume {
    justify-content: center;
    margin-left: 0;
  }

  .hero {
    min-height: 78svh;
    padding: 106px 0 54px;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(16, 18, 22, 0.96) 0%, rgba(16, 18, 22, 0.78) 100%),
      linear-gradient(0deg, rgba(16, 18, 22, 0.88) 0%, rgba(16, 18, 22, 0) 38%);
  }

  h2 {
    line-height: 1.14;
  }

  .hero-copy,
  .intro-copy {
    font-size: 18px;
  }

  .impact-metrics,
  .project-grid,
  .skill-grid,
  .principle-grid {
    grid-template-columns: 1fr;
  }

  .impact-metrics div {
    min-height: 88px;
  }

  .section {
    padding: 74px 0;
  }

  .section-heading {
    margin-bottom: 34px;
  }

  .experience-card,
  .project-card,
  .skill-grid section,
  .education-list article,
  .principle-grid article,
  .focus-list article {
    padding: 24px;
  }

  .project-card {
    min-height: 0;
  }

  .education-list article,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .education-meta {
    text-align: left;
    white-space: normal;
  }
}

@media (max-width: 460px) {
  .brand-text span {
    display: none;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .button {
    justify-content: center;
  }

  .contact-wrap {
    grid-template-columns: 1fr;
  }

  .contact-link {
    align-items: flex-start;
    overflow-wrap: anywhere;
  }

  .impact-metrics dt {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
  }
}