/* Steve Nketiah — portfolio
   One typeface (Hanken Grotesk) everywhere. White ground. Math uses KaTeX's own LaTeX font. */

:root {
  --paper: #ffffff;
  --ink: #111315;
  --ink-2: #4a5057;
  --ink-3: #868c93;
  --rule: #e4e7ea;
  --wash: #f4f5f6;
  --accent: #1f6f4a;
  --accent-wash: #eef6f1;
  --font: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gut: clamp(20px, 5vw, 64px);
  --wrap: 1180px;
  --read: 700px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- nav + footer ---------- */
.nav {
  max-width: var(--wrap); margin: 0 auto; padding: 22px var(--gut);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.mark { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
.mark .chip {
  width: 24px; height: 24px; border: 1.5px solid var(--ink); border-radius: 5px;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
}
.links { display: flex; gap: 24px; font-size: 15px; color: var(--ink-2); }
.links a { text-decoration: none; }
.links a:hover, .links a[aria-current="page"] { color: var(--ink); }

.foot {
  max-width: var(--wrap); margin: 0 auto; padding: 32px var(--gut) 40px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 14px; color: var(--ink-3);
}
.foot .socials { margin: 0; }
.foot a.text { color: var(--ink-2); text-decoration: none; }
.foot a.text:hover { color: var(--ink); }

/* social icons */
.socials { display: flex; gap: 12px; align-items: center; }
.icon {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--rule);
  display: grid; place-items: center; color: var(--ink); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.icon:hover { border-color: var(--ink); }
.icon svg { width: 19px; height: 19px; fill: currentColor; }
.icon.li { border: 0; overflow: hidden; }
.icon.li img { width: 100%; height: 100%; }
.icon.li:hover { transform: scale(1.06); }
.icon.sm { width: 36px; height: 36px; }
.icon.sm svg { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { .icon.li:hover { transform: none; } }

/* labels */
.label { font-size: 12.5px; font-weight: 500; letter-spacing: .01em; color: var(--ink-3); }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- homepage ---------- */
.home-hero {
  max-width: var(--wrap); margin: 0 auto; padding: 64px var(--gut) 56px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px;
}
.avatar {
  width: clamp(168px, 22vw, 224px); height: auto; aspect-ratio: 1; border-radius: 50%;
  object-fit: cover; object-position: 50% 22%; background: var(--wash);
}
.home-hero h1 { font-size: clamp(32px, 4.2vw, 46px); line-height: 1.1; letter-spacing: -.025em; font-weight: 600; margin: 0 0 10px; }
.home-hero p { margin: 0 auto; color: var(--ink-2); max-width: 56ch; font-size: 17px; }
.home-hero .socials { justify-content: center; margin-top: 22px; }
.home-hero p.looking { margin-top: 12px; color: var(--ink); font-weight: 500; font-size: 16px; }

.experience { max-width: var(--wrap); margin: 0 auto; padding: 8px var(--gut) 64px; }
.experience h2 { font-size: 24px; font-weight: 600; letter-spacing: -.015em; margin: 0 0 24px; }
.jobs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 560px) { .jobs { grid-template-columns: 1fr; } }
.job { display: grid; gap: 4px; align-content: start; justify-items: center; text-align: center; padding: 24px; border: 1px solid var(--rule); border-radius: 8px; }
.job .logo { height: 52px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.job .logo img { height: 44px; width: auto; max-width: 100%; }
.job .company { font-size: 22px; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
.job .title { font-size: 15.5px; color: var(--ink-2); }
.job .label { margin-top: 6px; }

.projects { max-width: var(--wrap); margin: 0 auto; padding: 8px var(--gut) 80px; }
.projects-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.projects-head h2 { font-size: 24px; font-weight: 600; letter-spacing: -.015em; margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  font: 500 13.5px/1 var(--font); padding: 8px 13px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink-2); cursor: pointer;
}
.pill:hover { border-color: #c9cdd2; color: var(--ink); }
.pill[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
span.pill { cursor: default; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 26px; }
.card { text-decoration: none; display: flex; flex-direction: column; gap: 14px; }
.card .thumb { aspect-ratio: 4 / 3; border-radius: 6px; }
.card .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.card p { margin: 4px 0 0; color: var(--ink-2); font-size: 14.5px; }
.card:hover h3 { color: var(--accent); }
.badge { font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-wash); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }

.thumb { background: var(--wash); overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
a:hover .thumb img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .thumb img { transition: none; } a:hover .thumb img { transform: none; } }

/* ---------- article ---------- */
.cover { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.cover .thumb { aspect-ratio: 2 / 1; border-radius: 8px; }
.cover img { object-position: var(--focus, 50% 50%); }

/* the header, contents list and article share one centred reading column */
.head { max-width: calc(var(--read) + 2 * var(--gut)); margin: 0 auto; padding: 44px var(--gut) 8px; display: grid; gap: 18px; }
.crumb { font-size: 14px; color: var(--ink-3); }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.head h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.03; letter-spacing: -.032em; font-weight: 600; margin: 0; max-width: 22ch; text-wrap: balance; }
.dek { font-size: 19px; line-height: 1.5; color: var(--ink-2); max-width: 62ch; margin: 0; }
.specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); margin-top: 10px; }
.specs div { padding: 14px 16px 14px 0; min-width: 0; }
.specs .eyebrow { display: block; margin-bottom: 4px; }
.specs b { font-weight: 500; font-size: 15px; }

.body { max-width: calc(var(--wrap) + 140px); margin: 0 auto; padding: 32px var(--gut) 72px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--read)) minmax(0, 1fr); column-gap: 48px; }
.body > article { grid-column: 2; grid-row: 1; }
.toc { grid-column: 1; grid-row: 1; width: min(100%, 176px); position: sticky; top: 24px; align-self: start; display: grid; gap: 2px; font-size: 14px; max-height: calc(100vh - 48px); overflow-y: auto; }
.toc .eyebrow { margin-bottom: 10px; }
.toc a { text-decoration: none; color: var(--ink-3); padding: 5px 0 5px 12px; border-left: 1px solid var(--rule); line-height: 1.35; }
.toc a:hover { color: var(--ink-2); }
.toc a.on { color: var(--ink); border-left-color: var(--ink); }

article { width: 100%; max-width: var(--read); min-width: 0; }
article > *:first-child { margin-top: 0; }
article h2 { font-size: 27px; letter-spacing: -.02em; line-height: 1.2; font-weight: 600; margin: 64px 0 14px; scroll-margin-top: 24px; text-wrap: balance; }
article h3 { font-size: 19px; letter-spacing: -.01em; font-weight: 600; margin: 36px 0 10px; scroll-margin-top: 24px; }
article h4 { font-size: 16px; font-weight: 600; margin: 24px 0 6px; }
article p, article li { font-size: 17px; line-height: 1.72; color: #23272b; }
article p { margin: 0 0 18px; }
article ul, article ol { padding-left: 22px; margin: 0 0 18px; }
article li { margin-bottom: 6px; }
article li > ul { margin: 6px 0 0; }
article a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #b9bec4; }
article a:hover { text-decoration-color: var(--ink); }
article strong { font-weight: 600; color: var(--ink); }
article code { font-size: .92em; background: var(--wash); padding: 1px 5px; border-radius: 4px; }

figure { margin: 30px 0; }
figure img, figure video { border-radius: 5px; background: var(--wash); width: 100%; height: auto; }
figure img { cursor: zoom-in; }
figcaption { font-size: 14px; line-height: 1.5; color: var(--ink-3); margin-top: 10px; }
figcaption a { color: inherit; }

/* image wider than the text column, on desktop */
@media (min-width: 1300px) { figure.wide { margin-inline: -60px; } }

/* rows of media */
.row { display: grid; gap: 12px; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); align-items: start; }
.row.n3 { --n: 3; }
.row.n4 { --n: 4; }
.row .cell { display: grid; gap: 6px; min-width: 0; }
.row .cell .label { display: block; }
.row img, .row video { aspect-ratio: var(--ar, auto); object-fit: cover; }
.row.square { --ar: 1; }
.row.photo { --ar: 4 / 3; }

/* text beside media (media on the right) */
.side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--side-w, 280px)); gap: 28px; align-items: start; margin: 0 0 18px; }
.side > .text > *:last-child { margin-bottom: 0; }
.side figure { margin: 0; }
.side.wide-media { --side-w: 340px; }
@media (min-width: 1300px) { .side.bleed { margin-inline: -60px; --side-w: 380px; } }

/* callout */
.callout { border-left: 2px solid var(--accent); padding: 6px 0 6px 20px; margin: 26px 0; }
.callout p { font-size: 16px; color: var(--ink-2); margin: 0 0 8px; }
.callout p:last-child { margin: 0; }
.callout b, .callout strong { color: var(--ink); }
.note { background: var(--wash); border-radius: 8px; padding: 16px 20px; margin: 26px 0; font-size: 15.5px; color: var(--ink-2); }
.note p { font-size: 15.5px; margin: 0; }

/* tables */
.table-wrap { overflow-x: auto; margin: 26px 0; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; font-variant-numeric: tabular-nums; }
th { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--ink); white-space: nowrap; vertical-align: bottom; }
td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
td.num, th.num { text-align: right; }
tr.pick td { background: var(--accent-wash); font-weight: 600; color: var(--ink); }
tr.pick td:first-child { box-shadow: inset 2px 0 0 var(--accent); padding-left: 10px; }
tr.total td { font-weight: 600; border-top: 1px solid var(--ink); border-bottom: 0; }
.table-wrap.wide { margin-right: 0; }
@media (min-width: 1300px) { .table-wrap.wide { margin-inline: -60px; } }
.table-note { font-size: 13.5px; color: var(--ink-3); margin-top: -14px; }

/* design evolution: versions side by side, no borders */
.evo { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 24px; margin: 22px 0 34px; }
.evo.n2 { --n: 2; }
.evo .ver { min-width: 0; }
.evo h4 { margin: 0 0 10px; }
.evo img { border-radius: 5px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: var(--wash); cursor: zoom-in; }
.evo ul { margin: 14px 0 0; padding-left: 18px; }
.evo li { font-size: 15.5px; line-height: 1.55; }

/* math + LaTeX diagrams */
.math { overflow-x: auto; overflow-y: hidden; margin: 22px 0; padding: 4px 0; }
.math .katex-display { margin: 0; }
.katex { font-size: 1.08em; }
.tex-fig { margin: 28px 0; }
.tex-fig img, .tex-fig svg { margin: 0 auto; width: auto; max-width: 100%; background: none; cursor: default; border-radius: 0; }
.tex-fig.scroll { overflow-x: auto; }
.tex-fig.scroll img { max-width: none; }

/* download link */
.download { display: inline-flex; align-items: center; gap: 10px; padding: 11px 16px; border: 1px solid var(--rule); border-radius: 8px; text-decoration: none !important; font-size: 15px; font-weight: 500; color: var(--ink); margin: 4px 0 22px; }
.download:hover { border-color: var(--ink); }
.download svg { width: 16px; height: 16px; fill: currentColor; }

.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--rule); }

/* gallery */
.gallery { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut) 72px; }
.gallery-head { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--ink); padding-top: 14px; margin-bottom: 22px; }
.gallery-head h2 { font-size: 16px; font-weight: 600; margin: 0; }
.gallery-grid { columns: 3 260px; column-gap: 12px; }
.gallery-grid a { display: block; margin-bottom: 12px; break-inside: avoid; border-radius: 5px; overflow: hidden; background: var(--wash); cursor: zoom-in; }
.gallery-grid img { width: 100%; height: auto; transition: opacity .2s; }
.gallery-grid a:hover img { opacity: .9; }

/* related */
.related { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut) 80px; }
.related-head { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--ink); padding-top: 14px; margin-bottom: 24px; }
.related-head h2 { font-size: 16px; font-weight: 600; margin: 0; }
.related-head a { font-size: 14px; color: var(--ink-2); text-decoration: none; }
.related .grid { gap: 26px; }

/* lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(255, 255, 255, .96); }
.lightbox .inner { width: 100%; height: 100%; display: grid; place-items: center; padding: 56px 16px 24px; }
.lightbox img { max-width: min(1600px, 100%); max-height: calc(100vh - 120px); width: auto; height: auto; object-fit: contain; border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .12); }
.lightbox p { text-align: center; color: var(--ink-3); font-size: 14px; margin: 12px 0 0; max-width: 70ch; }
.lightbox button { position: fixed; top: 14px; right: 16px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule); background: var(--paper); font: 400 22px/1 var(--font); color: var(--ink); cursor: pointer; }
.lightbox .prev, .lightbox .next { top: 50%; transform: translateY(-50%); }
.lightbox .prev { left: 16px; right: auto; }
.lightbox .next { right: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .body { grid-template-columns: minmax(0, var(--read)); justify-content: center; }
  .body > article { grid-column: 1; }
  .toc { display: none; }
}
@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side { grid-template-columns: 1fr; }
  .side figure { max-width: 420px; }
  .evo { grid-template-columns: 1fr; gap: 36px; }
  .row.n3, .row.n4 { --n: 2; }
  .cover .thumb { aspect-ratio: 4 / 3; }
  article h2 { font-size: 24px; margin-top: 52px; }
}
@media (max-width: 540px) {
  .grid { grid-template-columns: 1fr; }
  .row { --n: 1 !important; }
  .links { gap: 16px; }
  .dek { font-size: 17px; }
  article p, article li { font-size: 16.5px; }
}
