/* ==========================================================================
   Vault & Vector — assets/css/site.css
   Design system: "instrumentation panel"
   Hairline rules, monospace data, sharp corners, single accent.
   No framework, no build step, no external requests.
   ========================================================================== */

/* --------------------------------------------------------------------------
   01 — Fonts (self-hosted, SIL OFL 1.1, no third-party requests)
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Plex Sans';
  src: url('../fonts/plex-sans-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plex Sans';
  src: url('../fonts/plex-sans-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plex Mono';
  src: url('../fonts/plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plex Mono';
  src: url('../fonts/plex-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   02 — Tokens
   Contrast ratios against --bg are noted; all pass WCAG 2.1 AA, most AAA.
   -------------------------------------------------------------------------- */

:root {
  /* Surfaces — light and institutional.
     The audience is CISOs and IT directors buying assurance, not a security
     product. Near-black reads as "security product" or "lone operator"; a
     paper ground with deep blue ink reads as a firm. Panels sit above the
     page ground so cards lift rather than being drawn with borders alone. */
  --bg:            #F6F8FA;
  --bg-raise:      #EFF4F8;   /* hover tint */
  --bg-panel:      #FFFFFF;
  --bg-inset:      #E9EEF3;

  /* Hairlines */
  --line:          #DFE5EB;
  --line-strong:   #C4CFD8;
  --line-accent:   #6E8FA1;   /*  3.2:1  AA non-text  */

  /* Ink */
  --text:          #0F1720;   /* 16.9:1  AAA */
  --text-mid:      #47525E;   /*  7.5:1  AAA */
  --text-dim:      #636E7A;   /*  4.9:1  AA  */

  /* Accent — single, deep institutional blue. Not the generic corporate
     #0066CC the brief warned against; the darker sibling of the original
     cyan, which keeps the brand family while working as text on paper. */
  --accent:        #15607F;   /*  6.6:1  AA — white on it 7.0:1 */
  --accent-deep:   #0E4A61;
  --accent-wash:   rgba(21, 96, 127, 0.06);
  --accent-edge:   rgba(21, 96, 127, 0.24);

  /* Error state — form validation only */
  --danger:        #A3221C;   /*  7.0:1  AAA */

  /* Theme-dependent. Never hardcode these three anywhere else: the dark
     theme has to flip them, and white on the dark accent is only 2.6:1. */
  --accent-strong: #0E4A61;   /* button hover — white on it is 9.0:1 */
  --btn-ink:       #FFFFFF;   /* ink on an --accent fill */
  --hdr-bg:        rgba(246, 248, 250, 0.85);
  --grain:         0.028;

  /* Type */
  --ff-sans: 'Plex Sans', 'IBM Plex Sans', 'Segoe UI', Helvetica, Arial, sans-serif;
  --ff-mono: 'Plex Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --fs-display: clamp(2.25rem, 1.35rem + 3.9vw, 4.25rem);
  --fs-h2:      clamp(1.6rem, 1.3rem + 1.3vw, 2.35rem);
  --fs-h3:      clamp(1.0625rem, 1.02rem + 0.2vw, 1.1875rem);
  --fs-lead:    clamp(1.0625rem, 1rem + 0.42vw, 1.3125rem);
  --fs-body:    1rem;
  --fs-sm:      0.875rem;
  --fs-xs:      0.8125rem;
  --fs-label:   0.75rem;

  /* Rhythm — 4px base */
  --s-1:  0.25rem;
  --s-2:  0.5rem;
  --s-3:  0.75rem;
  --s-4:  1rem;
  --s-5:  1.5rem;
  --s-6:  2rem;
  --s-7:  3rem;
  --s-8:  4rem;
  --s-9:  6rem;
  --s-10: 8rem;

  /* Layout */
  --maxw:    1140px;
  --gutter:  clamp(1.25rem, 4vw, 3rem);
  --rail:    260px;   /* sticky section-header column */
  --header-h: 61px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur:  220ms;
}

/* --------------------------------------------------------------------------
   Dark theme — opt-in through the header toggle, never automatic.

   Light is the default because the audience is buying assurance and a paper
   ground reads as a firm. Dark is offered because that same audience often
   works in it. Every pair below was recomputed rather than inverted: white on
   the dark accent is only 2.6:1, so the button ink flips to the page ground,
   and the hover shade gets lighter instead of darker.
   -------------------------------------------------------------------------- */

:root[data-theme='dark'] {
  --bg:            #080B12;
  --bg-raise:      #0C1119;
  --bg-panel:      #0A0E16;
  --bg-inset:      #070A10;

  --line:          #19212E;
  --line-strong:   #26303F;
  --line-accent:   #3A6C7E;   /*  3.3:1 on panel — AA non-text */

  --text:          #E4E9EE;   /* 16.1:1  AAA */
  --text-mid:      #93A1B0;   /*  7.5:1  AAA */
  --text-dim:      #7C8A9A;   /*  5.6:1  AA  */

  --accent:        #5EA9C4;   /*  7.5:1  AAA */
  --accent-deep:   #2E5A6B;
  --accent-wash:   rgba(94, 169, 196, 0.08);
  --accent-edge:   rgba(94, 169, 196, 0.28);

  --danger:        #E8837A;   /*  7.5:1  AAA */

  --accent-strong: #8CC5DA;   /* lighter, not darker */
  --btn-ink:       #080B12;   /*  7.5:1 on --accent */
  --hdr-bg:        rgba(8, 11, 18, 0.82);
  --grain:         0.035;
}

/* --------------------------------------------------------------------------
   03 — Reset
   -------------------------------------------------------------------------- */

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

* { margin: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
svg { height: auto; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; padding: 0; }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

/* Focus — visible, accent, never removed */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* --------------------------------------------------------------------------
   04 — Primitives
   -------------------------------------------------------------------------- */

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

.skip {
  position: absolute;
  left: var(--s-4);
  top: -100%;
  z-index: 200;
  padding: var(--s-3) var(--s-4);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  transition: top var(--dur) var(--ease);
}
.skip:focus { top: var(--s-4); }

/* Monospace label — the recurring "instrument" device */
.label {
  font-family: var(--ff-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.mono { font-family: var(--ff-mono); font-variant-numeric: tabular-nums; }

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
}

/* Accent-marked inline term */
.term {
  font-family: var(--ff-mono);
  font-size: 0.92em;
  color: var(--accent);
}

/* Visually hidden, still announced by screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Lead statement blocks (niche, client profile) */
.statement {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--text-mid);
  max-width: 64ch;
}
.statement__more {
  margin-top: var(--s-5);
  font-size: var(--fs-sm);
  color: var(--text-mid);
  max-width: 70ch;
}

/* --------------------------------------------------------------------------
   05 — Header / navigation
   -------------------------------------------------------------------------- */

.hdr {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--hdr-bg);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.hdr__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  height: var(--header-h);
}

/* Wordmark */
.mark {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  flex-shrink: 0;
}
.mark__glyph { width: 22px; height: 22px; color: var(--accent); }
.mark__txt {
  font-family: var(--ff-mono);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text);
  white-space: nowrap;
}
.mark__amp { color: var(--accent); }

/* Desktop nav */
.nav { display: none; }

@media (min-width: 900px) {
  .nav {
    display: flex;
    align-items: center;
    gap: var(--s-6);
    margin-inline-start: auto;
  }
  .nav__lnk {
    position: relative;
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--text-dim);
    padding-block: var(--s-2);
    transition: color var(--dur) var(--ease);
  }
  .nav__lnk::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur) var(--ease);
  }
  .nav__lnk:hover { color: var(--text); }
  .nav__lnk:hover::after,
  .nav__lnk[aria-current='true']::after { transform: scaleX(1); }
  .nav__lnk[aria-current='true'] { color: var(--accent); }
}

.hdr__end {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-inline-start: auto;
}
@media (min-width: 900px) {
  .hdr__end { margin-inline-start: 0; }
}

/* Language switch */
.lang {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--ff-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.lang a { transition: color var(--dur) var(--ease); }
.lang a:hover { color: var(--text); }
.lang [aria-current='page'] { color: var(--accent); }
.lang__sep { color: var(--line-strong); }

/* Theme toggle. The icon shows the destination, not the current state:
   a moon in light mode (click for dark), a sun in dark mode (click for
   light). aria-pressed carries the actual state for screen readers. */
.themetog {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid var(--line-accent);
  color: var(--text-mid);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.themetog:hover { color: var(--accent); border-color: var(--accent); }
.themetog__sun { display: none; }
:root[data-theme='dark'] .themetog__sun  { display: block; }
:root[data-theme='dark'] .themetog__moon { display: none; }

/* Mobile menu toggle */
.burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  margin-inline-start: var(--s-1);
}
/* Target the bars by class, never by element: a bare `.burger span` rule also
   caught the visually-hidden label and stretched it to 100% of the viewport,
   which widened the whole document on mobile. */
.burger__bar {
  display: block;
  height: 1px;
  width: 100%;
  background: var(--text);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.burger[aria-expanded='true'] .burger__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded='true'] .burger__bar:nth-child(2) { opacity: 0; }
.burger[aria-expanded='true'] .burger__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (min-width: 900px) { .burger { display: none; } }

/* Mobile drawer */
.drawer {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--bg-raise);
}
.drawer[data-open='true'] { display: block; }
@media (min-width: 900px) { .drawer { display: none !important; } }

.drawer__lnk {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  padding: var(--s-4) var(--gutter);
  border-bottom: 1px solid var(--line);
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  color: var(--text-mid);
}
.drawer__lnk span:first-child { color: var(--accent); font-size: var(--fs-label); }
.drawer__lnk:hover { color: var(--text); background: var(--accent-wash); }

/* --------------------------------------------------------------------------
   06 — Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding-block: clamp(var(--s-8), 11vw, var(--s-10)) clamp(var(--s-8), 9vw, var(--s-9));
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}

/* Schematic grid backdrop — masked so it fades, never a "hacker cave" */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 76px 76px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 22% -10%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 90% 70% at 22% -10%, #000 0%, transparent 72%);
  opacity: 0.85;
}

/* Faint accent bloom, top-left */
.hero::after {
  content: '';
  position: absolute;
  top: -30%;
  left: -10%;
  width: 60%;
  height: 120%;
  z-index: -2;
  background: radial-gradient(ellipse at center, var(--accent-wash) 0%, transparent 62%);
  pointer-events: none;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
.hero__eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

h1, .h1 {
  font-size: var(--fs-display);
  line-height: 1.04;
  letter-spacing: -0.035em;
  max-width: 17ch;
}

.hero__lead {
  margin-top: var(--s-5);
  max-width: 58ch;
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--text-mid);
}

.hero__cta {
  margin-top: var(--s-7);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-5);
}

/* Primary action — a solid instrument key, not a rounded pill.
   Filled rather than outlined: on the paper ground an outlined button in a
   pale wash reads as secondary, and this is the only primary CTA on the page.
   White on --accent is 7.0:1; on --accent-deep it is higher still. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--btn-ink);
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn__arrow { transition: transform var(--dur) var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* Hero footnote strip */
.hero__meta {
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  display: grid;
  gap: var(--s-5);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .hero__meta { grid-template-columns: repeat(3, 1fr); gap: var(--s-6); }
}
.hero__meta dt { margin-bottom: var(--s-2); }
.hero__meta dd { font-size: var(--fs-sm); color: var(--text-mid); }

/* Decorative vector field, right of hero on wide screens */
.hero__fig {
  display: none;
  position: absolute;
  right: calc(var(--gutter) * -0.5);
  top: 50%;
  transform: translateY(-50%);
  width: 340px;
  z-index: -1;
  color: var(--accent);
  opacity: 0.5;
  pointer-events: none;
}
@media (min-width: 1080px) { .hero__fig { display: block; } }

/* --------------------------------------------------------------------------
   07 — Section shell (asymmetric: sticky rail + content)
   -------------------------------------------------------------------------- */

.sec {
  border-bottom: 1px solid var(--line);
  padding-block: clamp(var(--s-7), 8vw, var(--s-9));
}

.sec__grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: 1fr;
}
@media (min-width: 1000px) {
  .sec__grid {
    grid-template-columns: var(--rail) 1fr;
    gap: var(--s-8);
    align-items: start;
  }
  .sec__rail { position: sticky; top: calc(var(--header-h) + var(--s-6)); }
}

.sec__num {
  font-family: var(--ff-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent);
  display: block;
  margin-bottom: var(--s-3);
}

.sec__h {
  font-size: var(--fs-h2);
  letter-spacing: -0.03em;
  max-width: 14ch;
}

.sec__note {
  margin-top: var(--s-4);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  max-width: 34ch;
}

/* --------------------------------------------------------------------------
   08 — Practice areas
   -------------------------------------------------------------------------- */

.areas {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (min-width: 760px) { .areas { grid-template-columns: 1fr 1fr; } }

.area {
  background: var(--bg-panel);
  padding: var(--s-6) var(--s-5);
  transition: background var(--dur) var(--ease);
}
.area:hover { background: var(--bg-raise); }

.area__h {
  font-size: var(--fs-h3);
  letter-spacing: -0.015em;
  margin-bottom: var(--s-3);
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
}
.area__h::before {
  content: '';
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  background: var(--accent);
  transform: translateY(-2px);
}

/* In the 2-column grid a two-line title would push its description out of
   line with the card beside it. Reserve two lines so every row aligns. */
@media (min-width: 760px) {
  .area__h { min-height: 2.3em; }
}

.area__desc {
  font-size: var(--fs-sm);
  color: var(--text-mid);
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-5);
  border-bottom: 1px dashed var(--line-strong);
}

.area__list li {
  position: relative;
  padding-left: var(--s-5);
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--text-mid);
}
.area__list li + li { margin-top: var(--s-3); }
.area__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 9px;
  height: 1px;
  background: var(--accent-deep);
}

/* --------------------------------------------------------------------------
   09 — Approach
   -------------------------------------------------------------------------- */

.approach { display: grid; gap: 0; }

.approach__item {
  display: grid;
  gap: var(--s-2) var(--s-5);
  grid-template-columns: 1fr;
  padding-block: var(--s-5);
  border-top: 1px solid var(--line);
}
.approach__item:last-child { border-bottom: 1px solid var(--line); }

@media (min-width: 680px) {
  .approach__item { grid-template-columns: 3.5rem 1fr; }
}

/* --accent-deep fails AA as text (2.6:1). It is kept only for the 1px
   decorative rules and bullet squares, never for glyphs the eye must read. */
.approach__idx {
  font-family: var(--ff-mono);
  font-size: var(--fs-label);
  color: var(--text-dim);
  padding-top: 0.28em;
}
.approach__h {
  font-size: var(--fs-h3);
  letter-spacing: -0.015em;
  margin-bottom: var(--s-2);
}
.approach__p {
  font-size: var(--fs-sm);
  color: var(--text-mid);
  max-width: 62ch;
}

/* --------------------------------------------------------------------------
   10 — Engagements (anonymised references)
   -------------------------------------------------------------------------- */

.engs { display: grid; gap: var(--s-5); }

.eng {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  padding: var(--s-5);
  transition: border-color var(--dur) var(--ease);
}
.eng:hover { border-color: var(--line-accent); }

/* Grid, not flex: with flex-wrap a two-line title pushed the tag onto its own
   row, so cards with long titles stopped aligning with the others. */
.eng__top {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: var(--s-3);
  padding-bottom: var(--s-4);
  margin-bottom: var(--s-4);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 560px) {
  .eng__top {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--s-3) var(--s-5);
  }
  .eng__tag { justify-self: end; }
}

/* Now a real title, not a sector label: sans, larger, wraps to two lines. */
.eng__sector {
  font-family: var(--ff-sans);
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text);
  max-width: 44ch;
}
.eng__tag {
  font-family: var(--ff-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-edge);
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

.eng__body {
  font-size: var(--fs-sm);
  color: var(--text-mid);
  max-width: 76ch;
}

/* Figures pulled out in mono so they scan */
.eng__body b, .eng__figure {
  font-family: var(--ff-mono);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.confidential {
  margin-top: var(--s-5);
  padding: var(--s-4);
  border: 1px dashed var(--line-strong);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
}
.confidential svg { flex-shrink: 0; color: var(--text-dim); margin-top: 2px; }

/* --------------------------------------------------------------------------
   11 — Technology grid
   -------------------------------------------------------------------------- */

.techset { display: grid; gap: var(--s-6); }

.techgroup__h {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-4);
}
.techgroup__h::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Hairlines come from the cells themselves, not from a 1px gap over a coloured
   container. With the gap technique any track left empty by a short final row
   showed the container colour as a ghost cell — visible in the three-item
   group at the four-column breakpoint. Borders simply stop where items stop. */
.tech {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 620px) { .tech { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .tech { grid-template-columns: repeat(4, 1fr); } }

.tech li {
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: var(--s-4) var(--s-4);
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--text-mid);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.tech li:hover { color: var(--text); background: var(--bg-raise); }
.tech li::before {
  content: '';
  width: 4px;
  height: 4px;
  flex-shrink: 0;
  background: var(--accent-deep);
  transition: background var(--dur) var(--ease);
}
.tech li:hover::before { background: var(--accent); }

/* Reserved slot — partner badge, rendered only once formally approved */
.partner-slot {
  margin-top: var(--s-5);
  padding: var(--s-5);
  border: 1px dashed var(--line-strong);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   12 — Contact
   -------------------------------------------------------------------------- */

.contact { display: grid; gap: var(--s-6); }

.contact__lbl { margin-bottom: var(--s-4); }

.contact__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
}

.contact__mail {
  display: inline-flex;
  align-items: center;
  gap: var(--s-4);
  font-family: var(--ff-mono);
  font-size: clamp(1.0625rem, 0.9rem + 0.8vw, 1.5rem);
  color: var(--text);
  border-bottom: 1px solid var(--line-accent);
  padding-bottom: var(--s-2);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  word-break: break-word;
}
.contact__mail:hover { color: var(--accent); border-color: var(--accent); }

.copy {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line-strong);
  font-family: var(--ff-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.copy:hover { color: var(--accent); border-color: var(--accent-edge); }
.copy[data-done='true'] { color: var(--accent); border-color: var(--accent); }

.contact__grid {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: 1fr;
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
@media (min-width: 700px) { .contact__grid { grid-template-columns: repeat(2, 1fr); } }

.contact__item dt { margin-bottom: var(--s-2); }
.contact__item dd { font-size: var(--fs-sm); color: var(--text-mid); }
.contact__item a { border-bottom: 1px solid var(--line-accent); transition: color var(--dur) var(--ease); }
.contact__item a:hover { color: var(--accent); }

/* ---- Contact form -------------------------------------------------------
   Self-hosted proof-of-work instead of a hosted captcha. Turnstile, hCaptcha
   and reCAPTCHA all make cross-origin requests, which would force script-src
   and connect-src open and falsify the "no third-party request" statement in
   privacy.html. This costs the visitor ~1s of CPU and costs the site nothing.
   ------------------------------------------------------------------------- */

.form {
  display: grid;
  gap: var(--s-5);
  max-width: 44rem;
  margin-top: var(--s-6);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
}

.form__row { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 640px) { .form__row { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: var(--s-2); }

.input {
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--bg-panel);
  /* --line-strong is only 1.6:1 on white; a field boundary is a UI component
     under WCAG 1.4.11 and needs 3:1. --line-accent is 3.4:1. */
  border: 1px solid var(--line-accent);
  padding: 0.7rem 0.85rem;
  width: 100%;
  transition: border-color var(--dur) var(--ease);
}
.input:hover { border-color: var(--accent); }
.input:focus-visible { border-color: var(--accent); }
.input--area { resize: vertical; min-height: 8.5rem; line-height: 1.6; }

/* Honeypot: off-screen rather than display:none, because some bots skip
   hidden fields. Never remove — it is the no-JavaScript spam defence. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.pow__state,
.form__result {
  font-family: var(--ff-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  color: var(--text-dim);
  min-height: 1.2em;
}
.pow__state[data-tone='ok'],
.form__result[data-tone='ok']    { color: var(--accent); }
.pow__state[data-tone='error'],
.form__result[data-tone='error'] { color: var(--danger); }

.form__note {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  max-width: 62ch;
}
.form__note a { color: var(--accent); border-bottom: 1px solid var(--line-accent); }
.form__note a:hover { border-bottom-color: var(--accent); }

.form button[disabled] { opacity: 0.55; cursor: not-allowed; }

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4) var(--s-5);
}

/* --------------------------------------------------------------------------
   13 — Footer
   -------------------------------------------------------------------------- */

.ftr { padding-block: var(--s-7) var(--s-6); }

.ftr__top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--line);
}

.ftr__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.ftr__nav a { transition: color var(--dur) var(--ease); }
.ftr__nav a:hover { color: var(--accent); }

.ftr__legal {
  margin-top: var(--s-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  font-family: var(--ff-mono);
  font-size: var(--fs-label);
  color: var(--text-dim);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   14 — Secondary pages (legal / privacy)
   -------------------------------------------------------------------------- */

.doc { padding-block: var(--s-8) var(--s-9); }

.doc__head { padding-bottom: var(--s-6); margin-bottom: var(--s-7); border-bottom: 1px solid var(--line); }
.doc__head h1 { font-size: var(--fs-h2); max-width: 24ch; }
.doc__updated { margin-top: var(--s-4); }

.prose { max-width: 72ch; }
.prose h2 {
  font-size: var(--fs-h3);
  margin-top: var(--s-7);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
}
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--text-mid); font-size: var(--fs-sm); }
.prose p + p { margin-top: var(--s-4); }
.prose a { color: var(--accent); border-bottom: 1px solid var(--line-accent); }
.prose a:hover { border-bottom-color: var(--accent); }

.prose ul { margin-top: var(--s-4); }
.prose ul li {
  position: relative;
  padding-left: var(--s-5);
  font-size: var(--fs-sm);
  color: var(--text-mid);
}
.prose ul li + li { margin-top: var(--s-3); }
.prose ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 9px;
  height: 1px;
  background: var(--accent-deep);
}

/* Definition table for legal identity block */
.facts {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: var(--s-5);
}
.facts > div {
  background: var(--bg-panel);
  padding: var(--s-4);
  display: grid;
  gap: var(--s-1);
}
@media (min-width: 640px) {
  .facts > div { grid-template-columns: 200px 1fr; gap: var(--s-4); align-items: baseline; }
}
.facts dt { font-family: var(--ff-mono); font-size: var(--fs-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.facts dd { font-size: var(--fs-sm); color: var(--text); }
.facts dd.is-mono { font-family: var(--ff-mono); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   15 — Motion
   One orchestrated load, restrained scroll reveals. Nothing decorative.
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

.rise {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 760ms var(--ease) forwards;
}
.rise:nth-child(1) { animation-delay: 60ms; }
.rise:nth-child(2) { animation-delay: 140ms; }
.rise:nth-child(3) { animation-delay: 220ms; }
.rise:nth-child(4) { animation-delay: 300ms; }
.rise:nth-child(5) { animation-delay: 380ms; }

@keyframes rise { to { opacity: 1; transform: none; } }

/* Respect the user's stated preference — no exceptions */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .rise { opacity: 1; transform: none; animation: none; }
}

/* Fallback: if JS is unavailable, nothing stays hidden */
.no-js .reveal { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   16 — Schematic figures and atmosphere

   Everything here is inline SVG, a same-origin .svg file, or a CSS gradient.
   Nothing uses a data: URI. The shipped CSP sets img-src 'self', which blocks
   them — verified against the real header, two securitypolicyviolation events
   for the escaped and base64 forms alike. The usual "noise texture as a data
   URI" recipe therefore fails silently on this site. getComputedStyle will not
   reveal it either: CSP blocks the fetch, not the parse.
   -------------------------------------------------------------------------- */

/* Schematic sitting under a sticky section heading. Shown only where the rail
   column actually exists and has empty space to fill. */
/* These carry role="img" with a title and desc, so WCAG 1.4.11 applies to the
   primary geometry: it must reach 3:1. Composited over the paper ground the
   accent gives 2.77:1 at opacity .6 and 3.38:1 at .7. Do not lower this value.
   (It was .6 while the palette was dark — the same opacity buys less contrast
   on light, because the composite moves toward the background either way.)
   De-emphasised strokes inside each figure sit below that deliberately; the
   information they carry is also stated in the adjacent prose. */
.figure {
  display: none;
  width: 100%;
  max-width: 208px;
  margin-top: var(--s-6);
  color: var(--accent);
  opacity: 0.7;
}
@media (min-width: 1000px) { .figure { display: block; } }

/* Grain. 318 B on the wire, 240 B gzipped, served from this origin.
   On the paper ground the usable range is roughly 0.02–0.04; above that it
   stops reading as paper and starts reading as dirt. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  background-image: url('../img/noise.svg');
  background-size: 160px 160px;
  opacity: var(--grain);
}

/* Schematic grid behind two section headings — the hero idiom with the mask
   anchored on the opposite side, so it reads as a variation, not a repeat.
   Deliberately used twice and no more: a third would turn it into wallpaper. */
.sec--grid { position: relative; isolation: isolate; }
.sec--grid::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 76px 76px;
  -webkit-mask-image: radial-gradient(ellipse 58% 92% at 90% 50%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 58% 92% at 90% 50%, #000 0%, transparent 70%);
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   17 — Print
   -------------------------------------------------------------------------- */

@media print {
  :root { --bg: #fff; --bg-panel: #fff; --text: #000; --text-mid: #333; --text-dim: #555; --line: #ccc; --accent: #004f6a; }
  body { background: #fff; color: #000; }
  body::after { display: none !important; }
  .hdr, .drawer, .hero__fig, .burger, .copy, .figure { display: none !important; }
  .sec--grid::before { display: none !important; }
  .sec, .hero { border-color: #ccc; }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 0.75em; color: #555; }
}
