@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/newsreader-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/newsreader-500-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/source-sans-3-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/source-sans-3-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/source-sans-3-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #f2efe8;
  --bg-elevated: #faf8f4;
  --ink: #1c1a16;
  --muted: #5c564c;
  --brass: #7a4e20;
  --accent: #1c4534;
  --accent-fill: #1c4534;
  --accent-fill-hover: #143528;
  --on-accent: #f7f4ee;
  --line: #ddd6ca;
  --line-strong: #b9b0a2;
  --glow: rgba(28, 69, 52, 0.09);
  --selection: #d5e4da;
  --header: rgba(242, 239, 232, 0.9);
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #131411;
    --bg-elevated: #1c1e1a;
    --ink: #f3efe6;
    --muted: #c8c1b4;
    --brass: #e4c78d;
    --accent: #b7e4cc;
    --accent-fill: #c6ead8;
    --accent-fill-hover: #daf6e8;
    --on-accent: #132019;
    --line: #31352f;
    --line-strong: #5c6154;
    --glow: rgba(183, 228, 204, 0.08);
    --selection: #2c4638;
    --header: rgba(19, 20, 17, 0.9);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.25rem;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 42% at 100% -8%, var(--glow), transparent 55%),
    var(--bg);
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ul,
ol,
dl {
  margin: 0;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
}

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

code {
  font-family: inherit;
  font-weight: 700;
  font-size: 1em;
  white-space: nowrap;
}

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

:focus {
  outline: none;
}

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

main:focus {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-120%);
  z-index: 50;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-weight: 700;
  padding: 0.65rem 1rem;
  border-radius: 0 0 10px 10px;
}

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

.wrap {
  width: min(1080px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header);
  backdrop-filter: blur(16px);
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid var(--line);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem 0.75rem;
  min-height: 4.25rem;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
}

.brand:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.nav {
  margin-left: auto;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.1rem;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  border-radius: 999px;
}

.nav a:hover,
.nav a[aria-current="true"] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.nav-toggle .close-label {
  display: none;
}

.nav-toggle[aria-expanded="true"] .menu-label {
  display: none;
}

.nav-toggle[aria-expanded="true"] .close-label {
  display: inline;
}

.hero .wrap {
  padding-top: 2.15rem;
  padding-bottom: 2.6rem;
}

.spec dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.name {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3rem, 8vw, 5.6rem);
  letter-spacing: -0.035em;
  line-height: 0.92;
  text-wrap: balance;
}

.hero-role {
  display: block;
  margin-top: 1.05rem;
  max-width: 24em;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(1.3rem, 2.3vw, 1.7rem);
  letter-spacing: -0.022em;
  line-height: 1.25;
}

.hero-role .at {
  color: var(--brass);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.45rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.button-primary {
  background: var(--accent-fill);
  color: var(--on-accent);
}

.button-primary:hover {
  background: var(--accent-fill-hover);
}

.button-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

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

.section .wrap {
  border-top: 1px solid var(--line);
  padding-top: 3.25rem;
  padding-bottom: 3.25rem;
}

h2 {
  margin-bottom: 1.15rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
}

h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.lede {
  max-width: 42rem;
  margin-bottom: 1.35rem;
  color: var(--muted);
}

.prose {
  max-width: 68ch;
  font-size: 1.125rem;
  line-height: 1.65;
}

.prose p + p {
  margin-top: 1.1rem;
}

.timeline {
  margin-top: 0.25rem;
}

.timeline > li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
}

.timeline > li:last-child {
  border-bottom: 1px solid var(--line);
}

.when {
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.timeline h3 {
  font-size: 1.45rem;
}

.where {
  margin-top: 0.2rem;
  font-weight: 700;
}

.role-note {
  margin-top: 0.25rem;
  color: var(--muted);
}

.role-list {
  margin-top: 0.8rem;
  max-width: 68ch;
}

.role-list li {
  position: relative;
  padding-left: 1rem;
  margin: 0.45rem 0;
}

.role-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--brass);
}

.work-grid {
  display: grid;
  gap: 0.85rem;
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 100%;
  padding: 1.2rem 1.2rem 1.3rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.work-card h3 {
  font-size: 1.45rem;
  text-wrap: balance;
}

.work-card p {
  line-height: 1.55;
}

.work-link {
  padding-top: 0.15rem;
}

.text-link {
  font-weight: 700;
  text-underline-offset: 0.18em;
}

.text-link:hover {
  text-decoration-thickness: 2px;
}

.patent {
  max-width: 46rem;
  padding: 1.35rem 1.35rem 1.45rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.patent-id {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
}

.patent h3 {
  margin-top: 0.55rem;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  text-wrap: balance;
}

.patent-meta {
  margin-top: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.patent .text-link {
  display: inline-flex;
  margin-top: 0.9rem;
}

.skills {
  display: grid;
  gap: 0.75rem;
}

.skills li {
  padding: 0.95rem 1.05rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-weight: 700;
}

.skills li span {
  display: block;
  margin-top: 0.2rem;
  font-weight: 400;
  color: var(--muted);
}

.spec {
  display: grid;
  border-top: 1px solid var(--line);
}

.spec div {
  padding: 1rem 1rem 1rem 0;
  border-bottom: 1px solid var(--line);
}

.spec dt {
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.spec dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.contact-list {
  display: grid;
  gap: 0.75rem;
}

.contact-list a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 2.75rem;
  padding: 1.05rem 1.15rem;
  color: inherit;
  text-decoration: none;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.contact-list a:hover {
  border-color: var(--accent);
}

.contact-list a:hover .contact-kind {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.contact-kind {
  font-weight: 700;
  font-size: 1.08rem;
}

.contact-url {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.site-footer .wrap {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2.4rem;
}

.footer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.98rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: var(--ink);
  font-weight: 700;
}

@media (min-width: 700px) {
  .wrap {
    width: min(1080px, calc(100% - 3rem));
  }

  .skills {
    grid-template-columns: 1fr 1fr;
  }

  .spec {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .spec div {
    padding-right: 1.5rem;
  }

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

@media (min-width: 800px) {
  .timeline > li {
    grid-template-columns: 12.5rem minmax(0, 1fr);
    gap: 0.4rem 2rem;
    padding: 1.6rem 0;
  }
}

@media (min-width: 980px) {
  .work-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .skills {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .skills li:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 1040px) {
  .header-bar {
    flex-wrap: wrap;
  }

  .brand { order: 1; }
  .nav-toggle { order: 2; margin-left: auto; }
  .nav {
    order: 4;
    width: 100%;
    margin-left: 0;
  }

  .js .nav { display: none; }
  .js .nav.is-open { display: block; }
  .js .nav-toggle { display: inline-flex; }

  .nav ul {
    justify-content: flex-start;
    padding-bottom: 0.4rem;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  body,
  .site-header,
  .work-card,
  .skills li,
  .patent,
  .contact-list a,
  .button,
  .nav-toggle {
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
  }
}

@media print {
  :root {
    --bg: #fff;
    --bg-elevated: #fff;
    --ink: #111;
    --muted: #333;
    --accent: #111;
    --brass: #111;
    --line: #ccc;
    --line-strong: #111;
    --header: #fff;
  }

  .site-header {
    position: static;
  }

  .nav-toggle,
  .skip-link {
    display: none !important;
  }

  .nav {
    display: none !important;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-weight: 400;
    font-size: 0.85em;
  }
}
