/* The application grammar: a nav of routes, thick panels on a hard shadow, stat tiles whose
 * hero is the number, uppercase actions that sink when you press them, and a gate that names
 * what is missing instead of greying a button out.
 *
 * 🔴 A hard black shadow is invisible on a black page. The three surfaces below are therefore
 * stacked in luminance — page darkest, shadow in the middle, panel lightest — so the offset
 * block reads against both of them. The page is the banner's own ground, #090909; the other
 * two are that ground walked up the disc's hue (15 deg) rather than towards grey, which is why
 * they are warm.
 *
 *   page    #090909   relative luminance 0.0029   (measured, 60.97% of the banner)
 *   shadow  #1A0F0B                      0.0095
 *   panel   #241915                      0.0162
 */
:root {
  --page:      #090909;
  --shadowbox: #1A0F0B;
  --panel:     #241915;
  --panel-2:   #1B120F;
  --edge:      #3A2017;
  --edge-lit:  color-mix(in srgb, var(--ember-2) 58%, transparent);
  --hard:      6px 6px 0 var(--shadowbox);
  --hard-sm:   4px 4px 0 var(--shadowbox);
  --hard-press: 0 0 0 var(--shadowbox);
}

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

/* ---- the route nav ------------------------------------------------------------------ */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--page) 94%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 3px solid var(--edge);
}
.nav-in { display: flex; align-items: center; gap: 14px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand img { display: block; }
.brand b { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.routes { display: flex; gap: 6px; margin-left: 10px; }
.routes a {
  display: inline-block; padding: 7px 13px;
  font: 500 13px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-dim); text-decoration: none;
  border: 2px solid transparent; border-radius: 2px;
}
.routes a:hover { color: var(--ink); border-color: var(--edge); }
.routes a[aria-current="page"] {
  color: var(--page); background: var(--ember-4); border-color: var(--ember-4);
}
.nav .spacer { flex: 1; }
.nav .flag {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border: 2px solid var(--bad); border-radius: 2px;
  font: 600 11.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--bad); white-space: nowrap;
}
.nav .flag i { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
/* the horizontal route strip the nav collapses into on a phone */
.routebar { display: none; border-bottom: 3px solid var(--edge); background: var(--page); }
.routebar .wrap { display: flex; gap: 6px; overflow-x: auto; padding: 9px 0; }
.routebar a { flex: 0 0 auto; }

@media (max-width: 860px) {
  .nav .routes { display: none; }
  .routebar { display: block; position: sticky; top: 64px; z-index: 39; }
  .nav .flag span { display: none; }
}

/* ---- sections ----------------------------------------------------------------------- */
.sec { padding: 54px 0; }
.eyebrow {
  font: 600 12px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ember-4); margin: 0 0 12px;
}
.sec h2 {
  margin: 0 0 10px; font-size: clamp(27px, 4.2vw, 40px); font-weight: 600;
  letter-spacing: -0.03em; line-height: 1.08;
}
.sec .lede { margin: 0 0 26px; max-width: 68ch; color: var(--ink-dim); font-size: 17px; }

/* ---- panels ------------------------------------------------------------------------- */
.panel {
  background: var(--panel); border: 3px solid var(--edge); border-radius: 3px;
  box-shadow: var(--hard), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 20px;
}
.panel > h3 {
  margin: 0 0 4px; font-size: 19px; font-weight: 600; letter-spacing: -0.02em;
}
.panel > .sub { margin: 0 0 16px; color: var(--ink-dim); font-size: 14.5px; }
.panel-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: -20px -20px 18px; padding: 14px 20px;
  background: var(--panel-2); border-bottom: 3px solid var(--edge);
}
.panel-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.panel-head .note { font: 400 13px/1.4 var(--mono); color: var(--ink-dim); margin-left: auto; }

/* ---- stat tiles: the hero is the number --------------------------------------------- */
.tiles { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(214px, 1fr)); }
.tile {
  background: var(--panel); border: 3px solid var(--edge); border-radius: 3px;
  box-shadow: var(--hard), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 17px 18px 16px; transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tile:hover { transform: translate(-2px, -4px); box-shadow: 8px 10px 0 var(--shadowbox), inset 0 1px 0 rgba(255,255,255,0.05); }
.tile .k {
  font: 600 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ember-4); display: block; margin-bottom: 11px;
}
.tile .v {
  display: block; font-family: var(--sans); font-size: clamp(34px, 5vw, 46px); font-weight: 600;
  letter-spacing: -0.045em; line-height: 0.95; font-variant-numeric: tabular-nums;
}
.tile .v.sm { font-size: clamp(20px, 2.6vw, 25px); letter-spacing: -0.02em; line-height: 1.12; }
.tile .u { font-size: 0.42em; letter-spacing: 0; color: var(--ink-dim); margin-left: 6px; }
.tile .s { display: block; margin-top: 10px; font-size: 13.5px; color: var(--ink-dim); line-height: 1.42; }
.tile.zero .v { color: var(--bad); }
.tile.good .v { color: var(--ember-5); }

/* ---- actions ------------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; min-height: 46px;
  font: 600 13px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--page); background: var(--ember-4);
  border: 3px solid var(--ember-5); border-radius: 3px;
  box-shadow: var(--hard-sm); cursor: pointer; text-decoration: none;
  transition: transform 0.07s ease, box-shadow 0.07s ease, background 0.12s ease;
}
.btn:hover { background: var(--ember-5); }
.btn:active { transform: translate(4px, 4px); box-shadow: var(--hard-press); }
.btn.sec2 {
  color: var(--ink); background: var(--panel); border-color: var(--edge);
}
.btn.sec2:hover { background: var(--panel-2); border-color: var(--edge-lit); }
.btn.danger { color: var(--page); background: var(--bad); border-color: var(--ember-3); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn[disabled]:active { transform: none; box-shadow: var(--hard-sm); }
.btnrow { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---- the gate: it names what is missing --------------------------------------------- */
.gate {
  border: 3px dashed var(--ember-2); border-radius: 3px; background: var(--panel-2);
  padding: 17px 19px; display: flex; gap: 14px; align-items: flex-start;
}
.gate .mk {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 2px;
  border: 2px solid var(--bad); color: var(--bad);
  display: grid; place-items: center; font: 700 15px/1 var(--mono);
}
.gate h4 { margin: 0 0 5px; font-size: 15.5px; font-weight: 600; }
.gate p { margin: 0; font-size: 14px; color: var(--ink-dim); line-height: 1.5; }
.gate code { font-family: var(--mono); font-size: 0.92em; color: var(--ember-5); }

/* ---- skeleton ----------------------------------------------------------------------- */
.sk { position: relative; overflow: hidden; color: transparent !important; }
.sk::after {
  content: ''; position: absolute; inset: 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--panel-2) 0%, var(--ember-0) 48%, var(--panel-2) 100%);
  background-size: 220% 100%; animation: sweep 1.25s linear infinite;
}
@keyframes sweep { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .sk::after { animation: none; } }

/* ---- evidence type ------------------------------------------------------------------ */
.mono { font-family: var(--mono); }
.felt {
  font: 400 13px/1.5 var(--mono); color: var(--ember-5);
  word-break: break-all; overflow-wrap: anywhere;
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; align-items: baseline; }
.kv dt { font: 500 12px/1.5 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim); }
.kv dd { margin: 0; font: 400 13.5px/1.5 var(--mono); word-break: break-all; }
.ok { color: var(--ember-5); }
.no { color: var(--bad); }

/* ---- the opening block --------------------------------------------------------------- */
.hero-h1 {
  margin: 0 0 20px;
  font-size: clamp(42px, 8.4vw, 86px); font-weight: 600;
  letter-spacing: -0.045em; line-height: 0.96;
}
.hero-lede {
  margin: 0; max-width: 60ch; font-size: clamp(17px, 2.1vw, 20px); line-height: 1.52;
  color: var(--ink-dim);
}
.hero-lede strong { color: var(--ink); font-weight: 600; }
.hero-lede em { color: var(--ember-5); font-style: normal; }

/* ---- tables of evidence --------------------------------------------------------------- */
.ptable { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ptable th, .ptable td {
  text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}
.ptable th {
  font: 600 11px/1.4 var(--mono); letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--ember-4); border-bottom-color: var(--rule);
}
.ptable td:last-child, .ptable th:last-child { padding-right: 0; }
.ptable tbody tr:last-child td { border-bottom: 0; }
.ptable .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ptable td.mono, .ptable .mono { font-family: var(--mono); font-size: 13.5px; }

/* ---- two up, and the stack of gates ---------------------------------------------------- */
.two { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.gates { display: grid; gap: 14px; }

/* ---- foot ------------------------------------------------------------------------------ */
.foot { border-top: 3px solid var(--edge); margin-top: 10px; padding: 22px 0 40px; }
.foot .wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  font: 400 13px/1.5 var(--mono); color: var(--ink-dim); }
.foot .spacer { flex: 1; }
.foot a { color: var(--ember-4); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

main code.mono, main .mono code { color: var(--ember-5); }
main p code { font-family: var(--mono); font-size: 0.9em; color: var(--ember-5); }

/* The disc lights the opening band and nothing else. It is anchored to this band rather than
 * fixed, for the reason the stylesheet gives beside `.plate-disc`: fixed, its hot core stays in
 * one screen position and every line of text scrolls through it. */
.hero-band { position: relative; overflow: hidden; }
.hero-band .plate-disc { inset: -120px 0 -40px 0; }
.hero-band > .sec { position: relative; z-index: 1; }

/* ---- phone: long identifiers break, wide tables scroll inside their panel ---------------- */
.mono, .felt, .kv dd, .gate code, .gate h4 { overflow-wrap: anywhere; }
.tscroll { overflow-x: auto; overscroll-behavior-x: contain; }
.tscroll:focus-visible { outline: 2px solid var(--ember-5); outline-offset: 3px; }
.tscroll > .ptable { min-width: 460px; }
@media (max-width: 520px) {
  .tscroll > .ptable { min-width: 0; }
  .ptable th, .ptable td { padding-right: 10px; font-size: 13.5px; }
  .ptable td.mono, .ptable .mono { font-size: 12.5px; }
}
