/* ==========================================================================
   CYBERGIL — Design System
   Tactical-HUD dark identity. Vanilla CSS, no build step.
   1. Tokens          5. Navigation
   2. Base + reset    6. Sections
   3. Layout          7. Page-specific
   4. Components      8. Motion + responsive
   ========================================================================== */

/* 1. TOKENS ============================================================== */

:root {
  /* Brand */
  --mint: #00f5c4;
  --mint-dim: #00c9a2;
  --violet: #7c5cff;
  --amber: #ffb020;
  --danger: #ff4d6d;

  /* Dark theme surfaces (default) */
  --bg: #05070d;
  --bg-alt: #080b14;
  --surface: #0d1220;
  --surface-2: #121a2c;
  --line: #1c2740;
  --line-soft: #141c2e;

  /* Type */
  --text: #e8eefc;
  --text-2: #a4b1c9;
  --text-3: #6b7a95;

  --glow: 0 0 0 1px rgba(0, 245, 196, 0.25), 0 0 32px -8px rgba(0, 245, 196, 0.45);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.85);
  --grid-line: rgba(120, 145, 190, 0.055);
  --hero-veil: rgba(5, 7, 13, 0.72);

  /* Fonts */
  --f-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* Rhythm */
  --wrap: 1200px;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --section-y: clamp(4.5rem, 9vw, 8rem);
  --r-sm: 6px;
  --r: 12px;
  --r-lg: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Light theme */
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-alt: #eaeef6;
  --surface: #ffffff;
  --surface-2: #f0f3f9;
  --line: #d5dced;
  --line-soft: #e4e9f3;
  --text: #0b1120;
  --text-2: #46526b;
  --text-3: #6b7891;
  --mint: #00a884;
  --mint-dim: #008f70;
  --violet: #5b3fd8;
  --glow: 0 0 0 1px rgba(0, 168, 132, 0.3), 0 10px 30px -12px rgba(0, 168, 132, 0.4);
  --shadow: 0 20px 45px -25px rgba(21, 35, 66, 0.35);
  --grid-line: rgba(40, 65, 110, 0.06);
  --hero-veil: rgba(244, 246, 251, 0.7);
}

/* 2. BASE ================================================================ */

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

* { margin: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}

/* Ambient grid + vignette on every page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 20%, transparent 78%);
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.35rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

p { color: var(--text-2); }

::selection { background: var(--mint); color: #04120e; }

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

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 99px;
  border: 3px solid var(--bg-alt);
}
::-webkit-scrollbar-thumb:hover { background: var(--mint-dim); }

/* 3. LAYOUT ============================================================== */

.wrap {
  width: min(100% - (var(--gutter) * 2), var(--wrap));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.section { padding-block: var(--section-y); position: relative; }
.section--alt { background: var(--bg-alt); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.stack-sm > * + * { margin-top: 0.65rem; }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.measure { max-width: 62ch; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

/* Hairline divider with a lit node */
.rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  border: 0;
  margin-block: 0;
}

/* 4. COMPONENTS ========================================================== */

/* --- Eyebrow / section label --- */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mint);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--mint);
  opacity: 0.7;
}

.section-head { max-width: 68ch; margin-bottom: clamp(2.2rem, 4vw, 3.4rem); }
.section-head.center { margin-inline: auto; }
.section-head p { font-size: 1.06rem; margin-top: 1rem; }

/* --- Buttons --- */
.btn {
  --btn-bg: var(--mint);
  --btn-fg: #04120e;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.6rem;
  font-family: var(--f-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: var(--r-sm);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -10px rgba(0, 245, 196, 0.55);
}
.btn:active { transform: translateY(0); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn--ghost:hover {
  --btn-fg: var(--mint);
  box-shadow: inset 0 0 0 1px var(--mint), 0 12px 30px -14px rgba(0, 245, 196, 0.4);
}

.btn--violet { --btn-bg: var(--violet); --btn-fg: #fff; }
.btn--violet:hover { box-shadow: 0 12px 30px -10px rgba(124, 92, 255, 0.6); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
}

/* --- Tags / chips --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 3px;
  border: 1px solid;
  white-space: nowrap;
}
.tag--comm { color: var(--mint); border-color: rgba(0, 245, 196, 0.35); background: rgba(0, 245, 196, 0.07); }
.tag--gov { color: var(--violet); border-color: rgba(124, 92, 255, 0.4); background: rgba(124, 92, 255, 0.08); }
.tag--new { color: var(--amber); border-color: rgba(255, 176, 32, 0.38); background: rgba(255, 176, 32, 0.08); }
.tag--cred { color: var(--danger); border-color: rgba(255, 77, 109, 0.38); background: rgba(255, 77, 109, 0.08); }
.tag--phase { color: var(--text); border-color: var(--line); background: var(--surface-2); }

.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* --- Cards --- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(1.4rem, 2.5vw, 1.9rem);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

/* Mouse-follow spotlight (position fed by JS custom props) */
.card--spot::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s;
  background: radial-gradient(
    340px circle at var(--mx, 50%) var(--my, 50%),
    rgba(0, 245, 196, 0.09),
    transparent 65%
  );
  pointer-events: none;
}
.card--spot:hover::before { opacity: 1; }
.card--spot:hover { border-color: rgba(0, 245, 196, 0.4); transform: translateY(-4px); }

.card h3 { margin-bottom: 0.6rem; }
.card p { font-size: 0.94rem; }

/* Corner bracket accents */
.card--bracket::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 16px;
  height: 16px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  transition: border-color 0.3s;
}
.card--bracket:hover::after { border-color: var(--mint); }

/* Numbered index badge */
.card-idx {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.12em;
  margin-bottom: 0.9rem;
  display: block;
}

/* Icon tile */
.icon-tile {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(150deg, rgba(0, 245, 196, 0.16), rgba(124, 92, 255, 0.12));
  border: 1px solid var(--line);
  color: var(--mint);
  margin-bottom: 1.1rem;
  flex-shrink: 0;
}
.icon-tile svg { width: 22px; height: 22px; stroke-width: 1.6; }

/* --- Lists --- */
.ticks { list-style: none; padding: 0; }
.ticks li {
  position: relative;
  padding-left: 1.7rem;
  margin-bottom: 0.6rem;
  color: var(--text-2);
  font-size: 0.94rem;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--mint);
  box-shadow: 0 0 10px rgba(0, 245, 196, 0.7);
}
.ticks--violet li::before { background: var(--violet); box-shadow: 0 0 10px rgba(124, 92, 255, 0.7); }
.ticks--danger li::before { background: var(--danger); box-shadow: 0 0 10px rgba(255, 77, 109, 0.6); }
.ticks--amber li::before { background: var(--amber); box-shadow: 0 0 10px rgba(255, 176, 32, 0.6); }

/* --- Stat --- */
.stat { text-align: center; padding: 1.4rem 1rem; }
.stat b {
  display: block;
  font-family: var(--f-display);
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat b .unit { color: var(--mint); }
/* Direct child only — the counter <span> lives inside <b> and must not inherit this. */
.stat > span {
  display: block;
  margin-top: 0.6rem;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* --- Terminal window --- */
.terminal {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-alt) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--f-mono);
  font-size: 0.83rem;
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
}
.terminal__bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}
.terminal__bar i:nth-child(1) { background: #ff5f57; }
.terminal__bar i:nth-child(2) { background: #febc2e; }
.terminal__bar i:nth-child(3) { background: #28c840; }
.terminal__bar span {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--text-3);
  letter-spacing: 0.1em;
}
.terminal__body {
  padding: 1.15rem;
  min-height: 232px;
  line-height: 1.85;
}
.terminal__body .ln { display: block; white-space: pre-wrap; word-break: break-word; }
.t-prompt { color: var(--mint); }
.t-flag { color: var(--violet); }
.t-warn { color: var(--amber); }
.t-crit { color: var(--danger); }
.t-dim { color: var(--text-3); }
.cursor-blink {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--mint);
  vertical-align: text-bottom;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* --- Accordion --- */
.acc { border-top: 1px solid var(--line); }
.acc__item { border-bottom: 1px solid var(--line); }
.acc__btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0.25rem;
  text-align: left;
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  transition: color 0.25s;
}
.acc__btn:hover { color: var(--mint); }
.acc__btn .n {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--text-3);
  flex-shrink: 0;
}
.acc__btn .ico {
  margin-left: auto;
  width: 22px;
  height: 22px;
  position: relative;
  flex-shrink: 0;
}
.acc__btn .ico::before,
.acc__btn .ico::after {
  content: "";
  position: absolute;
  inset: 50% 2px auto 2px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s var(--ease);
}
.acc__btn .ico::after { transform: rotate(90deg); }
.acc__btn[aria-expanded="true"] { color: var(--mint); }
.acc__btn[aria-expanded="true"] .ico::after { transform: rotate(0deg); }
.acc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease);
}
.acc__panel > div { overflow: hidden; }
.acc__item.is-open .acc__panel { grid-template-rows: 1fr; }
.acc__inner { padding: 0 0 1.5rem 2.6rem; }

/* --- Tabs --- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.2rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.9rem;
}
.tab {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.6rem 1.1rem;
  border-radius: var(--r-sm);
  color: var(--text-3);
  border: 1px solid transparent;
  transition: all 0.25s var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  color: var(--mint);
  border-color: rgba(0, 245, 196, 0.4);
  background: rgba(0, 245, 196, 0.07);
}
.tabpanel[hidden] { display: none; }

/* --- Filter chips --- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 2rem;
}
.chip {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--text-2);
  background: var(--surface);
  transition: all 0.22s var(--ease);
}
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip.is-active {
  background: var(--mint);
  border-color: var(--mint);
  color: #04120e;
  font-weight: 600;
}
.filters__count {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--text-3);
  margin-left: auto;
}

/* --- Pros / cons --- */
.pc {
  border-radius: var(--r);
  border: 1px solid var(--line);
  padding: clamp(1.3rem, 2.5vw, 1.8rem);
  background: var(--surface);
}
.pc--pro { border-left: 3px solid var(--mint); }
.pc--con { border-left: 3px solid var(--danger); }
.pc h4 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-family: var(--f-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.pc--pro h4 { color: var(--mint); }
.pc--con h4 { color: var(--danger); }

/* --- Timeline / process --- */
.steps { list-style: none; padding: 0; position: relative; }
.steps::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--mint), var(--violet), transparent);
  opacity: 0.5;
}
.step {
  position: relative;
  padding-left: 3.6rem;
  padding-bottom: 2rem;
}
.step:last-child { padding-bottom: 0; }
.step__dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 0.78rem;
  color: var(--mint);
  z-index: 1;
}
.step h4 { font-family: var(--f-display); font-size: 1.05rem; margin-bottom: 0.4rem; }
.step p { font-size: 0.93rem; }

/* --- Table --- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  font-size: 0.92rem;
}
table.data th,
table.data td {
  padding: 0.95rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}
table.data th {
  background: var(--surface-2);
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  font-weight: 600;
}
table.data td { color: var(--text-2); }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background 0.2s; }
table.data tbody tr:hover { background: var(--surface-2); }

/* --- Callout --- */
.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  background: var(--surface);
  border-radius: var(--r);
  padding: 1.2rem 1.4rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.callout svg { flex-shrink: 0; color: var(--amber); width: 20px; height: 20px; margin-top: 3px; }
.callout p { font-size: 0.92rem; }
.callout--mint { border-left-color: var(--mint); }
.callout--mint svg { color: var(--mint); }

/* --- Forms --- */
.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 0.5rem;
}
.field label .req { color: var(--mint); }
.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-3); }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(0, 245, 196, 0.12);
}
.field textarea { resize: vertical; min-height: 130px; }
.field select { appearance: none; cursor: pointer; }
.field.has-error input,
.field.has-error textarea,
.field.has-error select { border-color: var(--danger); }
.field .err {
  display: none;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--danger);
  margin-top: 0.4rem;
}
.field.has-error .err { display: block; }

.form-note {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-top: 1rem;
}
.form-status {
  display: none;
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  border-radius: var(--r-sm);
  border: 1px solid rgba(0, 245, 196, 0.4);
  background: rgba(0, 245, 196, 0.08);
  font-size: 0.92rem;
  color: var(--text);
}
.form-status.is-visible { display: block; }

/* 5. NAVIGATION ========================================================== */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--mint), var(--violet));
  z-index: 200;
  transition: width 0.1s linear;
}

.hdr {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s;
}
.hdr.is-stuck {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.hdr__in {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 74px;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 0.65rem; flex-shrink: 0; }
.logo svg { width: 32px; height: 32px; }
.logo__txt {
  font-family: var(--f-display);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.logo__txt em {
  font-style: normal;
  color: var(--mint);
}
.logo__tld {
  font-family: var(--f-mono);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: var(--text-3);
  display: block;
  margin-top: -2px;
}

.nav { display: flex; align-items: center; gap: 0.35rem; margin-left: auto; }
.nav a {
  position: relative;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  color: var(--text-2);
  border-radius: var(--r-sm);
  transition: color 0.22s;
}
.nav a:hover { color: var(--text); }
.nav a.is-current { color: var(--mint); }
.nav a.is-current::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.1rem;
  height: 1px;
  background: var(--mint);
}

.hdr__actions { display: flex; align-items: center; gap: 0.6rem; }

.theme-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-2);
  transition: all 0.25s var(--ease);
}
.theme-btn:hover { color: var(--mint); border-color: var(--mint); }
.theme-btn svg { width: 17px; height: 17px; }
[data-theme="light"] .theme-btn .i-moon { display: none; }
.theme-btn .i-sun { display: none; }
[data-theme="light"] .theme-btn .i-sun { display: block; }

.burger {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  position: relative;
}
.burger span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.burger span:nth-child(1) { top: 13px; }
.burger span:nth-child(2) { top: 18px; }
.burger span:nth-child(3) { top: 23px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* Footer */
.ftr {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  position: relative;
  z-index: 1;
}
.ftr__grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 3rem;
}
.ftr h5 {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1.1rem;
  font-weight: 600;
}
.ftr ul { list-style: none; padding: 0; }
.ftr li { margin-bottom: 0.6rem; }
.ftr li a {
  font-size: 0.9rem;
  color: var(--text-2);
  transition: color 0.2s, padding-left 0.25s var(--ease);
}
.ftr li a:hover { color: var(--mint); padding-left: 5px; }
.ftr__bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-3);
}
.ftr__bottom p { font-size: 0.82rem; }
.office {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  color: var(--text-2);
}
.office svg { width: 16px; height: 16px; color: var(--mint); flex-shrink: 0; margin-top: 4px; }
.office b { display: block; color: var(--text); font-size: 0.82rem; font-family: var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; }

.to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--mint);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { border-color: var(--mint); box-shadow: var(--glow); }
.to-top svg { width: 18px; height: 18px; }

/* 6. SECTIONS ============================================================ */

/* --- Hero --- */
.hero {
  position: relative;
  min-height: clamp(600px, 88vh, 900px);
  display: flex;
  align-items: center;
  padding-block: clamp(3rem, 8vw, 6rem);
  overflow: hidden;
}
#net-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 60% 55% at 50% 45%, transparent 0%, var(--hero-veil) 100%);
  pointer-events: none;
}
.hero__in {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
/* Sized to sit inside the hero's narrower copy column, not the full page. */
.hero h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.5rem);
  margin-bottom: 1.4rem;
}
.hero h1 .lit {
  background: linear-gradient(100deg, var(--mint) 10%, var(--violet) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__lead { font-size: clamp(1rem, 1.6vw, 1.14rem); max-width: 54ch; margin-bottom: 2rem; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.9rem 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(8px);
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: 1.6rem;
}
.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(0, 245, 196, 0.16);
  animation: pulse 2.4s var(--ease) infinite;
  margin-left: 0.35rem;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(0, 245, 196, 0.18); }
  50% { box-shadow: 0 0 0 8px rgba(0, 245, 196, 0); }
}

/* --- Marquee --- */
.marquee {
  border-block: 1px solid var(--line);
  background: var(--bg-alt);
  padding-block: 1.05rem;
  overflow: hidden;
  position: relative;
  z-index: 1;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: slide 42s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track span {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 3rem;
  white-space: nowrap;
}
.marquee__track span::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--mint);
  opacity: 0.6;
}
@keyframes slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* --- Page hero (inner pages) --- */
.phero {
  position: relative;
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.phero::before {
  content: "";
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 420px;
  background: radial-gradient(ellipse at center, rgba(0, 245, 196, 0.12), transparent 68%);
  pointer-events: none;
}
.phero h1 { max-width: 20ch; }
.phero p { font-size: 1.05rem; max-width: 62ch; margin-top: 1.2rem; }
.crumbs {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.1em;
  margin-bottom: 1.4rem;
}
.crumbs a:hover { color: var(--mint); }
.crumbs span { color: var(--mint); }

/* --- CTA band --- */
.cta-band {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(ellipse 70% 130% at 15% 0%, rgba(0, 245, 196, 0.11), transparent 60%),
    radial-gradient(ellipse 70% 130% at 85% 100%, rgba(124, 92, 255, 0.13), transparent 60%),
    var(--surface);
  padding: clamp(2.4rem, 5vw, 4rem);
  overflow: hidden;
  text-align: center;
}
.cta-band h2 { max-width: 20ch; margin-inline: auto; }
.cta-band p { max-width: 56ch; margin: 1.1rem auto 2rem; }
.cta-band .btn-row { justify-content: center; }

/* 7. PAGE-SPECIFIC ======================================================= */

/* Domain cards (services) */
.domain {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 100%;
}
.domain__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.domain__no {
  font-family: var(--f-mono);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--line);
  letter-spacing: -0.04em;
  transition: color 0.3s;
}
.card--spot:hover .domain__no { color: rgba(0, 245, 196, 0.55); }
.domain__services {
  list-style: none;
  padding: 0;
  margin-top: auto;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--line);
}
.domain__services li {
  font-size: 0.85rem;
  color: var(--text-3);
  padding: 0.3rem 0;
  display: flex;
  gap: 0.5rem;
}
.domain__services li::before { content: "▸"; color: var(--mint); opacity: 0.7; }
.domain.is-hidden { display: none; }
.card.is-hidden { display: none; }

/* Phase-1 highlight cards */
.phase-card {
  position: relative;
  border: 1px solid rgba(0, 245, 196, 0.3);
  background: linear-gradient(160deg, rgba(0, 245, 196, 0.06), transparent 55%), var(--surface);
  border-radius: var(--r);
  padding: clamp(1.5rem, 3vw, 2rem);
  overflow: hidden;
}
.phase-card::after {
  content: attr(data-num);
  position: absolute;
  right: -12px;
  bottom: -34px;
  font-family: var(--f-display);
  font-size: 7rem;
  font-weight: 700;
  color: var(--text);
  opacity: 0.035;
  line-height: 1;
}

/* Comparison / VS layout */
.vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: stretch;
}
.vs__mid {
  display: grid;
  place-items: center;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--text-3);
  letter-spacing: 0.16em;
  position: relative;
}
.vs__mid::before,
.vs__mid::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  background: linear-gradient(var(--line), transparent);
  height: calc(50% - 26px);
}
.vs__mid::before { top: 0; background: linear-gradient(transparent, var(--line)); }
.vs__mid::after { bottom: 0; }

/* Contact split */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(1.5rem, 3vw, 2.2rem);
}
.contact-item {
  display: flex;
  gap: 1rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.contact-item:last-child { border-bottom: 0; }
.contact-item .icon-tile { margin-bottom: 0; width: 40px; height: 40px; }
.contact-item b {
  display: block;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.3rem;
}
.contact-item a, .contact-item p { font-size: 0.95rem; color: var(--text); }
.contact-item a:hover { color: var(--mint); }

/* Value / about */
.value-num {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--mint);
  letter-spacing: 0.16em;
  display: block;
  margin-bottom: 0.75rem;
}

/* Placeholder marker for content the client must supply */
.tbd {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px dashed rgba(255, 176, 32, 0.45);
  border-radius: 3px;
  padding: 0.15rem 0.45rem;
}

/* 8. MOTION + RESPONSIVE ================================================= */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }
.reveal[data-d="5"] { transition-delay: 0.4s; }

/* Glitch on hover for the wordmark */
.glitch { position: relative; }
.glitch:hover::before,
.glitch:hover::after {
  content: attr(data-txt);
  position: absolute;
  inset: 0;
  background: var(--bg);
  clip-path: inset(0 0 55% 0);
}
.glitch:hover::before { color: var(--mint); animation: gl-a 0.5s steps(2) infinite; }
.glitch:hover::after { color: var(--violet); clip-path: inset(60% 0 0 0); animation: gl-b 0.5s steps(2) infinite; }
@keyframes gl-a { 0%, 100% { transform: translate(0); } 50% { transform: translate(-2px, -1px); } }
@keyframes gl-b { 0%, 100% { transform: translate(0); } 50% { transform: translate(2px, 1px); } }

@media (max-width: 980px) {
  .hero__in { grid-template-columns: 1fr; }
  .hero__visual { display: none; }
  .ftr__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .vs { grid-template-columns: 1fr; }
  .vs__mid { padding-block: 0.5rem; }
  .vs__mid::before, .vs__mid::after { display: none; }
}

@media (max-width: 860px) {
  .burger { display: block; }
  .nav {
    position: fixed;
    inset: 74px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0.75rem var(--gutter) 1.5rem;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--ease);
    max-height: calc(100vh - 74px);
    overflow-y: auto;
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav a { padding: 0.9rem 0.25rem; border-bottom: 1px solid var(--line-soft); font-size: 1rem; }
  .nav a.is-current::after { display: none; }
  .nav .btn { margin-top: 1rem; justify-content: center; }
  .hdr__actions { margin-left: auto; }
}

@media (max-width: 600px) {
  .ftr__grid { grid-template-columns: 1fr; }
  .acc__inner { padding-left: 0; }
  .btn { width: 100%; }
  .btn-row .btn { flex: 1 1 100%; }
  .filters__count { width: 100%; margin-left: 0; }
}

/* Skip link: off-screen until keyboard focus, so sighted mouse users never see it. */
.skip {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 300;
  padding: 0.75rem 1.3rem;
  background: var(--mint);
  color: #05070d;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: top 0.15s ease;
}
.skip:focus { top: 1rem; }

/* Anchored sections land below the sticky header instead of underneath it. */
[id] { scroll-margin-top: 96px; }

@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;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .hdr, .ftr, .to-top, .progress, #net-canvas, .marquee { display: none; }
  body { background: #fff; color: #000; }
}
