@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/space-grotesk-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #101115;
  --ink: #f0eff6;
  --muted: #b7b6c8;
  --surface: #181920;
  --surface-raised: #1d1e27;
  --line: #363744;
  --accent: #c3b6ff;
  --accent-strong: #b7a5fa;
  --accent-wash: #242135;
  --header: 61px;
  --mono: ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 22px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.65 "Space Grotesk", system-ui, sans-serif;
}
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
h1, h2, h3, h4 { line-height: 1.08; font-weight: 700; letter-spacing: -.042em; }
h2 { font-size: clamp(2rem, 3.5vw, 3.25rem); }
h3 { font-size: clamp(1.25rem, 2.25vw, 1.68rem); }
a { color: inherit; text-underline-offset: .23em; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.shell { width: min(1190px, calc(100% - 76px)); margin-inline: auto; }
.section { padding-block: 51px; }
.icon { flex: 0 0 auto; width: 1em; height: 1em; vertical-align: -.1em; }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  padding: .6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(calc(-100% - 20px));
}
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header);
  gap: 1rem;
}
.brand {
  flex: none;
  padding-block: .4rem;
  font-size: 1.31rem;
  font-weight: 700;
  letter-spacing: -.09em;
  text-decoration: none;
}
.brand span { color: var(--accent); }
.nav-links, .stack, .breadcrumbs ol, .study-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem 1.33rem; }
.nav-links a {
  display: block;
  padding: .68rem .08rem;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
}
.nav-links a:hover, .nav-links a[aria-current] { color: var(--accent); }
.nav-links a[aria-current] { box-shadow: inset 0 -2px var(--accent); }
.nav-toggle {
  display: none;
  min-height: 40px;
  padding-inline: .8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(165px, 250px);
  align-items: center;
  gap: clamp(30px, 7vw, 100px);
  padding-block: clamp(34px, 5vw, 65px) clamp(36px, 5.4vw, 70px);
}
.role, .project-status {
  color: var(--accent);
  font-family: var(--mono);
  font-size: .79rem;
  font-weight: 650;
  letter-spacing: .018em;
  line-height: 1.55;
}
.role { font-size: clamp(.85rem, 1.55vw, 1rem); }
.hero h1 {
  margin-block: .6rem .77rem;
  max-width: 19ch;
  font-size: clamp(2.65rem, 5.3vw, 4.35rem);
  line-height: 1.02;
  letter-spacing: -.065em;
}
.intro { max-width: 55ch; color: var(--muted); font-size: clamp(1.02rem, 1.5vw, 1.16rem); }
.availability { margin-top: .68rem; color: var(--ink); font-size: .91rem; font-weight: 600; }
.actions, .card-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .52rem;
}
.actions { margin-top: 1.2rem; }
.button, .text-link {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  max-width: 100%;
  font-weight: 700;
  line-height: 1.28;
}
.button {
  justify-content: center;
  min-height: 44px;
  padding: .6rem .88rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: .91rem;
  text-decoration: none;
}
.button-primary { background: var(--accent-strong); color: #141221; }
.button-primary:hover { background: #d3c7ff; }
.button-outline { border-color: #565568; color: var(--ink); }
.button-outline:hover { background: var(--surface-raised); border-color: var(--accent); }
.text-link { min-height: 34px; color: var(--accent); font-size: .9rem; }
.text-link:hover { color: #e0d9ff; }
.secondary-link { color: var(--muted); }
.hero-portrait { justify-self: end; width: min(100%, 200px); }
.hero-portrait img {
  width: 100%;
  height: auto;
}
.hero-portrait figcaption {
  padding-top: .52rem;
  color: var(--muted);
  font: 400 .74rem/1.3 var(--mono);
  text-align: right;
}

.section-title { margin-bottom: 21px; }
.projects { padding-top: 22px; border-top: 1px solid var(--line); }
.featured-list { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr); gap: 17px; }
.featured-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.project-preview { min-width: 0; margin: 0; }
.feature-title { padding: .93rem 1.15rem 0; }
.feature-title h3 { margin-top: .33rem; }
.featured-card .project-preview { padding: 10px 10px 0; }
.preview-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #22232c;
}
.preview-frame img { width: 100%; height: 100%; object-fit: contain; }
.featured-card .preview-frame { height: clamp(163px, 23vw, 295px); }
.project-preview figcaption, .study-image figcaption {
  padding: .5rem .25rem .03rem;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
}
.card-body { min-width: 0; }
.featured-card .card-body { padding: 1.05rem 1.15rem .72rem; }
.card-body h3, .card-body h4 { margin: .35rem 0 .45rem; }
.featured-card h3 { font-size: clamp(1.52rem, 2.72vw, 2.32rem); }
.card-body h4 { font-size: clamp(1.18rem, 2vw, 1.54rem); }
.card-summary { color: var(--muted); }
.stack {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem .7rem;
  margin-top: .65rem;
  color: var(--muted);
  font-size: .87rem;
  font-weight: 600;
}
.stack li { display: flex; align-items: center; gap: .32rem; }
.stack li::before { content: ""; width: 3px; height: 3px; background: var(--accent); }
.featured-card .card-evidence { margin-inline: 1.15rem; padding-block: .72rem .95rem; border-top: 1px solid var(--line); }
.card-metric, .study-metric {
  display: grid;
  gap: .16rem;
  margin-bottom: .4rem;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.4;
}
.card-metric strong {
  color: var(--ink);
  font-size: clamp(1.53rem, 2.48vw, 2.13rem);
  line-height: 1.12;
  letter-spacing: -.056em;
}
.card-links { gap: .18rem .9rem; }
.project-group, .content-section {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  align-items: start;
  gap: 28px;
}
.project-group { margin-top: 32px; border-top: 1px solid var(--line); }
.group-title { padding-top: 17px; }
.group-title a { margin-top: .3rem; }
.project-row {
  display: grid;
  grid-template-columns: minmax(125px, 182px) minmax(0, 1fr) minmax(0, .6fr);
  align-items: start;
  gap: 16px;
  padding-block: 17px;
  border-bottom: 1px solid var(--line);
}
.project-row .card-metric strong { font-size: 1.55rem; }
.project-row .project-preview .preview-frame { height: 102px; }
.project-row .project-preview figcaption { font-size: .76rem; }
.project-row .text-link { font-size: .86rem; }
.project-row .card-links { display: grid; justify-items: start; }

.diagram {
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.diagram figcaption {
  margin-bottom: .57rem;
  color: var(--accent);
  font: 650 .77rem/1.4 var(--mono);
}
.diagram ol { display: grid; gap: .55rem; list-style: none; margin: 0; padding: 0; }
.diagram li {
  position: relative;
  padding: .4rem .58rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--ink);
  font-size: .87rem;
  line-height: 1.32;
}
.diagram li + li::before {
  content: "";
  position: absolute;
  top: -.59rem;
  left: .8rem;
  width: 1px;
  height: .55rem;
  background: var(--accent);
}
.project-row .diagram { padding: .55rem; }
.project-row .diagram figcaption, .project-row .diagram li { font-size: .74rem; }

.content-section { border-top: 1px solid var(--line); }
.content-section .section-title { margin-bottom: 0; }
.content-section h2 { font-size: clamp(1.92rem, 3vw, 2.52rem); }
.timeline article {
  display: grid;
  grid-template-columns: minmax(0, 145px) minmax(0, 1fr);
  align-items: baseline;
  gap: .55rem 1rem;
  padding: 0 0 1.05rem;
}
.timeline article + article { padding-top: 1.05rem; border-top: 1px solid var(--line); }
.timeline article:last-child { padding-bottom: 0; }
.timeline .position { margin-top: .25rem; font-weight: 700; }
.timeline .position + p { max-width: 72ch; margin-top: .2rem; color: var(--muted); }
.timeline .button { margin-top: .5rem; }
.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem 1.45rem; }
.skills-grid div { padding: 0 0 .8rem; border-bottom: 1px solid var(--line); }
.skills-grid dt { margin-bottom: .17rem; font-weight: 700; }
.skills-grid dd, .about-copy p { color: var(--muted); }
.about-copy { max-width: 69ch; }
.about-copy p + p { margin-block: .65rem 1.05rem; }
.certificates { padding-left: 1.2rem; margin-block: .3rem 0; }
.contact-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: clamp(21px, 4vw, 44px);
  margin-bottom: 36px;
  border: 1px solid #4f4868;
  border-radius: 8px;
  background: var(--accent-wash);
}
.contact-panel h2 { margin-bottom: .4rem; }
.contact-panel p { max-width: 47ch; color: var(--muted); }
.contact-panel .actions { margin-top: 0; }
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 17px 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}

.study { max-width: 1110px; padding-block: 20px 46px; }
.breadcrumbs { margin-bottom: 23px; color: var(--muted); font-size: .86rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: baseline; gap: .18rem .52rem; }
.breadcrumbs li + li::before { content: "/"; margin-right: .52rem; color: var(--muted); }
.breadcrumbs [aria-current] { color: var(--ink); }
.study-layout {
  display: grid;
  grid-template-areas: "menu heading" "menu content";
  grid-template-columns: minmax(0, 168px) minmax(0, 1fr);
  align-items: start;
  gap: 22px 33px;
}
.study-heading { grid-area: heading; }
.study-heading h1 {
  max-width: 21ch;
  margin-block: .48rem .6rem;
  font-size: clamp(2.35rem, 5.15vw, 4.1rem);
  letter-spacing: -.06em;
}
.study-heading .stack { margin-block: .68rem .8rem; }
.study-metric {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .28rem .8rem;
  margin: .9rem 0 0;
  padding: .67rem .81rem;
  border-left: 2px solid var(--accent);
  background: var(--accent-wash);
}
.study-metric strong {
  color: var(--ink);
  font-size: clamp(1.55rem, 2.8vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -.052em;
}
.study-nav {
  grid-area: menu;
  position: sticky;
  top: calc(var(--header) + 23px);
  padding: .65rem .7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.study-nav p { margin-bottom: .28rem; font-weight: 700; }
.study-nav a { display: block; min-height: 33px; padding-block: .26rem; color: var(--muted); font-size: .87rem; }
.study-nav a:hover { color: var(--accent); }
.study-content { grid-area: content; min-width: 0; }
.study-image { padding: 11px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.study-image a { display: block; }
.study-image img { width: auto; height: auto; max-height: 620px; margin-inline: auto; border-radius: 4px; object-fit: contain; }
.study-section { padding-block: 1.05rem 1.18rem; border-top: 1px solid var(--line); }
.study-section h2 { margin-bottom: .42rem; font-size: clamp(1.38rem, 2.63vw, 1.83rem); }
.study-section p, .study-results { max-width: 72ch; color: var(--muted); }
.study-section .diagram { margin-top: .7rem; }
.study-results { margin: 0; padding-left: 1.14rem; }
.study-results li + li { margin-top: .4rem; }
.all-projects { margin-top: .35rem; }

@media (min-width: 860px) {
  .study-section .diagram ol { display: flex; align-items: stretch; }
  .study-section .diagram li { flex: 1 1 0; min-width: 0; }
  .study-section .diagram li + li::before {
    top: 50%;
    left: -.57rem;
    width: .55rem;
    height: 1px;
  }
}

@media (hover: hover) {
  .button, .featured-card { transition: background-color .18s ease, box-shadow .18s ease, border-color .18s ease; }
  .featured-card:hover { border-color: #625a83; box-shadow: 0 8px 26px #0005; }
}
@media (max-width: 980px) {
  .shell { width: calc(100% - 48px); }
  .project-group, .content-section { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .project-row { grid-template-columns: minmax(105px, 145px) minmax(0, 1fr) minmax(0, .7fr); }
  .content-section { padding-block: 37px; }
}
@media (max-width: 735px) {
  :root { --header: 55px; }
  .shell { width: calc(100% - 34px); }
  .navigation { flex-wrap: wrap; }
  .nav-links { padding-bottom: .64rem; }
  .js .nav-toggle { display: inline-flex; align-items: center; }
  .js .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    gap: .2rem .7rem;
    padding: .5rem 17px .85rem;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }
  .js .nav-links.open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-links a { min-height: 42px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-block: 32px 26px; }
  .hero h1 { font-size: clamp(2.72rem, 10vw, 3.55rem); }
  .hero .actions { margin-top: .94rem; gap: .42rem; }
  .hero .button { padding-inline: .46rem; }
  .hero .button .icon { width: .84em; }
  .hero-portrait { display: flex; align-items: center; gap: .55rem; width: auto; justify-self: start; }
  .hero-portrait img { width: 49px; }
  .hero-portrait figcaption { padding: 0; text-align: left; }
  .section { padding-block: 35px; }
  .projects { padding-top: 20px; }
  .featured-list { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .project-group { margin-top: 21px; }
  .project-row { grid-template-columns: minmax(0, 1fr); gap: .45rem; }
  .project-row .project-preview .preview-frame { height: 128px; }
  .project-row .card-links { display: flex; }
  .timeline article, .skills-grid { grid-template-columns: minmax(0, 1fr); gap: .37rem; }
  .contact-panel { display: block; padding: 19px; margin-bottom: 22px; }
  .contact-panel .actions { margin-top: .7rem; }
  .study { padding-bottom: 32px; }
  .study-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "heading" "menu" "content"; gap: 15px; }
  .study-nav { position: static; }
  .study-nav ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .featured-card { transition: none; }
}
