/* Self-hosted IBM Plex (SIL Open Font License 1.1), latin + latin-ext subsets from Google Fonts.
   Sans is one variable file covering weights 400-600. */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-400-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-400-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-500-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-500-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(../fonts/ibm-plex-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(../fonts/ibm-plex-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =========================================================================
   Saiful Iqbal — Portfolio v2
   Design system: "Evidence-backed". See docs/REDESIGN-PLAN.md
   ========================================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --paper: #F3F1EC;
  --paper-2: #EBE8E1;
  --ink: #16181B;
  --ink-2: #3E424A;
  --muted: #696D74;
  --rule: #D7D3CA;
  --accent: #B93C12;
  --accent-ink: #FFFFFF;
  --ok: #2C6A43;
  --warn: #7F5600;
  --focus: #1D4ED8;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  --max: 1180px;
  --gutter: 24px;
  --index-col: 220px;
  --radius: 3px;
  --header-h: 64px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111315;
    --paper-2: #181B1E;
    --ink: #ECE9E3;
    --ink-2: #C3C0BA;
    --muted: #8E9299;
    --rule: #2A2E33;
    --accent: #F0794A;
    --accent-ink: #111315;
    --ok: #76C495;
    --warn: #E2B457;
    --focus: #93B4FF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111315;
  --paper-2: #181B1E;
  --ink: #ECE9E3;
  --ink-2: #C3C0BA;
  --muted: #8E9299;
  --rule: #2A2E33;
  --accent: #F0794A;
  --accent-ink: #111315;
  --ok: #76C495;
  --warn: #E2B457;
  --focus: #93B4FF;
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (min-width: 900px) { body { font-size: 1.0625rem; } }

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.2vw, 4.4rem); letter-spacing: -0.03em; line-height: 1.04; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.2rem, 1.8vw, 1.5rem); font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: 1rem; font-weight: 600; }

p { margin: 0 0 var(--s-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
strong { color: var(--ink); font-weight: 600; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; }
dl, dd { margin: 0; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .15s ease, text-decoration-color .15s ease;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }

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

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

.icon { width: 1em; height: 1em; flex-shrink: 0; }
.icon--stroke { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--fill { fill: currentColor; }

.visually-hidden {
  position: absolute !important;
  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: var(--s-4);
  top: -100px;
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--s-4); color: var(--paper); }

/* ---------- 3. Layout ---------- */
.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
@media (max-width: 639px) { :root { --gutter: 16px; } }

.section {
  padding-block: var(--s-9);
  border-top: 1px solid var(--rule);
}
@media (max-width: 899px) { .section { padding-block: var(--s-8); } }

.section-grid {
  display: grid;
  gap: var(--s-5) var(--s-7);
}
/* Let grid children shrink below their content width (e.g. the scrollable filter bar) */
.section-grid > *, .hero-grid > *, .cs-layout > *, .about-grid > *, .two-col > *, .contact-grid > * { min-width: 0; }
@media (min-width: 900px) {
  .section-grid { grid-template-columns: var(--index-col) minmax(0, 1fr); }
}

.section-index {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
}
.section-index .num { color: var(--accent); }
@media (min-width: 900px) {
  .section-index { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; flex-direction: column; gap: var(--s-1); }
}

.section-head { margin-bottom: var(--s-7); max-width: 760px; }
.section-head h2 { margin-bottom: var(--s-4); }
.section-head .lead { color: var(--ink-2); font-size: 1.125rem; }

.sub-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  padding-bottom: var(--s-3);
  margin: var(--s-8) 0 0;
  border-bottom: 1px solid var(--ink);
}
.sub-head:first-child { margin-top: 0; }
.sub-head h3 { font-size: 1.125rem; }
.sub-head .meta { margin: 0; }

/* ---------- 4. Small components ---------- */
.meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.mark {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 100% 0.09em;
  background-position: 0 92%;
  padding-bottom: 0.04em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font: 500 0.9375rem/1.2 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--outline { background: transparent; color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--paper); }
.btn .icon { width: 16px; height: 16px; transition: transform .15s ease; }
.btn:hover .icon--arrow { transform: translate(2px, -2px); }
.btn:hover .icon--right { transform: translateX(3px); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}
.text-link .icon { width: 14px; height: 14px; transition: transform .15s ease; }
.text-link:hover { color: var(--accent); border-color: var(--accent); }
.text-link:hover .icon--arrow { transform: translate(2px, -2px); }
.text-link:hover .icon--right { transform: translateX(3px); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-2);
  white-space: nowrap;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 7px; height: 7px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  flex-shrink: 0;
}
.status--live { color: var(--ok); }
.status--live::before { background: currentColor; }
.status--client { color: var(--ink); }
.status--client::before { border-radius: 1px; background: currentColor; }
.status--private { color: var(--ink-2); }
.status--private::before { border-radius: 1px; }
.status--demo { color: var(--warn); }

/* Record (key/value summary block) */
.record {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  border-top: 1px solid var(--ink);
  font-size: 0.9375rem;
}
.record dt, .record dd {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.record dt {
  padding-right: var(--s-5);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 13px;
}
.record dd { color: var(--ink); }
@media (max-width: 639px) {
  .record { grid-template-columns: 1fr; }
  .record dt { border-bottom: 0; padding-bottom: 0; }
  .record dd { padding-top: 2px; }
}

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  height: var(--header-h);
}

.brand {
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--accent); }
.brand:hover { color: var(--ink); }

.nav { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.nav-list { display: flex; gap: 2px; list-style: none; }
.nav-list a {
  display: block;
  padding: 8px 10px;
  font-size: 0.9375rem;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: var(--radius);
}
.nav-list a:hover { color: var(--ink); background: var(--paper-2); }
.nav-list a[aria-current="true"],
.nav-list a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

.header-actions { display: flex; align-items: center; gap: var(--s-2); }
.header-actions .btn { min-height: 38px; padding: 7px 14px; font-size: 0.875rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn .icon { width: 18px; height: 18px; }

.theme-toggle .icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon--sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon--moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon--sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon--moon { display: none; }
}

.menu-toggle { display: none; }

@media (max-width: 899px) {
  .menu-toggle { display: inline-grid; }
  .nav { position: static; margin-left: auto; }
  .nav-list {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: var(--s-2) var(--gutter) var(--s-5);
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }
  .js .nav-list { display: none; }
  .js .nav[data-open="true"] .nav-list { display: flex; }
  .nav-list a { padding: 14px 0; font-size: 1.0625rem; border-bottom: 1px solid var(--rule); border-radius: 0; }
  .nav-list a[aria-current="true"] { box-shadow: none; color: var(--accent); }
  .header-actions .btn--resume { display: none; }
}
@media (max-width: 899px) {
  .no-js .site-header .container { height: auto; flex-wrap: wrap; padding-block: var(--s-3); }
  .no-js .nav-list { position: static; flex-direction: row; flex-wrap: wrap; padding: 0; border: 0; }
  .no-js .nav-list a { border: 0; padding: 6px 8px; }
}

/* ---------- 6. Hero ---------- */
.hero { padding-block: var(--s-9) var(--s-8); }
@media (max-width: 899px) { .hero { padding-block: var(--s-7) var(--s-7); } }

.hero-grid {
  display: grid;
  gap: var(--s-7);
  align-items: start;
}
@media (min-width: 1000px) {
  .hero-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: var(--s-8); }
}

.hero-kicker { margin-bottom: var(--s-5); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); }
.hero h1 { margin-bottom: var(--s-5); max-width: 16ch; }
.hero-lead { font-size: 1.1875rem; max-width: 36rem; color: var(--ink-2); margin-bottom: var(--s-6); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.hero-card { display: grid; gap: var(--s-5); }
.portrait {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: var(--s-4);
  align-items: end;
}
.portrait img {
  width: 112px;
  height: 158px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--paper-2);
}
.portrait figcaption { font-size: 0.875rem; color: var(--muted); line-height: 1.5; }
.portrait figcaption strong { display: block; color: var(--ink); font-size: 1rem; }

.proof {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: var(--s-8);
  border-top: 1px solid var(--ink);
  list-style: none;
}
@media (min-width: 900px) { .proof { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.proof li {
  padding: var(--s-5) var(--s-5) var(--s-5) 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 900px) {
  .proof li { border-bottom: 0; padding-left: var(--s-5); border-left: 1px solid var(--rule); }
  .proof li:first-child { border-left: 0; padding-left: 0; }
}
.proof .figure {
  display: block;
  font-size: clamp(1.5rem, 2.6vw, 2.125rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: var(--s-2);
}
.proof .label { font-size: 0.875rem; color: var(--ink-2); line-height: 1.45; display: block; }
.proof a { text-decoration: none; display: block; }
.proof a:hover .figure { color: var(--accent); }
.proof .source { margin-top: var(--s-2); display: block; }

/* ---------- 7. Work ---------- */
.filter-bar {
  display: flex;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.filter-bar::-webkit-scrollbar { display: none; }
.no-js .filter-bar { display: none; }
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 38px;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: 500 0.875rem/1 var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.filter-btn:hover { border-color: var(--ink); color: var(--ink); }
.filter-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filter-btn .count { font-family: var(--font-mono); font-size: 0.75rem; opacity: .7; }

.work-group + .work-group { margin-top: var(--s-8); }

/* Featured work cards: see section 17 */

/* Project index (expandable rows) */
.project-list { list-style: none; border-top: 1px solid var(--ink); }
.project-row { border-bottom: 1px solid var(--rule); }
.project-row summary {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto 24px;
  gap: var(--s-4);
  align-items: baseline;
  padding: var(--s-4) 0;
  cursor: pointer;
  list-style: none;
}
.project-row summary::-webkit-details-marker { display: none; }
.project-row summary:hover .p-name { color: var(--accent); }
.p-id { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.p-name { font-weight: 600; color: var(--ink); transition: color .15s ease; }
.p-desc { display: block; font-size: 0.9375rem; color: var(--ink-2); font-weight: 400; margin-top: 2px; }
.p-toggle {
  position: relative;
  width: 14px; height: 14px;
  align-self: center;
  justify-self: end;
}
.p-toggle::before, .p-toggle::after {
  content: "";
  position: absolute;
  left: 0; top: 6px;
  width: 14px; height: 1.5px;
  background: var(--ink);
  transition: transform .2s ease;
}
.p-toggle::after { transform: rotate(90deg); }
.project-row[open] .p-toggle::after { transform: rotate(0deg); }
.p-body {
  display: grid;
  gap: var(--s-4) var(--s-6);
  padding: 0 0 var(--s-6) 72px;
}
@media (min-width: 900px) { .p-body { grid-template-columns: minmax(0, 1fr) 240px; } }
.p-body ul:not(.tag-list) { list-style: none; display: grid; gap: var(--s-2); }
.p-body ul:not(.tag-list) li { position: relative; padding-left: var(--s-4); font-size: 0.9375rem; }
.p-body ul:not(.tag-list) li::before { content: "–"; position: absolute; left: 0; color: var(--muted); }
.p-body .tag-list { align-content: start; }
@media (max-width: 639px) {
  .project-row summary { grid-template-columns: minmax(0, 1fr) 20px; }
  .project-row summary .p-id { display: none; }
  .project-row summary .status { grid-column: 1; grid-row: 2; }
  .project-row summary .p-toggle { grid-column: 2; grid-row: 1; }
  .p-body { padding-left: 0; }
}

.empty-note { padding: var(--s-5) 0; color: var(--muted); }

/* ---------- 8. Timeline (experience) ---------- */
.timeline { list-style: none; border-top: 1px solid var(--ink); }
.timeline > li {
  display: grid;
  gap: var(--s-2) var(--s-6);
  padding: var(--s-6) 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 900px) { .timeline > li { grid-template-columns: 180px minmax(0, 1fr); } }
.timeline .when { padding-top: 5px; }
.timeline h3 { margin-bottom: var(--s-1); }
.timeline .org { color: var(--muted); margin-bottom: var(--s-4); font-size: 0.9375rem; }
.bullets { list-style: none; display: grid; gap: var(--s-2); }
.bullets li { position: relative; padding-left: var(--s-5); }
.bullets li::before {
  content: "";
  position: absolute;
  left: 2px; top: 0.72em;
  width: 8px; height: 1.5px;
  background: var(--accent);
}

/* ---------- 9. Capabilities ---------- */
.cap-grid {
  display: grid;
  gap: var(--s-7) var(--s-7);
}
@media (min-width: 900px) { .cap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.evidence { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.evidence caption { text-align: left; padding-bottom: var(--s-3); border-bottom: 1px solid var(--ink); }
.evidence caption h3 { font-size: 1.125rem; }
.evidence th, .evidence td { text-align: left; vertical-align: top; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.evidence th { font-weight: 500; color: var(--ink); padding-right: var(--s-4); width: 48%; }
.evidence td { color: var(--muted); }

.stack-groups { display: grid; gap: var(--s-5); }
.stack-group h4 { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-2); }

/* ---------- 10. Credentials ---------- */
.cred-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.cred-table th, .cred-table td { text-align: left; padding: 11px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.cred-table thead th { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--ink); padding-top: 0; }
.cred-table td:first-child { color: var(--ink); font-weight: 500; padding-right: var(--s-4); }
.cred-table td:nth-child(2) { color: var(--ink-2); padding-right: var(--s-4); }
.cred-table td:last-child, .cred-table th:last-child { text-align: right; white-space: nowrap; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); }
.cred-table abbr { text-decoration: none; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent); margin-left: 6px; }
@media (max-width: 639px) {
  .cred-table thead { display: none; }
  .cred-table tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .cred-table td { border: 0; padding: 0; }
  .cred-table td:nth-child(2) { grid-column: 1; grid-row: 2; font-size: 0.875rem; color: var(--muted); }
  .cred-table td:last-child { grid-column: 2; grid-row: 1; }
}

.two-col { display: grid; gap: var(--s-7); }
@media (min-width: 900px) { .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.plain-list { list-style: none; border-top: 1px solid var(--ink); }
.plain-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.plain-list li > span:first-child { color: var(--ink); }
.plain-list .note { color: var(--muted); font-size: 0.875rem; display: block; }
.plain-list .yr { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }
.award { font-weight: 600; color: var(--accent); }

/* ---------- 11. About ---------- */
.about-grid { display: grid; gap: var(--s-7); }
@media (min-width: 1000px) { .about-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s-8); } }
.about-story p { font-size: 1.0625rem; }
.about-story p:first-of-type { font-size: 1.25rem; color: var(--ink); line-height: 1.5; }

.principles { list-style: none; counter-reset: p; border-top: 1px solid var(--ink); }
.principles li {
  counter-increment: p;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: var(--s-3);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--rule);
}
.principles li::before {
  content: counter(p, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  padding-top: 3px;
}
.principles h4 { margin-bottom: 2px; }
.principles p { font-size: 0.9375rem; color: var(--ink-2); }

.photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
  margin-top: var(--s-7);
}
.photos figure { margin: 0; }
.photos img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--paper-2);
  filter: saturate(.85);
}
.photos figcaption { font-size: 0.8125rem; color: var(--muted); margin-top: var(--s-2); line-height: 1.45; }
@media (max-width: 639px) {
  .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photos figure:last-child { display: none; }
}

.pubs { display: grid; gap: var(--s-5); }
@media (min-width: 640px) { .pubs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pub { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.pub img { width: 84px; height: 134px; object-fit: cover; border: 1px solid var(--rule); border-radius: 2px; }
.pub h4 { font-size: 0.9375rem; line-height: 1.35; margin-bottom: var(--s-2); }
.pub p { font-size: 0.875rem; color: var(--ink-2); margin-bottom: var(--s-2); }

/* ---------- 12. Contact ---------- */
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin: var(--s-5) 0 var(--s-6);
}
.contact-email a {
  font-size: clamp(1.5rem, 3.6vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  line-height: 1.2;
  word-break: break-all;
}
.contact-email a:hover { color: var(--accent); }
.copy-btn { font: 500 0.8125rem/1 var(--font-mono); gap: 6px; width: auto; padding: 0 12px; display: inline-flex; align-items: center; }
.copy-btn .icon { width: 15px; height: 15px; }

.contact-grid { display: grid; gap: var(--s-7); margin-top: var(--s-7); }
@media (min-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s-8); } }

.link-list { list-style: none; border-top: 1px solid var(--ink); }
.link-list a {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
}
.link-list a .icon { width: 18px; height: 18px; }
.link-list a .handle { margin-left: auto; color: var(--muted); font-family: var(--font-mono); font-size: 0.8125rem; }
.link-list a .icon--arrow { width: 14px; height: 14px; color: var(--muted); transition: transform .15s ease; }
.link-list a:hover { color: var(--accent); }
.link-list a:hover .icon--arrow { transform: translate(2px, -2px); color: var(--accent); }

.form { display: grid; gap: var(--s-4); }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.field input, .field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font-sans);
  transition: border-color .15s ease;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field textarea:focus { border-color: var(--ink); outline: 2px solid var(--focus); outline-offset: 1px; }
.form-note { font-size: 0.8125rem; color: var(--muted); }
.form-status { font-size: 0.9375rem; min-height: 1.5em; margin: 0; }
.form-status[data-state="ok"] { color: var(--ok); }
.form-status[data-state="error"] { color: var(--accent); }

/* ---------- 13. Footer: see section 17 ---------- */

/* ---------- 14. Case study pages ---------- */
.cs-hero { padding-block: var(--s-8) var(--s-7); }
.breadcrumb { margin-bottom: var(--s-6); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 0.9375rem; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin: 0 var(--s-2); color: var(--rule); }
.breadcrumb a { text-decoration: none; color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current] { color: var(--ink); }
.cs-hero .meta { display: block; margin-bottom: var(--s-4); }
.cs-hero .meta .num { color: var(--accent); }
.cs-hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.75rem); max-width: 20ch; margin-bottom: var(--s-5); }
.cs-hero .hero-lead { max-width: 44rem; }

.cs-layout { display: grid; gap: var(--s-7); }
@media (min-width: 1000px) { .cs-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-8); } }
.cs-aside { align-self: start; }
@media (min-width: 1000px) { .cs-aside { position: sticky; top: calc(var(--header-h) + 24px); grid-column: 2; grid-row: 1; } }
.cs-aside .record { font-size: 0.875rem; }
.cs-aside .record dt { padding-right: var(--s-4); }
.cs-aside .btn { width: 100%; margin-top: var(--s-5); }

.prose { max-width: 70ch; }
.prose h2 {
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  margin: var(--s-8) 0 var(--s-4);
  padding-top: var(--s-5);
  border-top: 1px solid var(--rule);
  display: flex;
  gap: var(--s-4);
  align-items: baseline;
}
.prose h2:first-child { margin-top: 0; }
.prose h2 .num { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent); font-weight: 500; letter-spacing: .04em; }
.prose h3 { font-size: 1.125rem; margin: var(--s-6) 0 var(--s-3); }
.prose ul.bullets, .prose ol { margin-bottom: var(--s-4); }
.prose ol.steps { list-style: none; counter-reset: s; display: grid; gap: var(--s-3); border-top: 1px solid var(--rule); padding-top: var(--s-4); }
.prose ol.steps li { counter-increment: s; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--s-2); }
.prose ol.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent); padding-top: 4px; }
.prose code { font-family: var(--font-mono); font-size: 0.875em; background: var(--paper-2); padding: 1px 5px; border-radius: 2px; color: var(--ink); }
.prose pre { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 2px; padding: var(--s-3); overflow-x: auto; max-width: 100%; margin: var(--s-4) 0; }
.prose pre code { background: none; padding: 0; font-size: 0.8125rem; line-height: 1.6; white-space: pre; }

.callout {
  margin: var(--s-6) 0;
  padding: var(--s-5) var(--s-5) var(--s-5) var(--s-5);
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
}
.callout p { color: var(--ink); font-size: 1.125rem; line-height: 1.5; }
.callout .meta { display: block; margin-top: var(--s-2); }

.decisions { display: grid; gap: 0; border-top: 1px solid var(--ink); margin-top: var(--s-4); }
.decision { display: grid; gap: var(--s-2) var(--s-5); padding: var(--s-5) 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 640px) { .decision { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); } }
.decision h3 { font-size: 1rem; margin: 0; }
.decision .label { display: block; margin-bottom: 4px; }
.decision p { font-size: 0.9375rem; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; margin: var(--s-4) 0 var(--s-5); }
.data-table th, .data-table td { text-align: left; vertical-align: top; padding: 10px var(--s-4) 10px 0; border-bottom: 1px solid var(--rule); }
.data-table thead th { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--ink); }
.data-table td:first-child { color: var(--ink); font-weight: 500; white-space: nowrap; }
@media (max-width: 639px) {
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; }
  .data-table thead { display: none; }
  .data-table tr { padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .data-table td { border: 0; padding: 0; white-space: normal !important; }
}

.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  list-style: none;
  margin: var(--s-4) 0 var(--s-5);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
.flow li { padding: 6px 10px; border: 1px solid var(--ink); border-radius: var(--radius); color: var(--ink); }
.flow li.arrow { border: 0; padding: 0; color: var(--accent); }

.cs-pager {
  display: grid;
  gap: var(--s-4);
  border-top: 1px solid var(--ink);
  padding-top: var(--s-5);
  margin-top: var(--s-9);
}
@media (min-width: 640px) { .cs-pager { grid-template-columns: 1fr 1fr; } }
.cs-pager a { display: block; text-decoration: none; padding: var(--s-4) 0; }
.cs-pager a:last-child { text-align: right; }
.cs-pager .meta { display: block; margin-bottom: 4px; }
.cs-pager strong { font-size: 1.125rem; font-weight: 500; }
.cs-pager a:hover strong { color: var(--accent); }

/* ---------- 15. 404 ---------- */
.not-found { min-height: 60vh; display: grid; align-content: center; padding-block: var(--s-9); }
.not-found h1 { margin: var(--s-4) 0 var(--s-5); }

/* ---------- 16. Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@media print {
  .site-header, .filter-bar, .form, .copy-btn, .theme-toggle, .cs-pager { display: none !important; }
  .section { border-color: #999; padding-block: 24px; }
  details { display: block; }
  a { text-decoration: none; }
}

/* ---------- 17. v3 layout: hero, featured cards, footer ---------- */
[hidden] { display: none !important; }

@media (min-width: 1000px) {
  .hero { min-height: calc(100svh - var(--header-h)); display: grid; align-items: center; }
  .hero-grid { align-items: center; }
}
.hero-card .portrait img { width: 96px; height: 136px; }
.hero-card .portrait { grid-template-columns: 96px minmax(0, 1fr); }

/* Featured work cards */
.case-grid {
  list-style: none;
  display: grid;
  gap: var(--s-5);
  margin-top: var(--s-5);
}
@media (min-width: 820px) { .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.case-tilt {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--paper-2) 55%, var(--paper));
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}
.case-visual {
  position: relative;
  aspect-ratio: 5 / 3;
  background:
    linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 100% 24px,
    linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 24px 100%,
    var(--paper-2);
  background-blend-mode: normal;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.case-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, var(--paper-2) 100%);
  pointer-events: none;
}
.case-body {
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  flex: 1;
}
.case-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.case-statuses { display: inline-flex; gap: var(--s-4); flex-wrap: wrap; }
.case-id { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent); }
.case-body h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 500; letter-spacing: -0.02em; }
.case-body h3 a { text-decoration: none; }
.case-body h3 a:hover { color: var(--accent); }
.case-body .sub { color: var(--muted); font-size: 0.9375rem; margin: 0; }
.case-body > p { margin: 0; }
.case-body .tag-list { margin-top: var(--s-2); }
.case-links { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: auto; padding-top: var(--s-3); }

@media (min-width: 820px) {
  .case-card--wide { grid-column: 1 / -1; }
  .case-card--wide .case-tilt { flex-direction: row; }
  .case-card--wide .case-body { flex: 1.15; padding: var(--s-6); }
  .case-card--wide .case-visual { flex: 1; aspect-ratio: auto; min-height: 320px; border-bottom: 0; border-left: 1px solid var(--rule); }
  .case-card--flip .case-tilt { flex-direction: row-reverse; }
  .case-card--flip .case-visual { border-left: 0; border-right: 1px solid var(--rule); }
}

/* Diagrams inside the cards */
.motif { width: 100%; height: 100%; display: block; position: relative; z-index: 1; }
.m-grid, .m-wire, .m-ring { fill: none; stroke: var(--ink); stroke-opacity: .22; stroke-width: 1; }
.m-ring { stroke-dasharray: 3 5; }
.m-sweep { fill: var(--accent); fill-opacity: .2; }
.m-blip, .m-pin--hot, .m-packet { fill: var(--accent); }
.m-pin { fill: var(--ink); fill-opacity: .55; }
.m-radius { fill: var(--accent); fill-opacity: .18; }
.m-node rect { fill: var(--paper); stroke: var(--rule); stroke-width: 1.5; }
.m-road { fill: none; stroke: var(--ink); stroke-opacity: .1; stroke-width: 30; stroke-linecap: round; }
.m-dash { fill: none; stroke: var(--ink); stroke-opacity: .4; stroke-width: 1.5; stroke-dasharray: 8 10; }
.m-label { font: 500 9px var(--font-mono); letter-spacing: .1em; fill: var(--ink); }
.m-label--muted { fill: var(--muted); }

.browser {
  position: relative;
  z-index: 1;
  width: min(78%, 330px);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 24px 48px -24px color-mix(in srgb, var(--ink) 45%, transparent);
}
.browser-bar { display: flex; align-items: center; gap: 5px; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.browser-bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--rule); }
.browser-bar i:first-child { background: var(--accent); }
.browser-bar span { margin-left: 8px; font: 500 0.6875rem var(--font-mono); color: var(--muted); }
.browser img { width: 100%; height: auto; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--ink);
  padding-block: var(--s-7) var(--s-6);
  font-size: 0.875rem;
  color: var(--muted);
  overflow: hidden;
}
.site-footer .container { display: grid; gap: var(--s-6); }
.footer-top, .footer-bottom { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); justify-content: space-between; align-items: baseline; }
.footer-cta { font-size: clamp(1.125rem, 2vw, 1.5rem); color: var(--ink); margin: 0; letter-spacing: -0.01em; }
.footer-cta a { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.footer-time { margin: 0; font-variant-numeric: tabular-nums; }
.footer-bottom p { margin: 0; }
.site-footer a { color: var(--ink-2); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-4); list-style: none; }
.wordmark { margin-inline: -0.04em; }

/* ---------- Identity & search additions ---------- */
/* Name line inside the homepage H1: the page's main heading names the person it is about. */
.hero h1 .hero-name { display: block; font-size: 0.42em; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 0.35em; color: var(--ink-2); }
.hero h1 .hero-name .dot { color: var(--accent); }

/* Author line on case studies and the profile page */
.byline { display: block; margin-top: calc(-1 * var(--s-2)); color: var(--muted); }
.byline a { color: inherit; }
.byline a:hover { color: var(--accent); }

/* Profile page */
.profile-hero { display: grid; gap: var(--s-7); align-items: start; }
@media (min-width: 900px) { .profile-hero { grid-template-columns: minmax(0, 1fr) 260px; } }
.profile-hero .portrait img { width: 100%; height: auto; border-radius: 4px; }
.faq { border-top: 1px solid var(--ink); margin-top: var(--s-4); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: var(--s-4) 0; font-weight: 500; display: flex; justify-content: space-between; gap: var(--s-4); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--muted); }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--accent); }
.faq details > div { padding-bottom: var(--s-4); color: var(--ink-2); }
.prose .link-row { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); margin: var(--s-4) 0; }
