:root {
  --paper: #f4f1ea;
  --paper-deep: #ebe7de;
  --ink: #17191d;
  --navy: #11233f;
  --navy-soft: #1b3153;
  --slate: #5d6670;
  --rule: #d7d2c8;
  --entry-rule: #cbc5ba;
  --body-copy: #4d555e;
  --prose: #48515a;
  --entry-copy: #525a61;
  --button-ink: #fffdf8;
  --contact-bg: #11233f;
  --contact-ink: #fffdf8;
  --shell: min(1180px, calc(100% - 64px));
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #0f141b;
  --paper-deep: #151c25;
  --ink: #f1eee7;
  --navy: #9db7d8;
  --navy-soft: #c1d0e2;
  --slate: #a5afb9;
  --rule: #333d48;
  --entry-rule: #3a4551;
  --body-copy: #c2c8ce;
  --prose: #bcc3c9;
  --entry-copy: #b9c1c8;
  --button-ink: #0f141b;
  --contact-bg: #0a1a31;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #0f141b;
    --paper-deep: #151c25;
    --ink: #f1eee7;
    --navy: #9db7d8;
    --navy-soft: #c1d0e2;
    --slate: #a5afb9;
    --rule: #333d48;
    --entry-rule: #3a4551;
    --body-copy: #c2c8ce;
    --prose: #bcc3c9;
    --entry-copy: #b9c1c8;
    --button-ink: #0f141b;
    --contact-bg: #0a1a31;
    color-scheme: dark;
  }
}

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

html {
  background: var(--paper);
  color: var(--ink);
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--navy);
  color: var(--button-ink);
}

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

button {
  color: inherit;
  font: inherit;
}

img,
svg {
  display: block;
}

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

h1,
h2 {
  font-family: var(--serif);
  font-weight: 500;
  text-wrap: balance;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-160%);
  background: var(--navy);
  color: var(--button-ink);
  font-size: 0.875rem;
}

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

:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 4px;
}

main:focus {
  outline: none;
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(24px, 4vw, 48px);
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

:root[data-theme="dark"] .brand-mark {
  filter: brightness(0) invert(1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .brand-mark {
    filter: brightness(0) invert(1);
  }
}

.nav-links,
.nav-controls {
  display: flex;
  align-items: center;
}

.nav-links {
  justify-content: flex-end;
  gap: clamp(20px, 3vw, 38px);
  color: var(--body-copy);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.nav-links a::after {
  position: absolute;
  right: 0;
  bottom: 8px;
  left: 0;
  height: 1px;
  content: "";
  background: var(--navy);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 160ms ease;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-controls {
  gap: 8px;
}

.nav-linkedin,
.language-link,
.theme-trigger {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  background: transparent;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.nav-linkedin,
.theme-trigger {
  border-radius: 50%;
}

.nav-linkedin {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: lowercase;
}

.language-link {
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.theme-trigger {
  padding: 0;
  cursor: pointer;
}

.nav-linkedin:hover,
.language-link:hover,
.theme-trigger:hover {
  border-color: var(--slate);
  background: var(--paper-deep);
}

.theme-icon {
  width: 16px;
  height: 16px;
}
.theme-icon-light,
.theme-icon-dark {
  display: none;
}

:root[data-theme] .theme-icon-auto {
  display: none;
}

:root[data-theme="light"] .theme-icon-light,
:root[data-theme="dark"] .theme-icon-dark {
  display: block;
}

.hero {
  position: relative;
  display: grid;
  min-height: calc(100svh - 72px);
  padding-top: clamp(80px, 12vh, 146px);
  padding-bottom: clamp(80px, 10vh, 120px);
}

.hero::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: clamp(-32px, -3vw, -18px);
  width: 1px;
  content: "";
  background: var(--rule);
}

.hero-content {
  align-self: center;
  max-width: 980px;
}

.hero-role {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: clamp(30px, 4vw, 46px);
}

.hero-role-title,
.hero-role-context {
  margin: 0;
}

.hero-role-title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.025em;
}

.hero-role-context {
  padding-left: 16px;
  border-left: 1px solid var(--rule);
  color: var(--slate);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.035em;
}

h1 {
  max-width: 940px;
  margin-bottom: 34px;
  font-size: clamp(3.2rem, 7.5vw, 6.75rem);
  line-height: 0.98;
  letter-spacing: -0.052em;
}

.hero-copy {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--body-copy);
  font-size: clamp(1.05rem, 1.7vw, 1.28rem);
  line-height: 1.65;
}

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

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 13px 19px;
  border: 1px solid var(--navy);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.025em;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

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

.button-primary:hover {
  background: var(--navy-soft);
  transform: translateY(-1px);
}

.button-secondary {
  background: transparent;
  color: var(--navy);
}

.button-secondary:hover {
  background: var(--navy);
  color: var(--button-ink);
}

.link-arrow {
  font-size: 1rem;
  line-height: 1;
}

.section {
  border-top: 1px solid var(--rule);
  scroll-margin-top: 72px;
}

.section-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(48px, 8vw, 128px);
  padding-block: clamp(84px, 10vw, 136px);
}

.section-label {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding-top: 9px;
  color: var(--slate);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.section-number {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.section-body,
.contact-content {
  min-width: 0;
}

.section-body h2 {
  max-width: 760px;
  margin-bottom: clamp(38px, 5vw, 66px);
  font-size: clamp(2.2rem, 4.2vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.section--education {
  background: var(--paper-deep);
}

.entry-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--entry-rule);
}

.entry {
  display: grid;
  align-items: start;
  gap: clamp(28px, 4vw, 56px);
  padding-block: 34px 38px;
  border-bottom: 1px solid var(--entry-rule);
}

.entry--work {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-block: clamp(34px, 4vw, 48px);
}

.entry--education {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
}

.entry-index {
  padding-top: 2px;
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.entry h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.25vw, 1.8rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.025em;
}

.entry--work h3 {
  max-width: 640px;
  font-size: clamp(1.55rem, 2.7vw, 2.2rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.entry-organization {
  margin: 13px 0 0;
  color: var(--entry-copy);
  font-size: 0.94rem;
  line-height: 1.55;
}

.entry--work .entry-organization {
  margin-top: 13px;
  font-size: 0.94rem;
}

.entry-detail {
  margin: 0;
  color: var(--slate);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.55;
  letter-spacing: 0.035em;
}

.entry-main .entry-detail {
  margin-top: 17px;
}

.entry--work > .entry-detail {
  padding-top: 6px;
  text-align: right;
}

.contact {
  background: var(--contact-bg);
  color: var(--contact-ink);
  scroll-margin-top: 72px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(48px, 8vw, 128px);
  padding-block: clamp(88px, 12vw, 150px);
}

.contact-kicker {
  color: #fffdf8b8;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.contact-content h2 {
  max-width: 720px;
  margin-bottom: 28px;
  font-size: clamp(3rem, 6.8vw, 6.25rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.contact-content > p {
  max-width: 650px;
  margin-bottom: 42px;
  color: #fffdf8c7;
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.75;
}

.contact-actions a {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border: 1px solid #fffdf866;
  font-size: 0.82rem;
  font-weight: 650;
  transition: color 160ms ease, background-color 160ms ease;
}

.contact-actions a:hover {
  background: var(--contact-ink);
  color: var(--contact-bg);
}

.contact a:focus-visible,
.footer a:focus-visible {
  outline-color: var(--contact-ink);
}

.footer {
  padding: 27px 0;
  border-top: 1px solid #f4f1ea2e;
  background: var(--contact-bg);
  color: #fffdf8ad;
}

.footer-row,
.footer-meta {
  display: flex;
  align-items: center;
}

.footer-row {
  justify-content: space-between;
  gap: 30px;
}

.footer p,
.footer-meta {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.footer-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 24px;
}

.footer a {
  color: #fffdf8e0;
}

.footer a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.not-found-page {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100svh;
}

.not-found-page .site-header {
  position: static;
}

.not-found-main {
  display: grid;
  align-items: center;
  padding-block: 64px 96px;
}

.not-found-content {
  max-width: 720px;
}

.not-found-code {
  margin-bottom: 24px;
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.not-found-content h1 {
  margin-bottom: 28px;
  font-size: clamp(3.4rem, 8vw, 6.8rem);
}

.not-found-content > p:not(.not-found-code) {
  max-width: 520px;
  margin-bottom: 36px;
  color: var(--body-copy);
  font-size: 1.05rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (max-width: 880px) {
  :root {
    --shell: min(100% - 48px, 720px);
  }

  .section-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 46px;
  }

  .section-label {
    padding-top: 0;
  }

  .entry--education {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 22px;
  }
}

@media (max-width: 680px) {
  :root {
    --shell: calc(100% - 36px);
  }

  html {
    scroll-padding-top: 104px;
  }

  .nav {
    grid-template-columns: 1fr auto;
    gap: 0 14px;
    min-height: 96px;
    padding-top: 8px;
  }

  .brand {
    gap: 8px;
    font-size: 0.98rem;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .nav-links {
    grid-area: 2 / 1 / auto / -1;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    margin-top: 7px;
    border-top: 1px solid var(--rule);
    font-size: 0.65rem;
    letter-spacing: 0.055em;
  }

  .nav-links a {
    min-height: 40px;
  }

  .nav-links a::after {
    bottom: 4px;
  }

  .nav-controls {
    grid-area: 1 / 2;
  }

  .nav-linkedin,
  .language-link,
  .theme-trigger {
    width: 40px;
    height: 40px;
  }

  .hero {
    min-height: auto;
    padding-top: 62px;
    padding-bottom: 68px;
  }

  .hero::before {
    display: none;
  }

  .hero-role {
    display: grid;
    gap: 7px;
    margin-bottom: 24px;
  }

  .hero-role-context {
    padding-left: 0;
    border-left: 0;
  }

  h1 {
    margin-bottom: 24px;
    font-size: clamp(2.5rem, 12.4vw, 3.8rem);
  }

  .hero-copy {
    font-size: 1rem;
  }

  .button {
    width: 100%;
  }

  .section,
  .contact {
    scroll-margin-top: 96px;
  }

  .section-grid {
    gap: 28px;
    padding-block: 68px;
  }

  .section-body h2 {
    margin-bottom: 28px;
  }

  .entry {
    gap: 22px;
  }

  .entry--work {
    grid-template-columns: 1fr;
    padding-block: 30px 34px;
  }

  .entry--work > .entry-detail {
    padding-top: 0;
    text-align: left;
  }

  .entry--education {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px 14px;
    padding-block: 28px 30px;
  }

  .contact-grid {
    gap: 36px;
    padding-block: 68px;
  }

  .contact-actions a {
    width: 100%;
    justify-content: space-between;
  }

  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-meta {
    justify-content: flex-start;
    gap: 12px 20px;
  }

  .not-found-content .button {
    width: auto;
  }
}

@media (max-width: 360px) {
  .nav-linkedin {
    display: none;
  }

  .nav-links {
    gap: 12px;
  }
}

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

@media (forced-colors: active) {
  .button,
  .contact-actions a,
  .nav-linkedin,
  .language-link,
  .theme-trigger {
    border: 1px solid ButtonText;
  }
}
