/* ============================================================
   CATALYTIC AI — "activation energy" design system

   A catalyst does not do the reaction for you. It lowers the
   barrier so a reaction that was impossible at your temperature
   becomes routine. That is the whole product, so it is the whole
   design language: honeycomb substrate (a catalytic converter is
   a hex monolith), reaction-coordinate curves, and the flat
   drawing conventions of an engineering print.

   Dark is the default — a machine shop at night. Light is a
   blueprint under bench lamps. Every ink/surface pair below is
   verified >= 4.5:1; accents on fills >= 4.5:1.
   ============================================================ */

/* ---------- 1. FONTS (self-hosted, latin subset) ---------- */
@font-face {
  font-family: 'SpaceGroteskVar';
  src: url('/fonts/space-grotesk-var.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'InterVar';
  src: url('/fonts/inter-var.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrainsMonoVar';
  src: url('/fonts/jetbrains-mono-var.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
}

/* ---------- 2. TOKENS ---------- */
:root {
  color-scheme: dark;

  /* Surfaces — graphite, cool */
  --paper:        #0E1116;
  --paper-2:      #141A21;
  --paper-3:      #1A212A;
  --card:         #151C24;

  /* Ink */
  --ink:          #F2F5F8;
  --ink-2:        #D6DCE4;   /* body            13.7:1 on paper */
  --ink-3:        #9EAAB9;   /* muted            8.0:1 */
  --ink-4:        #95A2B2;   /* labels           7.3:1 */
  --ink-faint:    #7C8998;   /* placeholders only */

  /* Rules */
  --rule:         #232B36;
  --rule-strong:  #33414F;

  /* Accents — flare is heat, volt is signal */
  --flare:        #FF7A45;   /* 7.3:1 on paper */
  --flare-2:      #FF9468;
  --flare-wash:   rgba(255, 122, 69, 0.13);
  --volt:         #5CC8EA;   /* 9.8:1 on paper */
  --volt-2:       #84D8F2;
  --volt-wash:    rgba(92, 200, 234, 0.13);

  /* Status */
  --ok:           #5FC98F;
  --ok-wash:      rgba(95, 201, 143, 0.13);
  --warn:         #E0A64F;
  --warn-wash:    rgba(224, 166, 79, 0.13);

  /* Ink that sits ON a solid accent fill */
  --on-flare:     #1A0B04;
  --on-volt:      #04161C;

  --tick:         rgba(255, 255, 255, 0.22);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 10px 34px -12px rgba(0, 0, 0, 0.62);
  --glow:     0 0 0 1px var(--flare-wash), 0 6px 26px -12px rgba(255, 122, 69, 0.45);

  /* Structural — shared by both themes */
  --font-display: 'SpaceGroteskVar', 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body:    'InterVar', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrainsMonoVar', 'SF Mono', 'Cascadia Code', Consolas, monospace;

  --fs-display: clamp(2.4rem, 1.55rem + 3.4vw, 4.15rem);
  --fs-h1:      clamp(2rem,   1.45rem + 2.4vw, 3.25rem);
  --fs-h2:      clamp(1.6rem, 1.32rem + 1.3vw, 2.3rem);
  --fs-h3:      clamp(1.12rem,1.06rem + 0.36vw, 1.34rem);
  --fs-body:    clamp(1rem,   0.975rem + 0.12vw, 1.0625rem);
  --fs-sm:      0.9rem;
  --fs-xs:      0.8rem;
  --fs-label:   0.72rem;

  --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;

  --measure: 66ch;
  --page:    1220px;
  --radius:  4px;
  --nav-h:   58px;
}

[data-theme="light"] {
  color-scheme: light;

  /* Surfaces — blueprint white, cool not cream */
  --paper:        #F7F9FB;
  --paper-2:      #EDF1F6;
  --paper-3:      #E4EAF1;
  --card:         #FFFFFF;

  --ink:          #12161C;
  --ink-2:        #333B47;   /* 10.7:1 on paper */
  --ink-3:        #525C6B;   /*  6.4:1 */
  --ink-4:        #59636F;   /*  5.8:1 */
  --ink-faint:    #727C8A;

  --rule:         #D8E0E9;
  --rule-strong:  #B6C2D0;

  --flare:        #A63A0C;   /* burnt, not the dark-theme neon. Measured from
                                rendered pixels: 4.70:1 even on flare-wash over
                                paper-3, the tightest pairing on the site. */
  --flare-2:      #8E3009;
  --flare-wash:   rgba(180, 64, 15, 0.09);
  --volt:         #0F5A80;   /* 7.1:1 */
  --volt-2:       #0B4562;
  --volt-wash:    rgba(15, 90, 128, 0.09);

  --ok:           #1B6B47;
  --ok-wash:      rgba(27, 107, 71, 0.10);
  --warn:         #8A5410;
  --warn-wash:    rgba(138, 84, 16, 0.10);

  --on-flare:     #FFFFFF;
  --on-volt:      #F7F9FB;

  --tick:         rgba(0, 0, 0, 0.20);

  --shadow-1: 0 1px 2px rgba(18, 30, 45, 0.06);
  --shadow-2: 0 8px 30px -10px rgba(18, 30, 45, 0.18);
  --glow:     0 0 0 1px var(--flare-wash), 0 6px 24px -12px rgba(180, 64, 15, 0.3);
}

/* ---------- 3. RESET / BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 1.5rem);
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.012em; }
h4 { font-size: 1.05rem; letter-spacing: -0.01em; }

p { text-wrap: pretty; }
p + p { margin-top: var(--s-4); }

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

img, svg { max-width: 100%; display: block; }
ul, ol { padding-left: 1.15rem; }
strong { color: var(--ink); font-weight: 600; }

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

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: var(--paper);
  padding: var(--s-3) var(--s-5); font-size: var(--fs-sm);
}
.skip-link:focus { left: 0; }

/* ---------- 4. LAYOUT ---------- */
.wrap { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: clamp(1.15rem, 4vw, 3rem); }
.section { padding-block: clamp(3.5rem, 7vw, var(--s-9)); }
.section--alt { background: var(--paper-2); border-block: 1px solid var(--rule); }
.section--tight { padding-block: clamp(2.5rem, 5vw, var(--s-8)); }

.split { display: grid; gap: clamp(1.5rem, 4vw, var(--s-7)); }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; }
  .split--sticky > :first-child { position: sticky; top: calc(var(--nav-h) + 2rem); }
}

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }
.measure { max-width: var(--measure); }
.lede { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem); color: var(--ink-3); line-height: 1.6; }

.grid { display: grid; gap: clamp(1rem, 2.2vw, 1.75rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr)); }

/* ---------- 5. CATALYTIC MOTIFS ---------- */

/* Section marker — a hex cell, then the label, then a rule out to the edge */
.marker {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--flare);
  display: flex; align-items: center; gap: var(--s-3);
}
.marker::before {
  content: '';
  width: 9px; height: 10px; flex-shrink: 0;
  background: currentColor;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
.marker::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--rule-strong), transparent);
}
.marker--plain::after { display: none; }

/* Datum strip — the technical stamp that replaces map coordinates */
.datum {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.13em; color: var(--ink-4);
  display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5);
  text-transform: uppercase;
}
.datum b { color: var(--ink-3); font-weight: 500; }

/* Section divider — a drawing dimension line with a label at the right */
.dim-rule {
  position: relative; height: 1px; background: var(--rule);
  margin-block: var(--s-7);
}
.dim-rule::before {
  content: attr(data-label);
  position: absolute; right: 0; top: 50%;
  transform: translateY(-50%);
  background: var(--paper); padding-left: var(--s-3);
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.14em; color: var(--ink-4);
  text-transform: uppercase;
}
.section--alt .dim-rule::before { background: var(--paper-2); }
/* end ticks, like a dimension line on a print */
.dim-rule::after {
  content: ''; position: absolute; left: 0; top: -3px;
  width: 1px; height: 7px; background: var(--rule-strong);
}

/* Corner ticks on cards — machined datum marks, revealed on hover */
.regmark { position: relative; }
.regmark::before, .regmark::after {
  content: ''; position: absolute; width: 9px; height: 9px;
  border-color: var(--flare); border-style: solid; opacity: 0;
  transition: opacity 0.25s ease;
}
.regmark::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.regmark::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.regmark:hover::before, .regmark:hover::after { opacity: 1; }

/* Honeycomb field — the catalytic substrate, behind the hero */
.hexfield {
  position: absolute; inset: 0; pointer-events: none;
  color: var(--flare);
  opacity: 0.16;
  mask-image: radial-gradient(115% 92% at 76% 20%, #000 18%, transparent 74%);
  -webkit-mask-image: radial-gradient(115% 92% at 76% 20%, #000 18%, transparent 74%);
}
[data-theme="light"] .hexfield { opacity: 0.12; }


/* ---------- 6. HEADER / NAV ---------- */
.site-head {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(12px) saturate(150%);
  border-bottom: 1px solid var(--rule);
}
.site-head .wrap { display: flex; align-items: center; gap: var(--s-5); width: 100%; }

.brand {
  display: flex; align-items: center; gap: var(--s-3);
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.06rem; letter-spacing: -0.005em;
  color: var(--ink); text-decoration: none; flex-shrink: 0;
}
.brand:hover { color: var(--ink); }
.brand svg { width: 25px; height: 25px; color: var(--flare); flex-shrink: 0; }
.brand span { white-space: nowrap; }
.brand small {
  display: block; font-family: var(--font-mono); font-weight: 500;
  font-size: 0.6rem; letter-spacing: 0.18em; color: var(--ink-4);
  text-transform: uppercase; margin-top: 1px;
}

.nav { margin-left: auto; display: flex; align-items: center; gap: var(--s-1); }
.nav a {
  font-size: var(--fs-sm); color: var(--ink-3); text-decoration: none;
  padding: var(--s-2) var(--s-3); border-radius: var(--radius);
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--flare-wash); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--flare); }

.nav-cta {
  font-size: var(--fs-sm); font-weight: 550;
  padding: 0.45rem 0.9rem !important;
  color: var(--on-flare) !important; background: var(--flare);
  border-radius: var(--radius);
}
.nav-cta:hover { background: var(--flare-2); color: var(--on-flare) !important; }

.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex-shrink: 0;
  background: none; border: 1px solid var(--rule);
  border-radius: var(--radius); color: var(--ink-3); cursor: pointer;
}
.icon-btn:hover { color: var(--ink); border-color: var(--rule-strong); }
.icon-btn svg { width: 15px; height: 15px; }
.icon-sun { display: block; }
.icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.nav-toggle { display: none; }

@media (max-width: 1080px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: var(--s-3) clamp(1.15rem, 4vw, 3rem) var(--s-5);
    box-shadow: var(--shadow-2);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    max-height: calc(100dvh - var(--nav-h)); overflow-y: auto;
  }
  .nav[data-open="true"] { transform: none; opacity: 1; visibility: visible; }
  .nav a { padding: var(--s-3) var(--s-2); border-bottom: 1px solid var(--rule); }
  .nav a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--flare); }
  .nav-cta { margin-top: var(--s-4); text-align: center; border-bottom: 0 !important; }
}

/* ---------- 7. HERO ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(168deg, var(--paper-2) 0%, var(--paper) 54%, var(--paper-3) 100%);
  border-bottom: 1px solid var(--rule);
  padding-block: clamp(3rem, 8vw, 6.5rem);
}
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; gap: clamp(2rem, 5vw, var(--s-7)); align-items: center; }
@media (min-width: 940px) { .hero-grid { grid-template-columns: minmax(0, 6.4fr) minmax(0, 5.6fr); } }

.hero h1 {
  font-size: var(--fs-display);
  font-weight: 620;
  letter-spacing: -0.032em;
  margin-top: var(--s-5);
}
.hero h1 em { font-style: normal; color: var(--flare); }
.hero .lede { margin-top: var(--s-5); max-width: 54ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }

/* ---------- 8. BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 550;
  padding: 0.7rem 1.3rem; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--flare); color: var(--on-flare); }
.btn--primary:hover { background: var(--flare-2); color: var(--on-flare); box-shadow: var(--glow); }
.btn--outline { border-color: var(--rule-strong); color: var(--ink-2); background: transparent; }
.btn--outline:hover { border-color: var(--flare); color: var(--ink); background: var(--flare-wash); }
.btn--ghost { color: var(--volt); padding-inline: 0; }
.btn--lg { padding: 0.85rem 1.6rem; font-size: 1rem; }

/* ---------- 9. AUDIENCE FORK ---------- */
.fork { display: grid; gap: var(--s-4); }
@media (min-width: 760px) { .fork { grid-template-columns: 1fr 1fr; } }

.door {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: clamp(1.35rem, 3vw, 2rem);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.door:hover {
  border-color: var(--flare); box-shadow: var(--shadow-2);
  transform: translateY(-2px); color: inherit;
}
.door h3 { margin-top: var(--s-3); }
.door p { color: var(--ink-3); font-size: var(--fs-sm); margin-top: var(--s-3); }
.door-go {
  display: inline-flex; align-items: center; gap: 0.4em;
  margin-top: var(--s-4); color: var(--volt);
  font-size: var(--fs-sm); font-weight: 550;
}
.door:hover .door-go { gap: 0.7em; }
.door-go svg { width: 14px; height: 14px; transition: transform 0.18s ease; }

/* ---------- 10. CARDS ---------- */
.card {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: clamp(1.2rem, 2.4vw, 1.7rem);
  display: flex; flex-direction: column;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-1); }
.card h3, .card h4 { margin-bottom: var(--s-3); }
.card p { color: var(--ink-3); font-size: var(--fs-sm); }
.card-icon {
  width: 26px; height: 26px; color: var(--flare);
  margin-bottom: var(--s-4); stroke-width: 1.4;
}
.card-foot { margin-top: auto; padding-top: var(--s-4); }
/* mono heading variant, for cards that are really data labels */
.card h3.mono, .card h4.mono { font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0; font-weight: 600; }

/* ---------- 11. DATA SURFACES ---------- */
.node {
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--card); overflow: hidden; margin-top: var(--s-5);
}
.node-head {
  display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap;
  padding: var(--s-4) clamp(1rem, 2.5vw, 1.5rem);
  background: var(--paper-2); border-bottom: 1px solid var(--rule);
}
[data-theme="light"] .node-head { background: var(--paper-3); }
.node-name {
  font-family: var(--font-mono); font-weight: 600; font-size: 1.02rem;
  letter-spacing: 0.06em; color: var(--ink);
}
.node-role { font-size: var(--fs-sm); color: var(--ink-3); }
.node-summary {
  display: grid; gap: 1px; background: var(--rule);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr));
}
.node-summary div { background: var(--card); padding: var(--s-4) clamp(1rem, 2.5vw, 1.5rem); }
.node-summary dt {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-4);
}
.node-summary dd {
  margin: var(--s-1) 0 0; font-family: var(--font-mono);
  font-size: 1.02rem; color: var(--ink); font-weight: 500;
}

/* Spec plate — a machine data plate, rivets and all */
.plate {
  position: relative;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--paper-2); padding: var(--s-5) clamp(1rem, 2.5vw, 1.5rem);
  /* Four rivets, one per corner. Painted as background dots rather than
     pseudo-elements: ::before/::after are only two, and box-shadow offsets
     cannot be percentages, so the obvious trick does not reach all four. */
  background-image:
    radial-gradient(circle at 8px 8px,               var(--rule-strong) 1.9px, transparent 2.2px),
    radial-gradient(circle at calc(100% - 8px) 8px,  var(--rule-strong) 1.9px, transparent 2.2px),
    radial-gradient(circle at 8px calc(100% - 8px),  var(--rule-strong) 1.9px, transparent 2.2px),
    radial-gradient(circle at calc(100% - 8px) calc(100% - 8px), var(--rule-strong) 1.9px, transparent 2.2px);
  background-repeat: no-repeat;
}
[data-theme="light"] .plate { background-color: var(--paper-3); }
.plate-title {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-4);
  margin-bottom: var(--s-4);
}
.plate-rows { display: grid; gap: var(--s-3); }
.plate-row {
  display: flex; align-items: baseline; gap: var(--s-3);
  font-family: var(--font-mono); font-size: var(--fs-sm);
}
.plate-row dt { color: var(--ink-4); font-size: var(--fs-label); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.plate-row .fill { flex: 1; border-bottom: 1px dotted var(--rule-strong); min-width: 1rem; }
.plate-row dd { margin: 0; color: var(--ink); font-weight: 500; white-space: nowrap; }

.spec { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.spec th, .spec td { text-align: left; vertical-align: top; padding: var(--s-4) clamp(1rem, 2.5vw, 1.5rem); border-top: 1px solid var(--rule); }
.spec th {
  width: 15rem; font-family: var(--font-mono); font-weight: 500;
  font-size: var(--fs-label); letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--ink-4);
}
.spec td { color: var(--ink-3); font-family: var(--font-mono); line-height: 1.6; font-size: 0.83rem; }
@media (max-width: 700px) {
  .spec th, .spec td { display: block; width: auto; }
  .spec td { border-top: 0; padding-top: 0; }
}

details.disclose { border-top: 1px solid var(--rule); }
details.disclose > summary {
  cursor: pointer; list-style: none;
  padding: var(--s-4) clamp(1rem, 2.5vw, 1.5rem);
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--volt);
  display: flex; align-items: center; gap: var(--s-3);
}
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::after {
  content: '+'; margin-left: auto; font-size: 1.1rem; line-height: 1;
}
details.disclose[open] > summary::after { content: '−'; }
details.disclose > summary:hover { background: var(--volt-wash); }

/* ---------- 12. TAGS / NOTES ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.28em 0.6em; border-radius: 2px;
}
.tag--live   { background: var(--ok-wash);    color: var(--ok); }
.tag--flare  { background: var(--flare-wash); color: var(--flare); }
.tag--volt   { background: var(--volt-wash);  color: var(--volt); }
.tag--open   { background: var(--warn-wash);  color: var(--warn); }
/* legacy aliases so older markup keeps its colour */
.tag--brass  { background: var(--flare-wash); color: var(--flare); }
.tag--signal { background: var(--volt-wash);  color: var(--volt); }
.tag-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.note {
  border-left: 2px solid var(--flare); background: var(--flare-wash);
  padding: var(--s-4) var(--s-5); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--fs-sm); color: var(--ink-3);
}
.note strong { color: var(--ink); }

/* ---------- 13. VENDOR REGISTER ---------- */
.logo-strip {
  display: grid; gap: 1px; background: var(--rule);
  border: 1px solid var(--rule); border-radius: var(--radius);
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
}
@media (min-width: 560px) { .logo-strip { grid-template-columns: repeat(4, 1fr); } }
.logo-item {
  background: var(--card); padding: var(--s-5) var(--s-4);
  display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
  text-align: center; transition: background 0.18s ease;
}
.logo-item:hover { background: var(--paper-2); }
.logo-mark {
  display: block; width: 112px; height: 30px;
  background-color: var(--ink-3);
  -webkit-mask-image: var(--logo); mask-image: var(--logo);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  transition: background-color 0.18s ease;
}
.logo-item:hover .logo-mark { background-color: var(--flare); }
.logo-item small {
  font-family: var(--font-mono); font-size: 0.66rem;
  letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-4);
}

/* ---------- 14. TECHNICAL ILLUSTRATIONS ---------- */
.figure {
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--card); padding: clamp(1.25rem, 3vw, 2rem);
}
.figure svg { width: 100%; height: auto; color: var(--ink-3); }
.figure figcaption {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-4);
  margin-top: var(--s-4); padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
}
.fig-label, .fig-value { stroke: none !important; }
.fig-label {
  font-family: var(--font-mono); font-size: 7px;
  letter-spacing: 0.1em; fill: currentColor;
}
.fig-value { font-family: var(--font-mono); font-size: 9px; fill: currentColor; font-weight: 600; }
.fig-accent { color: var(--flare); }
.fig-volt   { color: var(--volt); }

/* ---------- 15. STEPS ---------- */
.steps { counter-reset: step; display: grid; gap: var(--s-5); }
.step { display: grid; grid-template-columns: auto 1fr; gap: var(--s-5); align-items: start; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600;
  color: var(--flare);
  width: 2.4rem; height: 2.7rem; display: grid; place-items: center;
  flex-shrink: 0;
  /* hex cell, not a circle — the substrate motif, at badge scale */
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--flare-wash);
}
.step h3 { margin-bottom: var(--s-2); }
.step p { color: var(--ink-3); font-size: var(--fs-sm); }

/* ---------- 16. FORMS ---------- */
.field { display: block; margin-bottom: var(--s-5); }
.field > label {
  display: block; font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: var(--s-2);
}
.field .hint { font-family: var(--font-body); font-size: var(--fs-xs); color: var(--ink-4); letter-spacing: 0; text-transform: none; display: block; margin-top: 2px; }

input, select, textarea {
  width: 100%; font-family: var(--font-body); font-size: var(--fs-body);
  color: var(--ink); background: var(--card);
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
}
textarea { resize: vertical; min-height: 6.5rem; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--volt); outline-offset: 1px; border-color: var(--volt);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 1.25rem, calc(100% - 13px) 1.25rem; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2.5rem; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); margin-top: var(--s-6); }
.form-note { font-size: var(--fs-xs); color: var(--ink-4); }

.form-alert {
  display: none; margin-top: var(--s-5); padding: var(--s-4) var(--s-5);
  border-radius: var(--radius); font-size: var(--fs-sm);
  border-left: 2px solid var(--warn); background: var(--warn-wash); color: var(--ink-2);
}
.form-alert[data-show="true"] { display: block; }
.form-alert a { font-weight: 600; }

.form-done { display: none; text-align: center; padding: var(--s-7) var(--s-5); }
.form-done[data-show="true"] { display: block; }
.form-done svg { width: 42px; height: 42px; color: var(--ok); margin: 0 auto var(--s-4); stroke-width: 1.5; }
.form-done h3 { margin-bottom: var(--s-2); }
.form-done p { color: var(--ink-3); font-size: var(--fs-sm); }

/* ---------- 17. TEAM ---------- */
.person { text-align: left; }
.person .avatar {
  width: 44px; height: 50px;
  display: grid; place-items: center; margin-bottom: var(--s-4);
  font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600;
  letter-spacing: 0.05em;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
.person .avatar.filled { background: var(--flare); color: var(--on-flare); }
.person .avatar.open { background: var(--paper-3); color: var(--ink-4); }
.person .role {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--flare); margin-bottom: var(--s-3);
}

/* ---------- 18. CITATIONS ---------- */
.cite { border-top: 1px solid var(--rule); padding: var(--s-5) 0; }
.cite h3 { font-size: 1.02rem; margin-bottom: var(--s-2); }
.cite .authors { font-size: var(--fs-sm); color: var(--ink-3); }
.cite .venue {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--ink-4); margin-top: var(--s-1);
}
.cite .why { font-size: var(--fs-sm); color: var(--ink-3); margin-top: var(--s-3); }

/* ---------- 18b. ASCII PLATES ----------
   Monospace figures. They scale with the viewport and scroll inside their own
   box rather than widening the page, because the art has a fixed column count
   and cannot reflow. Decorative ones are aria-hidden; the ones carrying real
   information get role="img" and a label. */
.ascii {
  font-family: var(--font-mono);
  font-size: clamp(0.44rem, 0.2rem + 0.72vw, 0.76rem);
  line-height: 1.42;
  color: var(--ink-4);
  white-space: pre;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  margin: 0;
  padding: clamp(1rem, 2.4vw, 1.6rem);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  tab-size: 2;
}
[data-theme="light"] .ascii { background: var(--paper-3); }
.section--alt .ascii { background: var(--paper); }
[data-theme="light"] .section--alt .ascii { background: var(--card); }
/* inline accents inside the art */
.ascii b { color: var(--flare); font-weight: 500; }
.ascii i { color: var(--volt);  font-style: normal; }
.ascii u { color: var(--ink-2); text-decoration: none; }
.ascii s { color: var(--ok);    text-decoration: none; }
.ascii-cap {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-4);
  margin-top: var(--s-3);
}

/* Logo variant — decorative, no panel. Rendered from the real mark, so it is
   trimmed to a fixed column count and simply scrolls if the viewport is
   narrower than the art. */
.ascii--logo {
  background: none; border: 0; padding: 0;
  color: var(--flare);
  font-size: clamp(0.24rem, 0.02rem + 0.70vw, 0.55rem);
  /* 1.0 exactly: any leading opens horizontal gaps between the block rows
     and the mark reads as striped rather than solid. */
  line-height: 1;
  letter-spacing: 0;
  text-align: left;
  display: block; width: max-content; max-width: 100%;
  margin-inline: auto;
  opacity: .92;
  /* .ascii sets overflow-x:auto, and per CSS overflow, a non-visible value on
     one axis computes the other from visible to auto — so the block glyphs
     sitting ~1px proud of the line box were enough to raise a vertical
     scrollbar. Pin the y axis shut and give the descenders somewhere to go. */
  overflow-y: hidden;
  padding-bottom: 3px;
}
.section--alt .ascii--logo { background: none; }
[data-theme="light"] .ascii--logo,
[data-theme="light"] .section--alt .ascii--logo { background: none; }

/* Terminal variant — a captured console session */
.ascii--term {
  background: var(--paper); color: var(--ink-3);
  border-color: var(--rule-strong);
}
[data-theme="light"] .ascii--term,
[data-theme="light"] .section--alt .ascii--term { background: #10151C; color: #C4CDD8; border-color: #26313F; }
[data-theme="light"] .ascii--term b { color: #FF7A45; }
[data-theme="light"] .ascii--term i { color: #5CC8EA; }
[data-theme="light"] .ascii--term s { color: #5FC98F; }
[data-theme="light"] .ascii--term u { color: #F2F5F8; }

/* ---------- 19. CLUB SELECTOR (RPI) ---------- */
.club-tabs {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  margin-top: var(--s-6);
}
.club-tab {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  padding: 0.45rem 0.8rem; border-radius: var(--radius);
  border: 1px solid var(--rule); background: var(--card);
  color: var(--ink-3); cursor: pointer; white-space: nowrap;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}
.club-tab:hover { border-color: var(--rule-strong); color: var(--ink); }
.club-tab[aria-selected="true"] {
  border-color: var(--flare); color: var(--flare);
  background: var(--flare-wash); font-weight: 600;
}

.club-panel {
  margin-top: var(--s-5);
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--card); overflow: hidden;
}
.club-head {
  padding: var(--s-5) clamp(1.1rem, 2.6vw, 1.6rem);
  border-bottom: 1px solid var(--rule); background: var(--paper-2);
}
[data-theme="light"] .club-head { background: var(--paper-3); }
.club-head h3 { margin-bottom: var(--s-2); }
.club-head p { color: var(--ink-3); font-size: var(--fs-sm); }
.club-body {
  display: grid; gap: var(--s-5);
  padding: clamp(1.1rem, 2.6vw, 1.6rem);
}
@media (min-width: 780px) { .club-body { grid-template-columns: 1fr 1fr; gap: var(--s-7); } }
.club-body h4 {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-4);
  margin-bottom: var(--s-3); font-weight: 500;
}
.club-body ul { list-style: none; padding-left: 0; display: grid; gap: var(--s-2); }
.club-body li {
  font-size: var(--fs-sm); color: var(--ink-3);
  padding-left: 1.15rem; position: relative;
}
.club-body li::before {
  content: ''; position: absolute; left: 0; top: 0.55em;
  width: 7px; height: 8px; background: var(--flare);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
.club-why { font-size: var(--fs-sm); color: var(--ink-3); }

/* ---------- 20. FIT CALCULATOR ---------- */
.calc {
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--card); overflow: hidden;
}
.calc-controls {
  display: grid; gap: var(--s-4);
  padding: clamp(1.1rem, 2.6vw, 1.6rem);
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 700px) { .calc-controls { grid-template-columns: 1fr 1fr 1fr; align-items: end; } }
.calc-controls .field { margin-bottom: 0; }
.calc-out { padding: clamp(1.1rem, 2.6vw, 1.6rem); }

.gauge {
  position: relative; height: 30px; border-radius: 2px;
  background: var(--paper-3); overflow: hidden;
  border: 1px solid var(--rule);
}
.gauge-fill {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--ok), var(--ok));
  transition: width 0.35s cubic-bezier(.4,0,.2,1), background 0.35s ease;
}
.gauge[data-state="tight"] .gauge-fill { background: linear-gradient(90deg, var(--warn), var(--warn)); }
.gauge[data-state="over"]  .gauge-fill { background: linear-gradient(90deg, var(--flare), var(--flare)); }
/* Capacity ticks every 25%. Translucent rather than a solid rule, so they read
   as graduations over the fill instead of a seam splitting the bar. */
.gauge-ticks { position: absolute; inset: 0; pointer-events: none; }
.gauge-ticks span {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: var(--tick);
}
.gauge-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-4);
  margin-bottom: var(--s-2);
}
.gauge-label b { color: var(--ink); font-size: var(--fs-sm); letter-spacing: 0; }
.calc-verdict {
  margin-top: var(--s-4); font-size: var(--fs-sm);
  display: flex; align-items: flex-start; gap: var(--s-3);
}
.calc-verdict .dot {
  width: 9px; height: 10px; flex-shrink: 0; margin-top: 0.42em;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--ok);
}
.calc-verdict[data-state="tight"] .dot { background: var(--warn); }
.calc-verdict[data-state="over"]  .dot { background: var(--flare); }
.calc-verdict p { color: var(--ink-3); }
.calc-breakdown {
  margin-top: var(--s-5); padding-top: var(--s-4);
  border-top: 1px dotted var(--rule-strong);
  display: grid; gap: var(--s-2);
  font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-4);
}
.calc-breakdown div { display: flex; justify-content: space-between; gap: var(--s-4); }
.calc-breakdown b { color: var(--ink-3); font-weight: 500; }

/* ---------- 21. CTA BAND ---------- */
.cta-band {
  position: relative; overflow: hidden;
  background: var(--paper-2); border-block: 1px solid var(--rule);
  padding-block: clamp(3rem, 6vw, var(--s-8)); text-align: center;
}
[data-theme="light"] .cta-band { background: var(--paper-3); }
.cta-band .wrap { position: relative; z-index: 1; }
.cta-band h2 { margin-bottom: var(--s-4); }
.cta-band p { color: var(--ink-3); max-width: 52ch; margin-inline: auto; }
.cta-band .hero-actions { justify-content: center; }

/* ---------- 22. FOOTER ---------- */
.site-foot {
  border-top: 1px solid var(--rule); background: var(--paper-2);
  padding-block: var(--s-7) var(--s-6);
}
.foot-grid { display: grid; gap: var(--s-6); }
@media (min-width: 780px) { .foot-grid { grid-template-columns: 2fr 1fr 1fr; } }
.foot-col h2 {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 500; margin-bottom: var(--s-4);
}
.foot-col a {
  display: block; font-size: var(--fs-sm); color: var(--ink-3);
  text-decoration: none; padding: 0.25rem 0;
}
.foot-col a:hover { color: var(--volt); }
.foot-base {
  margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between;
  font-size: var(--fs-xs); color: var(--ink-4);
}

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

@media print {
  .site-head, .site-foot, .cta-band, .icon-btn, .hexfield { display: none; }
  body { background: #fff; color: #000; }
  a::after { content: ' (' attr(href) ')'; font-size: 0.75em; color: #555; }
}
