/* ==========================================================================
   LEAK HUNTER · SITE A · css/fig-chrome.css — figure "chrome" (section #problem)
   Graphite poster + black liquid-chrome stage · chrome numerals · stake scale ·
   four fact cards with live micro-diagrams. Scoped under #problem; loads after base.css.
   ========================================================================== */

/* ---------- colours -------------------------------------------------------------
   Neutral silver metal (numerals, kicker, redaction bar), the poster (--ch-p*, the same hexes
   as the shader's poster in js/fig-chrome.js) and the diagram screens. --k1 / --k2 are the rim
   kickers: decorative light, both silver-white, never a bite (red is for bites). */
#problem {
  --wh-rgb: var(--text-rgb);
  --k1-rgb: var(--glow-rgb); --k2-rgb: var(--ice-rgb);
  --ch-pa: #2B2B2E; --ch-pb: #1F1F21; --ch-pbg: #060606;
  --ch-i0-rgb: 243 242 238; --ch-i1-rgb: 163 162 158;
  --ch-r0: #F8F8F6; --ch-r1: #CFCFCB; --ch-r2: #A3A3A0;
  --ch-d0: #787876; --ch-d1: #303031; --ch-d2: #121213; --ch-d3: #060606;
  --ch-f0: #F7F7F5; --ch-f1: #E0E0DD; --ch-f2: #B2B2AE; --ch-f3: #747470; --ch-f4: #222222;
  --ch-f5: #4B4B4A; --ch-f6: #BDBDB9; --ch-f7: #F0F0ED; --ch-f8: #A6A6A2; --ch-f9: #60605D;
  --fact-hov: #1E1E20; --scr-0: #131314; --scr-1: #0F0F10;
  --fv-dim: #29292D; --fv-block: #171719; --fv-ring: #111112; --fv-swap: #E5E4E0; --fv-amb-hi: #E6D6B5;
}

/* ---------- stage, poster, WebGL ------------------------------------------- */
#problem .problem__stage { padding-bottom: 0; }
#problem .problem__stage::after { /* hairline above everything */
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(var(--wh-rgb) / .06);
}
/* The poster is what the shader starts from: the canvas paints exactly this until the reveal
   begins, so it can fade in over it without a seam — and with no WebGL the stage still reads. */
#problem .fig--chrome {
  background:
    radial-gradient(60% 50% at 30% 25%, var(--ch-pa), transparent 70%),
    radial-gradient(50% 40% at 80% 30%, var(--ch-pb), transparent 70%),
    var(--ch-pbg);
}
#problem .chrome__gl {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block;
  opacity: 0; transition: opacity .6s var(--ease-out);
}
#problem .fig--chrome.is-drawn .chrome__gl { opacity: 1; }
#problem .fig--chrome.is-lost .chrome__gl { opacity: 0; }

/* ---------- head ------------------------------------------------------------ */
#problem .problem__head { gap: 16px; }
#problem .problem__kicker { position: relative; letter-spacing: -0.04em; }
#problem .problem__kicker.is-split { background: none; color: transparent; }
#problem .problem__kicker .lh-w { /* pre-roll: the line is there, dim, before the redaction passes */
  position: relative; color: transparent;
  background-image: linear-gradient(180deg, rgb(var(--ch-i0-rgb) / .34) 0%, rgb(var(--ch-i1-rgb) / .34) 100%);
  -webkit-background-clip: text; background-clip: text;
}
#problem .problem__kicker .lh-w.is-ink { background-image: linear-gradient(180deg, rgb(var(--ch-i0-rgb)) 0%, rgb(var(--ch-i1-rgb)) 100%); }
#problem .kred { /* redaction bar: covers, then lifts off */
  position: absolute; left: -.07em; right: -.07em; top: .04em; bottom: .02em; border-radius: 2px;
  background: linear-gradient(180deg, var(--ch-r0) 0%, var(--ch-r1) 55%, var(--ch-r2) 100%);
  transform: scaleX(0); transform-origin: 0 50%; pointer-events: none;
}

#problem .problem__title { gap: 14px; }

/* chrome numerals: depth slab + face; the face carries the env gradient,
   a broad pointer sheen and a sharp specular sweep (all clipped to the glyphs) */
#problem .problem__num {
  position: relative; display: block; padding: 0 .04em;
  font: 700 clamp(92px, 14.5vw, 232px)/.84 var(--f-display); letter-spacing: -0.065em;
  font-variant-numeric: tabular-nums;
  background: none; -webkit-background-clip: border-box; background-clip: border-box; color: rgb(var(--wh-rgb));
  filter: drop-shadow(0 -1px 0 rgb(var(--wh-rgb) / .14)) drop-shadow(0 20px 34px rgba(0, 0, 0, .7));
}
#problem .problem__glyphs { position: relative; display: inline-block; vertical-align: top; }
/* letter-spacing also trims the advance after the last glyph: give it back, so box and ink share a centre */
#problem .problem__face,
#problem .problem__depth { display: block; white-space: nowrap; padding-right: .065em; }
#problem .problem__depth { /* the extrusion — also the pre-roll: dark glyphs the chrome pours into */
  position: absolute; left: 0; top: 0; right: 0;
  transform: translateY(.042em);
  background: linear-gradient(180deg, var(--ch-d0) 0%, var(--ch-d1) 26%, var(--ch-d2) 58%, var(--ch-d3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
#problem .problem__face {
  --sx: 100; --hz: 51; --gx: 50;
  position: relative;
  background-image:
    /* specular sweep: a dark reflection edge leads the hot band, so it reads even on the bright face */
    linear-gradient(114deg, rgba(14, 16, 18, 0) 40%, rgba(14, 16, 18, .8) 46.6%, rgb(var(--wh-rgb) / 1) 49.4%, rgb(var(--wh-rgb) / .55) 51.8%, rgb(var(--wh-rgb) / 0) 55.6%),
    radial-gradient(36% 85% at calc(var(--gx) * 1%) 20%, rgb(var(--wh-rgb) / .3), rgb(var(--wh-rgb) / 0) 72%),
    linear-gradient(90deg, rgb(var(--k1-rgb) / .11), rgb(var(--k1-rgb) / 0) 18%, rgb(var(--k2-rgb) / 0) 84%, rgb(var(--k2-rgb) / .07)),
    linear-gradient(180deg,
      var(--ch-f0) 2%, var(--ch-f1) 17%, var(--ch-f2) 32%,
      var(--ch-f3) calc((var(--hz) - 5) * 1%), var(--ch-f4) calc(var(--hz) * 1%), var(--ch-f5) calc((var(--hz) + 2.5) * 1%),
      var(--ch-f6) 66%, var(--ch-f7) 79%, var(--ch-f8) 90%, var(--ch-f9) 100%);
  background-size: 300% 100%, 100% 100%, 100% 100%, 100% 100%;
  background-position: calc(var(--sx) * 1%) 0, 0 0, 0 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}

/* stake scale: 0 … 100, the 30–40 band lit (tracks the count) */
#problem .stake {
  --lo: 30; --hi: 40;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 12px;
  width: min(100%, 540px); margin: 2px auto 2px;
  font: 400 12px/1 var(--f-mono); letter-spacing: .02em; color: rgb(var(--wh-rgb) / .64);
  font-variant-numeric: tabular-nums;
}
#problem .stake__end { transform: translateY(3px); text-shadow: 0 1px 2px rgba(0, 0, 0, .6), 0 0 12px rgba(0, 0, 0, .7); }
#problem .stake__track {
  position: relative; height: 13px;
  background:
    linear-gradient(90deg, rgb(var(--wh-rgb) / .3) 0 1px, transparent 1px) 0 100% / 10% 13px repeat-x,
    linear-gradient(90deg, rgb(var(--wh-rgb) / .14) 0 1px, transparent 1px) 0 100% / 2% 6px repeat-x,
    linear-gradient(rgb(var(--wh-rgb) / .16), rgb(var(--wh-rgb) / .16)) 0 100% / 100% 1px no-repeat;
}
#problem .stake__track::after { /* the 100 tick */
  content: ""; position: absolute; right: 0; bottom: 0; width: 1px; height: 13px; background: rgb(var(--wh-rgb) / .3);
}
#problem .stake__band {
  position: absolute; left: 0; right: 0; top: -6px; bottom: -2px;
  -webkit-clip-path: inset(0 calc((100 - var(--hi)) * 1%) 0 calc(var(--lo) * 1%));
  clip-path: inset(0 calc((100 - var(--hi)) * 1%) 0 calc(var(--lo) * 1%));
  background:
    linear-gradient(90deg, rgb(var(--wh-rgb)) 0 1px, transparent 1px) 0 calc(100% - 2px) / 10% 19px repeat-x,
    linear-gradient(90deg, rgb(var(--wh-rgb) / .85) 0 1px, transparent 1px) 0 calc(100% - 2px) / 2% 8px repeat-x,
    linear-gradient(var(--pink), var(--pink)) 0 100% / 100% 2px no-repeat,
    linear-gradient(0deg, rgb(var(--pink-rgb) / .34), rgb(var(--pink-rgb) / 0)) 0 100% / 100% 16px no-repeat;
}
/* the count lands: the lit band flares once */
#problem .stake.is-lock .stake__band { animation: chrome-lock 1.2s var(--ease-out) both; }
@keyframes chrome-lock {
  0% { filter: brightness(2.1) saturate(1.3); }
  100% { filter: none; }
}

#problem .problem__sub { margin-top: 2px; }
#problem .problem__lede { margin-top: -6px; }
#problem .problem__sub,
#problem .problem__lede,
#problem .problem__src { /* a soft dark halo: readable over any fold of the chrome */
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55), 0 0 18px rgba(0, 0, 0, .75), 0 0 44px rgba(0, 0, 0, .5);
}
/* phones: the source sits right under the claim (desktop keeps the footnote) */
#problem .problem__src { display: none; font: 500 13px/1.4 var(--f-ui); color: rgb(var(--wh-rgb) / .7); }

/* footnote markers: a 44×44 target around a small superscript */
#problem .fnref a { position: relative; display: inline-block; margin-left: 1px; padding: 0 1px; font: 700 12px/1 var(--f-ui); }
#problem .fnref a::after,
#problem .footnote__back::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px;
  transform: translate(-50%, -50%);
}
#problem .problem__cta { margin-top: 10px; }
#problem .problem__cta .i { width: 15px; height: 15px; }

/* ---------- facts ------------------------------------------------------------- */
#problem .problem__facts {
  display: flex; flex-direction: column; align-items: stretch; gap: 28px;
  padding-bottom: clamp(28px, 3.2vw, 46px);
}
#problem .problem__facts::after { content: none; display: none; } /* nothing is truncated: no fade */
#problem .facts { gap: 16px; }
/* one row: the research card (the paper, cited in full) gets the room its text needs,
   so the four cards end level instead of three of them trailing empty space */
@media (min-width: 1200px) {
  #problem .facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); }
}
#problem .fact {
  min-height: 0; gap: 12px; padding: 18px 18px 24px; border-radius: 12px;
  background: var(--s1);
  box-shadow: inset 0 0 0 1px rgb(var(--wh-rgb) / .07), inset 0 1px 0 rgb(var(--wh-rgb) / 0);
  transition: box-shadow .45s var(--ease-out), background-color .45s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { /* colour only: the same two hairlines, brighter */
  #problem .fact:hover {
    background-color: var(--fact-hov);
    box-shadow: inset 0 0 0 1px rgb(var(--wh-rgb) / .16), inset 0 1px 0 rgb(var(--wh-rgb) / .1);
  }
}
#problem .fact__label {
  display: flex; align-items: center; min-height: 15px;
  font: 600 12.5px/1.2 var(--f-ui); letter-spacing: 0; text-transform: none; color: var(--lime);
}
#problem .fact__caret {
  display: inline-block; width: .5em; height: 1.1em; margin-left: 3px; vertical-align: -.16em;
  background: var(--lime); box-shadow: 0 0 8px rgb(var(--lime-rgb) / .6);
}
#problem .fact__title { font-size: 20px; line-height: 1.04; }
#problem .fact__text { font-size: 15px; line-height: 1.55; color: rgb(var(--wh-rgb) / .74); }
/* the edge glint stays on its own layer for good: promoting and dropping a layer inside a
   rounded, clipped card costs Chrome a mask rebuild — a measured ~150 ms frame */
#problem .fact__glint {
  position: absolute; left: 0; top: 0; z-index: 2; width: 42%; height: 1px; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgb(var(--wh-rgb) / 0), rgb(var(--wh-rgb) / .8), rgb(var(--wh-rgb) / 0));
  transform: translateX(-110%); will-change: transform;
}

/* the paper, cited in full (card 03) */
#problem .fact__src {
  position: relative; align-self: flex-start; margin-top: auto; padding: 2px 0 3px;
  font: 600 13.5px/1.45 var(--f-ui); color: rgb(var(--wh-rgb)); text-decoration: none;
}
#problem .fact__src::after { /* the underline draws in (a transform, not a size) */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .5s var(--ease-out);
}
#problem .id { text-transform: none; letter-spacing: 0; } /* same as the shell's utility, scoped */
#problem .fact__srcid { white-space: nowrap; }
#problem .fact__src .id { color: var(--lime); text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; }
#problem .fact__arrow { display: inline-block; transition: transform .45s var(--ease-out); }
#problem .fact__src:focus-visible::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
  #problem .fact__src:hover::after { transform: scaleX(1); }
  #problem .fact__src:hover .fact__arrow { transform: translateX(4px); }
}

/* one ordinary button under the grid */
#problem .problem__all { align-self: center; }
#problem .problem__all .i { width: 15px; height: 15px; }

/* ---------- micro-diagram screens ------------------------------------------------ */
/* Each diagram is laid out in CSS pixels for the frame it sits in (rebuilt when the
   frame width changes), so its 12px captions stay 12px at every card width. */
#problem .fact__vis { display: none; }
#problem.has-vis .fact__vis {
  display: block; position: relative; height: 108px; margin: 2px 0 4px; border-radius: 8px; overflow: hidden;
  background:
    radial-gradient(rgb(var(--wh-rgb) / .055) .7px, transparent 1px) 4px 4px / 8px 8px,
    linear-gradient(180deg, var(--scr-0), var(--scr-1));
  box-shadow: inset 0 0 0 1px rgb(var(--wh-rgb) / .06), inset 0 10px 24px -14px rgba(0, 0, 0, .9);
}
#problem .fv { position: absolute; left: 0; top: 0; display: block; overflow: visible; }
#problem .fv text { font: 600 12px/1 var(--f-ui); letter-spacing: 0; fill: rgb(var(--wh-rgb) / .64); }
#problem .fv .fv-cap--hi { fill: rgb(var(--wh-rgb)); }
#problem .fv .fv-mono { font: 400 12px/1 var(--f-mono); fill: rgb(var(--wh-rgb) / .64); }
#problem .fv .fv-in { font-weight: 700; fill: var(--fv-amb-hi); }
#problem .fv .fv-in--ink { fill: var(--ink); }

/* 01 · auction: amber is auction activity (bids, the winner), never a leak */
#problem .fv-slot { fill: var(--s2); stroke: rgb(var(--wh-rgb) / .08); stroke-width: 1; }
#problem .fv-slot--tx { fill: var(--fv-swap); stroke: none; }
#problem .fv-slot--open {
  fill: rgb(var(--amber-rgb) / .04); stroke: rgb(var(--amber-rgb) / .62); stroke-dasharray: 3 2.4;
  transition: fill .35s var(--ease-out), stroke .35s var(--ease-out);
}
#problem .fv-slot--open.is-on { fill: rgb(var(--amber-rgb) / .22); stroke: var(--amber); stroke-dasharray: none; }
#problem .fv-bid rect { fill: rgb(var(--amber-rgb) / .08); stroke: rgb(var(--amber-rgb) / .72); stroke-width: 1; transition: fill .3s var(--ease-out); }
#problem .fv-bid.is-on rect { fill: var(--amber); stroke: var(--amber); }
#problem .fv-bid.is-on text { fill: var(--ink); }

/* 02 · weeks */
#problem .fv-day { fill: var(--fv-dim); }
#problem .fv-rule { stroke: rgb(var(--wh-rgb) / .12); stroke-width: 1; }
#problem .fv-pole { stroke: rgb(var(--wh-rgb) / .85); stroke-width: 1.2; }
#problem .fv-ring { fill: var(--fv-ring); stroke: rgb(var(--wh-rgb)); stroke-width: 1.4; }

/* 03 · one sandwich, three blocks; the route never reaches the chain */
#problem .fv-horizon { stroke: rgb(var(--wh-rgb) / .16); stroke-width: 1; stroke-dasharray: 2 3; }
#problem .fv-block { fill: var(--fv-block); stroke: rgb(var(--wh-rgb) / .12); stroke-width: 1; }
#problem .fv-row { fill: var(--fv-dim); transition: fill .35s var(--ease-out); }
#problem .fv-row.is-leg { fill: var(--pink); }
#problem .fv-row.is-swap { fill: var(--fv-swap); }
#problem .fv-thread { fill: none; stroke: var(--pink); stroke-width: 1.5; stroke-linecap: round; }
#problem .fv-thread-end { fill: var(--pink); }
#problem .fv-route rect { fill: rgb(var(--wh-rgb) / .03); stroke: rgb(var(--wh-rgb) / .34); stroke-width: 1; stroke-dasharray: 3 2.4; transition: stroke .35s var(--ease-out), fill .35s var(--ease-out); }
#problem .fv-route.is-on rect { stroke: rgb(var(--wh-rgb) / .8); fill: rgb(var(--wh-rgb) / .07); }
#problem .fv-route text { fill: rgb(var(--wh-rgb) / .64); transition: fill .35s var(--ease-out); }
#problem .fv-route.is-on text { fill: rgb(var(--wh-rgb)); }
#problem .fv-link { stroke: rgb(var(--wh-rgb) / .7); stroke-width: 1; stroke-dasharray: 2 2.6; }

/* 04 · hands: transport is ice */
#problem .fv-path { fill: none; stroke: rgb(var(--wh-rgb) / .15); stroke-width: 1; }
#problem .fv-hand {
  --hit: 0;
  fill: rgb(var(--ice-rgb) / calc(.04 + var(--hit) * .5));
  stroke: rgb(var(--ice-rgb) / calc(.32 + var(--hit) * .68)); stroke-width: 1;
}
#problem .fv-you { fill: rgb(var(--wh-rgb)); }
#problem .fv-leader { fill: rgb(var(--wh-rgb) / .06); stroke: rgb(var(--wh-rgb)); stroke-width: 1.3; }
#problem .fv-strike { stroke: rgb(var(--wh-rgb) / .78); stroke-width: 1.2; }
#problem .fv-pkt { fill: var(--ice); }

/* ---------- footnote ------------------------------------------------------------- */
#problem .footnote {
  align-items: baseline; gap: 8px; margin-top: 14px; padding: 2px 4px; border-radius: 6px;
  font: 400 13px/1.5 var(--f-ui); color: rgb(var(--wh-rgb) / .64);
}
#problem .footnote__n { font: 700 12px/1 var(--f-ui); color: var(--lime); }
#problem .footnote__back { position: relative; display: inline-block; padding: 0 4px; color: rgb(var(--wh-rgb) / .64); text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  #problem .footnote__back:hover { color: var(--lime); }
}
#problem .footnote__back:focus-visible { color: var(--lime); }
/* flashes when you arrive from the superscript */
#problem .footnote.is-flash { animation: chrome-fn 1.9s var(--ease-out); }
@keyframes chrome-fn {
  0%, 18% { background: rgb(var(--lime-rgb) / .14); box-shadow: 0 0 0 6px rgb(var(--lime-rgb) / .14); color: rgb(var(--wh-rgb)); }
  100% { background: rgb(var(--lime-rgb) / 0); box-shadow: 0 0 0 6px rgb(var(--lime-rgb) / 0); }
}

/* ---------- responsive --------------------------------------------------------- */
@media (max-width: 767px) {
  #problem .problem__head { gap: 14px; }
  #problem .problem__title { gap: 12px; }
  #problem .problem__src { display: block; margin-top: -4px; }
  #problem .problem__lede { margin-top: -4px; }
  #problem .stake { gap: 8px; font-size: 11px; letter-spacing: 0; }
  #problem .problem__facts { gap: 24px; padding-bottom: 28px; }
  #problem .facts { gap: 12px; }
  #problem .fact { padding: 16px 16px 22px; gap: 10px; }
}
@media (max-width: 479px) {
  #problem .problem__head { grid-template-columns: minmax(0, 1fr); }
  /* the h2 would otherwise size to the numeral's max-content and carry the stake past the column;
     without its side padding the numeral fits the column at 360 and stays centred */
  #problem .problem__title { width: 100%; grid-template-columns: minmax(0, 1fr); }
  #problem .problem__num { font-size: min(92px, 24vw); padding: 0; }
  #problem .stake { width: calc(100% - 8px); }
  #problem .problem__cta { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; width: 100%; }
  #problem .problem__all { align-self: stretch; }
}
