:root {
  --paper: #f3f0e8;
  --raised: #fbfaf6;
  --ink: #17202b;
  --muted: #465261;
  --faint: #66717f;
  --line: #d8d2c6;
  --teal: #0d5c56;
  --teal-deep: #084640;
  --copper: #8c4a20;
  --serif: "Source Serif 4", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --header: 4.25rem;
  --max: 72rem;
  --gutter: 1.5rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 0.75rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--teal-deep);
  text-underline-offset: 0.18em;
}

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

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.8rem;
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 30;
  background: transparent;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  height: 100%;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header);
  background: rgba(243, 240, 232, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.2) blur(8px);
}

.header-inner,
.wrap {
  width: min(var(--max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

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

.brand {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

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

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 500;
}

.nav a:hover,
.nav a.is-active {
  color: var(--teal-deep);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.7fr);
  gap: 3.5rem;
  align-items: end;
  padding: 3.5rem 0 2.5rem;
}

.kicker,
.section-index,
.meta,
.role-meta,
.skill dt,
.fact-list,
.year {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kicker {
  margin: 0 0 0.85rem;
  color: var(--teal);
  font-weight: 500;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

h1 {
  margin: 0;
  font-size: clamp(3.2rem, 7vw, 5.4rem);
}

.lead {
  max-width: 40rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.55;
}

.fact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--faint);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #f6f3ec;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
}

.button:hover {
  background: var(--teal-deep);
  border-color: var(--teal-deep);
  color: #f6f3ec;
}

.button.ghost {
  background: transparent;
  color: var(--teal-deep);
}

.button.ghost:hover {
  background: rgba(13, 92, 86, 0.08);
  color: var(--teal-deep);
}

.portrait {
  margin: 0;
}

.portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 18%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.portrait figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.55rem;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.now {
  display: grid;
  grid-template-columns: 9rem 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1rem 0 1.15rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--ink);
}

.now p {
  margin: 0;
}

.now-label {
  color: var(--teal);
}

.status {
  color: var(--copper);
  font-weight: 500;
}

.section {
  padding: 4.25rem 0 0.5rem;
}

.section-head {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 1.75rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.section-index {
  color: var(--teal);
  font-weight: 500;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.7rem);
}

.section-intro {
  max-width: 42rem;
  margin: -0.6rem 0 1.75rem 5.5rem;
  color: var(--muted);
}

.role + .role {
  margin-top: 2.4rem;
  padding-top: 2.4rem;
  border-top: 1px solid var(--line);
}

.role-top {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 1.5rem;
}

.role-meta {
  margin: 0.35rem 0 0;
  color: var(--faint);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

h3 {
  margin: 0;
  font-size: 1.7rem;
}

.role-title {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.role ul {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.role li {
  position: relative;
  padding-left: 1.1rem;
  margin: 0.7rem 0 0;
  color: var(--ink);
}

.role li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.38rem;
  height: 1px;
  background: var(--teal);
}

.project {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  padding: 1.4rem 0 0.4rem;
  border-top: 1px solid var(--ink);
}

.project h3 {
  font-size: 1.85rem;
}

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

.project h3 a:hover {
  color: var(--teal-deep);
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

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

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.stack li {
  border: 1px solid var(--line);
  background: var(--raised);
  padding: 0.22rem 0.5rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.annotation {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.annotation h3 {
  font-size: 1.55rem;
}

.skills {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2.5rem;
}

.skills div {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 0.8rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.skills dt {
  margin: 0;
  color: var(--teal);
  font-weight: 500;
  padding-top: 0.2rem;
}

.skills dd {
  margin: 0;
}

.background {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.background h3 {
  margin: 0 0 0.9rem;
  font-size: 1.35rem;
}

.background ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.background li + li {
  margin-top: 1rem;
}

.background p {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.contact-email {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.contact-email a {
  color: var(--ink);
  text-decoration-thickness: 1px;
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem 1.5rem;
  margin: 1.6rem 0 0;
  padding: 1.2rem 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.contact-list span {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.contact-list a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.contact-list a:hover {
  color: var(--teal-deep);
  text-decoration: underline;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  padding: 1.2rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 860px) {
  .hero,
  .role-top,
  .project,
  .background,
  .skills,
  .contact-list,
  .now {
    grid-template-columns: 1fr;
  }

  .section-intro {
    margin-left: 0;
  }

  .section-head {
    grid-template-columns: 3rem 1fr;
  }

  .portrait {
    max-width: 22rem;
  }

  .now {
    gap: 0.25rem;
  }

  .skills div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

@media (max-width: 720px) {
  :root {
    --gutter: 1.15rem;
  }

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

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.35rem var(--gutter) 0.8rem;
    background: var(--raised);
    border-bottom: 1px solid var(--line);
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.75rem 0;
    border-top: 1px solid var(--line);
  }

  .hero {
    padding-top: 2.2rem;
    gap: 1.8rem;
  }

  h1 {
    font-size: 3rem;
  }

  .site-footer {
    flex-direction: column;
  }
}

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

  .scroll-progress {
    display: none;
  }
}

@media print {
  .site-header,
  .scroll-progress,
  .actions,
  .nav-toggle {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

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