:root {
  color-scheme: light;
  --dark: #242620;
  --dark-rule: #4b4d43;
  --light: #faf9f2;
  --paper: #f9f8f1;
  --paper-alt: #f0efe5;
  --ink: #262820;
  --muted: #53554a;
  --rule: #d5d5c6;
  --rule-strong: #a8aa96;
  --outline: #b8baaa;
  --lime: #e3ef9a;
  --header-height: 76px;
  --mono: 'Cascadia Mono', 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #1b1d18;
  --paper-alt: #252820;
  --ink: #f1f2e8;
  --muted: #c6c9b9;
  --rule: #414638;
  --rule-strong: #69715e;
  --outline: #626a55;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.65 var(--sans);
}

h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { font-family: var(--mono); }
ul { padding: 0; }
a { color: inherit; text-underline-offset: .2em; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }

.shell { width: min(1120px, 100% - 104px); margin-inline: auto; }

.skip-link {
  position: fixed;
  z-index: 2;
  inset: 10px auto auto 10px;
  padding: 8px 16px;
  background: var(--lime);
  color: var(--dark);
  transform: translateY(-150%);
}

.skip-link:focus { transform: none; }

.site-header, .hero, .contact, .site-footer { background: var(--dark); color: var(--light); }
.site-header {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--dark-rule);
}

.header-inner, .footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.header-inner { min-height: var(--header-height); padding-block: 12px; }

.brand {
  margin-inline-end: auto;
  border: 1px solid #a7a999;
  padding: 4px 10px;
  font: 700 1.15rem/1.5 var(--mono);
  text-decoration: none;
}

.brand span, .hero h1 span { color: var(--lime); }
.brand:hover { border-color: var(--lime); }

.navigation { display: flex; flex-wrap: wrap; align-items: center; gap: 6px clamp(12px, 2.6vw, 36px); }
.navigation a, .site-footer { font: .875rem/1.5 var(--mono); }
.navigation a { padding-block: 9px; text-decoration: none; }
.navigation a:hover, .site-footer a:hover { color: var(--lime); }
.nav-contact span { color: var(--lime); }

.theme-toggle:not([hidden]) {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #878a79;
  background: transparent;
  color: var(--light);
  font: 1.25rem/1 'Segoe UI Symbol', var(--sans);
  cursor: pointer;
}

.theme-toggle:hover { border-color: var(--lime); color: var(--lime); }
.theme-toggle[aria-pressed='true'] { background: var(--lime); border-color: var(--lime); color: var(--dark); }
.theme-toggle[aria-pressed='true']:hover { background: #f1f7bf; }
.theme-toggle:focus-visible { outline-color: var(--light); }
.theme-toggle[aria-pressed='false'] .theme-sun,
.theme-toggle[aria-pressed='true'] .theme-moon { display: none; }

.hero {
  position: relative;
  isolation: isolate;
  border-bottom: 4px solid var(--lime);
}

.hero-grid {
  --grid-spacing: 18px;
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .65;
  mask-image: linear-gradient(to right, #0007, #0009 46%, #000 78%);
}

.hero-grid:not(.is-animated) {
  background-image: radial-gradient(circle, #747b58 1px, transparent 1.5px);
  background-size: var(--grid-spacing) var(--grid-spacing);
}

.hero-grid canvas { display: none; }
.hero-grid.is-animated canvas { display: block; width: 100%; height: 100%; }

.hero-inner {
  min-height: 490px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 410px);
  align-items: center;
  gap: 42px;
  padding-block: 66px 72px;
}

.location {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  color: #d9dbcd;
  font: .81rem/1.55 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}

.location span { width: 8px; height: 8px; background: var(--lime); border-radius: 50%; }

.hero h1 {
  font-size: clamp(3rem, 6.45vw, 6rem);
  font-weight: 750;
  line-height: 1.04;
  letter-spacing: -.075em;
}

.hero-role {
  margin-top: 18px;
  color: var(--lime);
  font: 600 clamp(1.12rem, 2.1vw, 1.55rem)/1.4 var(--mono);
  letter-spacing: -.035em;
}

.hero-intro { max-width: 46ch; margin-top: 18px; color: #dedfd2; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 13px 20px; margin-top: 30px; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  min-height: 48px;
  padding: 10px 15px;
  border: 1px solid transparent;
  text-decoration: none;
  font: 700 .875rem/1.4 var(--mono);
}

.button-primary { background: var(--lime); color: var(--dark); }
.button-primary:hover { background: #f1f7bf; }
.button-primary:focus-visible { outline-color: var(--light); }
.button-quiet { color: var(--light); border-color: #878a79; }
.button-quiet:hover { border-color: var(--lime); color: var(--lime); }
.button span, .text-link span { font-size: 1.1em; }

.hero-art {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1.17;
  max-height: 350px;
}

.art-frame {
  width: 77%;
  height: 76%;
  border: 1px solid #666b53;
  position: relative;
  display: grid;
  place-items: center;
}

.frame-corner, .art-plus { position: absolute; color: var(--lime); }
.frame-corner { width: 19px; height: 19px; border: 0 solid currentColor; }
.frame-top { inset: -1px auto auto -1px; border-width: 1px 0 0 1px; }
.frame-bottom { inset: auto -1px -1px auto; border-width: 0 1px 1px 0; }
.art-plus { font: 1.1rem/1 var(--mono); }
.art-plus-top { inset: 8px 9px auto auto; }
.art-plus-bottom { inset: auto auto 8px 9px; }

.sheet {
  display: grid;
  position: absolute;
  width: 53%;
  height: 49%;
  border: 2px solid #20231a;
  color: #272b20;
  box-shadow: 5px 5px #20231a;
}

.sheet-research { background: #a5aa86; transform: translate(29%, -40%) rotate(16deg); }
.sheet-operations { background: #f8f6e9; transform: translate(-11%, 39%) rotate(12deg); }
.sheet-people { background: var(--lime); transform: translate(-17%, -9%) rotate(-12deg); grid-template-columns: 1fr 1fr; align-items: center; }

.sheet-bars { display: flex; align-items: end; justify-content: center; gap: 8%; margin: 18% 16%; }
.sheet-bars i { width: 14%; background: currentColor; }
.sheet-bars i:nth-child(1) { height: 28%; }
.sheet-bars i:nth-child(2) { height: 64%; }
.sheet-bars i:nth-child(3) { height: 47%; }
.sheet-bars i:nth-child(4) { height: 93%; }

.sheet-rows { align-self: end; display: grid; gap: 8px; margin: 12% 15%; }
.sheet-rows i { display: block; height: 2px; background: currentColor; }
.sheet-rows i:last-child { width: 64%; }

.sheet-grid { width: 62%; aspect-ratio: 1; justify-self: end; display: grid; grid-template-columns: 1fr 1fr; gap: 10%; }
.sheet-grid i { border: 1px solid currentColor; }
.sheet-grid i:first-child, .sheet-grid i:last-child { background: currentColor; }
.sheet-arrow { justify-self: center; font: 2rem/1 var(--mono); }

.section { padding-block: clamp(48px, 6vw, 86px); scroll-margin-top: 12px; }
.section-alternate { background: var(--paper-alt); border-block: 1px solid var(--rule); }

.section-layout {
  display: grid;
  grid-template-columns: minmax(170px, .36fr) minmax(0, 1fr);
  gap: clamp(24px, 5.4vw, 76px);
}

.section h2 { font-size: clamp(1.75rem, 3vw, 2.65rem); font-weight: 700; letter-spacing: -.065em; line-height: 1.17; }
.section h3 { font-size: 1.16rem; letter-spacing: -.035em; line-height: 1.35; }
.section-content > p, .experience-item > p, .publication > p, .education-list p { max-width: 68ch; color: var(--muted); }
.section-content .lead { font-size: 1.2rem; font-weight: 620; color: var(--ink); margin-bottom: 8px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 19px;
  list-style: none;
}

.tags li { padding: 5px 10px; border: 1px solid var(--outline); font: .8rem/1.5 var(--mono); }
.experience-list, .education-list { list-style: none; }
.experience-item { border-top: 1px solid var(--rule); padding-block: 20px; }
.experience-item:first-child { border-top-color: var(--rule-strong); }

.role-header { display: flex; align-items: start; justify-content: space-between; gap: 6px 20px; }
.company { margin-bottom: 3px; font-size: .88rem; font-weight: 700; }
.date, .publication .publication-label { color: var(--muted); font: .8rem/1.5 var(--mono); }
.role-header > .date { flex-shrink: 0; margin-top: 3px; }
.experience-item > p { margin-top: 8px; }

.more-experience { border-top: 1px solid var(--rule); }
.more-experience summary { width: fit-content; padding-block: 12px; cursor: pointer; font: 700 .9rem/1.5 var(--mono); }
.more-experience summary:hover { text-decoration: underline; text-underline-offset: .2em; }
.more-experience .experience-item:last-child { padding-bottom: 0; }

.publication-list { display: grid; gap: 14px; }
.publication { padding: clamp(18px, 2.5vw, 28px); border: 1px solid var(--outline); }
.publication .publication-label { margin-bottom: 8px; }
.publication h3 { max-width: 52ch; }
.publication h3 + p { margin-top: 8px; }
.text-link { display: inline-block; margin-top: 12px; font: 700 .86rem/1.55 var(--mono); }
.text-link:hover { text-decoration-thickness: 2px; }
:root[data-theme='dark'] .text-link { color: var(--lime); }

.education-list { display: grid; gap: 18px; }
.education-list p { margin-top: 4px; }
.credentials-title { margin-top: 30px; }
.credentials-title + .tags { margin-top: 11px; }

.contact .section-content > p { color: #dedfd2; }
.contact .section-content .lead { color: var(--light); }
.contact .button { margin-top: 20px; }
.site-footer { border-top: 1px solid var(--dark-rule); color: #dedfd2; }
.footer-inner { padding-block: 18px; }

@media (max-width: 920px) {
  .shell { width: calc(100% - 64px); }
  .hero-inner { min-height: 440px; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; }
}

@media (max-width: 690px) {
  :root { --header-height: 64px; }
  .shell { width: calc(100% - 40px); }
  .navigation { gap: 4px 10px; }
  .navigation a { font-size: .78rem; }
  .hero-grid { mask-image: linear-gradient(to bottom, #0008 45%, #000); }
  .hero-inner { min-height: auto; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 46px 36px; }
  .hero h1 { font-size: clamp(2.85rem, 10.6vw, 4.5rem); }
  .hero-art { width: min(100%, 400px); height: clamp(172px, 54vw, 250px); justify-self: center; }
  .art-frame { width: min(73%, 265px); }
  .section-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 540px) {
  :root { --header-height: 98px; }
  .header-inner { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; }
  .navigation { grid-area: 2 / 1 / 3 / -1; justify-content: space-between; column-gap: clamp(4px, 1.3vw, 10px); }
  .navigation a { padding-block: 5px; }
  .theme-toggle { grid-area: 1 / 2; }
}

@media (max-width: 460px) {
  .role-header { flex-direction: column; }
  .role-header > .date { margin-top: 0; }
}

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