/* ─── why-dts.css ─────────────────────────────────────────────────────
   "Why DTS" field note — research-page register of the main chrome.
   Inter for prose, JetBrains Mono for eyebrows / labels / numbers.
   Semantic color only; no decorative hues, no gradients, no glows.
   Depends on base.css for tokens, nav, .pill, .btn.
   ──────────────────────────────────────────────────────────────────── */

.wd {
  --wd-measure: 688px;                       /* text column; ~640px content ≈ 75ch @17px */
  --wd-wide: 840px;                          /* figure breakout tier (> measure) */
  --wd-prose-fg: rgba(245, 245, 245, 0.85);  /* long-form body: brighter than the 70% tool cap */
  --wd-muted: rgba(245, 245, 245, 0.58);     /* eyebrows + captions; clears WCAG AA on #0A0A0A */
}

/* ── Shell ──────────────────────────────────────────────────────── */

.wd__wrap {
  max-width: var(--wd-measure);
  margin: 0 auto;
  padding: 0 var(--content-padding);
}

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

.wd-hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 88px var(--content-padding) 56px;
  text-align: center;
}

.wd-hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wd-muted);
  margin-bottom: var(--space-5);
}

.wd-hero__title {
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--foreground);
  margin: 0 0 var(--space-5);
}

.wd-hero__dek {
  font-size: clamp(18px, 2.4vw, 21px);
  line-height: 1.5;
  color: var(--wd-prose-fg);
  max-width: 620px;
  margin: 0 auto;
}

.wd-hero__byline {
  margin-top: var(--space-6);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--foreground-muted);
}

/* Lives inside a .wd__wrap so its ends align with the article text column
   (inset by the wrap's 24px side padding) at every viewport width. */
.wd-rule {
  height: 1px;
  background: var(--border-subtle);
}

/* ── Section headings ───────────────────────────────────────────── */

.wd-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wd-muted);
  margin: var(--space-8) 0 var(--space-2);
}

.wd-h2 {
  font-size: clamp(24px, 4vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--foreground);
  margin: 0 0 var(--space-5);
}

/* ── Prose ──────────────────────────────────────────────────────── */

/* :where() keeps base-prose specificity at (0,0,1) so utility-classed
   paragraphs (.wd-eyebrow, .wd-lead) win without a specificity fight. */
:where(.wd__wrap) p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--wd-prose-fg);
  margin: 0 0 var(--space-5);
}

.wd-lead {
  font-size: 20px;
  line-height: 1.6;
  color: var(--foreground);
}

.wd em { font-style: italic; }
.wd strong { color: var(--foreground); font-weight: 600; }

/* ── Callout ────────────────────────────────────────────────────── */

.wd-callout {
  margin: var(--space-6) 0;
  padding: var(--space-5);
  background: var(--background-subtle);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--border-active);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.wd-callout p:last-child { margin-bottom: 0; }

/* ── Numbered findings ──────────────────────────────────────────── */

.wd-finding {
  display: flex;
  gap: var(--space-4);
  margin: var(--space-6) 0 var(--space-4);
}

.wd-finding__n {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wd-finding__body { flex: 1; min-width: 0; }

.wd-finding__body h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--foreground);
  margin: var(--space-1) 0 var(--space-3);
}

.wd-finding__body p:last-child { margin-bottom: 0; }

/* ── Axis pills (monochrome — categories, not status) ───────────── */

.wd-axes {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-4) 0 0;
}

.wd-axis-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--background-subtle);
  border: 1px solid var(--border-default);
  color: var(--foreground-secondary);
}

.wd-axis-pill b {
  color: var(--foreground);
  font-weight: 600;
}

/* ── Figure / SVG card ──────────────────────────────────────────── */

.wd-figure {
  margin: var(--space-6) 0;
  padding: var(--space-5);
  background: var(--background-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.wd-figure svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }

.wd-figure__cap {
  font-size: 13px;
  line-height: 1.55;
  color: var(--wd-muted);
  margin-top: var(--space-4);
}

.wd-figure__cap b { color: var(--foreground); font-weight: 600; }

/* ── Pull quote (highlighted, within the text measure) ─────────── */

.wd-pullquote {
  margin: var(--space-6) 0;
  text-align: center;
  font-size: clamp(20px, 2.4vw, 24px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: var(--foreground);
}

.wd-pullquote em { font-style: normal; color: var(--semantic-info); }

/* ── Instrument-mode hero readout (full-bleed) ──────────────────────
   The one scoped place instrument mode appears in the article: a layer
   profile, per the design doc. Pure black, phosphor green, CRT grid +
   scanlines + glow. JetBrains Mono only. Sits as a body-level block, so
   it spans edge-to-edge without any breakout trick. */
.wd-instrument {
  background: var(--instrument-bg);
  color: var(--instrument-green);
  font-family: var(--font-mono);
  border-top: 1px solid var(--instrument-green-faint);
  border-bottom: 1px solid var(--instrument-green-faint);
  padding: var(--space-6) var(--content-padding);
  margin-bottom: var(--space-7);
  position: relative;
  overflow: hidden;
  text-shadow: var(--instrument-glow);
  background-image:
    linear-gradient(rgba(0, 255, 102, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 102, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* scan-line overlay (subtle, per design doc) */
.wd-instrument::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg, rgba(0, 255, 102, 0.035) 0 1px, transparent 1px 3px
  );
}

.wd-instrument__inner {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
}

.wd-instrument__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}

.wd-rec::before {
  content: "\25CF";
  margin-right: 6px;
  animation: wd-blink 1s steps(1) infinite;
}

@keyframes wd-blink { 50% { opacity: 0.25; } }

.wd-instrument__meta {
  font-size: 11px;
  color: var(--instrument-green-dim);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-4);
}

.wd-instrument__axis {
  font-size: 11px;
  color: var(--instrument-green-dim);
  letter-spacing: 0.08em;
  text-align: center;
  margin-top: var(--space-3);
}

.wd-scope {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 2px rgba(0, 255, 102, 0.35));
}

.wd-scope__base { stroke: var(--instrument-green-faint); stroke-width: 1; }
.wd-scope__grid { stroke: var(--instrument-green-faint); stroke-width: 1; }
.wd-scope__trace { fill: none; stroke: var(--instrument-green-dim); stroke-width: 1.5; stroke-linejoin: round; }
.wd-scope__trace--bright { stroke: var(--instrument-green); stroke-width: 1.75; }
.wd-scope__fill { fill: rgba(0, 255, 102, 0.1); stroke: none; }
.wd-scope__label,
.wd-scope__tick-label {
  fill: var(--instrument-green-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.wd-scope__tick-label { font-size: 10px; }
.wd-scope__marker { stroke: var(--instrument-green-dim); stroke-width: 1; stroke-dasharray: 3 3; }
.wd-scope__dot { fill: var(--instrument-green); }
.wd-scope__annot { fill: var(--instrument-green); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; }
.wd-scope__flow { stroke: var(--instrument-green-dim); stroke-width: 1.5; fill: var(--instrument-green-dim); }
.wd-scope__flowlabel { fill: var(--instrument-green); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; }

/* One-shot "probe sweep": the trace draws in L0->L48 on load, then the
   fill and markers resolve. Pure CSS; reduced-motion falls back to the
   final static state via base.css. */
@keyframes wd-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes wd-fade { from { opacity: 0; } to { opacity: 1; } }

.wd-scope__trace--bright {
  stroke-dasharray: 1;
  animation: wd-draw 1.6s ease-out both;
}
.wd-scope__fill {
  opacity: 0;
  animation: wd-fade 0.7s ease-out 1.15s both;
}
.wd-scope__marker,
.wd-scope__dot,
.wd-scope__annot,
.wd-scope__flow,
.wd-scope__flowlabel {
  opacity: 0;
  animation: wd-fade 0.5s ease-out 1.55s both;
}

/* main-chrome bridge caption under the band */
.wd-instrument-cap {
  font-size: 13px;
  line-height: 1.5;
  color: var(--wd-muted);
  margin: 0 0 var(--space-5);
}
.wd-instrument-cap b { color: var(--foreground); font-weight: 600; }
.wd-cap-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--foreground-faint);
}

/* ── SVG element classes (tokenized, mirrors .dim-radar__*) ─────── */

.wd-svg__axis   { stroke: var(--border-default); stroke-width: 1; }
.wd-svg__needle { stroke: var(--semantic-info); stroke-width: 2; }
.wd-svg__needle-head { fill: var(--semantic-info); }
.wd-svg__tick   { stroke: var(--foreground-faint); stroke-width: 1; }

.wd-svg__label,
.wd-svg__num {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--foreground-muted);
}
.wd-svg__label--data   { fill: var(--semantic-info); }

/* status-colored marks (pass/fail/abstain) — semantic */
.wd-svg__ok   { fill: var(--semantic-ok); }
.wd-svg__warn { fill: var(--semantic-warn); }
.wd-svg__fail { fill: var(--semantic-fail); }


/* ── Stat tiles ─────────────────────────────────────────────────── */

.wd-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-3);
  margin: var(--space-6) 0;
}

.wd-stat {
  background: var(--background-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.wd-stat__v {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.wd-stat__l {
  font-size: 13px;
  line-height: 1.45;
  color: var(--foreground-muted);
  margin-top: var(--space-2);
}

/* ── Clean list ─────────────────────────────────────────────────── */

.wd-list { list-style: none; margin: 0 0 var(--space-5); }

.wd-list li {
  position: relative;
  padding: var(--space-3) 0 var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 16px;
  line-height: 1.6;
  color: var(--foreground-secondary);
}
.wd-list li:last-child { border-bottom: 0; }
.wd-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 21px;
  width: 6px;
  height: 6px;
  background: var(--semantic-info);
  transform: rotate(45deg);
}

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

.wd-footer {
  margin: var(--space-8) 0 var(--space-7);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
}

.wd-footer p {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--foreground-muted);
  margin: 0 0 var(--space-2);
}

@media (max-width: 520px) {
  .wd-hero { padding: 56px 20px 40px; }
  .wd-eyebrow { margin-top: var(--space-7); }
}
