/* Outcore Tech — "Control Room" styles.
   Spec: docs/superpowers/specs/2026-09-28-outcore-tech-site-design.md §4.
   Colours come only from the tokens below; tools/check-contrast.mjs enforces their contract. */

/* ---------- Fonts (self-hosted, Latin subset, SIL OFL — see ../fonts/OFL.txt) ---------- */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-latin-var.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
/* Hebrew subset, used only by the בס״ד line. Not preloaded; unicode-range means it's fetched only for Hebrew text. */
@font-face {
  font-family: "IBM Plex Sans Hebrew";
  src: url("../fonts/ibm-plex-sans-hebrew-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0590-05FF, U+FB1D-FB4F;
}

/* ---------- Tokens: light (default) ---------- */
:root {
  --bg: #f3f2ee;
  --surface: #ffffff;
  --surface-2: #ebeae5;
  --line: #d6d8dc;
  --field-border: #767e88;
  --text: #12161b;
  --muted: #57616c;
  --accent: #ffb020;
  --accent-text: #8a5a00;
  --on-accent: #16110a;
  --focus: #8a5a00;
  --danger: #b42318;
  /* Logo mark (decorative, exempt from the contrast contract). The spectrum ends on the node colour;
     --signal-node-off is the unlit node, a dim amber on the header (--surface at 90% over --bg). */
  --spectrum-1: #7c3aed;
  --spectrum-2: #2563eb;
  --spectrum-3: #0891b2;
  --spectrum-4: #1aa957;
  --spectrum-5: #d9a400;
  --spectrum-6: #f5a30f;
  --signal-node: #f5a30f;
  --signal-node-off: #fbd693;
  --mark-bloom-opacity: 0.45;
  --mark-beam-opacity: 0.38;
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header-h: 64px;
  /* The בס״ד bar: 6px top padding + one line of .bsd (0.875rem × 1.5). The 404 subtracts it to stay above the fold. */
  --bsd-h: calc(6px + 1.3125rem);
  --radius: 4px;
}

/* ---------- Tokens: dark ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1115;
    --surface: #151a20;
    --surface-2: #1b2129;
    --line: #27303a;
    --field-border: #6b7684;
    --text: #e7eaee;
    --muted: #9ba5b1;
    --accent: #ffb020;
    --accent-text: #ffb020;
    --on-accent: #16110a;
    --focus: #ffb020;
    --danger: #ff7a70;
    --spectrum-1: #8b5cf6;
    --spectrum-2: #3b82f6;
    --spectrum-3: #06b6d4;
    --spectrum-4: #22c55e;
    --spectrum-5: #eab308;
    --spectrum-6: #ffb020;
    --signal-node: #ffb020;
    --signal-node-off: #674f20;
    --mark-bloom-opacity: 0.8;
    --mark-beam-opacity: 0.5;
  }
}

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

html {
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 8px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0 0 0.5em;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4rem); }
h2 { font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.75rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }
p, li, dd { text-wrap: pretty; }

/* :where() keeps this reset at zero specificity, so component margins (.service-strip, .tags, .ticks) win. */
:where(ul[class], ol[class]) { margin: 0; padding: 0; list-style: none; }

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 2px; }

svg { display: block; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: 16px;
}
@media (min-width: 480px) { .container { padding-inline: 24px; } }
@media (min-width: 1024px) { .container { padding-inline: 32px; } }

/* ---------- Shared components ---------- */
.eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.625rem 1.125rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 500 1rem/1.2 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--field-border); }
.btn-ghost:hover { border-color: var(--text); }
.btn:disabled { opacity: 0.75; cursor: progress; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-nav ul { display: flex; align-items: center; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.site-nav a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.75rem;
  color: var(--text);
  font-size: 0.9375rem;
  text-decoration: none;
}
.site-nav a:not(.btn):hover { color: var(--accent-text); }
.nav-cta { margin-left: 0.5rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 0 3rem;
  border-bottom: 1px solid var(--line);
}
.hero::before,
.not-found::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 35%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse at 70% 35%, #000 25%, transparent 75%);
  opacity: 0.6;
}
.hero-inner { position: relative; display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) {
  .hero { padding: 5.5rem 0 4rem; }
  .hero-inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}
.status {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0 0 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-wrap: balance;
}
.status-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}
.hero-sub { max-width: 38rem; margin: 1.25rem 0 2rem; font-size: 1.1875rem; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
@media (max-width: 479.98px) {
  .status { font-size: 0.75rem; letter-spacing: 0.06em; }
  .hero-actions .btn { flex: 1 1 100%; }
}
.icon-arrow { display: inline-block; width: 1em; height: 1em; }
.icon-arrow path { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Sections ---------- */
.section { padding: 4.5rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .section { padding: 6rem 0; } }
.section-head { max-width: 46rem; margin-bottom: 2.5rem; }
.contact-lead { color: var(--muted); font-size: 1.125rem; }

/* ---------- Footer ---------- */
.site-footer { padding: 2rem 0; color: var(--muted); font-size: 0.9375rem; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}
.site-footer p { margin: 0; }
.site-footer ul { display: flex; flex-wrap: wrap; margin: 0 -0.5rem; padding: 0; list-style: none; }
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.5rem;
  color: var(--text);
  text-decoration: none;
}
.site-footer a:hover { color: var(--accent-text); }
.footer-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- Hero schematic (decorative; motion capped at 4.9 s, off under reduced motion) ---------- */
.schematic { width: 100%; max-width: 520px; height: auto; justify-self: center; }
@media (max-width: 44.999em) { .schematic { max-width: 360px; } }
.sch-trace { fill: none; stroke: var(--muted); stroke-opacity: 0.45; stroke-width: 1.5; }
.sch-via { fill: var(--bg); stroke: var(--muted); stroke-opacity: 0.7; stroke-width: 1.5; }
.sch-pad { fill: var(--accent); }
.sch-node rect { fill: var(--surface); stroke: var(--muted); stroke-opacity: 0.6; stroke-width: 1.5; }
.sch-label { font: 500 13px var(--font-mono); letter-spacing: 0.12em; fill: var(--text); }
.sch-index { font: 400 10px var(--font-mono); letter-spacing: 0.1em; fill: var(--muted); }
.sch-pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 6 200;
  stroke-dashoffset: 6;
}
@media (prefers-reduced-motion: no-preference) {
  .sch-pulse { animation: sch-pulse 2.4s ease-in-out 0.1s 2; }
}
@keyframes sch-pulse {
  from { stroke-dashoffset: 6; }
  to { stroke-dashoffset: -100; }
}

/* ---------- Logo mark "Pure Scope" (decorative; spec §4.3, motion rules §4.5) ----------
   At rest it is the ink trace (currentColor) plus the amber node; every other layer is invisible.
   Motion (WCAG 2.2.2): CSS only; plays once on load (0.25 s delay + 3.4 s = 3.65 s); replays on hover or
   keyboard focus of the brand link; never under reduced motion. Fill-mode is "backwards", so every layer drops
   back to its resting state when the run ends (holding the end frame with "forwards" on the filtered layers
   triggers a Chrome filter artifact).
   Timeline (% of 3.4 s): the beam sweeps x 1→31 over 0–44.118%; the lit trace's head tracks it (vertices at
   12.5% / 21.324%, node reached at 36.029%); the node lights over 30.882–36.029% and blooms; over 58–94% the
   spectrum drains left→right into the node, uncovering the settled ink trace. */
.mark { width: 28px; height: 28px; flex: none; overflow: visible; }
.mark-s1 { stop-color: var(--spectrum-1); }
.mark-s2 { stop-color: var(--spectrum-2); }
.mark-s3 { stop-color: var(--spectrum-3); }
.mark-s4 { stop-color: var(--spectrum-4); }
.mark-s5 { stop-color: var(--spectrum-5); }
.mark-s6 { stop-color: var(--spectrum-6); }
.mark-trace, .mark-lit, .mark-bloom { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.mark-trace { stroke: currentColor; }
.mark-lit, .mark-bloom { stroke-dasharray: 1 1.2; stroke-dashoffset: 1; opacity: 0; }
.mark-lit { stroke-width: 2.7; }
.mark-bloom { stroke-width: 3.5; }
.mark-node { fill: var(--signal-node); }
.mark-flare { fill: var(--signal-node); opacity: 0; transform-box: fill-box; transform-origin: center; }
.mark-beam { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .mark-trace { animation: mark-trace 3.4s linear 0.25s 1 backwards; }
  .mark-bloom { animation: mark-bloom 3.4s linear 0.25s 1 backwards; }
  .mark-lit { animation: mark-lit 3.4s linear 0.25s 1 backwards; }
  .mark-flare { animation: mark-flare 3.4s linear 0.25s 1 backwards; }
  .mark-node { animation: mark-node 3.4s linear 0.25s 1 backwards; }
  .mark-beam { animation: mark-beam 3.4s linear 0.25s 1 backwards; }
  /* The replay adds a second, identical run under a new name; the finished load run is left alone. */
  .brand:hover .mark .mark-trace,
  .brand:focus-visible .mark .mark-trace { animation: mark-trace 3.4s linear 0.25s 1 backwards, mark-trace-r 3.4s linear 0s 1 backwards; }
  .brand:hover .mark .mark-bloom,
  .brand:focus-visible .mark .mark-bloom { animation: mark-bloom 3.4s linear 0.25s 1 backwards, mark-bloom-r 3.4s linear 0s 1 backwards; }
  .brand:hover .mark .mark-lit,
  .brand:focus-visible .mark .mark-lit { animation: mark-lit 3.4s linear 0.25s 1 backwards, mark-lit-r 3.4s linear 0s 1 backwards; }
  .brand:hover .mark .mark-flare,
  .brand:focus-visible .mark .mark-flare { animation: mark-flare 3.4s linear 0.25s 1 backwards, mark-flare-r 3.4s linear 0s 1 backwards; }
  .brand:hover .mark .mark-node,
  .brand:focus-visible .mark .mark-node { animation: mark-node 3.4s linear 0.25s 1 backwards, mark-node-r 3.4s linear 0s 1 backwards; }
  .brand:hover .mark .mark-beam,
  .brand:focus-visible .mark .mark-beam { animation: mark-beam 3.4s linear 0.25s 1 backwards, mark-beam-r 3.4s linear 0s 1 backwards; }
  @keyframes mark-trace {
    0%, 36.029% { opacity: 0.22; }
    48.029%, 100% { opacity: 1; }
  }
  @keyframes mark-trace-r {
    0%, 36.029% { opacity: 0.22; }
    48.029%, 100% { opacity: 1; }
  }
  @keyframes mark-bloom {
    0% { stroke-dashoffset: 1; opacity: 0; }
    3.309% { stroke-dashoffset: 1; opacity: calc(var(--mark-bloom-opacity) * 0.55); }
    12.5% { stroke-dashoffset: 0.8212; }
    21.324% { stroke-dashoffset: 0.552; }
    36.029% { stroke-dashoffset: 0; opacity: calc(var(--mark-bloom-opacity) * 0.55); }
    42.029% { opacity: var(--mark-bloom-opacity); }
    58% { stroke-dashoffset: 0; opacity: calc(var(--mark-bloom-opacity) * 0.5); }
    68.112% { stroke-dashoffset: -0.1788; }
    77.82% { stroke-dashoffset: -0.448; }
    94% { stroke-dashoffset: -1; opacity: calc(var(--mark-bloom-opacity) * 0.4); }
    100% { stroke-dashoffset: -1; opacity: 0; }
  }
  @keyframes mark-bloom-r {
    0% { stroke-dashoffset: 1; opacity: 0; }
    3.309% { stroke-dashoffset: 1; opacity: calc(var(--mark-bloom-opacity) * 0.55); }
    12.5% { stroke-dashoffset: 0.8212; }
    21.324% { stroke-dashoffset: 0.552; }
    36.029% { stroke-dashoffset: 0; opacity: calc(var(--mark-bloom-opacity) * 0.55); }
    42.029% { opacity: var(--mark-bloom-opacity); }
    58% { stroke-dashoffset: 0; opacity: calc(var(--mark-bloom-opacity) * 0.5); }
    68.112% { stroke-dashoffset: -0.1788; }
    77.82% { stroke-dashoffset: -0.448; }
    94% { stroke-dashoffset: -1; opacity: calc(var(--mark-bloom-opacity) * 0.4); }
    100% { stroke-dashoffset: -1; opacity: 0; }
  }
  @keyframes mark-lit {
    0% { stroke-dashoffset: 1; opacity: 0; }
    3.309% { stroke-dashoffset: 1; opacity: 1; }
    12.5% { stroke-dashoffset: 0.8212; }
    21.324% { stroke-dashoffset: 0.552; }
    36.029%, 58% { stroke-dashoffset: 0; }
    68.112% { stroke-dashoffset: -0.1788; }
    77.82% { stroke-dashoffset: -0.448; }
    94% { stroke-dashoffset: -1; opacity: 1; }
    100% { stroke-dashoffset: -1; opacity: 0; }
  }
  @keyframes mark-lit-r {
    0% { stroke-dashoffset: 1; opacity: 0; }
    3.309% { stroke-dashoffset: 1; opacity: 1; }
    12.5% { stroke-dashoffset: 0.8212; }
    21.324% { stroke-dashoffset: 0.552; }
    36.029%, 58% { stroke-dashoffset: 0; }
    68.112% { stroke-dashoffset: -0.1788; }
    77.82% { stroke-dashoffset: -0.448; }
    94% { stroke-dashoffset: -1; opacity: 1; }
    100% { stroke-dashoffset: -1; opacity: 0; }
  }
  @keyframes mark-flare {
    0%, 35.029% { opacity: 0; transform: scale(0.85); }
    39.029% { opacity: 0.95; transform: scale(1.32); }
    58.029% { opacity: 0.35; transform: scale(1.12); }
    81.029%, 100% { opacity: 0; transform: scale(1); }
  }
  @keyframes mark-flare-r {
    0%, 35.029% { opacity: 0; transform: scale(0.85); }
    39.029% { opacity: 0.95; transform: scale(1.32); }
    58.029% { opacity: 0.35; transform: scale(1.12); }
    81.029%, 100% { opacity: 0; transform: scale(1); }
  }
  @keyframes mark-node {
    0%, 30.882% { fill: var(--signal-node-off); }
    36.029%, 100% { fill: var(--signal-node); }
  }
  @keyframes mark-node-r {
    0%, 30.882% { fill: var(--signal-node-off); }
    36.029%, 100% { fill: var(--signal-node); }
  }
  @keyframes mark-beam {
    0% { transform: translateX(1px); opacity: 0; }
    3%, 34.029% { opacity: var(--mark-beam-opacity); }
    44.118%, 100% { transform: translateX(31px); opacity: 0; }
  }
  @keyframes mark-beam-r {
    0% { transform: translateX(1px); opacity: 0; }
    3%, 34.029% { opacity: var(--mark-beam-opacity); }
    44.118%, 100% { transform: translateX(31px); opacity: 0; }
  }
}

/* ---------- Reduced motion: nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Grid and cards ---------- */
.grid { display: grid; gap: 1rem; }
@media (min-width: 720px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card {
  position: relative;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 0 solid var(--accent);
  pointer-events: none;
}
.card::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: var(--radius); }
.card::after { right: -1px; bottom: -1px; border-right-width: 2px; border-bottom-width: 2px; border-bottom-right-radius: var(--radius); }
.card-index {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* ---------- Services ---------- */
.service h3 { margin-bottom: 0.75rem; }
.service-lead { font-weight: 500; }
.service-body { color: var(--muted); }
.ticks {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}
.ticks li { position: relative; padding-left: 1.25rem; }
.ticks li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 8px;
  height: 2px;
  background: var(--accent);
}

/* ---------- Hero service strip ---------- */
.service-strip {
  position: relative;
  display: grid;
  margin-top: 3rem;
  border-top: 1px solid var(--line);
}
@media (min-width: 720px) { .service-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; } }
@media (min-width: 1080px) { .service-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.service-strip a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}
.service-strip a:hover { color: var(--accent-text); }
.strip-index { color: var(--accent-text); }

/* ---------- Industries ---------- */
.industry-list { display: grid; gap: 0.75rem; }
@media (min-width: 720px) {
  .industry-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .industry-list li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 1160px) {
  .industry-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .industry-list li:last-child:nth-child(odd) { grid-column: auto; }
  .industry-list li:last-child:nth-child(4n+3) { grid-column: span 2; }
}
.industry-list li {
  display: flex;
  align-items: baseline;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 500;
}
.industry-index { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent-text); }

/* ---------- How I work ---------- */
.steps { gap: 2rem 1.5rem; }
.step { padding-top: 1.25rem; border-top: 2px solid var(--accent); }
.step-index {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--accent-text);
}
.step p:last-child { margin: 0; color: var(--muted); }

/* ---------- Selected work ---------- */
.grid-work { display: grid; gap: 1rem; }
@media (min-width: 900px) {
  .grid-work { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* An odd last card spans the row, with Challenge / Built / Result side by side. */
  .work-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .work-card:last-child:nth-child(odd) .work-detail { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 2rem; }
}
.work-card h3 { margin-bottom: 0.75rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.tags li {
  padding: 0.25rem 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.work-industry { margin: 0; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); }
.work-detail {
  display: grid;
  gap: 0.875rem;
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.work-detail dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.work-detail dd { margin: 0.25rem 0 0; }

/* ---------- About ---------- */
.about-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .about-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; } }
.about-role {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.about-bio p:last-child { font-size: 1.125rem; }
.tool-group + .tool-group { margin-top: 1.75rem; }
.tool-group h3 {
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips li {
  padding: 0.375rem 0.625rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; gap: 4rem; }
}
.contact-form { display: grid; gap: 1.125rem; }
.field { display: grid; gap: 0.375rem; }
.field label { font-size: 0.9375rem; font-weight: 500; }
.optional { font-weight: 400; color: var(--muted); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.625rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field :user-invalid { border-color: var(--danger); }
.contact-form .btn { justify-self: start; }
.form-privacy { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.form-status,
.form-error,
.form-sent {
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.form-error { color: var(--danger); border-left-color: var(--danger); }
.form-error a { color: inherit; text-decoration: underline; }
/* Keep the live regions rendered (in the accessibility tree) while empty so later text is announced;
   the negative margin cancels the grid gap an empty region would otherwise add. */
.form-status:empty,
.form-error:empty { margin-top: -1.125rem; padding: 0; border: 0; background: none; }
.form-sent { margin-bottom: 1.25rem; }
.form-sent:not(:target) { display: none; }

/* ---------- Mobile nav (below 45em / 720 px at the default text size); state lives in the button's aria-expanded ---------- */
.nav-toggle { display: none; }
@media (max-width: 44.999em) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 0.875rem;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--field-border);
    border-radius: var(--radius);
    font: 500 0.875rem var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .nav-toggle[aria-expanded="true"] + .site-nav { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem 16px 1rem; }
  .site-nav a:not(.btn) { display: flex; min-height: 48px; padding: 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav-cta { display: flex; margin: 0.75rem 0 0; }
}
@media (min-width: 480px) and (max-width: 44.999em) {
  .site-nav ul { padding-inline: 24px; }
}

/* ---------- 404 (reuses the hero grid through .not-found::before) ---------- */
.not-found {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--bsd-h) - var(--header-h));
  min-height: calc(100dvh - var(--bsd-h) - var(--header-h));
  padding: 6rem 0;
  border-bottom: 1px solid var(--line);
}
.not-found .container { position: relative; }
.not-found h1 { max-width: 20ch; }

/* ---------- בס״ד line: top right of every page, above the sticky header; it scrolls away with the page ---------- */
.bsd-bar {
  display: flex;
  justify-content: flex-end;
  height: var(--bsd-h); /* border-box: 6px padding + the 1.3125rem line below */
  padding: 6px 16px 0;
  background: var(--bg);
}
@media (min-width: 480px) { .bsd-bar { padding-inline: 24px; } }
@media (min-width: 1024px) { .bsd-bar { padding-inline: 32px; } }
.bsd { margin: 0; font: 400 0.875rem/1.5 "IBM Plex Sans Hebrew", var(--font-sans); color: var(--muted); }
