@font-face {
  font-family: Inter;
  src: url("/assets/fonts/Inter-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #161616;
  --muted: #535357;
  --soft: #f5f5f7;
  --line: #dcdcdf;
  --page: #ffffff;
  --edge: clamp(20px, 6vw, 100px);
  --max: 1220px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul, figure { margin: 0; }
a { color: inherit; }
img { display: block; width: 100%; height: auto; }
[id] { scroll-margin-top: 88px; }
:focus-visible { outline: 2px solid #202020; outline-offset: 5px; }

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

.skip-link {
  position: fixed;
  z-index: 5;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--page);
  color: var(--ink);
  transform: translateY(-160%);
}

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

.top {
  position: sticky;
  z-index: 3;
  top: 0;
  border-bottom: 1px solid #e7e7e9;
  background: rgb(255 255 255 / 95%);
  backdrop-filter: blur(16px);
}

.top-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}

.brand, .nav a, .top-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.brand {
  width: fit-content;
  font-weight: 750;
  font-size: 16px;
  letter-spacing: -.055em;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 42px);
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
}

.nav a:hover, .footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .3em; }
.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: .4em; }

.top-action {
  gap: 8px;
  justify-self: end;
  font-size: 14px;
  font-weight: 650;
}

.top-action:hover { text-decoration: underline; text-underline-offset: .3em; }

.overline {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: 1fr .94fr;
  gap: clamp(40px, 8vw, 112px);
  align-items: center;
  padding-block: clamp(58px, 8vw, 112px);
}

.hero-copy { padding-block: 7px; }

.hero h1 {
  margin: 0 0 25px;
  font-size: clamp(69px, 9.6vw, 140px);
  font-weight: 750;
  line-height: .91;
  letter-spacing: -.073em;
}

.hero-summary {
  max-width: 520px;
  color: var(--muted);
  font-size: clamp(18px, 1.7vw, 23px);
  line-height: 1.5;
  letter-spacing: -.033em;
  text-wrap: pretty;
}

.portrait {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 1 / 1.04;
  border-radius: clamp(20px, 2.6vw, 38px);
  background: #d9d9db;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% center;
  filter: grayscale(1);
}

.button, .text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .58em;
  width: fit-content;
  min-height: 44px;
  font-weight: 650;
  letter-spacing: -.02em;
  text-decoration: none;
  white-space: nowrap;
}

.button {
  padding: 11px 21px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 15px;
  transition: background-color .18s ease;
}

.button-dark { color: white; background: var(--ink); }
.button-dark:hover { background: #37373a; }
.text-link { text-underline-offset: .25em; }
.text-link:hover { text-decoration: underline; }

.section { padding-block: clamp(67px, 8vw, 111px); }

.section h2, .sec-head h2 {
  font-size: clamp(48px, 6vw, 87px);
  font-weight: 725;
  line-height: .97;
  letter-spacing: -.058em;
}

.writing {
  display: grid;
  grid-template-columns: 1fr .94fr;
  align-items: end;
  gap: clamp(34px, 8vw, 112px);
  border-top: 1px solid var(--line);
}

.writing .overline { margin-bottom: 18px; }

.writing-copy p, .section-summary {
  color: var(--muted);
  font-size: clamp(18px, 1.72vw, 23px);
  line-height: 1.5;
  letter-spacing: -.024em;
  text-wrap: pretty;
}

.writing-copy .text-link { margin-top: 12px; }

.work-section { background: var(--soft); }

.section-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: clamp(18px, 5vw, 70px);
  margin-bottom: 38px;
}

.section-summary { max-width: 690px; margin-top: 20px; }

.resume-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  flex-shrink: 0;
}

.resume-actions .text-link { font-size: 14px; }

.career { padding: 0; list-style: none; }

.career li {
  display: grid;
  grid-template-columns: 1.08fr 1.53fr auto;
  gap: 12px clamp(24px, 4vw, 58px);
  align-items: baseline;
  padding: 26px 0 28px;
  border-top: 1px solid var(--line);
}

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

.career h3 {
  font-size: clamp(26px, 3.1vw, 41px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.056em;
}

.career-role { margin-top: 7px; font-size: 15px; font-weight: 590; letter-spacing: -.015em; }

.career-summary { max-width: 530px; color: var(--muted); text-wrap: pretty; }
.career-date { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 2.7vw, 35px);
}

.project {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e5e5e7;
  border-radius: 28px;
  background: var(--page);
}

.project-visual {
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 2 / 1;
  text-decoration: none;
}

.project-visual img { transition: transform .3s ease; }
.project-visual:hover img { transform: scale(1.045); }
.visual-pencil { background: #eeeeef; }
.visual-editor { background: #f3f3f5; }
.visual-compute { background: #12131a; }
.visual-credit { background: #202124; }
.project-icon { width: clamp(82px, 24%, 146px); }
.pencil-icon { border-radius: 24%; box-shadow: 0 12px 27px rgb(31 40 114 / 22%); }

.project-chart {
  width: 80%;
  max-height: 87%;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgb(0 0 0 / 21%));
}

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(22px, 2.8vw, 37px);
}

.project h2, .project h3 {
  font-size: clamp(26px, 3.4vw, 44px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.048em;
}

.project-body p { margin: 13px 0 15px; color: var(--muted); text-wrap: pretty; }
.project-links { display: flex; flex-wrap: wrap; column-gap: 21px; margin-top: auto; }
.project-links .text-link { font-size: 14px; }

.project-feature {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: .84fr 1.16fr;
}

.project-feature .project-body {
  grid-area: 1 / 1;
  justify-content: center;
  padding: clamp(27px, 4.5vw, 65px);
}

.project-feature .project-links { margin-top: 0; }
.project-feature h2, .project-feature h3 { font-size: clamp(39px, 5vw, 64px); }
.project-feature .visual-cascade { grid-area: 1 / 2; min-height: 250px; aspect-ratio: auto; background: #142020; }
.cascade-preview { width: 94%; margin-block: 16px; border: 1px solid #3c5150; border-radius: 11px; }

@media (max-width: 720px) {
  .project-feature { grid-template-columns: 1fr; }
  .project-feature .visual-cascade { grid-area: 1 / 1; min-height: 0; }
  .project-feature .project-body { grid-area: 2 / 1; padding: 22px; }
}

.footer { border-top: 1px solid var(--line); background: var(--soft); }

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 87px;
  font-size: 14px;
}

.footer-inner > span { font-weight: 700; letter-spacing: -.035em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px clamp(14px, 3vw, 34px); }
.footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }

/* Standalone portfolio pages */
.page-title {
  font-size: clamp(56px, 7.4vw, 104px);
  font-weight: 750;
  line-height: .98;
  letter-spacing: -.06em;
}
.writing-page { min-height: calc(100svh - 152px); border-top: 0; align-items: center; }
.code-page { min-height: calc(100svh - 152px); }
.cv-page { padding-block: clamp(50px, 7vw, 96px); }
.cv-header { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 28px; padding-bottom: 42px; border-bottom: 1px solid var(--line); }
.cv-header .overline { margin-bottom: 16px; font-size: 14px; }
.cv-header .cv-location { margin-top: 18px; }
.cv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.cv-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, .85fr); gap: clamp(36px, 7vw, 100px); margin-top: 48px; }
.cv-section-title { font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -.035em; margin-bottom: 25px; }
.cv-job + .cv-job { border-top: 1px solid var(--line); margin-top: 34px; padding-top: 34px; }
.cv-job h3 { font-size: clamp(26px, 3vw, 36px); font-weight: 700; line-height: 1.1; letter-spacing: -.045em; }
.cv-job-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.cv-role { margin-top: 10px; font-weight: 650; }
.cv-location, .cv-date { color: var(--muted); font-size: 14px; }
.cv-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cv-job ul { padding-left: 20px; margin-top: 20px; color: var(--muted); }
.cv-job li + li { margin-top: 12px; }
.cv-positions { margin: 20px 0 0; }
.cv-positions > div { display: flex; justify-content: space-between; gap: 18px; margin-top: 8px; }
.cv-positions dt { font-weight: 600; }
.cv-positions dd { margin: 0; color: var(--muted); font-size: 14px; white-space: nowrap; }
.cv-sidebar section + section { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
.cv-list { list-style: none; padding: 0; color: var(--muted); }
.cv-list li + li { margin-top: 18px; }
.cv-list a { text-decoration-thickness: 1px; text-underline-offset: .22em; overflow-wrap: anywhere; }
.cv-list strong { font-weight: 650; color: var(--ink); }

@media (max-width: 850px) {
  .cv-layout { grid-template-columns: minmax(0, 1fr); }
  .cv-sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .cv-sidebar section + section { margin-top: 0; padding-top: 0; border-top: 0; }
}
@media (max-width: 520px) {
  .cv-sidebar { grid-template-columns: minmax(0, 1fr); }
  .cv-header .page-title { font-size: clamp(43px, 11vw, 56px); }
  .cv-positions > div { flex-direction: column; gap: 2px; margin-top: 14px; }
}

/* Compute Book case study */
.page-hero { padding-block: clamp(70px, 9vw, 120px) clamp(45px, 5vw, 72px); }

.page-hero h1 {
  margin: 18px 0 22px;
  font-size: clamp(53px, 8.1vw, 112px);
  font-weight: 750;
  line-height: .97;
  letter-spacing: -.06em;
}

.lede { max-width: 830px; color: var(--muted); font-size: clamp(20px, 2.45vw, 29px); line-height: 1.45; letter-spacing: -.035em; text-wrap: pretty; }
.note { max-width: 760px; margin-top: 26px; padding: 15px 18px; border-radius: 12px; background: var(--soft); color: var(--muted); font-size: 14px; }
.case-study section { padding-block: clamp(44px, 6vw, 74px); border-top: 1px solid var(--line); }
.sec-head { margin-bottom: 30px; }
.sec-head p { max-width: 680px; margin-top: 16px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { height: 100%; padding: clamp(20px, 2.7vw, 34px); border-radius: 18px; background: var(--soft); }
.kpi .v { font-size: clamp(33px, 4.6vw, 64px); line-height: 1; font-weight: 725; letter-spacing: -.058em; }
.kpi .l { margin-top: 10px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.qtable { width: 100%; min-width: 565px; border-collapse: collapse; text-align: left; }
.qtable th, .qtable td { padding: 15px 24px 15px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.qtable td:first-child { font-weight: 650; }
.qtable td:not(:first-child) { color: var(--muted); }
.ex { max-width: 1040px; margin-inline: auto; }
.ex + .ex { margin-top: 53px; }
.plate { display: block; overflow: hidden; background: var(--soft); border-radius: 20px; }
.ex figcaption { margin-top: 16px; }
.ex figcaption b { display: block; margin-bottom: 5px; font-size: 19px; letter-spacing: -.03em; }
.ex figcaption span, .method { color: var(--muted); }
.method { max-width: 800px; }
.method p + p { margin-top: 15px; }
.method b { color: var(--ink); }
.dl { display: grid; }
.dl a { display: flex; align-items: center; justify-content: space-between; min-height: 57px; gap: 20px; padding-block: 12px; border-top: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.dl a:last-child { border-bottom: 1px solid var(--line); }
.dl a:hover { text-decoration: underline; text-underline-offset: .25em; }
.dl small { color: var(--muted); white-space: nowrap; }

@media (max-width: 950px) {
  .section-intro:has(.resume-actions) { align-items: start; flex-direction: column; }
  .resume-actions { max-width: 100%; }
}

@media (max-width: 720px) {
  [id] { scroll-margin-top: 114px; }
  .top-inner { grid-template-columns: 1fr auto; gap: 0 12px; padding-block: 2px; }
  .brand { grid-column: 1; grid-row: 1; }
  .top-action { grid-column: 2; grid-row: 1; }
  .nav { grid-column: 1 / -1; grid-row: 2; gap: 23px; }
  .nav a { min-height: 38px; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding-block: 48px 56px; }
  .hero h1 { font-size: clamp(64px, 13vw, 97px); margin-block: 0 17px; }
  .hero h1 br { display: none; }
  .portrait { aspect-ratio: 1.11; }
  .portrait img { object-position: 50% 37%; }
  .section { padding-block: 55px; }
  .writing { grid-template-columns: 1fr; gap: 19px; }
  .writing h2 br { display: none; }
  .writing .overline { margin-bottom: 12px; }
  .section-intro { margin-bottom: 25px; }
  .career li { grid-template-columns: 1fr auto; gap: 12px; padding-block: 20px; }
  .career-summary { grid-column: 1 / -1; grid-row: 2; }
  .career-date { grid-column: 2; grid-row: 1; font-size: 12px; }
  .gallery { grid-template-columns: 1fr; gap: 21px; }
  .project { border-radius: 23px; }
  .project-visual { aspect-ratio: 1.83; }
  .project-chart { width: 82%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-header .nav { column-gap: 18px; }
}

@media (max-width: 365px) {
  .hero h1 { font-size: 58px; }
  .nav { gap: 18px; }
  .footer-inner { gap: 10px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .project-visual img { transition: none; }
}
