/* ============================================================================
   MCPdef — the gate and the chain
   ----------------------------------------------------------------------------
   One stylesheet, no framework, no build step, no runtime network request.

   The world comes from the product's two nouns. A GATE: every call is decided
   before it runs, so allow and deny are semantic colours used on decisions and
   nowhere else — they are not the brand. A CHAIN: the audit ledger links each
   record to the last by hash, so records are drawn as links with a rule running
   through them.

   The accent is deliberately separate from allow/deny. If the brand colour were
   green, a page about a deny-by-default gate would be reading "allow" in its
   own furniture.
   ============================================================================ */

@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ────────────────────────────────────────────────────────────────
   Dark-first: this is an appliance. The complete dark palette sits on bare
   :root; the light overrides live in a `prefers-color-scheme: light` block
   guarded against an explicit dark choice, and `[data-theme]` wins in both
   directions. Nothing declares a colour outside these three blocks. */

:root {
  --ground: #0e1016;
  --panel: #161a24;
  --panel-2: #1d2331;
  --rule: #29303f;
  --rule-lit: #3a4356;
  --text: #e8eaf1;
  --text-2: #9ba4ba;
  --text-3: #7c8599;

  --accent: #8f9df8;
  --accent-wash: #191c33;

  /* Semantic only. These appear on a decision and nowhere else. */
  --allow: #4ec98a;
  --allow-wash: #12291f;
  --deny: #e58279;
  --deny-wash: #2b1a19;

  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --sans: "Figtree", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;

  --t-xs: 0.6875rem;
  --t-sm: 0.8125rem;
  --t-md: 1rem;
  --t-lg: 1.1875rem;
  --t-h3: 1.3125rem;
  --t-h2: clamp(1.6rem, 1rem + 2.5vw, 2.6rem);
  --t-hero: clamp(2rem, 0.9rem + 4.4vw, 4.1rem);

  --gutter: clamp(1.15rem, 4vw, 2.75rem);
  --max: 1180px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground: #fbfbfd;
    --panel: #f2f3f8;
    --panel-2: #e7e9f1;
    --rule: #d8dbe6;
    --rule-lit: #b8bccd;
    --text: #12141c;
    --text-2: #4b5163;
    --text-3: #5b6175;

    --accent: #3b45b0;
    --accent-wash: #e6e8fa;

    --allow: #146b45;
    --allow-wash: #dcefe4;
    --deny: #a4362c;
    --deny-wash: #f6e2df;
  }
}

:root[data-theme="light"] {
  --ground: #fbfbfd;
  --panel: #f2f3f8;
  --panel-2: #e7e9f1;
  --rule: #d8dbe6;
  --rule-lit: #b8bccd;
  --text: #12141c;
  --text-2: #4b5163;
  --text-3: #5b6175;
  --accent: #3b45b0;
  --accent-wash: #e6e8fa;
  --allow: #146b45;
  --allow-wash: #dcefe4;
  --deny: #a4362c;
  --deny-wash: #f6e2df;
}

/* ── Base ──────────────────────────────────────────────────────────────── */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
figure,
table {
  margin: 0;
}

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

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

a:hover {
  color: var(--text);
}

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

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

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

.skip {
  position: absolute;
  left: -9999px;
  background: var(--text);
  color: var(--ground);
  padding: 0.7rem 1.1rem;
  z-index: 100;
  font-family: var(--mono);
  font-size: var(--t-xs);
}

.skip:focus {
  left: 0;
}

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

/* ── Masthead ──────────────────────────────────────────────────────────── */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

@supports not (backdrop-filter: blur(1px)) {
  .top {
    background: var(--ground);
  }
}

.top__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.4rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  color: var(--text);
}

.logo svg {
  width: 1.35rem;
  height: 1.35rem;
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2.2vw, 1.6rem);
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
}

.nav a {
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
  padding-block: 0.4rem;
  border-bottom: 1px solid transparent;
}

.nav a:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.nav__cta {
  color: var(--accent) !important;
  font-weight: 700;
}

@media (max-width: 46rem) {
  .nav__opt {
    display: none;
  }
}

/* ── Sections ──────────────────────────────────────────────────────────── */

.band {
  border-top: 1px solid var(--rule);
}

.band--fill {
  background: var(--panel);
}

.band__in {
  padding-block: clamp(2.75rem, 6.5vw, 5rem);
}

.eyebrow {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

h2 {
  margin-top: 0.9rem;
  font-size: var(--t-h2);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
  max-width: 22ch;
}

h3 {
  font-size: var(--t-h3);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.lead {
  margin-top: 1.1rem;
  font-size: var(--t-lg);
  line-height: 1.55;
  color: var(--text-2);
  max-width: 62ch;
}

.prose {
  margin-top: 1.3rem;
  max-width: 66ch;
  color: var(--text-2);
}

.prose p + p {
  margin-top: 0.9em;
}

.prose b,
.prose strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */

.hero {
  padding-block: clamp(2.5rem, 6vw, 4.25rem) clamp(1.5rem, 3vw, 2.25rem);
}

h1 {
  margin-top: 1.2rem;
  font-size: var(--t-hero);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.045em;
  max-width: 18ch;
  text-wrap: balance;
}

h1 .a {
  color: var(--accent);
}

.hero__lead {
  margin-top: 1.5rem;
  font-size: var(--t-lg);
  line-height: 1.55;
  color: var(--text-2);
  max-width: 58ch;
}

.acts {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: var(--t-sm);
  font-weight: 700;
  text-decoration: none;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--accent);
  transition: background-color 0.14s ease, color 0.14s ease;
}

.btn--solid {
  background: var(--accent);
  color: var(--ground);
}

.btn--solid:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--ground);
}

.btn--ghost {
  color: var(--accent);
  background: transparent;
}

.btn--ghost:hover {
  background: var(--accent-wash);
  color: var(--accent);
}

/* ── The data path diagram ─────────────────────────────────────────────── */

.path {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 0.9fr) auto minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--rule);
  background: var(--panel);
  font-family: var(--mono);
  font-size: var(--t-xs);
}

@media (max-width: 56rem) {
  .path {
    grid-template-columns: minmax(0, 1fr);
  }
}

.path__c {
  padding: 1rem 1.1rem 1.15rem;
  min-width: 0;
}

.path__c--mid {
  background: var(--accent-wash);
}

.path__k {
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-bottom: 0.7rem;
}

.path__c--mid .path__k {
  color: var(--accent);
}

.path__l {
  color: var(--text-2);
  line-height: 1.8;
}

.path__l b {
  color: var(--text);
  font-weight: 700;
}

.path__a {
  display: grid;
  place-items: center;
  padding-inline: 0.7rem;
  border-inline: 1px solid var(--rule);
  color: var(--text-3);
  font-weight: 700;
}

@media (max-width: 56rem) {
  .path__a {
    border-inline: 0;
    border-block: 1px solid var(--rule);
    padding-block: 0.45rem;
  }
}

/* ── The gate pipeline: nine stages, in order ──────────────────────────── */

.pipe {
  margin-top: 2rem;
  border-top: 1px solid var(--rule-lit);
}

.stage {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 11rem) minmax(0, 1fr);
  gap: 0.3rem clamp(0.8rem, 2.2vw, 1.6rem);
  align-items: baseline;
  padding-block: 0.95rem;
  border-bottom: 1px solid var(--rule);
}

@media (max-width: 46rem) {
  .stage {
    grid-template-columns: 2.25rem minmax(0, 1fr);
  }
  .stage__d {
    grid-column: 2;
  }
}

.stage__n {
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.stage__c {
  font-family: var(--mono);
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--accent);
  overflow-wrap: anywhere;
}

.stage__d {
  font-size: var(--t-sm);
  color: var(--text-2);
  line-height: 1.5;
}

/* ── The chain: ledger records linked by hash ──────────────────────────── */

.chain {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
}

.link {
  position: relative;
  padding-left: 2.25rem;
  padding-bottom: 1.4rem;
}

.link:last-child {
  padding-bottom: 0;
}

/* The rule running through the records IS the hash chain. */
.link::before {
  content: "";
  position: absolute;
  left: 0.6875rem;
  top: 1.5rem;
  bottom: -0.1rem;
  width: 1px;
  background: var(--rule-lit);
}

.link:last-child::before {
  display: none;
}

.link::after {
  content: "";
  position: absolute;
  left: 0.375rem;
  top: 0.8rem;
  width: 0.6875rem;
  height: 0.6875rem;
  border: 1px solid var(--rule-lit);
  background: var(--ground);
}

.band--fill .link::after {
  background: var(--panel);
}

.link--allow::after {
  border-color: var(--allow);
  background: var(--allow);
}

.link--deny::after {
  border-color: var(--deny);
  background: var(--deny);
}

.rec {
  border: 1px solid var(--rule);
  background: var(--panel);
  padding: 0.85rem 1rem;
  font-family: var(--mono);
  font-size: var(--t-xs);
  line-height: 1.75;
  overflow-x: auto;
  white-space: pre;
  color: var(--text-2);
}

.band--fill .rec {
  background: var(--ground);
}

.rec .f {
  color: var(--text-3);
}

.rec .h {
  color: var(--accent);
}

.rec .allow {
  color: var(--allow);
  font-weight: 700;
}

.rec .deny {
  color: var(--deny);
  font-weight: 700;
}

.link__k {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-bottom: 0.5rem;
}

/* ── Terminal ──────────────────────────────────────────────────────────── */

.term {
  border: 1px solid var(--rule);
  background: var(--panel);
  font-family: var(--mono);
  font-size: var(--t-sm);
  line-height: 1.7;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  white-space: pre;
  color: var(--text);
  tab-size: 2;
}

.band--fill .term {
  background: var(--ground);
}

.term .c {
  color: var(--text-3);
}

.term .p {
  color: var(--accent);
  font-weight: 700;
  user-select: none;
}

.term .k {
  color: var(--accent);
}

.term .ok {
  color: var(--allow);
  font-weight: 700;
}

.term .no {
  color: var(--deny);
  font-weight: 700;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 2rem;
}

.card {
  background: var(--ground);
  padding: clamp(1.1rem, 2.4vw, 1.6rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.band--fill .card {
  background: var(--panel);
}

.card__k {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.card p {
  font-size: var(--t-sm);
  color: var(--text-2);
  line-height: 1.55;
}

.card ul {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: var(--t-sm);
  color: var(--text-2);
}

.card li {
  position: relative;
  padding-left: 0.95rem;
  line-height: 1.45;
}

.card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.4rem;
  height: 1px;
  background: var(--accent);
}

/* ── Figures ───────────────────────────────────────────────────────────── */

.figs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 2rem;
}

.fig {
  background: var(--ground);
  padding: 1.1rem 1.15rem 1.25rem;
}

.band--fill .fig {
  background: var(--panel);
}

.fig__n {
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.fig__n small {
  font-size: 0.5em;
  color: var(--text-2);
  letter-spacing: 0;
}

.fig__t {
  margin-top: 0.5rem;
  font-size: var(--t-sm);
  color: var(--text-2);
  line-height: 1.45;
}

/* ── Status list: landed / next, stated plainly ────────────────────────── */

.status {
  margin-top: 2rem;
  border-top: 1px solid var(--rule-lit);
}

.srow {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.3rem clamp(0.8rem, 2.2vw, 1.5rem);
  align-items: baseline;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

@media (max-width: 40rem) {
  .srow {
    grid-template-columns: minmax(0, 1fr);
  }
}

.srow__k {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.srow__k--yes {
  color: var(--allow);
}

.srow__k--no {
  color: var(--deny);
}

.srow__d {
  font-size: var(--t-sm);
  color: var(--text-2);
  line-height: 1.5;
}

.srow__d b {
  color: var(--text);
  font-weight: 600;
}

/* ── Caveat: the limit that would make the page dishonest if left out ──── */

.caveat {
  margin-top: 1.6rem;
  border-left: 2px solid var(--deny);
  background: var(--deny-wash);
  padding: 0.95rem 1.15rem;
  font-size: var(--t-sm);
  color: var(--text-2);
  line-height: 1.55;
  max-width: 68ch;
}

.caveat b {
  display: block;
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--deny);
  margin-bottom: 0.35rem;
}

.caveat i {
  font-style: normal;
  color: var(--text);
  font-weight: 600;
}

.note {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--text-3);
  line-height: 1.6;
  max-width: 76ch;
}

/* ── Footer ────────────────────────────────────────────────────────────── */

.foot {
  border-top: 1px solid var(--rule-lit);
  background: var(--panel);
}

.foot__in {
  padding-block: 2rem 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--text-3);
  line-height: 1.7;
}

.foot a {
  color: var(--text-2);
  text-decoration: none;
}

.foot a:hover {
  color: var(--accent);
}

.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
}
