/* ==========================================================================
   AIgen Consult — Swiss Editorial Light
   Off-white ground · near-black ink · one deep ink-blue accent
   Hairline rules, strict modular grid, typographic numbers.
   Second typographic voice: JetBrains Mono for labels, indices, dates,
   tags and tabular figures — ink-blue reserved for data ink.
   ========================================================================== */

@font-face {
  font-family: "InterVar";
  src: url("/assets/fonts/InterVariable.woff2?v=20260702") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Regular.woff2?v=20260702") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Medium.woff2?v=20260702") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fbfbf9;
  --surface: #ffffff;
  --band: #f3f3ef;
  --ink: #101114;
  --ink-2: #33363c;
  --muted: #575b63;
  --label: #62666e;
  --ghost: #8f939b;
  --line: #e3e3dd;
  --line-mid: #c9c9c1;
  --accent: #1f3dc4;
  --accent-deep: #162c8e;
  --accent-tint: #94a7ff;
  --sans: "InterVar", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --container: min(1160px, 100% - 48px);
  --header-h: 64px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

h1, h2, h3 { margin: 0; font-weight: 600; }

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

/* --- skip link ----------------------------------------------------------- */

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 200;
  transform: translateY(-300%);
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.skip-link:focus { transform: translateY(0); }

/* --- header --------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 251, 249, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 32px;
  width: var(--container);
  min-height: var(--header-h);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-text strong {
  display: block;
  font-size: 14.5px;
  font-weight: 640;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-text small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  padding: 8px 10px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 530;
  letter-spacing: -0.005em;
  transition: color 160ms ease;
}

.nav a:hover { color: var(--accent); }

.header-cta {
  min-width: max-content;
  padding: 9px 16px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 590;
  letter-spacing: -0.005em;
  transition: background-color 160ms ease;
}

.header-cta:hover { background: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--line-mid);
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  transition: transform 200ms ease;
}

.nav-open .nav-toggle span:first-child { transform: translateY(4.5px) rotate(45deg); }
.nav-open .nav-toggle span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

/* --- shared shells --------------------------------------------------------- */

.section-shell {
  width: var(--container);
  margin: 0 auto;
  padding: 104px 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  color: var(--label);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 22px;
  height: 1px;
  background: var(--line-mid);
}

/* Section indices — decorative Swiss numbering via CSS only */
#services .eyebrow::before,
#work .eyebrow::before,
#proof .eyebrow::before,
#profile .eyebrow::before,
#opensource .eyebrow::before,
#method .eyebrow::before,
#contact .eyebrow::before {
  width: auto;
  height: auto;
  background: none;
  color: var(--accent);
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.04em;
}

#services .eyebrow::before { content: "01"; }
#work .eyebrow::before { content: "02"; }
#proof .eyebrow::before { content: "03"; }
#profile .eyebrow::before { content: "04"; }
#opensource .eyebrow::before { content: "05"; }
#method .eyebrow::before { content: "06"; }
#contact .eyebrow::before { content: "07"; }


.section-heading h2 {
  max-width: 22ch;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 620;
  letter-spacing: -0.028em;
  line-height: 1.12;
  text-wrap: balance;
}

.section-heading.narrow h2 { max-width: 20ch; }

.section-heading p:not(.eyebrow) {
  max-width: 52ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
}

.section-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.section-split .section-heading {
  position: sticky;
  top: calc(var(--header-h) + 40px);
}

/* --- hero ------------------------------------------------------------------ */

.hero {
  padding-top: clamp(64px, 8vh, 100px);
  padding-bottom: clamp(72px, 9vh, 100px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(300px, 4fr);
  gap: clamp(48px, 6vw, 92px);
  align-items: start;
}

.hero h1 {
  font-size: clamp(2.6rem, 4.35vw, 3.9rem);
  font-weight: 635;
  letter-spacing: -0.032em;
  line-height: 1.04;
  text-wrap: balance;
}

.hero-lede {
  max-width: 58ch;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.25vw, 1.1rem);
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 38px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  border: 1px solid var(--ink);
  font-size: 14.5px;
  font-weight: 590;
  letter-spacing: -0.005em;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.button-primary {
  color: #fff;
  background: var(--ink);
}

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

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

.button-secondary:hover {
  color: #fff;
  background: var(--ink);
}

.button-invert {
  color: var(--ink);
  background: #fff;
  border-color: #fff;
}

.button-invert:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.full { width: 100%; }

/* --- hero operating-proof instrument panel ----------------------------------- */

.hero-proof {
  border-top: 2px solid var(--ink);
  padding-top: 18px;
}

.panel-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--label);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.status-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 61, 196, 0.14);
}

.proof-list {
  margin: 8px 0 0;
  padding: 0;
}

.proof-list > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 20px;
  align-items: baseline;
  padding: 15px 0;
}

.proof-list > div + div {
  border-top: 1px solid var(--line);
}

.proof-list dt {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.proof-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* --- credibility strip (single mono line between hairlines) ------------------- */

.credibility-strip {
  border-block: 1px solid var(--line);
}

.strip-inner {
  width: var(--container);
  margin: 0 auto;
}

.credibility-strip ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 28px;
  margin: 0;
  padding: 22px 0;
  list-style: none;
}

.credibility-strip li {
  color: var(--label);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* --- problems (ruled editorial rows) ----------------------------------------- */

.problem-list {
  display: grid;
}

.problem-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px;
  align-items: baseline;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.problem-row:first-child { border-top: 0; padding-top: 6px; }

.row-index,
.profile-row > span,
.ledger article > span {
  color: var(--label);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

.row-index { color: var(--accent); }

/* Dates and tags sit right-aligned against the gutter for strict columns */
.profile-row > span,
.ledger article > span {
  text-align: right;
}

.problem-row h3 {
  font-size: 1.18rem;
  font-weight: 615;
  letter-spacing: -0.018em;
  line-height: 1.3;
}

.problem-row p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.68;
}

/* --- engagement band (full-bleed ink for mid-page rhythm) ----------------------- */

.section-band {
  color: #f4f4f2;
  background: var(--ink);
}

.section-band .section-heading h2 { color: #ffffff; }

.section-band .eyebrow { color: #9aa0a9; }
.section-band .eyebrow::before { background: #4a4e56; }

/* Index numerals on dark bands read in the tint data-ink */
#work .eyebrow::before,
#contact .eyebrow::before { color: var(--accent-tint); }

.section-band :focus-visible { outline-color: var(--accent-tint); }

.engagement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px);
  margin-top: 64px;
}

.engagement-grid article {
  display: flex;
  flex-direction: column;
  border-top: 2px solid #f4f4f2;
  padding-top: 20px;
}

.card-kicker {
  margin: 0;
  color: var(--accent-tint);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.engagement-grid h3 {
  margin-top: 16px;
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 620;
  letter-spacing: -0.022em;
  line-height: 1.22;
}

.engagement-grid article > p:not(.card-kicker) {
  margin: 14px 0 0;
  color: #a9adb5;
  font-size: 14.5px;
  line-height: 1.68;
}

.engagement-grid ul {
  display: grid;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.engagement-grid li {
  display: flex;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid rgba(244, 244, 242, 0.16);
  color: #ced1d6;
  font-size: 13.5px;
  line-height: 1.5;
}

.engagement-grid li::before {
  content: "—";
  color: var(--accent-tint);
  flex: none;
}

/* --- evidence ledger ---------------------------------------------------------- */

.ledger {
  display: grid;
}

.ledger article {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.ledger article:first-child { border-top: 0; padding-top: 6px; }

.ledger article > span {
  padding-top: 3px;
  text-transform: uppercase;
}

.ledger h3 {
  font-size: 1.1rem;
  font-weight: 615;
  letter-spacing: -0.016em;
  line-height: 1.35;
}

.ledger p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.66;
}

/* --- profile (ruled ledger with mono date gutter) ----------------------------------- */

.profile-section {
  border-top: 1px solid var(--line);
}

.profile-ledger {
  margin-top: 56px;
  border-top: 2px solid var(--ink);
}

.profile-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  column-gap: 40px;
  padding: 24px 0;
}

.profile-row + .profile-row {
  border-top: 1px solid var(--line);
}

.profile-row > span {
  grid-row: 1;
  padding-top: 4px;
}

.profile-row h3 {
  grid-row: 1;
  grid-column: 2;
  font-size: 1.06rem;
  font-weight: 615;
  letter-spacing: -0.014em;
  line-height: 1.35;
}

.profile-row p {
  grid-column: 2;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.64;
}

/* --- open source ---------------------------------------------------------------------- */

.open-source-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
  border-top: 1px solid var(--line);
}

.open-source-grid .section-heading {
  position: sticky;
  top: calc(var(--header-h) + 40px);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  color: var(--accent);
  font-size: 14.5px;
  font-weight: 590;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.text-link::after {
  content: "→";
  transition: transform 160ms ease;
}

.text-link:hover { color: var(--accent-deep); }
.text-link:hover::after { transform: translateX(4px); }

.repo-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 8px;
  padding: 0 0 26px;
}

.repo-stats > div + div {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.repo-stats dt {
  color: var(--accent);
  font-family: var(--mono);
  font-size: clamp(1.8rem, 2.4vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.repo-stats dd {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.repo-list {
  display: grid;
}

.repo-list a {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  align-items: baseline;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  transition: color 160ms ease;
}

.repo-list strong {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color 160ms ease;
}

.repo-list a:hover strong { color: var(--accent); }

.repo-list span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.62;
}

/* --- method ---------------------------------------------------------------------------- */

.method-section {
  border-top: 1px solid var(--line);
}

.method-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 40px);
  margin: 64px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.method-list li {
  border-top: 1px solid var(--line-mid);
  padding-top: 20px;
}

.method-list li > span {
  display: block;
  color: var(--ghost);
  font-size: clamp(2.2rem, 2.9vw, 2.8rem);
  font-weight: 280;
  letter-spacing: -0.03em;
  line-height: 1;
  font-feature-settings: "tnum" 1;
}

.method-list h3 {
  margin-top: 22px;
  font-size: 1.1rem;
  font-weight: 620;
  letter-spacing: -0.015em;
}

.method-list p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.64;
}

/* --- stack ---------------------------------------------------------------------------- */

.stack-section {
  padding-top: 0;
  padding-bottom: 104px;
}

.stack-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.stack-cloud span {
  color: var(--label);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}

.stack-cloud span::after {
  content: "/";
  margin: 0 14px;
  color: var(--line-mid);
}

.stack-cloud span:last-child::after { content: none; }

/* --- contact band ----------------------------------------------------------------------- */

.contact-band {
  color: #f4f4f2;
  background: var(--ink);
}

.final-cta {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(48px, 7vw, 110px);
  align-items: start;
  padding: clamp(88px, 11vh, 128px) 0;
}

.contact-band .eyebrow { color: #9aa0a9; }
.contact-band .eyebrow::before { background: #4a4e56; }

.contact-band :focus-visible { outline-color: var(--accent-tint); }

.contact-copy h2 {
  max-width: 18ch;
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  font-weight: 630;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: #fff;
  text-wrap: balance;
}

.contact-copy p:not(.eyebrow) {
  max-width: 46ch;
  margin: 24px 0 0;
  color: #a9adb5;
  font-size: 15.5px;
  line-height: 1.7;
}

.contact-card {
  display: grid;
  align-content: start;
  font-style: normal;
}

.contact-card .button { margin-bottom: 14px; }

.contact-card a:not(.button) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 2px;
  border-top: 1px solid rgba(244, 244, 242, 0.16);
  color: #e8e9e6;
  font-size: 14.5px;
  font-weight: 530;
  transition: color 160ms ease;
}

.contact-card a:not(.button)::after {
  content: "→";
  color: var(--accent-tint);
  transition: transform 160ms ease;
}

.contact-card a:not(.button):hover { color: #fff; }
.contact-card a:not(.button):hover::after { transform: translateX(4px); }

.contact-card p {
  margin: 18px 0 0;
  color: #8d9199;
  font-size: 12.5px;
  line-height: 1.6;
}

/* --- footer ---------------------------------------------------------------------------- */

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

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  width: var(--container);
  margin: 0 auto;
  padding: 26px 0 34px;
  color: var(--muted);
  font-size: 13px;
}

.footer p { margin: 0; }

.footer .footer-inner > div {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer a {
  color: var(--ink-2);
  font-weight: 550;
  transition: color 160ms ease;
}

.footer a:hover { color: var(--accent); }

/* --- 404 ------------------------------------------------------------------------------- */

.not-found {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px;
}

.not-found-card {
  width: min(680px, 100%);
  border-top: 2px solid var(--ink);
  padding-top: 26px;
}

.not-found-card h1 {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 640;
  letter-spacing: -0.034em;
  line-height: 1.04;
}

.not-found-card p:not(.eyebrow) {
  max-width: 46ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
}

.not-found-card .hero-actions { margin-top: 34px; }

/* --- reveal motion ----------------------------------------------------------------------- */

[data-reveal] { opacity: 1; }

.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1), transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- responsive --------------------------------------------------------------------------- */

@media (max-width: 1060px) {
  .method-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 44px;
  }

  .problem-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .problem-row p {
    grid-column: 2;
  }

  .profile-row { grid-template-columns: 170px minmax(0, 1fr); }
}

@media (max-width: 940px) {
  .section-split,
  .open-source-grid,
  .final-cta {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .section-split .section-heading,
  .open-source-grid .section-heading {
    position: static;
  }

  .engagement-grid {
    grid-template-columns: 1fr;
    gap: 44px;
    margin-top: 52px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .credibility-strip ul {
    justify-content: flex-start;
    gap: 12px 26px;
  }
}

/* --- mobile navigation --------------------------------------------------------------------- */

@media (max-width: 880px) {
  .nav-toggle { display: flex; }

  .header-cta {
    margin-left: auto;
    padding: 8px 13px;
    font-size: 12.5px;
  }

  .brand { margin-right: 0; }

  .nav {
    position: absolute;
    top: 100%;
    left: calc(50% - 50vw);
    width: 100vw;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 48px rgba(16, 17, 20, 0.08);
  }

  .nav-open .nav { display: flex; }

  .nav a {
    width: var(--container);
    margin: 0 auto;
    padding: 15px 0;
    border-top: 1px solid var(--line);
    font-size: 15.5px;
    font-weight: 570;
  }

  .nav a:first-child { border-top: 0; }
}

@media (max-width: 640px) {
  :root { --container: min(1160px, 100% - 40px); }

  html { scroll-padding-top: calc(var(--header-h) + 12px); }

  .brand-text small { display: none; }

  .header-inner { gap: 14px; }

  .header-cta {
    padding: 8px 10px;
    font-size: 11px;
  }

  .section-shell { padding: 76px 0; }

  .hero {
    padding-top: 44px;
    padding-bottom: 64px;
  }

  .hero-grid { gap: 52px; }

  .hero h1 { font-size: clamp(2.25rem, 9.4vw, 2.9rem); }

  .hero-actions { margin-top: 32px; }

  .hero-actions .button { width: 100%; }

  .proof-list > div {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 16px;
  }

  .problem-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 26px 0;
  }

  .problem-row .row-index { margin-bottom: 2px; }

  .problem-row p { grid-column: auto; }

  .ledger article,
  .repo-list a {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ledger article > span { text-align: left; }

  .repo-stats > div + div { padding-left: 18px; }

  .profile-row {
    grid-template-columns: 1fr;
    padding: 22px 0;
  }

  .profile-row > span {
    grid-row: auto;
    padding-top: 0;
    margin-bottom: 8px;
    text-align: left;
  }

  .profile-row h3,
  .profile-row p {
    grid-row: auto;
    grid-column: 1;
  }

  .method-list {
    grid-template-columns: 1fr;
    row-gap: 36px;
  }

  .stack-section { padding-bottom: 76px; }

  .contact-card .button {
    font-size: 13.5px;
    padding: 0 16px;
  }

  .footer-inner { padding: 22px 0 30px; }
}

/* --- reduced motion --------------------------------------------------------------------------- */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
