/* ============================================================
   SOCIOPATH.AI — core stylesheet
   Visual system: "black-site dossier"
   Committed single-theme (dark). Every colour painted explicitly.
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* ground: near-black with a blue-violet bias — cold instrument, not warm */
  --void:        #07070A;
  --void-lift:   #0A0A0E;
  --strata:      #0E0E13;
  --strata-2:    #14141B;
  --rule:        #1C1C24;
  --rule-hot:    #2E1613;

  /* text */
  --bone:        #E4E2DE;
  --ash:         #82818C;
  --dim:         #55545E;

  /* signal — spent sparingly */
  --signal:      #FF2E1F;
  --signal-deep: #A8140B;
  --signal-wash: rgba(255, 46, 31, 0.08);

  /* semantic severity — not decorative accents */
  --sev-critical: #FF2E1F;
  --sev-severe:   #E8A33D;
  --sev-elevated: #C9C55E;
  --sev-baseline: #6E8F7A;

  /* type */
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body:    "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* metrics */
  --shell:   1240px;
  --measure: 68ch;
  --rail:    124px;

  --pad-x: clamp(1.15rem, 4vw, 3.5rem);
  --gap-section: clamp(4.5rem, 11vh, 9rem);

  /* single floor for every mono micro-label: never below 11px */
  --fs-label: clamp(0.6875rem, 0.66rem + 0.1vw, 0.73rem);
  /* minimum comfortable tap target */
  --tap: 44px;
}

/* ---------- RESET / 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; }
}

body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font-family: var(--body);
  font-size: clamp(0.95rem, 0.9rem + 0.18vw, 1.0625rem);
  line-height: 1.68;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, canvas { display: block; max-width: 100%; }

a { color: inherit; }

::selection { background: var(--signal); color: #08080B; }

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

/* ---------- ATMOSPHERE ---------- */
/* film grain — fixed, above ground, below content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* faint hairline survey grid */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 15%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 15%, transparent 78%);
}

/* ---------- LAYOUT PRIMITIVES ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  position: relative;
  z-index: 2;
}

main { position: relative; z-index: 2; }

.section { padding-block: var(--gap-section); }
/* any in-page anchor target must clear the sticky header */
:target, section[id] { scroll-margin-top: 100px; }
.section--tight { padding-block: clamp(3rem, 7vh, 5rem); }

/* dossier grid: mono metadata rail + content */
.dossier {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.75rem);
  align-items: start;
}
@media (max-width: 860px) {
  .dossier { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
}

.rail {
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.75;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-transform: uppercase;
  border-top: 1px solid var(--rule);
  padding-top: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.rail b {
  display: block;
  color: var(--ash);
  font-weight: 500;
}
@media (max-width: 860px) {
  .rail { flex-direction: row; flex-wrap: wrap; gap: 0.35rem 1.4rem; }
}

/* ---------- TYPE ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0 0 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--signal);
  flex: none;
}
.eyebrow--ash { color: var(--ash); }
.eyebrow--ash::before { background: var(--ash); }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-variation-settings: "wdth" 118;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  line-height: 0.98;
  text-wrap: balance;
  margin: 0;
  /* last-resort break so a long word can never punch out of its box on a 280px screen */
  overflow-wrap: break-word;
}

/* running text gets the same safety net for long URLs and compound terms */
.prose, .cell p, .case__dek, .deflist dd, .lede, .callout p {
  overflow-wrap: break-word;
}

.h-hero {
  font-size: clamp(2.6rem, 8.4vw, 6.6rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.022em;
}
.h-1 { font-size: clamp(2rem, 5.2vw, 3.9rem); letter-spacing: -0.015em; }
.h-2 { font-size: clamp(1.5rem, 3.1vw, 2.35rem); letter-spacing: -0.01em; }
.h-3 {
  font-size: clamp(1.0625rem, 1.6vw, 1.3rem);
  font-variation-settings: "wdth" 108;
  letter-spacing: 0.005em;
}

.lede {
  font-size: clamp(1.0625rem, 1.5vw, 1.35rem);
  line-height: 1.56;
  color: var(--ash);
  max-width: 56ch;
  margin: 1.5rem 0 0;
  font-weight: 300;
}

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.15rem; color: #C6C4C2; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--bone); font-weight: 600; }
.prose em { color: var(--bone); font-style: italic; }

.mono-note {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: var(--dim);
  line-height: 1.7;
}

.hl { color: var(--signal); }

/* section heading block */
.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(2rem, 4vw, 3.2rem);
}
.sec-head__idx {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  color: var(--dim);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- CORNER-TICK PANEL ---------- */
.panel {
  position: relative;
  background: var(--strata);
  padding: clamp(1.35rem, 2.6vw, 2.1rem);
  border: 1px solid var(--rule);
}
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid var(--signal);
  opacity: 0.55;
  pointer-events: none;
}
.panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.panel::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ---------- CLASSIFICATION STRIP ---------- */
.classbar {
  position: relative;
  z-index: 60;
  background: #030305;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  overflow: hidden;
}
.classbar__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: space-between;
  height: 30px;
  white-space: nowrap;
}
.classbar__inner span { display: flex; align-items: center; gap: 0.55rem; }
.classbar .dot {
  width: 5px; height: 5px;
  background: var(--signal);
  flex: none;
  animation: blip 2.4s steps(1, end) infinite;
}
@keyframes blip { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.15; } }
@media (prefers-reduced-motion: reduce) { .classbar .dot { animation: none; } }
/* specificity must beat `.classbar__inner span` above, or these never hide */
.classbar__inner .classbar__hide { display: none; }
@media (min-width: 780px) {
  .classbar__inner .classbar__hide { display: flex; }
}

/* the two middle items are long; the second only fits past ~1120px
   (landscape phones are 844px wide and would clip it) */
@media (max-width: 1119px) {
  .classbar__inner .classbar__hide:nth-of-type(3) { display: none; }
}

/* below ~430px the strip can only hold the live stamp — keep the pulse, drop the words */
.classbar__lbl { font-weight: 400; }
@media (max-width: 430px) {
  .classbar__lbl { display: none; }
  .classbar__inner { gap: 0.75rem; }
}

/* ---------- HEADER ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 7, 10, 0.82);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--rule);
}
.site-head__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  flex: none;
  min-height: var(--tap);
}
.brand__mark {
  width: 17px; height: 17px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #FFF2F0 0%, var(--signal) 26%, var(--signal-deep) 58%, #180504 100%);
  box-shadow: 0 0 14px rgba(255, 46, 31, 0.55);
  flex: none;
}
.brand__txt {
  font-family: var(--display);
  font-variation-settings: "wdth" 116;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--bone);
}
.brand__txt i { font-style: normal; color: var(--dim); font-weight: 400; }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2vw, 2rem); }
.nav a {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ash);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  position: relative;
  transition: color 0.18s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 11px;
  width: 0; height: 1px;
  background: var(--signal);
  transition: width 0.22s ease;
}
.nav a:hover { color: var(--bone); }
.nav a:hover::after { width: 100%; }
.nav a[aria-current="page"] { color: var(--bone); }
.nav a[aria-current="page"]::after { width: 100%; }

@media (max-width: 880px) { .nav { display: none; } }

.burger {
  display: none;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid var(--rule);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.burger i { display: block; width: 16px; height: 1px; background: var(--bone); transition: transform 0.25s ease, opacity 0.2s ease; }
.burger[aria-expanded="true"] i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.burger[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
@media (max-width: 880px) { .burger { display: flex; } }

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(4, 4, 7, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem var(--pad-x) 3rem;
  gap: 0.25rem;
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 0.42s cubic-bezier(0.7, 0, 0.2, 1), visibility 0.42s;
}
.mobile-nav[data-open="true"] { transform: translateY(0); visibility: visible; }
.mobile-nav { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mobile-nav a {
  font-family: var(--display);
  font-variation-settings: "wdth" 115;
  font-size: clamp(1.7rem, 8vw, 2.6rem);
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bone);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
}
.mobile-nav a span {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  color: var(--signal);
  font-weight: 500;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: clamp(600px, 92svh, 940px);
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}

/* short viewports — landscape phones, half-height browser windows.
   A 600px floor on a 390px-tall screen means the hero never fits on screen. */
@media (max-height: 600px) {
  .hero { min-height: 430px; }
  .hero__body { padding-block: 3.4rem 2.4rem; }
  .hero .h-hero { font-size: clamp(2.1rem, 5.6vw, 3.4rem); }
  .hero .lede { font-size: 1rem; margin-top: 1.1rem; max-width: 52ch; }
  .hero__meta { margin-top: 1.4rem; padding-top: 0.9rem; }
  .hero__cta { margin-top: 1.4rem; }
  .mobile-nav { justify-content: flex-start; padding-top: 4.5rem; }
  .mobile-nav a { font-size: clamp(1.15rem, 4.5vw, 1.6rem); padding: 0.45rem 0; }
  #optic { transform: translate(14%, -4%); }
}

.optic-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 0;
}
/* the optic sits to the right of the text column so the lede stays on dark ground */
#optic {
  width: min(112vw, 126svh);
  height: min(112vw, 126svh);
  opacity: 0.95;
  transform: translate(19%, -8%);
}
@media (max-width: 1100px) { #optic { transform: translate(9%, -12%); } }
@media (max-width: 780px)  { #optic { transform: translate(0, -44%); opacity: 0.68; } }

/* vignette + floor fade so type stays legible over the optic */
.hero__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(7,7,10,0.94) 0%, rgba(7,7,10,0.80) 30%, rgba(7,7,10,0.28) 56%, rgba(7,7,10,0) 82%),
    radial-gradient(ellipse 66% 54% at 64% 40%, transparent 0%, rgba(7,7,10,0.30) 58%, rgba(7,7,10,0.88) 100%),
    linear-gradient(to bottom, rgba(7,7,10,0.6) 0%, transparent 20%, transparent 52%, rgba(7,7,10,0.72) 84%, var(--void) 99%);
}
@media (max-width: 780px) {
  .hero__veil {
    background:
      linear-gradient(to bottom,
        rgba(7,7,10,0.62) 0%,
        rgba(7,7,10,0.08) 20%,
        rgba(7,7,10,0.62) 38%,
        rgba(7,7,10,0.95) 48%,
        var(--void) 58%);
  }
}

/* slow scanline sweep */
.hero__scan {
  position: absolute;
  left: 0; right: 0;
  height: 220px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(255, 46, 31, 0.045) 45%, rgba(255,255,255,0.02) 50%, transparent);
  animation: sweep 9s linear infinite;
}
@keyframes sweep {
  0%   { transform: translateY(-240px); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateY(105svh); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .hero__scan { display: none; } }

.hero__body { position: relative; z-index: 3; width: 100%; padding-block: 7rem 4.5rem; }

.hero h1 { margin-bottom: 0; }
.hero h1 .line { display: block; }
.hero h1 .line--out {
  color: transparent;
  -webkit-text-stroke: 1px var(--ash);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  margin-top: 2.6rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dim);
  max-width: 720px;
}
.hero__meta b { color: var(--ash); font-weight: 500; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2.4rem; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9rem 1.5rem;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--bone);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:hover { border-color: var(--ash); background: rgba(255,255,255,0.03); }
.btn__arrow { color: var(--signal); transition: transform 0.22s ease; }
.btn:hover .btn__arrow { transform: translateX(4px); }

.btn--signal {
  background: var(--signal);
  border-color: var(--signal);
  color: #0A0304;
  font-weight: 600;
}
.btn--signal:hover { background: #FF4335; border-color: #FF4335; color: #0A0304; }
.btn--signal .btn__arrow { color: #0A0304; }

/* ---------- TICKER ---------- */
.ticker {
  border-block: 1px solid var(--rule);
  background: var(--void-lift);
  overflow: hidden;
  position: relative;
  z-index: 2;
}
.ticker__track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: roll 46s linear infinite;
}
@keyframes roll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker:hover .ticker__track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .ticker__track { animation: none; } }

.ticker__item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.6rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash);
  white-space: nowrap;
  border-right: 1px solid var(--rule);
}
.ticker__item time { color: var(--dim); }
.ticker__item .sev { color: var(--signal); font-weight: 600; }

/* ---------- SEVERITY CHIP ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.chip::before { content: ""; width: 5px; height: 5px; background: currentColor; flex: none; }
.chip--critical { color: var(--sev-critical); }
.chip--severe   { color: var(--sev-severe); }
.chip--elevated { color: var(--sev-elevated); }
.chip--baseline { color: var(--sev-baseline); }
.chip--plain    { color: var(--dim); border-color: var(--rule); }

/* ---------- CARD GRID ---------- */
.grid {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

.cell {
  background: var(--void);
  padding: clamp(1.4rem, 2.6vw, 2.15rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  transition: background 0.25s ease;
}
a.cell { text-decoration: none; color: inherit; }
a.cell:hover { background: var(--strata); }
a.cell:hover .cell__go { color: var(--signal); transform: translateX(3px); }

.cell__num {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  color: var(--dim);
  text-transform: uppercase;
}
.cell p { margin: 0; color: var(--ash); font-size: 0.9375rem; line-height: 1.62; }
.cell__go {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: auto;
  padding-top: 0.6rem;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

/* ---------- CASE FILE (incident entry) ---------- */
.case {
  border: 1px solid var(--rule);
  background: var(--void);
  transition: border-color 0.25s ease, background 0.25s ease;
  /* clear the sticky header when a case is scrolled to */
  scroll-margin-top: 108px;
}
.case + .case { margin-top: -1px; }
.case:hover { background: var(--strata); border-color: #262630; }

.case__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 1.5rem;
  align-items: start;
  padding: clamp(1.2rem, 2.4vw, 1.85rem);
  cursor: pointer;
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
  font: inherit;
  color: inherit;
}
.case__id {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.18em;
  color: var(--signal);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}
.case__id time { color: var(--dim); }
.case__title {
  font-family: var(--display);
  font-variation-settings: "wdth" 110;
  font-size: clamp(1.0625rem, 2.1vw, 1.45rem);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.1;
  letter-spacing: -0.005em;
  margin: 0 0 0.65rem;
  text-wrap: balance;
}
.case__dek { margin: 0; color: var(--ash); font-size: 0.9375rem; line-height: 1.6; max-width: 62ch; }

.case__aside {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex: none;
}
.case__toggle {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1;
  color: var(--ash);
  transition: transform 0.28s cubic-bezier(0.6,0,0.2,1), color 0.2s ease, border-color 0.2s ease;
}
.case__head:hover .case__toggle { border-color: var(--ash); color: var(--bone); }
.case__head[aria-expanded="true"] .case__toggle {
  transform: rotate(45deg);
  color: var(--signal);
  border-color: var(--signal);
}

@media (max-width: 640px) {
  .case__head { grid-template-columns: minmax(0, 1fr); }
  .case__aside { justify-content: space-between; width: 100%; }
}

.case__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.42s cubic-bezier(0.6, 0, 0.2, 1);
}
.case__body[data-open="true"] { grid-template-rows: 1fr; }
.case__bodyInner { overflow: hidden; }
.case__content {
  padding: 0 clamp(1.2rem, 2.4vw, 1.85rem) clamp(1.4rem, 2.6vw, 1.95rem);
  border-top: 1px solid var(--rule);
  margin-top: 0;
  padding-top: 1.4rem;
}
@media (prefers-reduced-motion: reduce) { .case__body { transition: none; } }

.factrow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin: 1.4rem 0;
}
.factrow > div { background: var(--void-lift); padding: 0.85rem 1rem; }
.factrow dt {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 0.35rem;
}
.factrow dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--bone);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.pull {
  border-left: 2px solid var(--signal);
  padding: 0.15rem 0 0.15rem 1.15rem;
  margin: 1.5rem 0;
  font-family: var(--body);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.5;
  color: var(--bone);
  font-style: italic;
  font-weight: 300;
  max-width: 58ch;
}
.pull cite {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

/* underline the text rather than the box, so the hit area can reach 44px
   without the rule detaching from the words */
.src {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: var(--tap);
  padding-block: 0.3rem;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  color: var(--ash);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.src:hover { color: var(--signal); text-decoration-color: var(--signal); }
.srcs { display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; margin-top: 1rem; }

/* inline links inside running prose — keep the body face, mark with the accent */
.ilink {
  color: var(--bone);
  text-decoration: none;
  border-bottom: 1px solid var(--signal);
  transition: color 0.18s ease, background 0.18s ease;
}
.ilink:hover { color: var(--signal); background: var(--signal-wash); }

/* ---------- FILTER BAR ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--rule);
}
.filter {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.55rem 1rem;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ash);
  cursor: pointer;
  transition: all 0.18s ease;
}
.filter:hover { color: var(--bone); border-color: var(--ash); }
.filter[aria-pressed="true"] {
  background: var(--signal);
  border-color: var(--signal);
  color: #0A0304;
  font-weight: 600;
}

/* ---------- STEP / TAXONOMY LIST ---------- */
.steps { display: flex; flex-direction: column; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.step {
  background: var(--void);
  padding: clamp(1.4rem, 2.8vw, 2.2rem);
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: start;
}
@media (max-width: 620px) { .step { grid-template-columns: minmax(0, 1fr); gap: 0.9rem; } }
.step__n {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--signal);
  padding-top: 0.3rem;
  font-variant-numeric: tabular-nums;
}
.step h3 { margin-bottom: 0.7rem; }

.deflist { margin: 1.3rem 0 0; display: flex; flex-direction: column; gap: 0.9rem; }
.deflist > div {
  display: grid;
  /* 132px clears the longest single unbreakable label ("Infrastructure") at 11px mono */
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
}
@media (max-width: 620px) { .deflist > div { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; } }
.deflist dt {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  overflow-wrap: break-word;
}
.deflist dd { margin: 0; color: var(--ash); font-size: 0.9375rem; line-height: 1.62; }
.deflist dd strong { color: var(--bone); font-weight: 600; }

/* ---------- TABLE ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); margin: 1.8rem 0; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-family: var(--mono); font-size: 0.8125rem; }
th, td { text-align: left; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
th {
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
  background: var(--void-lift);
  position: sticky;
  top: 0;
}
td { color: var(--ash); }
td:first-child { color: var(--bone); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--strata); }

/* ---------- CODE ---------- */
.code {
  background: #050507;
  border: 1px solid var(--rule);
  padding: 1.15rem 1.3rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.72;
  color: #B9B7C4;
  margin: 1.4rem 0;
}
.code b { color: var(--signal); font-weight: 500; }
.code i { color: var(--dim); font-style: normal; }
.code span { color: var(--sev-baseline); }

/* ---------- CALLOUT ---------- */
.callout {
  border: 1px solid var(--rule-hot);
  background: var(--signal-wash);
  padding: clamp(1.2rem, 2.4vw, 1.75rem);
  margin: 2rem 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
}
.callout__mark {
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--signal);
  border: 1px solid var(--signal);
  padding: 0.28rem 0.5rem;
  white-space: nowrap;
}
.callout p { margin: 0; font-size: 0.9375rem; line-height: 1.66; color: #CFCDCB; }
.callout p + p { margin-top: 0.75rem; }
@media (max-width: 560px) { .callout { grid-template-columns: minmax(0, 1fr); } .callout__mark { justify-self: start; } }

/* ---------- SIGNUP ---------- */
.signup {
  border-top: 1px solid var(--rule);
  background:
    radial-gradient(ellipse 60% 130% at 50% 100%, rgba(255,46,31,0.07), transparent 70%),
    var(--void-lift);
}
.signup__form { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2rem; max-width: 520px; }
.signup input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  background: var(--void);
  border: 1px solid var(--rule);
  color: var(--bone);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  padding: 0.9rem 1.1rem;
}
.signup input::placeholder { color: var(--dim); }
.signup input:focus { outline: none; border-color: var(--signal); }
.signup__note { margin-top: 1.1rem; }
.signup__ok {
  margin-top: 1.1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--sev-baseline);
  text-transform: uppercase;
}

/* ---------- FOOTER ---------- */
.site-foot {
  border-top: 1px solid var(--rule);
  background: #040406;
  padding-block: clamp(2.6rem, 6vw, 4.2rem) 2rem;
  position: relative;
  z-index: 2;
}
.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 2.2rem;
  padding-bottom: 2.6rem;
  border-bottom: 1px solid var(--rule);
}
.foot-col h4 {
  font-family: var(--mono);
  font-variation-settings: normal;
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--dim);
  margin-bottom: 1rem;
  text-transform: uppercase;
}
.foot-col p {
  display: block;
  font-size: 0.875rem;
  color: var(--ash);
  margin: 0 0 0.6rem;
}
.foot-col a {
  display: flex;
  align-items: center;
  min-height: 40px;
  font-size: 0.875rem;
  color: var(--ash);
  text-decoration: none;
  transition: color 0.18s ease;
}
.foot-col a:hover { color: var(--signal); }
/* the brand lockup in the footer keeps its own spacing */
.foot-col a.brand { min-height: var(--tap); }
.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  padding-top: 1.6rem;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- REVEAL ---------- */
.rv { opacity: 0; transform: translateY(18px); transition: opacity 0.8s cubic-bezier(0.2,0,0.2,1), transform 0.8s cubic-bezier(0.2,0,0.2,1); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } }

/* ---------- PAGE MASTHEAD (inner pages) ---------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  padding-block: clamp(3.2rem, 8vw, 5.5rem) clamp(2.4rem, 5vw, 3.6rem);
  position: relative;
  overflow: hidden;
}
.masthead::after {
  content: "";
  position: absolute;
  right: -140px; top: 50%;
  width: 420px; height: 420px;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(255,46,31,0.13), transparent 66%);
  pointer-events: none;
}
.masthead .lede { max-width: 60ch; }
