/* Layer Two - stacked planes, depth gauge, deep violet + cyan.
   One shared stylesheet for every page. System fonts only. */

:root {
  color-scheme: dark;

  /* palette seeds */
  --void: #0f0a2a;
  --indigo: #2b1f6b;
  --cyan: #3de0ff;
  --lilac: #b58cff;
  --text: #edebff;
  --dim: #b5b0da;

  /* derived tokens */
  --deep: #150f3f;
  --panel: #1b1450;
  --panel-hi: #241a63;
  --raised: #321f8a;
  --edge: #8d78d8;
  --edge-soft: rgba(181, 140, 255, 0.3);
  --cyan-hi: #8ceeff;
  --lilac-soft: rgba(181, 140, 255, 0.16);
  --cyan-soft: rgba(61, 224, 255, 0.14);
  --err: #ff9fb0;
  --ok: #7cf2be;
  --amber: #ffd36e;

  /* type */
  --sans: "Trebuchet MS", "Segoe UI", Verdana, "DejaVu Sans", system-ui, sans-serif;
  --mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --fs-sm: clamp(0.88rem, 0.86rem + 0.1vw, 0.95rem);
  --fs-base: clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --fs-lg: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  --fs-h3: clamp(1.2rem, 1.1rem + 0.6vw, 1.6rem);
  --fs-h2: clamp(1.75rem, 1.2rem + 2.4vw, 3rem);
  --fs-h1: clamp(2.6rem, 1.4rem + 5.6vw, 5.6rem);

  /* spacing scale */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4.5rem;
  --s9: 7rem;

  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --header-h: 72px;

  --shadow-1: 0 1px 0 rgba(237, 235, 255, 0.06) inset, 0 8px 24px rgba(5, 3, 20, 0.45);
  --shadow-2: 0 1px 0 rgba(237, 235, 255, 0.08) inset, 0 2px 4px rgba(5, 3, 20, 0.5), 0 24px 60px rgba(5, 3, 20, 0.55);
}

*, *::before, *::after { box-sizing: border-box; }
/* no transitions until the page has settled, so first paint is always the final state */
html:not(.ready) *, html:not(.ready) *::before, html:not(.ready) *::after { transition: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
  background: var(--void);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(61, 224, 255, 0.13), transparent 60%),
    radial-gradient(800px 700px at -10% 20%, rgba(181, 140, 255, 0.16), transparent 60%),
    linear-gradient(180deg, var(--void) 0%, var(--deep) 55%, var(--void) 100%);
  background-color: var(--void);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  overflow-x: clip;
  padding-bottom: 60px;
}

body::before {
  /* faint floor grid that deepens with the gauge */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    repeating-linear-gradient(0deg, rgba(181, 140, 255, 0.05) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, rgba(181, 140, 255, 0.05) 0 1px, transparent 1px 64px);
  opacity: 0.6;
  transition: opacity 0.6s ease;
}
body[data-layer="1"]::before { opacity: 0.9; }
body[data-layer="2"]::before { opacity: 1; background-size: auto; }

h1, h2, h3, h4 {
  font-family: var(--sans);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 var(--s4);
  font-weight: 700;
  overflow-wrap: break-word;
}
h1 { font-size: var(--fs-h1); letter-spacing: -0.04em; line-height: 0.98; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; }
h4 { font-size: var(--fs-lg); letter-spacing: -0.01em; }

p { margin: 0 0 var(--s4); }
ul, ol { margin: 0 0 var(--s4); padding-left: 1.25rem; }
li { margin-bottom: var(--s2); }
strong { color: var(--text); }
em { font-style: italic; }

a { color: var(--cyan); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--cyan-hi); text-decoration-thickness: 2px; }

code, kbd, samp, .mono { font-family: var(--mono); font-size: 0.9em; }
code {
  background: var(--lilac-soft);
  border: 1px solid var(--edge-soft);
  border-radius: 6px;
  padding: 0.05em 0.4em;
  color: var(--text);
}
kbd {
  background: var(--panel-hi);
  border: 1px solid var(--edge);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.05em 0.45em;
  color: var(--text);
}

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

::selection { background: var(--cyan); color: var(--void); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--s4);
  top: -80px;
  z-index: 200;
  background: var(--cyan);
  color: var(--void);
  padding: var(--s3) var(--s5);
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: var(--s3); color: var(--void); outline-color: var(--text); }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
}
.wrap-narrow { width: min(100% - 2 * var(--gutter), 780px); margin-inline: auto; }

/* ---------- header ---------- */
.site-header {
  position: relative;
  z-index: 50;
  background: rgba(15, 10, 42, 0.94);
  border-bottom: 1px solid var(--edge-soft);
  box-shadow: 0 10px 30px rgba(5, 3, 20, 0.4);
}
@media (min-width: 900px) {
  .site-header { position: sticky; top: 0; }
}
.header-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s5);
  min-height: var(--header-h);
  padding-block: var(--s2);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}
.brand:hover { color: var(--text); }
.brand .logo { width: 34px; height: 34px; flex: none; transition: transform 0.3s ease; }
.brand:hover .logo { transform: translateY(-2px) rotate(-4deg); }
.brand b { color: var(--cyan); font-weight: 700; }

.nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin: 0;
  padding: 0;
}
.nav li { margin: 0; }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s4);
  border-radius: 999px;
  color: var(--dim);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.nav a:hover { background: var(--lilac-soft); color: var(--text); border-color: var(--edge-soft); }
.nav a[aria-current="page"] {
  background: var(--panel-hi);
  color: var(--text);
  border-color: var(--edge);
  box-shadow: 0 0 0 1px rgba(61, 224, 255, 0.0) inset, 0 -3px 0 var(--cyan) inset;
}

/* ---------- depth gauge ---------- */
.gauge {
  position: fixed;
  z-index: 60;
  left: 0; right: 0; bottom: 0;
  height: 56px;
  background: var(--void);
  border-top: 1px solid var(--edge);
}
.gauge-list {
  list-style: none;
  margin: 0; padding: 0;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  position: relative;
}
.gauge-list li { margin: 0; display: flex; }
.gauge-list a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 52px;
  color: var(--dim);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 700;
}
.gauge-list a:hover { color: var(--text); background: var(--lilac-soft); }
.gl-n {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.gauge-list a[aria-current="true"] { color: var(--text); }
.gauge-list a[aria-current="true"] .gl-n { color: var(--cyan); }
.gauge-list .gauge-marker {
  position: absolute;
  top: 0;
  left: calc(var(--gp, 0) * 66.6667%);
  width: 33.3333%;
  height: 4px;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
  transition: left 0.25s ease-out;
  pointer-events: none;
}

@media (min-width: 1100px) {
  body { padding-right: 84px; padding-bottom: 0; }
  .gauge {
    left: auto;
    right: 14px;
    top: 50%;
    bottom: auto;
    height: auto;
    width: 60px;
    transform: translateY(-50%);
    padding: 28px 0;
    background: rgba(15, 10, 42, 0.88);
    border: 1px solid var(--edge-soft);
    border-radius: 30px;
    box-shadow: var(--shadow-1);
  }
  .gauge::before {
    content: "DEPTH";
    position: absolute;
    top: 9px; left: 0; right: 0;
    text-align: center;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    color: var(--dim);
    font-weight: 700;
  }
  .gauge-list {
    display: block;
    height: min(40vh, 300px);
    width: 44px;
    margin-inline: auto;
  }
  .gauge-list::before {
    content: "";
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: linear-gradient(180deg, var(--lilac), var(--cyan));
    opacity: 0.55;
  }
  .gauge-list li { position: absolute; left: 0; right: 0; display: block; }
  .gauge-list li:nth-child(1) { top: 0; }
  .gauge-list li:nth-child(2) { top: 50%; }
  .gauge-list li:nth-child(3) { top: 100%; }
  .gauge-list a {
    position: relative;
    width: 44px; height: 44px;
    min-height: 44px;
    margin-top: -22px;
    border-radius: 50%;
    background: var(--void);
    border: 2px solid var(--edge);
    flex: none;
  }
  .gauge-list a:hover { border-color: var(--cyan); }
  .gauge-list a[aria-current="true"] { background: var(--cyan); border-color: var(--cyan); }
  .gauge-list a[aria-current="true"] .gl-n { color: var(--void); }
  .gl-n { font-size: 0.8rem; }
  .gl-t {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: var(--void);
    border: 1px solid var(--edge-soft);
    border-radius: 999px;
    padding: 2px 12px;
    font-size: 0.78rem;
    color: var(--text);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  .gauge-list a:hover .gl-t,
  .gauge-list a:focus-visible .gl-t { opacity: 1; visibility: visible; }
  .gauge-list .gauge-marker {
    right: auto;
    left: -3px;
    top: calc(var(--gp, 0) * 100%);
    width: 14px; height: 14px;
    margin: -7px 0 0 -7px;
    background: var(--lilac);
    border: 2px solid var(--void);
    transform: rotate(45deg);
    box-shadow: 0 0 0 2px var(--cyan), 0 0 16px var(--cyan);
    transition: top 0.25s ease-out;
    z-index: 2;
  }
}
@media (max-width: 1099px) {
  .gl-t { display: inline; }
}

/* ---------- layout primitives ---------- */
.sec-head p.layer-tag, .article p.layer-tag { color: var(--void); font-size: 0.8rem; max-width: none; }
.section {
  position: relative;
  padding-block: clamp(var(--s7), 8vw, var(--s9));
}
.section--tight { padding-block: clamp(var(--s6), 5vw, var(--s8)); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  margin: 0 0 var(--s4);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lilac);
  font-weight: 700;
}
.eyebrow .dot {
  width: 10px; height: 10px;
  background: var(--cyan);
  transform: rotate(45deg);
  box-shadow: 0 0 12px var(--cyan);
}
.lede { font-size: var(--fs-lg); color: var(--text); max-width: 60ch; line-height: 1.55; }
.dim { color: var(--dim); }
.measure { max-width: 66ch; }
.sec-head { max-width: 760px; margin-bottom: var(--s6); }
.sec-head p { color: var(--dim); font-size: var(--fs-lg); }

.layer-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--void);
  background: var(--lilac);
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: var(--s3);
}

.grid { display: grid; gap: var(--s5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.split-2 {
  display: grid;
  gap: var(--s6);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 900px) {
  .split-2 { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--s7); }
  .split-2--flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
}

/* ---------- panels / cards ---------- */
.card {
  position: relative;
  background: linear-gradient(160deg, rgba(36, 26, 99, 0.92), rgba(27, 20, 80, 0.92));
  border: 1px solid var(--edge-soft);
  border-radius: var(--radius);
  padding: var(--s5);
  box-shadow: var(--shadow-1);
}
.card::after {
  /* a second translucent plane peeking out underneath */
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: -7px;
  height: 14px;
  z-index: -1;
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgba(181, 140, 255, 0.16);
  border: 1px solid var(--edge-soft);
  border-top: 0;
}
.card h3 { margin-bottom: var(--s3); }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card--glow { border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(61, 224, 255, 0.35), 0 0 40px rgba(61, 224, 255, 0.12), var(--shadow-1); }
.card-link {
  display: block;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.card-link:hover { color: var(--text); transform: translateY(-4px); border-color: var(--cyan); }
.card-link .go { display: inline-flex; align-items: center; gap: var(--s2); color: var(--cyan); font-weight: 700; margin-top: var(--s3); }

.num {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--cyan);
  color: var(--void);
  font-family: var(--mono);
  font-weight: 700;
  margin-bottom: var(--s3);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 46px;
  padding: 0 var(--s5);
  border-radius: 12px;
  border: 2px solid transparent;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--cyan);
  color: var(--void);
  box-shadow: 0 4px 0 #1c8ca6, 0 12px 30px rgba(61, 224, 255, 0.2);
}
.btn-primary:hover { background: var(--cyan-hi); color: var(--void); }
.btn-primary:active { box-shadow: 0 1px 0 #1c8ca6; transform: translateY(3px); }
.btn-ghost {
  background: rgba(15, 10, 42, 0.5);
  color: var(--text);
  border-color: var(--edge);
}
.btn-ghost:hover { background: var(--lilac-soft); border-color: var(--lilac); color: var(--text); }
.btn-lilac { background: var(--lilac); color: var(--void); }
.btn-lilac:hover { background: #cfb0ff; color: var(--void); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--panel);
  color: var(--dim);
  border: 2px dashed var(--edge);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.btn-sm { min-height: 40px; padding: 0 var(--s4); }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s5) 0; }

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--s4);
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.chip:hover { background: var(--raised); border-color: var(--lilac); }
.chip[aria-pressed="true"] { background: var(--cyan); color: var(--void); border-color: var(--cyan); }
.chip[aria-pressed="true"]::before { content: "\2713\00a0"; }
.chip:disabled { background: var(--panel); color: var(--dim); border-style: dashed; cursor: not-allowed; }
.chip-row { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---------- forms ---------- */
label, .label { display: block; font-weight: 700; margin-bottom: var(--s2); }
.help { color: var(--dim); font-size: var(--fs-sm); margin: var(--s2) 0 0; }
input[type="text"], input[type="email"], input[type="search"], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: var(--s3) var(--s4);
  background: var(--void);
  color: var(--text);
  border: 2px solid var(--edge);
  border-radius: var(--radius-sm);
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"].mono, input.mono { font-family: var(--mono); }
textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--lilac); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--cyan); outline: 3px solid var(--cyan); outline-offset: 2px; }
input:disabled, select:disabled, textarea:disabled {
  background: var(--panel);
  color: var(--dim);
  border-style: dashed;
  cursor: not-allowed;
}
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 3px rgba(255, 159, 176, 0.2); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 700; margin-bottom: var(--s2); }
.field { margin-bottom: var(--s4); }
.field-row { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

.check {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 44px;
  font-weight: 400;
  margin: 0;
  cursor: pointer;
}
.check input { width: 24px; height: 24px; accent-color: var(--cyan); flex: none; margin: 0; cursor: pointer; }

/* segmented radios */
.seg { display: flex; flex-wrap: wrap; gap: var(--s2); }
.seg-item { position: relative; flex: 1 1 140px; }
.seg-item input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg-item label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 48px;
  margin: 0;
  padding: 0 var(--s4);
  text-align: center;
  background: var(--void);
  border: 2px solid var(--edge);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 700;
  transition: background 0.2s, border-color 0.2s;
}
.seg-item input:hover + label { border-color: var(--lilac); }
.seg-item input:checked + label { background: var(--cyan); color: var(--void); border-color: var(--cyan); }
.seg-item input:checked + label::before { content: "\2713"; }
.seg-item input:focus-visible + label { outline: 3px solid var(--cyan); outline-offset: 3px; }
.seg-item input:disabled + label { background: var(--panel); color: var(--dim); border-style: dashed; cursor: not-allowed; }

/* range */
.range { display: grid; gap: var(--s2); }
.range-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.range-top label { margin: 0; }
output { font-family: var(--mono); font-weight: 700; color: var(--cyan); }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  background: transparent;
  margin: 0;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--indigo), var(--lilac));
  border: 1px solid var(--edge);
}
input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--indigo), var(--lilac));
  border: 1px solid var(--edge);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--cyan);
  border: 3px solid var(--void);
  box-shadow: 0 0 0 2px var(--cyan), 0 4px 10px rgba(5, 3, 20, 0.6);
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--cyan);
  border: 3px solid var(--void);
  box-shadow: 0 0 0 2px var(--cyan);
}
input[type="range"]:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 8px; }

/* messages */
.msg {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: flex-start;
  margin: var(--s4) 0 0;
  padding: var(--s3) var(--s4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--edge);
  background: var(--void);
  color: var(--text);
  font-size: var(--fs-sm);
}
.msg:empty { display: none; }
.msg > span { flex: 1 1 14rem; min-width: 0; }
.msg strong { white-space: nowrap; }
.msg--err { border-color: var(--err); }
.msg--err strong { color: var(--err); }
.msg--ok { border-color: var(--ok); }
.msg--ok strong { color: var(--ok); }
.msg--info { border-color: var(--cyan); }
.msg--info strong { color: var(--cyan); }

.empty {
  border: 2px dashed var(--edge);
  border-radius: var(--radius);
  padding: var(--s5);
  text-align: center;
  color: var(--dim);
}
.empty strong { color: var(--text); display: block; margin-bottom: var(--s2); }

/* ---------- slab dividers (CSS 3D) ---------- */
.slabs {
  position: relative;
  height: clamp(90px, 14vw, 150px);
  perspective: 700px;
  perspective-origin: 50% 0%;
  overflow: clip;
  pointer-events: none;
}
.slabs i {
  position: absolute;
  left: 8%; right: 8%;
  top: 50%;
  height: clamp(46px, 7vw, 74px);
  margin-top: -34px;
  border-radius: 14px;
  border: 1px solid rgba(181, 140, 255, 0.7);
  background:
    repeating-linear-gradient(90deg, rgba(237, 235, 255, 0.1) 0 1px, transparent 1px 36px),
    linear-gradient(100deg, rgba(61, 224, 255, 0.2), rgba(43, 31, 107, 0.7) 45%, rgba(181, 140, 255, 0.22));
  box-shadow: 0 18px 40px rgba(5, 3, 20, 0.5);
  transform:
    translate3d(calc(var(--p, 0) * var(--k) * 26px), calc((var(--k) - 1) * -16px), 0)
    rotateX(64deg);
  transform-origin: 50% 50%;
}
.slabs i:nth-child(1) { --k: 0; opacity: 0.9; }
.slabs i:nth-child(2) { --k: 1; opacity: 0.75; left: 12%; right: 12%; }
.slabs i:nth-child(3) { --k: 2; opacity: 0.6; left: 16%; right: 16%; }
.slabs--rev i { transform: translate3d(calc(var(--p, 0) * var(--k) * -26px), calc((var(--k) - 1) * -16px), 0) rotateX(64deg); }

/* ---------- HERO (home) ---------- */
.hero { position: relative; padding-block: clamp(var(--s6), 6vw, var(--s8)) clamp(var(--s5), 4vw, var(--s7)); overflow: clip; }
.hero-grid {
  display: grid;
  gap: var(--s6);
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: var(--s7); }
}
.hero h1 .two { color: var(--cyan); }
.hero-tag {
  font-size: clamp(1.25rem, 1rem + 1.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: var(--s4) 0 var(--s4);
  color: var(--lilac);
}
.hint {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  color: var(--dim);
  font-size: var(--fs-sm);
  border-left: 3px solid var(--cyan);
  padding-left: var(--s4);
  max-width: 54ch;
}

.stage {
  position: relative;
  height: clamp(380px, 50vw, 520px);
  display: grid;
  place-items: center;
}
.stage::before {
  /* ground shadow */
  content: "";
  position: absolute;
  left: 12%; right: 12%; bottom: 6%;
  height: 16%;
  background: radial-gradient(closest-side, rgba(61, 224, 255, 0.22), transparent);
  filter: blur(6px);
}
.stack {
  --rx: 58deg;
  --rz: -34deg;
  --gap: 90px;
  --lift: 76px;
  --ps: clamp(200px, 40vw, 320px);
  position: relative;
  width: var(--ps);
  height: var(--ps);
  perspective: 1500px;
  transform: translateY(var(--lift));
}
.plane {
  --i: 0;
  position: absolute;
  inset: 0;
  /* each plane carries its own tilt; vertical separation is a plain screen-space lift */
  transform: translateY(calc(var(--i) * var(--lift) * -1)) rotateX(var(--rx)) rotateZ(var(--rz));
  border-radius: 18px;
  border: 1.5px solid rgba(181, 140, 255, 0.85);
  background:
    repeating-linear-gradient(0deg, rgba(181, 140, 255, 0.16) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg, rgba(181, 140, 255, 0.16) 0 1px, transparent 1px 30px),
    linear-gradient(135deg, rgba(61, 224, 255, 0.18), rgba(43, 31, 107, 0.62) 55%, rgba(15, 10, 42, 0.7));
  box-shadow: 0 0 0 1px rgba(15, 10, 42, 0.8) inset, 0 30px 50px rgba(5, 3, 20, 0.5);
}
.plane--base { --i: 0; }
.plane--mid { --i: 1; }
.plane--top { --i: 2; }
.plane--mid { border-color: rgba(61, 224, 255, 0.8); }
.plane.is-on {
  border-color: var(--cyan);
  border-width: 2.5px;
  box-shadow: 0 0 0 1px rgba(15, 10, 42, 0.8) inset, 0 0 46px rgba(61, 224, 255, 0.55), 0 30px 50px rgba(5, 3, 20, 0.5);
  background:
    repeating-linear-gradient(0deg, rgba(61, 224, 255, 0.22) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg, rgba(61, 224, 255, 0.22) 0 1px, transparent 1px 30px),
    linear-gradient(135deg, rgba(61, 224, 255, 0.34), rgba(43, 31, 107, 0.7) 60%, rgba(15, 10, 42, 0.72));
}
.spine {
  position: absolute;
  left: 50%;
  top: calc(50% - var(--lift) * 2);
  height: calc(var(--lift) * 2);
  width: 0;
  border-left: 2px dashed rgba(61, 224, 255, 0.75);
}
.plane-lbl {
  --i: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  width: max-content;
  max-width: 190px;
  transform: translate(-50%, calc(-50% - var(--i) * var(--lift)));
}
.plane-lbl--mid { --i: 1; }
.plane-lbl--top { --i: 2; }
.plane-btn {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 44px;
  padding: var(--s2) var(--s3);
  background: rgba(15, 10, 42, 0.92);
  color: var(--text);
  border: 1.5px solid var(--edge);
  border-radius: 12px;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(5, 3, 20, 0.5);
  transition: border-color 0.2s, background 0.2s;
}
.plane-btn:hover { border-color: var(--lilac); background: #1a1250; }
.plane-btn[aria-pressed="true"] { border-color: var(--cyan); background: var(--cyan); color: var(--void); }
.plane-btn[aria-pressed="true"] .pb-tag { color: var(--void); }
.plane-btn:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.pb-tag { display: block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--lilac); font-weight: 700; line-height: 1.3; }
.pb-name { display: block; font-weight: 700; font-size: 0.98rem; letter-spacing: -0.01em; line-height: 1.2; }

.console {
  margin-top: var(--s4);
  background: rgba(15, 10, 42, 0.75);
  border: 1px solid var(--edge-soft);
  border-radius: var(--radius);
  padding: var(--s4) var(--s5) var(--s5);
  box-shadow: var(--shadow-1);
}
.console-sliders { display: grid; gap: var(--s2) var(--s5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.stepper { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s3); }
.step-count { font-family: var(--mono); font-weight: 700; color: var(--cyan); margin: 0; flex: 1 1 100%; }
.detail { margin-top: var(--s4); padding: var(--s4); border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--edge-soft); min-height: 8.5rem; }
.detail-title { font-weight: 700; font-size: var(--fs-lg); letter-spacing: -0.02em; margin: 0 0 var(--s2); color: var(--text); }
.detail p:last-child { margin-bottom: 0; }

/* receipt / tab slip */
.slip {
  position: relative;
  font-family: var(--mono);
  background: linear-gradient(180deg, #f0edff 0%, #dcd7ff 100%);
  color: #1b1450;
  border-radius: 6px;
  padding: var(--s5) var(--s5) var(--s6);
  transform: rotate(-1.4deg);
  box-shadow: 0 2px 0 #b9b1f0, 0 26px 50px rgba(5, 3, 20, 0.6);
  max-width: 400px;
  margin-inline: auto;
}
.slip::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -9px;
  height: 10px;
  background:
    linear-gradient(135deg, transparent 50%, #dcd7ff 50%) 0 0 / 14px 10px,
    linear-gradient(225deg, transparent 50%, #dcd7ff 50%) 0 0 / 14px 10px;
}
.slip h3 { font-family: var(--sans); color: #1b1450; font-size: 1.25rem; margin-bottom: var(--s3); }
.slip ul { list-style: none; padding: 0; margin: 0 0 var(--s4); border-top: 2px dashed #6a5bc0; }
.slip li { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; margin: 0; border-bottom: 1px dashed #6a5bc0; font-size: 0.95rem; }
.slip .sig { display: flex; gap: var(--s4); margin-top: var(--s5); font-size: 0.85rem; }
.slip .sig span { flex: 1; border-top: 2px solid #1b1450; padding-top: 4px; }
.slip .stamp {
  position: absolute;
  right: 14px; bottom: 22px;
  border: 3px solid #1b1450;
  color: #1b1450;
  padding: 2px 10px;
  border-radius: 6px;
  transform: rotate(-9deg);
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  background: rgba(220, 215, 255, 0.85);
}

/* lifecycle strip */
.life { display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); counter-reset: life; }
.life > li { list-style: none; margin: 0; }
.mini-plane { display: block; width: 100%; height: auto; margin-bottom: var(--s3); }

/* ---------- SIMULATOR ---------- */
.sim {
  display: grid;
  gap: var(--s5);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1000px) {
  .sim {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    grid-template-areas:
      "fund view"
      "pay view"
      "close view"
      "log log";
    align-items: start;
  }
  .sim-fund { grid-area: fund; }
  .sim-view { grid-area: view; }
  .sim-pay { grid-area: pay; }
  .sim-close { grid-area: close; }
  .sim-log { grid-area: log; }
}
.panel-title { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.panel-title h3 { margin: 0; }
.panel-title .num { margin: 0; flex: none; }

.diagram { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); background: rgba(15, 10, 42, 0.6); border: 1px solid var(--edge-soft); }
.diagram text { font-family: var(--sans); fill: var(--text); }
.d-small { font-size: 15px; }
.d-label { font-size: 17px; font-weight: 700; }
.d-peer { font-size: 30px; font-weight: 700; }
.d-plane-off { fill: rgba(43, 31, 107, 0.55); stroke: #b58cff; stroke-width: 1.5; }
.d-plane-on { fill: rgba(27, 20, 80, 0.8); stroke: #8d78d8; stroke-width: 1.5; }
.d-node { fill: #0f0a2a; stroke: #3de0ff; stroke-width: 3; }
.d-node--b { stroke: #b58cff; }
.d-link { stroke: #8d78d8; stroke-width: 3; stroke-dasharray: 4 8; fill: none; }
.is-open .d-link { stroke: #3de0ff; stroke-dasharray: none; }
.is-closed .d-link { stroke: #8d78d8; stroke-dasharray: 2 10; }
.d-tx { fill: rgba(15, 10, 42, 0.8); stroke: #8d78d8; stroke-width: 2; stroke-dasharray: 6 5; }
.d-tx.on { fill: #3de0ff; stroke: #3de0ff; stroke-dasharray: none; }
.d-tx-text { fill: var(--text); }
.d-tx.on + .d-tx-text { fill: #0f0a2a; }
.d-tether { stroke: #8d78d8; stroke-width: 2; stroke-dasharray: 3 6; }
.d-tether.on { stroke: #3de0ff; stroke-dasharray: none; stroke-width: 3; }
.packet-g { opacity: 0; }
.packet-g.live { opacity: 1; }
.packet-dot { fill: #3de0ff; stroke: #0f0a2a; stroke-width: 3; }
.packet-dot.sign { fill: #ffd36e; }
.packet-text { font-size: 15px; font-weight: 700; fill: var(--text); }

.peer-cards { display: grid; gap: var(--s3); grid-template-columns: 1fr 1fr; margin-top: var(--s4); }
.peer {
  background: var(--panel);
  border: 1px solid var(--edge-soft);
  border-radius: var(--radius-sm);
  padding: var(--s3) var(--s4);
  border-top: 4px solid var(--cyan);
}
.peer--b { border-top-color: var(--lilac); border-top-style: double; border-top-width: 6px; }
.peer h4 { margin: 0; font-size: var(--fs-base); display: flex; align-items: center; gap: var(--s2); }
.peer .bal { font-family: var(--mono); font-size: clamp(1.15rem, 0.9rem + 1.6vw, 1.8rem); font-weight: 700; margin: var(--s1) 0 0; overflow-wrap: anywhere; line-height: 1.2; }
.peer .sub { color: var(--dim); font-size: var(--fs-sm); margin: 0; }
.split-meter { margin-top: var(--s3); display: flex; height: 28px; border-radius: 999px; overflow: hidden; border: 2px solid var(--edge); background: var(--void); }
.split-a, .split-b { display: block; height: 100%; min-width: 0; transition: width 0.5s ease; }
.split-a { background: var(--cyan); }
.split-b { background: repeating-linear-gradient(135deg, var(--lilac) 0 8px, #8a5cf0 8px 16px); }
.split-empty { width: 100%; background: transparent; }

.counters { display: grid; gap: var(--s3); grid-template-columns: repeat(3, minmax(0, 1fr)); margin: var(--s4) 0 0; }
.counters > div { background: var(--panel); border: 1px solid var(--edge-soft); border-radius: var(--radius-sm); padding: var(--s3); }
.counters dt { color: var(--dim); font-size: var(--fs-sm); line-height: 1.3; }
.counters dd { margin: var(--s1) 0 0; font-family: var(--mono); font-weight: 700; font-size: clamp(1.4rem, 1rem + 2vw, 2.2rem); line-height: 1.1; color: var(--text); }
.counters .c-off dd { color: var(--cyan); }
.counters .c-on dd { color: var(--lilac); }

.compare { margin-top: var(--s4); }
.bar-row { display: grid; gap: var(--s1); margin-bottom: var(--s3); }
.bar-row p { margin: 0; font-size: var(--fs-sm); color: var(--dim); display: flex; justify-content: space-between; gap: var(--s3); }
.bar-row p b { color: var(--text); font-family: var(--mono); }
.bar { height: 14px; border-radius: 999px; background: var(--void); border: 1px solid var(--edge); overflow: hidden; }
.bar > span { display: block; height: 100%; min-width: 4px; border-radius: 999px; transition: width 0.5s ease; }
.bar--off > span { background: var(--cyan); }
.bar--chain > span { background: repeating-linear-gradient(135deg, var(--lilac) 0 8px, #8a5cf0 8px 16px); }

.protocol { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s2); counter-reset: proto; }
.protocol li {
  counter-increment: proto;
  margin: 0;
  padding: var(--s3) var(--s4) var(--s3) 3rem;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--edge-soft);
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-size: var(--fs-sm);
}
.protocol li::before {
  content: counter(proto);
  position: absolute;
  left: 0.8rem; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px solid var(--edge);
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text);
}
.protocol li[aria-current="step"] { color: var(--text); border-color: var(--cyan); background: var(--panel-hi); }
.protocol li[aria-current="step"]::before { background: var(--cyan); border-color: var(--cyan); color: var(--void); }
.protocol li[aria-current="step"]::after { content: "now"; position: absolute; right: 0.8rem; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); font-weight: 700; }
.protocol li.done::before { content: "\2713"; background: var(--panel); }
.protocol li.done { color: var(--text); }

.step-controls { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s3); }

.log { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; display: grid; gap: var(--s2); }
.log li {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  background: var(--void);
  border-left: 4px solid var(--edge);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--fs-sm);
}
.log .tag { font-family: var(--mono); font-weight: 700; color: var(--cyan); white-space: nowrap; }
.log .tag--chain { color: var(--lilac); }
.log .tag--warn { color: var(--amber); }
.log li.chain { border-left-color: var(--lilac); }
.log li.off { border-left-color: var(--cyan); }
.log li.warn { border-left-color: var(--amber); }

.summary { margin-top: var(--s4); border: 2px solid var(--ok); border-radius: var(--radius); padding: var(--s4) var(--s5); background: var(--panel); }
.summary h4 { margin-bottom: var(--s2); }
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s4); margin: 0; }
.summary dt { color: var(--dim); }
.summary dd { margin: 0; font-family: var(--mono); font-weight: 700; text-align: right; }

.tip-list { padding-left: 0; list-style: none; display: grid; gap: var(--s3); }
.tip-list li { position: relative; padding-left: 2rem; margin: 0; }
.tip-list li::before { content: ""; position: absolute; left: 0.2rem; top: 0.55em; width: 10px; height: 10px; background: var(--cyan); transform: rotate(45deg); }

/* ---------- TRADEOFFS ---------- */
.explorer { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) {
  .explorer { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: start; }
}
.weights { display: grid; gap: var(--s3); }
.w-row { padding: var(--s3) var(--s4); background: var(--void); border: 1px solid var(--edge-soft); border-radius: var(--radius-sm); }
.w-row .help { margin-top: 0; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: var(--s3) 0 0; padding: 0; list-style: none; }
.legend li { margin: 0; display: flex; align-items: center; min-height: 40px; }
.key-swatch { width: 34px; height: 14px; flex: none; }
.radar { width: 100%; height: auto; display: block; max-width: 560px; margin-inline: auto; }
.radar text { font-family: var(--sans); fill: var(--text); font-size: 20px; font-weight: 700; }
.radar .r-sub { font-size: 16px; font-weight: 400; fill: var(--dim); }
.radar .ring { fill: none; stroke: #8d78d8; stroke-width: 1; opacity: 0.55; }
.radar .axis { stroke: #8d78d8; stroke-width: 1.5; }
.radar .axis.off { stroke-dasharray: 3 6; opacity: 0.5; }
.radar .poly { stroke-width: 3; stroke-linejoin: round; transition: opacity 0.3s; }
.radar .poly-ch { fill: rgba(61, 224, 255, 0.22); stroke: #3de0ff; }
.radar .poly-sc { fill: rgba(181, 140, 255, 0.2); stroke: #b58cff; stroke-dasharray: 10 6; }
.radar .poly-ro { fill: rgba(255, 211, 110, 0.14); stroke: #ffd36e; stroke-dasharray: 2 6; stroke-linecap: round; }
.radar .mk-ch { fill: #3de0ff; }
.radar .mk-sc { fill: #b58cff; }
.radar .mk-ro { fill: #ffd36e; }
.radar .hidden-d { display: none; }
.radar-wrap { background: rgba(15, 10, 42, 0.6); border: 1px solid var(--edge-soft); border-radius: var(--radius); padding: var(--s4); }

.rank { list-style: none; padding: 0; margin: var(--s4) 0 0; display: grid; gap: var(--s3); }
.rank li { margin: 0; background: var(--void); border: 1px solid var(--edge-soft); border-radius: var(--radius-sm); padding: var(--s3) var(--s4); }
.rank-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.rank-name { font-weight: 700; display: inline-flex; align-items: center; gap: var(--s2); }
.rank-score { font-family: var(--mono); font-weight: 700; color: var(--cyan); }
.rank .bar { margin-top: var(--s2); }
.rank .bar > span { background: var(--cyan); }
.rank li[data-d="sc"] .bar > span { background: repeating-linear-gradient(135deg, var(--lilac) 0 8px, #8a5cf0 8px 16px); }
.rank li[data-d="ro"] .bar > span { background: repeating-linear-gradient(90deg, var(--amber) 0 6px, #c99a2c 6px 12px); }
.rank li.lead { border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(61, 224, 255, 0.35); }
.sym { display: inline-block; width: 14px; height: 14px; flex: none; }
.sym-ch { background: #3de0ff; border-radius: 50%; }
.sym-sc { background: #b58cff; }
.sym-ro { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 14px solid #ffd36e; background: none; }

.matrix { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--edge-soft); border-radius: var(--radius); overflow: hidden; }
.matrix caption { text-align: left; padding: var(--s4) 0; color: var(--dim); font-size: var(--fs-sm); caption-side: top; }
.matrix th, .matrix td { text-align: left; vertical-align: top; padding: var(--s4); border-bottom: 1px solid var(--edge-soft); font-size: var(--fs-sm); }
.matrix thead th { background: var(--panel-hi); border-bottom: 2px solid var(--edge); font-size: var(--fs-base); }
.matrix tbody th { background: rgba(15, 10, 42, 0.5); font-weight: 700; width: 22%; }
.matrix tr:last-child th, .matrix tr:last-child td { border-bottom: 0; }
.matrix .th-btn { background: none; border: 0; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; padding: 0; min-height: 40px; display: inline-flex; align-items: center; gap: var(--s2); text-align: left; text-decoration: underline; text-decoration-color: var(--edge); text-underline-offset: 4px; }
.matrix .th-btn:hover { text-decoration-color: var(--cyan); }
.matrix .th-btn[aria-pressed="true"] { color: var(--cyan); text-decoration-color: var(--cyan); }
.matrix col.is-focus, .matrix td.is-focus, .matrix th.is-focus { background: rgba(61, 224, 255, 0.1); }
.matrix td.is-focus { box-shadow: inset 0 0 0 2px rgba(61, 224, 255, 0.5); }
.w-badge { display: inline-block; margin-top: var(--s1); font-family: var(--mono); font-size: 0.78rem; font-weight: 700; color: var(--lilac); letter-spacing: 0.04em; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: var(--s2); }
.dots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--edge); background: transparent; }
.dots i.f { background: var(--cyan); border-color: var(--cyan); }
.cell-score { font-weight: 700; color: var(--text); display: block; margin-bottom: var(--s2); }
.cell-score .dots { margin-right: var(--s2); }
.cell-note { color: var(--dim); }
.matrix td.dim-cell { opacity: 1; }
.matrix tr.zero th, .matrix tr.zero td { background: repeating-linear-gradient(135deg, rgba(15, 10, 42, 0.5) 0 10px, rgba(27, 20, 80, 0.5) 10px 20px); }

@media (max-width: 799px) {
  .matrix, .matrix thead, .matrix tbody, .matrix tr, .matrix th, .matrix td { display: block; width: 100% !important; }
  .matrix thead { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .matrix thead th { width: 1px !important; padding: 0; }
  .matrix caption { display: block; width: 100%; padding-inline: var(--s2); }
  .matrix tr { border-bottom: 2px solid var(--edge); }
  .matrix tr:last-child { border-bottom: 0; }
  .matrix tbody th { border-bottom: 1px solid var(--edge); }
  .matrix td[data-label]::before { content: attr(data-label); display: block; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lilac); font-weight: 700; margin-bottom: var(--s1); }
  .design-focus-row { display: flex !important; }
}
.design-picker { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0 0 var(--s4); }

/* ---------- LEARN ---------- */
.learn-grid { display: grid; gap: var(--s6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .learn-grid { grid-template-columns: 240px minmax(0, 1fr); gap: var(--s7); } }
.toc { align-self: start; }
@media (min-width: 1000px) { .toc { position: sticky; top: calc(var(--header-h) + 24px); } }
.toc h2 { font-size: var(--fs-base); font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--lilac); margin-bottom: var(--s3); }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--edge-soft); }
.toc li { margin: 0; }
.toc a { display: flex; align-items: center; min-height: 40px; padding: 0 var(--s4); margin-left: -2px; border-left: 2px solid transparent; color: var(--dim); text-decoration: none; font-size: var(--fs-sm); font-weight: 700; }
.toc a:hover { color: var(--text); border-left-color: var(--lilac); }
.toc a[aria-current="location"] { color: var(--text); border-left-color: var(--cyan); background: var(--cyan-soft); }
.toc .toc-l { font-family: var(--mono); font-size: 0.72rem; color: var(--lilac); margin-right: var(--s2); }
@media (max-width: 999px) {
  .toc ol { display: flex; flex-wrap: wrap; gap: var(--s2); border-left: 0; }
  .toc a { border: 1px solid var(--edge-soft); border-radius: 999px; margin: 0; }
  .toc a[aria-current="location"] { border-color: var(--cyan); }
}
.article section { margin-bottom: var(--s8); }
.article section:last-child { margin-bottom: 0; }
.article h2 { margin-top: 0; }
.article p, .article li { max-width: 68ch; }
.callout {
  margin: var(--s5) 0;
  padding: var(--s4) var(--s5);
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--edge-soft);
  border-left: 6px solid var(--cyan);
}
.callout--analogy { border-left-color: var(--lilac); }
.callout--analogy::before, .callout--mech::before, .callout--care::before {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: var(--s2);
}
.callout--analogy::before { content: "Analogy"; color: var(--lilac); }
.callout--mech::before { content: "Mechanics"; color: var(--cyan); }
.callout--care { border-left-color: var(--amber); }
.callout--care::before { content: "Handle with care"; color: var(--amber); }
.callout p:last-child { margin-bottom: 0; }

.glossary-tools { display: grid; gap: var(--s3); margin-bottom: var(--s5); }
.gloss { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); margin: 0; }
.gloss > div { background: var(--panel); border: 1px solid var(--edge-soft); border-radius: var(--radius-sm); padding: var(--s4); }
.gloss dt { font-weight: 700; font-size: var(--fs-lg); letter-spacing: -0.01em; color: var(--text); margin-bottom: var(--s2); }
.gloss dt small { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lilac); margin-left: var(--s2); }
.gloss dd { margin: 0; color: var(--dim); }
.gloss [hidden] { display: none; }

.quiz { display: grid; gap: var(--s5); }
.q { background: var(--panel); border: 1px solid var(--edge-soft); border-radius: var(--radius); padding: var(--s5); }
.q legend { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.01em; margin-bottom: var(--s3); float: left; width: 100%; }
.q legend + * { clear: both; }
.q .opts { display: grid; gap: var(--s2); }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt label { display: flex; gap: var(--s3); align-items: center; min-height: 48px; margin: 0; padding: var(--s2) var(--s4); background: var(--void); border: 2px solid var(--edge); border-radius: var(--radius-sm); font-weight: 400; }
.opt label::before { content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--edge); }
.opt input:hover + label { border-color: var(--lilac); }
.opt input:checked + label { border-color: var(--cyan); background: var(--panel-hi); }
.opt input:checked + label::before { background: var(--cyan); border-color: var(--cyan); box-shadow: inset 0 0 0 3px var(--void); }
.opt input:focus-visible + label { outline: 3px solid var(--cyan); outline-offset: 3px; }
.q-result { margin: var(--s3) 0 0; }

/* ---------- CONTACT ---------- */
.mail-preview {
  font-family: var(--mono);
  font-size: 0.88rem;
  background: var(--void);
  border: 1px dashed var(--edge);
  border-radius: var(--radius-sm);
  padding: var(--s4);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0 0 var(--s4);
  color: var(--text);
}
.addr {
  font-family: var(--mono);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  margin-top: var(--s8);
  padding-block: var(--s7) var(--s6);
  background: linear-gradient(180deg, transparent, rgba(27, 20, 80, 0.8));
  border-top: 1px solid var(--edge-soft);
}
.foot-grid { display: grid; gap: var(--s6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 800px) { .foot-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-footer h2 { font-size: var(--fs-base); font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--lilac); margin-bottom: var(--s3); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0; }
.site-footer li a { display: inline-flex; align-items: center; min-height: 40px; }
.foot-note { color: var(--dim); font-size: var(--fs-sm); max-width: 52ch; }
.foot-base { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--edge-soft); color: var(--dim); font-size: var(--fs-sm); }

/* ---------- page header (inner pages) ---------- */
.page-hero { position: relative; padding-block: clamp(var(--s6), 6vw, var(--s8)) var(--s5); overflow: clip; }
.page-hero-grid { display: grid; gap: var(--s6); grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 900px) { .page-hero-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); } }
.page-hero h1 { font-size: clamp(2.3rem, 1.3rem + 4.6vw, 4.6rem); }
.steps-4 { display: grid; gap: var(--s3); margin: var(--s5) 0 0; padding: 0; list-style: none; counter-reset: st; }
.steps-4 li { counter-increment: st; margin: 0; display: flex; gap: var(--s3); align-items: flex-start; }
.steps-4 li::before { content: counter(st); flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--cyan); color: var(--void); font-family: var(--mono); font-weight: 700; }
.iso { width: 100%; height: auto; max-width: 440px; margin-inline: auto; display: block; }

/* ---------- print ---------- */
@media print {
  body, html { background: #fff !important; color: #000 !important; }
  body::before, .gauge, .site-header, .site-footer .nav-foot, .slabs, .skip, .stage, .console, .btn, form, .sim-fund, .sim-pay, .sim-close { display: none !important; }
  * { color: #000 !important; background: transparent !important; box-shadow: none !important; text-shadow: none !important; }
  .card, .panel, .summary, .peer, .counters > div { border: 1px solid #000 !important; }
  a { text-decoration: underline; }
  .section, .page-hero { padding-block: 12pt; }
  body { padding: 0; font-size: 11pt; }
}

/* ---------- reduced motion: remove every animation and transition ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition: none !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .brand:hover .logo, .card-link:hover, .btn:active { transform: none; }
  .packet-g { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .pulse { animation: pulse 2.4s ease-in-out infinite; }
  @keyframes pulse { 0%, 100% { opacity: 0.65; } 50% { opacity: 1; } }
  .plane.is-on { animation: planeglow 2.6s ease-in-out infinite; }
  @keyframes planeglow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(15, 10, 42, 0.8) inset, 0 0 30px rgba(61, 224, 255, 0.4), 0 30px 50px rgba(5, 3, 20, 0.5); }
    50% { box-shadow: 0 0 0 1px rgba(15, 10, 42, 0.8) inset, 0 0 56px rgba(61, 224, 255, 0.7), 0 30px 50px rgba(5, 3, 20, 0.5); }
  }
}
