/* ==========================================================================
   tgabor.eu — main stylesheet
   Structure: fonts · tokens · base · layout · components · sections · diagrams
   ========================================================================== */

/* ---------- Fonts (IBM Plex, SIL OFL 1.1 — see THIRD_PARTY_NOTICES.md) --- */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-normal.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;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-ext-400-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-500-normal.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: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-ext-500-normal.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-20C0, 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-latin-400-normal.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: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-ext-400-normal.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-20C0, 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-latin-500-normal.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-latin-ext-500-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ------------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Light: warm paper, deep navy ink, one burnt-orange signal colour */
  --bg: #f3f2ee;
  --bg-raised: #fbfaf7;
  --bg-sunken: #e9e7e1;
  --ink: #0f1a2a;
  --ink-2: #2e3a4b;
  --muted: #566070;
  --rule: #d6d3cb;
  --rule-strong: #a8a499;
  --accent: #b23f0d;
  --accent-ink: #ffffff;
  --accent-soft: #f2dccf;
  --focus: #1d5fd1;

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

  --step--1: clamp(0.82rem, 0.8rem + 0.1vw, 0.875rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.06rem + 0.3vw, 1.25rem);
  --step-2: clamp(1.35rem, 1.2rem + 0.6vw, 1.65rem);
  --step-3: clamp(1.75rem, 1.4rem + 1.5vw, 2.6rem);
  --step-4: clamp(2.35rem, 1.6rem + 3.4vw, 4.6rem);

  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1280px;
  --header-h: 64px;
  --section-gap: clamp(72px, 10vw, 136px);
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c131e;
    --bg-raised: #121b28;
    --bg-sunken: #09101a;
    --ink: #ebe8e1;
    --ink-2: #c7c4bc;
    --muted: #959daa;
    --rule: #233041;
    --rule-strong: #3d4d63;
    --accent: #f08a4b;
    --accent-ink: #0c131e;
    --accent-soft: #3b2417;
    --focus: #7fb0ff;
  }
}

/* ---------- Base --------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul[role="list"], ol[role="list"] { list-style: none; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--rule-strong);
  transition: text-decoration-color 150ms ease, color 150ms ease;
}
a:hover { text-decoration-color: var(--accent); }

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

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

svg { display: block; }

.sr-only {
  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(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }

/* Arrow glyphs are not in the Plex web subsets: let a system font render them */
.arrow { font-family: system-ui, sans-serif; font-weight: 400; color: var(--accent); }

/* Shared typographic roles */
.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 38em;
}

/* ---------- Layout ------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-gap) 0; }

/* Editorial section frame: a narrow rail with the section index, wide content */
.section__frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px 48px;
  border-top: 1px solid var(--ink);
  padding-top: 20px;
}
@media (min-width: 960px) {
  .section__frame { grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); }
}

.section__rail {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
@media (min-width: 960px) {
  .section__rail { flex-direction: column; gap: 4px; }
  .section__rail > * { position: sticky; top: calc(var(--header-h) + 20px); }
}
.section__index { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); letter-spacing: 0.08em; }

.section__title {
  font-size: var(--step-3);
  max-width: 20ch;
  margin-bottom: clamp(24px, 3vw, 40px);
}
.section__intro { margin-bottom: clamp(36px, 5vw, 56px); }
.section__frame > .cases,
.section__frame > .also,
.section__frame > .domains,
.section__frame > .domains__note { grid-column: 1 / -1; }
.nw { white-space: nowrap; }
.section__intro .section__title { margin-bottom: 16px; }
.section__intro p { color: var(--ink-2); max-width: 40em; }

/* ---------- Header & navigation ----------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  position: relative;
}
.brand__mark::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 7px;
  height: 7px;
  background: var(--accent);
}
.brand__role { color: var(--muted); font-weight: 400; }
@media (max-width: 1100px) { .brand__role { display: none; } }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 32px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  text-decoration: none;
  font-size: 0.9375rem;
  color: var(--ink-2);
  padding-block: 8px;
  position: relative;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="true"] { color: var(--ink); }
.site-nav a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 2px;
  background: var(--accent);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 500 0.9375rem/1 var(--font-sans);
  cursor: pointer;
}
.nav-toggle__icon {
  width: 16px; height: 10px;
  position: relative;
  border-top: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transition: transform 200ms ease;
}
.nav-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-top: 1.5px solid currentColor;
  transform: translateY(-50%);
}

@media (max-width: 860px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav {
    position: absolute;
    left: 0; right: 0; top: var(--header-h);
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: 8px var(--gutter) 24px;
    display: none;
  }
  .js .nav-open .site-nav { display: block; }
  .js .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .js .site-nav li { border-top: 1px solid var(--rule); }
  .js .site-nav li:first-child { border-top: 0; }
  .js .site-nav a { display: flex; padding-block: 14px; font-size: 1.125rem; }
  .js .site-nav a[aria-current="true"]::after { display: none; }
  .js .site-nav .btn { margin-top: 16px; justify-content: center; }

  /* Without JavaScript the links simply wrap below the brand */
  html:not(.js) .site-header__bar { height: auto; flex-wrap: wrap; padding-block: 12px; }
  html:not(.js) .site-nav ul { flex-wrap: wrap; gap: 4px 20px; }
}

/* ---------- Buttons ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font: 500 0.9375rem/1 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--small { min-height: 40px; padding: 0 14px; font-size: 0.875rem; }
.site-nav .btn { color: var(--bg); padding-block: 0; }
.site-nav .btn:hover { color: var(--accent-ink); }

/* ---------- Hero --------------------------------------------------------- */

.hero { padding-block: clamp(32px, 5vw, 72px) 0; }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
@media (min-width: 960px) {
  .hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; }
}

.hero__eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: clamp(20px, 3vw, 32px);
}
.hero__eyebrow .label:first-child { color: var(--ink); }

.hero__title {
  font-size: var(--step-4);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 15ch;
  margin-bottom: clamp(20px, 3vw, 32px);
}
.hero__title em { font-style: normal; color: var(--accent); }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(28px, 4vw, 40px);
}

.hero__visual { justify-self: center; width: 100%; max-width: 440px; }
.hero__visual svg { width: 100%; height: auto; }
@media (max-width: 719px) { .hero__visual { display: none; } }

.proof {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(48px, 6vw, 72px);
  border-top: 1px solid var(--ink);
}
@media (min-width: 860px) { .proof { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.proof__item {
  padding: 20px 20px 4px 0;
  border-bottom: 1px solid var(--rule);
}
.proof__item + .proof__item { padding-left: 20px; border-left: 1px solid var(--rule); }
@media (max-width: 859px) {
  .proof__item:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (min-width: 860px) { .proof__item { border-bottom: 0; } }
.proof__value {
  display: block;
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.proof__value small { font-size: 0.5em; letter-spacing: 0; margin-left: 2px; }
.proof__text { display: block; margin-top: 8px; padding-bottom: 16px; font-size: var(--step--1); color: var(--muted); line-height: 1.45; max-width: 24ch; }

/* ---------- Profile ------------------------------------------------------ */

.profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px 56px;
}
@media (min-width: 1100px) { .profile { grid-template-columns: minmax(0, 6fr) minmax(0, 3fr); } }

.profile__text { display: grid; gap: 1.1em; max-width: 40em; }
.profile__text p:first-child { font-size: var(--step-1); color: var(--ink); }
.profile__text p { color: var(--ink-2); }

.facts { display: grid; align-content: start; border-top: 1px solid var(--rule); }
.facts > div {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: 12px;
  padding-block: 12px;
  border-bottom: 1px solid var(--rule);
  font-size: var(--step--1);
}
@media (min-width: 1100px) { .facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.facts dt { color: var(--muted); font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 2px; }
.facts dd { color: var(--ink); }

/* ---------- Case studies ------------------------------------------------- */

.cases { display: grid; gap: clamp(56px, 8vw, 96px); }

.case {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px 48px;
  align-items: start;
}
@media (min-width: 1100px) {
  .case { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px 64px; }
  .case:nth-child(even) { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .case:nth-child(even) .case__figure { order: -1; }
}

.case__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 14px; }
.case__no { color: var(--accent); }
.case__title { font-size: var(--step-2); max-width: 28ch; margin-bottom: 16px; }
.case__summary { color: var(--ink-2); max-width: 36em; }

.case__figure-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.case__metric { display: grid; gap: 2px; white-space: nowrap; }
.case__metric strong { font-size: var(--step-2); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.case__metric span { font-size: var(--step--1); color: var(--muted); }

.constraints { display: grid; gap: 0; margin-top: 24px; border-top: 1px solid var(--rule); }
.constraints li {
  display: grid;
  grid-template-columns: 1.6em minmax(0, 1fr);
  padding-block: 10px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.constraints li::before { content: "—"; color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.tags li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1;
  padding: 6px 8px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  color: var(--ink-2);
  white-space: nowrap;
}

/* Expandable detail: native <details>, no JavaScript required */
.more { margin-top: 24px; border-top: 1px solid var(--ink); }
.more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  font-size: 0.9375rem;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after {
  content: "";
  width: 10px; height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform 200ms ease;
  flex: none;
}
.more[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.more > summary:hover { color: var(--accent); }
.more__closed-hint { margin-left: 6px; }
@media (max-width: 599px) { .more__closed-hint { display: none; } }
.more__closed-hint { color: var(--muted); font-weight: 400; }
.more[open] .more__closed-hint { display: none; }

.breakdown { display: grid; padding-bottom: 8px; }
.breakdown > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px 24px;
  padding-block: 14px;
  border-top: 1px solid var(--rule);
}
@media (min-width: 640px) { .breakdown > div { grid-template-columns: 9.5em minmax(0, 1fr); } }
.breakdown dt { padding-top: 3px; }
.breakdown dd { color: var(--ink-2); font-size: 0.9688rem; }
.breakdown dd ul { padding-left: 1.1em; display: grid; gap: 4px; }

.case__figure {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  padding: clamp(16px, 2.5vw, 28px);
}
@media (max-width: 599px) {
  .case__figure { margin-inline: calc(var(--gutter) * -1); border-inline: 0; padding-inline: 10px; }
  .case__figure figcaption { padding-inline: 6px; }
}
.case__figure svg { width: 100%; height: auto; max-width: 560px; margin-inline: auto; }
.case__figure figcaption {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Further engagements: compact rows */
.also { margin-top: clamp(72px, 9vw, 112px); }
.also__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 8px; }
.also__head h3 { font-size: var(--step-2); }

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px 40px;
  padding-block: 28px;
  border-top: 1px solid var(--rule);
}
.row:last-child { border-bottom: 1px solid var(--rule); }
@media (min-width: 900px) { .row { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.row__title { font-size: var(--step-1); font-weight: 500; line-height: 1.3; margin-top: 8px; max-width: 26ch; }
.row__body { display: grid; gap: 14px; color: var(--ink-2); }
.row__body .tags { margin-top: 4px; }

.shifts { display: grid; border-top: 1px solid var(--rule); }
.shifts li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr);
  gap: 12px;
  align-items: baseline;
  padding-block: 10px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.shifts .from { color: var(--muted); }
.shifts .to { color: var(--ink); }

/* ---------- Expertise ---------------------------------------------------- */

.domains { border-top: 1px solid var(--ink); }
.domain {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 40px;
  padding-block: 28px;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 760px) { .domain { grid-template-columns: 3.5em minmax(0, 4fr) minmax(0, 6fr); } }
@media (min-width: 1100px) { .domain { grid-template-columns: calc((100% - 48px) / 4) minmax(0, 4fr) minmax(0, 5fr); gap: 10px 48px; } }
.domain__no { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent); padding-top: 4px; }
.domain__name { font-size: var(--step-1); font-weight: 500; line-height: 1.3; }
.domain__desc { margin-top: 8px; color: var(--ink-2); font-size: 0.9688rem; max-width: 34em; }
.stack { display: grid; gap: 10px; align-content: start; }
.stack > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px 16px; }
@media (min-width: 560px) { .stack > div { grid-template-columns: 8.5em minmax(0, 1fr); } }
.stack dt { padding-top: 3px; }
.stack dd { font-size: 0.9688rem; color: var(--ink); }
.domains__note { margin-top: 20px; font-size: var(--step--1); color: var(--muted); max-width: 52em; }

/* ---------- Approach ----------------------------------------------------- */

.principles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--ink);
  counter-reset: principle;
}
@media (min-width: 760px) { .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; } }
.principle {
  padding-block: 24px 28px;
  border-bottom: 1px solid var(--rule);
  counter-increment: principle;
}
.principle h3 { font-size: var(--step-1); font-weight: 500; line-height: 1.3; display: flex; gap: 14px; align-items: baseline; }
.principle h3::before { content: counter(principle, decimal-leading-zero); font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent); }
.principle p { margin-top: 10px; color: var(--ink-2); font-size: 0.9688rem; max-width: 34em; }

/* ---------- Background --------------------------------------------------- */

.sides {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 48px;
  border-top: 1px solid var(--ink);
}
@media (min-width: 760px) { .sides { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.side { padding-block: 24px; border-bottom: 1px solid var(--rule); }
.side h3 { font-size: var(--step-1); font-weight: 500; margin: 8px 0 14px; }
.side ul { display: grid; gap: 8px; padding-left: 0; list-style: none; }
.side li { display: grid; grid-template-columns: 1.4em minmax(0, 1fr); color: var(--ink-2); font-size: 0.9688rem; }
.side li::before { content: "·"; color: var(--accent); font-weight: 500; }

.notes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 48px;
  margin-top: 0;
}
@media (min-width: 760px) { .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.note { padding-block: 24px; border-bottom: 1px solid var(--rule); }
.note p:not(.label) { margin-top: 8px; color: var(--ink-2); font-size: 0.9688rem; }

/* ---------- Contact ------------------------------------------------------ */

.contact__email {
  display: inline-block;
  font-size: clamp(1.75rem, 1rem + 4vw, 4.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-decoration: none;
  overflow-wrap: anywhere;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
}
.contact__email:hover { color: var(--accent); }
.contact__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 28px; }
.copy-status { font-size: var(--step--1); color: var(--muted); min-height: 1.5em; }
.contact__meta { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: var(--step--1); color: var(--muted); }
.contact__meta strong { color: var(--ink); font-weight: 500; }
[data-copy][hidden] { display: none; }

.notfound .hero__title { margin-top: 16px; }

/* ---------- Footer ------------------------------------------------------- */

.site-footer { margin-top: var(--section-gap); padding-block: 28px 40px; border-top: 1px solid var(--ink); font-size: var(--step--1); color: var(--muted); }
.site-footer__grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }

/* ---------- Diagrams (inline SVG, themed through tokens) ------------------ */

.dg { font-family: var(--font-mono); overflow: visible; }
.dg text { fill: var(--ink); font-size: 11.5px; }
.dg .t-s { font-size: 10.5px; fill: var(--muted); }
.dg .t-b { font-weight: 500; letter-spacing: 0.06em; }
.dg .t-acc { fill: var(--accent); }
.dg .t-slot { font-size: 10px; }
@media (max-width: 359px) { .dg .t-slot { font-size: 9px; } }
.dg .t-muted { fill: var(--muted); }
.dg .t-mid { text-anchor: middle; }
.dg .t-end { text-anchor: end; }

.dg .box { fill: var(--bg-raised); stroke: var(--ink-2); stroke-width: 1; }
.dg .box-soft { fill: var(--bg-sunken); stroke: var(--rule-strong); stroke-width: 1; }
.dg .box-ghost { fill: none; stroke: var(--rule-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.dg .line { fill: none; stroke: var(--ink-2); stroke-width: 1; }
.dg .line-muted { fill: none; stroke: var(--rule-strong); stroke-width: 1; }
.dg .dash { stroke-dasharray: 4 3; }
.dg .dot { stroke-dasharray: 1 3; stroke-linecap: round; }
.dg .acc { fill: none; stroke: var(--accent); stroke-width: 1.75; }
.dg .acc-fill { fill: var(--accent); }
.dg .ink-fill { fill: var(--ink); }
.dg .bg-fill { fill: var(--bg-raised); }
.dg .layer { fill: none; stroke: var(--rule-strong); stroke-width: 1; }
.dg .layer-fill { fill: var(--bg-sunken); }

/* Hero stack */
.stack-visual text { font-size: 10.5px; }
.stack-visual .t-layer { fill: var(--ink); font-weight: 500; letter-spacing: 0.08em; font-size: 10.5px; }
.stack-visual .t-sub { fill: var(--muted); font-size: 10px; }
.stack-visual .trace { stroke-dasharray: 520; stroke-dashoffset: 0; }

@media (prefers-reduced-motion: no-preference) {
  .stack-visual .trace { animation: trace 1.6s cubic-bezier(.4, 0, .2, 1) 0.3s both; }
  .stack-visual .node { animation: node-in 0.3s ease-out both; }
  .stack-visual .node:nth-of-type(1) { animation-delay: 0.45s; }
  .stack-visual .node:nth-of-type(2) { animation-delay: 0.7s; }
  .stack-visual .node:nth-of-type(3) { animation-delay: 0.95s; }
  .stack-visual .node:nth-of-type(4) { animation-delay: 1.2s; }
  .stack-visual .node:nth-of-type(5) { animation-delay: 1.45s; }
  .stack-visual .node:nth-of-type(6) { animation-delay: 1.7s; }
}
@keyframes trace { from { stroke-dashoffset: 520; } to { stroke-dashoffset: 0; } }
@keyframes node-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Motion preferences ------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Print -------------------------------------------------------- */

@media print {
  .site-header, .skip-link, .hero__actions, .contact__actions, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .more > .breakdown { display: grid !important; }
  .section { padding-top: 32px; }
}
