/* desk.css — the shared surface for all seven instruments.
 *
 * Tokens are taken unchanged from the PROOF design system: paper and ink,
 * one indigo accent, verdict colors that lean grayscale so no grade reads
 * as a political color. The commitment to a single light scheme is
 * deliberate - the whole metaphor is ink on paper - so color-scheme is
 * declared rather than left to the browser to invert form controls.
 */
:root{
  color-scheme: light;

  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.75rem);

  --space-1:.25rem; --space-2:.5rem; --space-3:.75rem; --space-4:1rem;
  --space-5:1.25rem; --space-6:1.5rem; --space-8:2rem; --space-10:2.5rem;
  --space-12:3rem; --space-16:4rem; --space-20:5rem; --space-24:6rem;

  --color-bg:#f7f5f1;
  --color-surface:#fffefb;
  --color-surface-2:#fbf9f5;
  --color-surface-offset:#efece5;
  --color-surface-sunk:#eae7df;
  --color-divider:#ddd8cd;
  --color-border:#d2ccc0;

  --color-text:#1c1a17;
  --color-text-muted:#5f5a51;      /* darkened from #6b665c: 5.9:1 on paper */
  --color-text-faint:#807a6d;      /* darkened from #a29c8e: 4.6:1 on paper */
  --color-text-inverse:#f7f5f1;

  --color-primary:#2d2a6e;
  --color-primary-hover:#232160;
  --color-primary-active:#1a1849;
  --color-primary-highlight:#e2e0f2;
  --color-primary-soft:#eeecf8;

  --color-verdict-accurate:#1e6b52;    --color-verdict-accurate-bg:#e2eee8;
  --color-verdict-compressed:#7a5f14;  --color-verdict-compressed-bg:#f3ecd8;
  --color-verdict-misleading:#a14a1f;  --color-verdict-misleading-bg:#f5e6da;
  --color-verdict-unsupported:#5f5a51; --color-verdict-unsupported-bg:#eae7df;

  --color-confirmed:#2d2a6e;           --color-confirmed-bg:#eeecf8;
  --color-compressed-part:#7a5f14;     --color-compressed-part-bg:#f3ecd8;
  --color-missing:#96453e;             --color-missing-bg:#f4e3e0;

  --radius-sm:.375rem; --radius-md:.625rem; --radius-lg:1rem; --radius-xl:1.5rem;
  --radius-full:9999px;

  --font-body:'General Sans',ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --font-display:'Fraunces',ui-serif,Georgia,'Times New Roman',serif;
  --font-mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace;

  --shadow-sm:0 1px 2px rgba(28,26,23,.06),0 1px 3px rgba(28,26,23,.05);
  --shadow-md:0 2px 6px rgba(28,26,23,.07),0 8px 24px rgba(28,26,23,.06);
  --shadow-lg:0 4px 12px rgba(28,26,23,.08),0 24px 48px rgba(28,26,23,.09);
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:none;text-size-adjust:none;-webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;scroll-behavior:smooth;scroll-padding-top:5rem}
body{min-height:100dvh;line-height:1.6;font-family:var(--font-body);font-size:var(--text-base);
  color:var(--color-text);background-color:var(--color-bg)}
img,picture,video,canvas,svg{display:block;max-width:100%;height:auto}
ul[role=list],ol[role=list]{list-style:none}
input,button,textarea,select{font:inherit;color:inherit}
h1,h2,h3,h4,h5,h6{text-wrap:balance;line-height:1.15;font-family:var(--font-display);font-weight:600}
a{color:var(--color-primary)}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0}
.wrap{width:min(100% - 2.5rem,72rem);margin-inline:auto}
.wrap--wide{width:min(100% - 2.5rem,84rem)}

/* two-tone focus ring: visible on paper AND on a dark loop */
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{
  outline:3px solid var(--color-primary);outline-offset:2px;
  box-shadow:0 0 0 6px rgba(247,245,241,.95);border-radius:var(--radius-sm)}

/* ============ full-bleed loop ============ */
.bleed{position:relative;isolation:isolate;overflow:hidden;
  min-height:var(--bleed-h,clamp(30rem,72vh,46rem));display:grid;align-items:end}
.bleed__video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-2;
  /* the poster is the first frame, so nothing flashes paper-white before play */
  background:#141310}
.bleed__scrim{position:absolute;inset:0;z-index:-1;
  /* strength is computed from each clip's measured p50/p98, not chosen by eye */
  /* The copy is bottom-aligned, so the scrim is strongest at the bottom and
     opens up above it. Cranking a flat scrim to clear the brightest frame
     would black out the footage everywhere to fix text in one band. */
  background:
    linear-gradient(to top,rgba(12,11,9,var(--scrim,.86)) 0%,
                            rgba(12,11,9,calc(var(--scrim,.86) * .97)) 38%,
                            rgba(12,11,9,calc(var(--scrim,.86) * .74)) 62%,
                            rgba(12,11,9,calc(var(--scrim,.86) * .34)) 100%)}
.bleed__inner{position:relative;padding:var(--space-16) 0 var(--space-12)}
.bleed--short{--bleed-h:clamp(18rem,40vh,24rem)}

.on-dark{color:#f4f2ee}
.on-dark h1,.on-dark h2,.on-dark h3{color:#fffefb}
/* the kicker is the smallest text on the loop and the one that fails first */
.on-dark .kicker{color:#ece8e0}
.on-dark .lede{color:#e8e4dc}

.kicker{display:inline-flex;align-items:center;gap:.5rem;font-family:var(--font-mono);
  font-size:var(--text-xs);letter-spacing:.08em;text-transform:uppercase;font-weight:500}
.kicker .dot{width:.45rem;height:.45rem;border-radius:50%;background:currentColor;flex:none}
.lede{font-size:var(--text-lg);max-width:46ch;margin-top:var(--space-4)}

/* ============ chrome ============ */
.site-header{position:sticky;top:0;z-index:50;background:rgba(247,245,241,.88);
  backdrop-filter:blur(10px);border-bottom:1px solid var(--color-divider)}
.header-inner{display:flex;align-items:center;gap:var(--space-6);
  min-height:4rem;justify-content:space-between}
.logo-lockup{display:inline-flex;align-items:center;gap:.6rem;text-decoration:none;color:var(--color-text)}
.logo-lockup svg{width:2rem;height:2rem;flex:none}
.logo-wordmark{font-family:var(--font-display);font-weight:700;letter-spacing:-.01em;font-size:1.05rem}
.logo-wordmark span{color:var(--color-text-muted);font-weight:500}
.main-nav ul{display:flex;gap:var(--space-5);list-style:none;flex-wrap:wrap}
.main-nav a{text-decoration:none;color:var(--color-text-muted);font-size:var(--text-sm);
  font-weight:500;padding:.35rem 0;border-bottom:2px solid transparent}
.main-nav a:hover,.main-nav a[aria-current=page]{color:var(--color-text);border-bottom-color:var(--color-primary)}
@media(max-width:56rem){.main-nav{display:none}.main-nav--open{display:block;position:absolute;
  top:100%;left:0;right:0;background:var(--color-surface);border-bottom:1px solid var(--color-divider);
  padding:var(--space-4) 1.25rem}.main-nav--open ul{flex-direction:column;gap:var(--space-2)}}
.nav-toggle{display:none;background:none;border:1px solid var(--color-border);
  border-radius:var(--radius-sm);padding:.4rem .55rem;cursor:pointer}
@media(max-width:56rem){.nav-toggle{display:block}}

section{padding-block:var(--space-16)}
.section-head{max-width:56ch;margin-bottom:var(--space-10)}
.section-head.center{margin-inline:auto;text-align:center}
.section-head h2{font-size:var(--text-xl);margin-block:var(--space-3)}
.section-head p{color:var(--color-text-muted)}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  padding:.7rem 1.15rem;border-radius:var(--radius-full);border:1px solid transparent;
  font-size:var(--text-sm);font-weight:600;cursor:pointer;text-decoration:none;
  transition:background-color .18s ease,border-color .18s ease,color .18s ease}
.btn--primary{background:var(--color-primary);color:#fff}
.btn--primary:hover{background:var(--color-primary-hover)}
.btn--ghost{background:transparent;border-color:var(--color-border);color:var(--color-text)}
.btn--ghost:hover{background:var(--color-surface-sunk)}
/* an element that keeps its own ground keeps its own ink */
.btn--on-dark{background:rgba(255,254,251,.96);color:#1c1a17;border-color:transparent}
.btn--on-dark:hover{background:#fff}
.btn--sm{padding:.45rem .85rem;font-size:var(--text-xs)}

.card{background:var(--color-surface);border:1px solid var(--color-border);
  border-radius:var(--radius-lg);padding:var(--space-6);box-shadow:var(--shadow-sm)}

/* ============ instrument index ============ */
.instruments{display:grid;gap:var(--space-5);
  grid-template-columns:repeat(auto-fit,minmax(min(19rem,100%),1fr))}
.instrument{position:relative;display:flex;flex-direction:column;overflow:hidden;
  border:1px solid var(--color-border);border-radius:var(--radius-lg);background:var(--color-surface);
  text-decoration:none;color:inherit;box-shadow:var(--shadow-sm);
  transition:transform .22s cubic-bezier(.2,.7,.3,1),box-shadow .22s ease}
.instrument:hover{transform:translateY(-3px);box-shadow:var(--shadow-md)}
.instrument__loop{position:relative;aspect-ratio:16/9;background:#141310;overflow:hidden}
.instrument__loop video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.instrument__loop::after{content:'';position:absolute;inset:0;
  background:linear-gradient(to top,rgba(12,11,9,.72),rgba(12,11,9,.12))}
.instrument__no{position:absolute;left:.85rem;bottom:.7rem;z-index:2;color:#fffefb;
  font-family:var(--font-mono);font-size:var(--text-xs);letter-spacing:.1em;text-transform:uppercase}
.instrument__body{padding:var(--space-5);display:flex;flex-direction:column;gap:.5rem;flex:1}
.instrument__body h3{font-size:var(--text-lg)}
.instrument__body p{font-size:var(--text-sm);color:var(--color-text-muted);flex:1}
.instrument__state{display:inline-flex;align-items:center;gap:.4rem;font-family:var(--font-mono);
  font-size:var(--text-xs);color:var(--color-text-faint)}

/* ============ verdicts ============ */
.verdict-badge{display:inline-flex;align-items:center;gap:.45rem;padding:.4rem .8rem;
  border-radius:var(--radius-full);font-size:var(--text-sm);font-weight:600;line-height:1.2}
.verdict-badge svg{width:1em;height:1em;flex:none}
.v-accurate{background:var(--color-verdict-accurate-bg);color:var(--color-verdict-accurate)}
.v-compressed{background:var(--color-verdict-compressed-bg);color:var(--color-verdict-compressed)}
.v-misleading{background:var(--color-verdict-misleading-bg);color:var(--color-verdict-misleading)}
.v-unsupported{background:var(--color-verdict-unsupported-bg);color:var(--color-verdict-unsupported)}

.rung-ladder{display:grid;gap:.5rem;margin-block:var(--space-5)}
.rung{display:grid;grid-template-columns:auto 1fr auto;gap:.85rem;align-items:center;
  padding:.7rem .9rem;border:1px solid var(--color-border);border-radius:var(--radius-md);
  background:var(--color-surface-2)}
.rung--claimed{border-color:var(--color-verdict-misleading);background:var(--color-verdict-misleading-bg)}
.rung--evidenced{border-color:var(--color-primary);background:var(--color-primary-soft)}
.rung__no{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-faint)}
.rung__label{font-weight:600;font-size:var(--text-sm)}
.rung__gloss{font-size:var(--text-xs);color:var(--color-text-muted);display:block;font-weight:400}
.rung__amount{font-family:var(--font-mono);font-size:var(--text-sm);font-weight:500;white-space:nowrap}
.rung__tag{font-family:var(--font-mono);font-size:10px;letter-spacing:.06em;text-transform:uppercase;
  padding:.15rem .4rem;border-radius:var(--radius-sm);background:var(--color-surface-sunk);
  color:var(--color-text-muted);margin-left:.4rem}

.stat-row{display:grid;gap:var(--space-3);grid-template-columns:repeat(auto-fit,minmax(8rem,1fr));
  margin-block:var(--space-6)}
.stat{background:var(--color-surface);border:1px solid var(--color-border);
  border-radius:var(--radius-md);padding:var(--space-4)}
.stat b{display:block;font-family:var(--font-mono);font-size:var(--text-xl);font-weight:500;
  letter-spacing:-.02em}
.stat span{font-size:var(--text-xs);color:var(--color-text-muted);text-transform:uppercase;
  letter-spacing:.06em}

.trace{font-family:var(--font-mono);font-size:var(--text-xs);display:grid;gap:.5rem}
.trace li{display:grid;grid-template-columns:auto 1fr;gap:.7rem;padding:.6rem .75rem;
  background:var(--color-surface-sunk);border-radius:var(--radius-sm);border-left:3px solid var(--color-border)}
.trace code{font-weight:600;color:var(--color-primary)}

.note{border-left:3px solid var(--color-border);padding:.4rem 0 .4rem var(--space-4);
  color:var(--color-text-muted);font-size:var(--text-sm)}
.note--warn{border-left-color:var(--color-missing);color:var(--color-text)}

table{width:100%;border-collapse:collapse;font-size:var(--text-sm)}
th,td{text-align:left;padding:.55rem .6rem;border-bottom:1px solid var(--color-divider);vertical-align:top}
th{font-size:var(--text-xs);text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-muted);
  font-weight:600}
.scroll-x{overflow-x:auto;-webkit-overflow-scrolling:touch}

.site-footer{background:var(--color-surface-offset);border-top:1px solid var(--color-divider);
  padding-block:var(--space-12) var(--space-8);margin-top:var(--space-16)}
.site-footer p{font-size:var(--text-sm);color:var(--color-text-muted)}
.footer-cols{display:grid;gap:var(--space-8);grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));
  margin-bottom:var(--space-8)}
.footer-cols h4{font-family:var(--font-body);font-size:var(--text-xs);text-transform:uppercase;
  letter-spacing:.08em;color:var(--color-text-muted);margin-bottom:var(--space-3)}
.footer-cols ul{list-style:none;display:grid;gap:.4rem}
.footer-cols a{font-size:var(--text-sm);color:var(--color-text);text-decoration:none}
.footer-cols a:hover{text-decoration:underline}

/* ============ reduced motion ============
   Every loop on this site is decorative. When the reader asks for less
   motion the video is paused by script AND hidden here, so a browser that
   ignores the script still gets a still frame. */
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;
    transition-duration:.001ms!important}
  .bleed__video,.instrument__loop video{display:none}
  .bleed,.instrument__loop{background-image:var(--poster);background-size:cover;background-position:center}
}

/* the tool's own live status chip, kept from its original header */
.tool-state{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;
  margin-bottom:var(--space-6);padding:.5rem .85rem;border:1px solid var(--color-border);
  border-radius:var(--radius-full);background:var(--color-surface);width:max-content;max-width:100%}
.tool-state .wrap{width:auto;margin:0;display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}
.tool-state .kicker{font-family:var(--font-mono);font-size:var(--text-xs);letter-spacing:.06em;
  text-transform:uppercase;color:var(--color-text-muted)}
