/* ============================================================
   COMPOUND -- SHARED STYLESHEET
   The design system, as code. One file, loaded by every page.

   This replaces the prose section of [C] Design System Prompt - Compound.md
   as the operative definition. Prose describes intent; this file decides
   what actually renders, and _tools/check_design.py fails the deploy when
   a page hard-codes a value instead of using a token.

   (!) CONTRAST NOTE, 2026-08-21. Two documented greys were tested against
   the real backgrounds and failed WCAG:
       Faint #8E8E96  ->  2.29:1 on #000000  (FAIL; it is used for the
                         SMALLEST text on the site, 9-10.5px mono labels)
       Dim   #A3A3AB  ->  5.33:1  (passes, but sat close to the floor)
   Both have moved up the same cool-grey ramp, hue unchanged. Every text
   token below now clears 4.5:1 on BOTH the page background and the card
   surface, so no combination in the system can produce failing text.
   ============================================================ */

:root{
  /* ---- ground ---- */
  --bg:#000000;            /* Compound Black */
  --surface:#0E1013;       /* card */
  --surface-2:#14171C;     /* raised */
  --surface-3:#1A1E24;     /* raised, interactive */
  --rule:#1C2026;          /* divider */
  --rule-hi:#2A3038;       /* divider, emphasis */

  /* ---- ink. all four clear 4.5:1 on --bg AND --surface ---- */
  --txt:#E9EBED;           /* 16.7 : 1  body */
  --dim:#A3A3AB;           /*  7.5 : 1  secondary body */
  --faint:#8E8E96;         /*  4.8 : 1  labels, eyebrows, metadata */
  --ghost:#5A626C;         /*  3.1 : 1  NON-TEXT ONLY -- rules, inactive bars */

  /* ---- accent. one, and only one ---- */
  --accent:#4C6FFF;        /*  8.4 : 1  Petronas Teal */
  --accent-wash:rgba(76,111,255,.15);
  --accent-ink:#06120F;    /* text ON accent */

  --yes:#4C6FFF;  --yes-t:#9EB1FF;
  --dep:#6B84E8;  --dep-t:#A3B4FF;
  --no:#C08A1E;   --no-t:#EDBB4E;

  /* ---- type ---- */
  --f-display:'Space Grotesk','General Sans','Inter',sans-serif;
  --f-body:'Inter','Inter Tight',system-ui,-apple-system,sans-serif;
  --f-mono:'JetBrains Mono','IBM Plex Mono',ui-monospace,monospace;

  /* ---- space. a 4px base; use the step, never a raw px ---- */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:24px;
  --s6:32px; --s7:48px; --s8:64px; --s9:96px;

  --r:12px; --r-lg:18px; --r-pill:99px;
  --ease:cubic-bezier(.16,1,.3,1);
  --wrap:1120px;

  /* ---- depth. Added 9 Sep 2026, the elevation pass. Two shadows and one
     edge-light, used together: cards carry the edge-light always and gain
     lift + tint on hover. Values are the only place depth is defined, so
     the whole site lifts or settles from here. ---- */
  --edge:inset 0 1px 0 rgba(255,255,255,.045);
  --lift:0 14px 34px -18px rgba(0,0,0,.65);
  --glow:0 6px 28px -8px rgba(76,111,255,.4);
}

/* ---------- COMPATIBILITY LAYER ----------
   The site grew two token vocabularies with identical values under different
   names: the library compound pages used --surf / --teal / --sg, the marketing
   pages used --surface / --accent. Rather than rewrite 15 pages of CSS by hand
   and risk breaking them, both names resolve to the same value here.

   These aliases are scaffolding. Retire them page by page as each one is
   rewritten, and delete this block when check_design reports no page using them. */
:root{
  --surf:var(--surface);   --surf2:var(--surface-2);  --rule2:var(--rule-hi);
  --teal:var(--accent);    --wash:var(--accent-wash); --accent-dim:var(--accent-wash);
  --sg:var(--f-display);   --in:var(--f-body);        --jb:var(--f-mono);
  --amber:#F5B544;         --warn:#E8CE7A;
}

*{box-sizing:border-box;margin:0;padding:0}
::selection{background:var(--accent);color:var(--bg)}
html{-webkit-text-size-adjust:100%;scroll-padding-top:150px;scroll-behavior:smooth}
body{
  background:var(--bg); color:var(--txt);
  font-family:var(--f-body); font-size:16px; line-height:1.6;
  -webkit-font-smoothing:antialiased; overflow-x:hidden;
}
a{color:inherit;text-decoration:none}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:4px}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* ---------- type scale ----------
   Display and H2 are SENTENCE CASE with deep negative tracking.
   Uppercase is kept only for eyebrows, buttons, card titles and the wordmark. */
h1,h2,h3,.display{font-family:var(--f-display);line-height:1.08;letter-spacing:-.025em}
h1,.h1{font-size:clamp(33px,6vw,60px);font-weight:700}
h2,.h2{font-size:clamp(24px,3.6vw,34px);font-weight:700}
h3,.h3{font-size:17px;font-weight:600;letter-spacing:-.01em}
.lede{font-size:clamp(16px,2.1vw,19px);color:var(--dim);line-height:1.62;max-width:62ch}
.lede b,.lede strong{color:var(--txt);font-weight:500}
.eyebrow{
  font-family:var(--f-mono);font-size:10.5px;letter-spacing:2px;
  text-transform:uppercase;color:var(--accent);
}
.meta,.mono{font-family:var(--f-mono);font-size:11px;color:var(--faint);letter-spacing:.4px}

/* ---------- layout ---------- */
.wrap{max-width:var(--wrap);margin:0 auto;padding:0 var(--s5)}
@media(max-width:600px){.wrap{padding:0 var(--s4)}}
section{padding:var(--s8) 0}
.shead{display:flex;align-items:baseline;justify-content:space-between;gap:var(--s5);
  margin-bottom:var(--s5);flex-wrap:wrap}
.shead p{color:var(--dim);font-size:14.5px;max-width:54ch}

/* ---------- molecular field ----------
   The brand's one piece of ambience. Canvas is drawn by field.js;
   the veil fades it toward the edges so text never fights it. */
#field{position:fixed;inset:0;z-index:0;pointer-events:none}
.veil{position:fixed;inset:0;z-index:1;pointer-events:none;
  background:radial-gradient(ellipse 1200px 760px at 50% 12%,
    transparent 0%, rgba(0,0,0,.52) 58%, rgba(0,0,0,.94) 100%)}
/* Everything a page puts in the body sits above the field. No opt-in list, so a
   new page cannot forget to ask and get faded out by the veil.
   (!) SPECIFICITY MATTERS. This must stay `body > *` -- (0,0,1). The first version
   was `body > *:not(#field):not(.veil)`, and because :not() takes the specificity
   of its argument, the #field inside made the whole selector ID-weight. That beat
   `.hdr{position:sticky}` and silently un-stuck every sticky header on the site.
   At (0,0,1) the #field (ID) and .veil (class) rules above still win, and so does
   any component that sets its own position. */
body > *{position:relative;z-index:2}

/* ---------- header ---------- */
.hdr{position:sticky;top:0;z-index:60;background:rgba(0,0,0,.78);
  backdrop-filter:blur(18px) saturate(1.35);border-bottom:1px solid var(--rule)}
.hdr .wrap{display:flex;align-items:center;gap:var(--s3);height:58px}
/* ---------- THE MARK ----------
   Three diagonal slash bars at 35 degrees, stepping in opacity .42 / .70 / 1.0
   left to right. The step replaces the retired gradient and reads as a
   measurement scale rather than decoration.
   Solid --txt on dark. TEAL ONLY ON HOVER -- a permanently teal mark was on
   9 pages and contradicted both the spec and the other 15. Never recolour it,
   never add a shadow, glow or outline, minimum 24px lockup height. */
.mark,.mark:link,.mark:visited{display:flex;align-items:center;gap:11px;
  text-decoration:none;color:var(--txt);white-space:nowrap}
.slashes{display:flex;gap:3px}
.slashes b,.slashes i{display:block;width:3px;height:17px;background:var(--txt);
  transform:skewX(-35deg);transition:background .4s var(--ease)}
.slashes b:nth-child(1),.slashes i:nth-child(1){opacity:.42}
.slashes b:nth-child(2),.slashes i:nth-child(2){opacity:.70}
.mark:hover .slashes b,.mark:hover .slashes i{background:var(--accent)}
.mark .wm,.mark b{font-family:var(--f-display);font-weight:700;font-size:15px;
  letter-spacing:2.4px;text-transform:uppercase;color:var(--txt)}
.mark .mark-sub{font-family:var(--f-mono);font-size:8px;letter-spacing:2px;
  color:var(--faint);display:block;margin-top:2px}
/* (!) NAMESPACED 21 Aug. This was `.sub`, which collided with a completely
   unrelated `.sub` used for hero paragraphs on the marketing pages -- stripping
   the logo rule silently unstyled the homepage lede. Two components, one name. */
.hdr nav{margin-left:auto;display:flex;gap:22px;font-size:13.5px;color:var(--dim)}
.hdr nav a:hover{color:var(--txt)}
@media(max-width:760px){.hdr nav a:not(.btn){display:none}}
.skip{position:absolute;left:-9999px;top:0;z-index:200;background:var(--accent);
  color:var(--accent-ink);padding:11px 18px;border-radius:0 0 8px 0;font-weight:600}
.skip:focus{left:0}

/* ---------- buttons ----------
   Pill since 9 Sep 2026 (the elevation pass): radius, a firmer padding, and a
   teal glow that appears on hover only -- the accent stays quiet at rest. */
.btn{display:inline-block;background:var(--accent);color:var(--accent-ink);
  font-weight:600;font-size:13px;padding:11px 20px;border-radius:var(--r-pill);
  letter-spacing:.01em;border:0;cursor:pointer;font-family:inherit;
  transition:filter .15s,box-shadow .25s var(--ease),transform .25s var(--ease)}
.btn:hover{filter:brightness(1.08);box-shadow:var(--glow);transform:translateY(-1px)}
.btn:active{transform:translateY(0)}
.btn-ghost{background:none;color:var(--dim);border:1px solid var(--rule-hi)}
.btn-ghost:hover{color:var(--txt);border-color:var(--faint);filter:none;box-shadow:none}

/* ---------- cards ---------- */
.card{background:var(--surface);border:1px solid var(--rule);border-radius:var(--r);
  padding:var(--s5);transition:border-color .16s,background .16s,
  transform .25s var(--ease),box-shadow .25s var(--ease);display:block;
  box-shadow:var(--edge)}
.card:hover{border-color:rgba(76,111,255,.32);background:var(--surface-2);
  transform:translateY(-2px);box-shadow:var(--edge),var(--lift)}
.card h3{margin-bottom:6px}
.card p{font-size:13.5px;color:var(--dim);line-height:1.55}
.card .arrow{color:var(--accent);font-size:13px;margin-top:var(--s3);display:block;
  font-family:var(--f-mono)}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:var(--s3)}

.vd{display:inline-flex;align-items:flex-start;gap:7px;font-size:12px;font-weight:500;
  padding:6px 10px;border-radius:6px;line-height:1.3;max-width:100%}
.vd i{width:7px;height:7px;border-radius:var(--r-pill);flex:0 0 auto;margin-top:4px}
.vd.yes{background:rgba(76,111,255,.13);border:1px solid rgba(76,111,255,.4);color:var(--yes-t)}
.vd.yes i{background:var(--yes)}
.vd.dep{background:rgba(107,132,232,.12);border:1px solid rgba(107,132,232,.36);color:var(--dep-t)}
.vd.dep i{background:var(--dep)}
.vd.no{background:rgba(192,138,30,.13);border:1px solid rgba(192,138,30,.42);color:var(--no-t)}
.vd.no i{background:var(--no)}
.vd.watch{background:rgba(154,163,174,.1);border:1px solid var(--rule-hi);color:var(--dim)}
.vd.watch i{background:var(--faint)}

/* ---------- regulatory badge ---------- */
.rx{font-family:var(--f-mono);font-size:9.5px;letter-spacing:.6px;text-transform:uppercase;
  border:1px solid var(--rule-hi);color:var(--faint);padding:3px 6px;border-radius:4px;
  white-space:nowrap}
.rx.cd,.rx.pom,.rx.pmix,.rx.cdnl,.rx.cdvet,.rx.cdvetnl{border-color:rgba(192,138,30,.5);color:var(--no-t)}
/* Added 2026-08-22. `nolic` and `p` were the only two rx states with no rule,
   so both fell back to the neutral base and read as "no status" -- the exact
   ambiguity the 15 Aug badge correction existed to remove. `nolic` is NOT a UK
   prescription medicine, so it must not borrow the amber; it gets a stated
   neutral instead. `p` (pharmacy medicine) is a real but lesser restriction
   than POM, so it gets the amber at reduced weight. */
.rx.nolic{border-color:var(--rule-hi);color:var(--dim)}
/* Added 2026-09-13 with the `unlic` state (Enclomiphene: approved nowhere,
   UK supply only as an unlicensed special). Not a UK prescription medicine, so
   it takes the same stated neutral as nolic rather than the amber. */
.rx.unlic{border-color:var(--rule-hi);color:var(--dim)}
/* The badge must be allowed to wrap on a phone. Added 22 Aug 2026: the off-label
   field made these strings long -- "UK: prescription only / licensed for
   drug-induced methaemoglobinaemia only" is 482px at nowrap -- and a single badge
   dragged the whole compound index to 508px in a 360px viewport. Four gates
   passed it; check_render.py caught it. Wrapping is right for a badge that now
   carries a sentence rather than two words. */
/* 22 Aug 2026, second pass: the wrap is now UNCONDITIONAL, not mobile-only.
   Batch 2 of the catalogue sweep gave four rows an `ol` note, and the longest
   composed badge -- "UK: prescription only in some forms - licensed for
   erectile dysfunction and prostate symptoms only" -- measures 631px at
   nowrap. The longest badge ever shipped is 190px.

   The mobile-only rule was safe for 360px and safe below 900px (the row is a
   single-column card there), but between 901px and 1140px the row is still a
   four-column grid whose name column is ~291px wide. A 631px nowrap badge
   spills out of it, and minmax(0,1fr) will not stop it. That window was never
   tested, because check_render.py cannot run on this machine.

   A badge that carries a sentence should wrap at every width. Making it
   conditional was the bug; the breakpoint was only ever hiding it. */
/* 28 Aug 2026: the 22 Aug wrap fix left the badge `display:inline`, so a badge
   that wrapped had its border broken into one box per line. Live on the library
   home the moment Semaglutide entered the recent row: "UK: PRESCRIPTION" in one
   box and "ONLY" in another beneath it. inline-block keeps the wrap and keeps
   the border around the whole badge. */
.rx{white-space:normal;line-height:1.45;display:inline-block}
.rx.p{border-color:rgba(192,138,30,.32);color:var(--no-t)}
/* WADA badge. Deliberately NOT the amber of the prescription badges: a doping
   ban is a different kind of fact from a legal supply restriction, and a reader
   scanning a row should be able to tell them apart without reading. Added
   22 Aug 2026 with the first five verified statuses. */
.rx.wada{border-color:rgba(178,58,72,.55);color:var(--no-t)}

/* ---------- the six marks ----------
   RENAMED .sig -> .sigmini on 22 Aug 2026. `.sig` collided with the Signature
   panel that every compound page defines inline. Because the page rule set no
   `display`, this grid won, every Signature laid its six rows out side by side,
   and all fourteen library pages overflowed ~1200px horizontally. Nothing in the
   HTML or the gates could see it; it took rendering the page.
   Class names in this stylesheet are global. Namespace anything generic. */
.sigmini{display:grid;grid-template-columns:repeat(6,1fr);gap:var(--sigmini-gap,11px)}
/* The gap is a token, 2026-08-22. The compound index needs a tighter gap at
   its middle breakpoint; expressing that as `.sigmini{gap:9px}` on the page
   re-created the .sig collision exactly -- a page rule setting one property
   while this rule's display and grid-template-columns leak in behind it.
   check_design.py caught it. A variable lets a page tune the gap without ever
   declaring the class, so there is nothing to collide with. */
.ax{display:flex;flex-direction:column;gap:5px}
.ax .k{font-family:var(--f-mono);font-size:9px;letter-spacing:.8px;color:var(--faint)}
.bars{display:flex;gap:2px}
.bars u{flex:1;height:6px;border-radius:2px;background:var(--rule-hi)}
.bars u.on{background:var(--accent)}
/* A NOT-SCORED axis. Added 22 Aug 2026 with the Reversibility finding.
   It must not look like a score of zero, because "we did not score this" and
   "this scores worst" are different statements and the reader will act on them
   differently. An unfilled track is the zero; a hatched track is the absence. */
/* Written pages build their bars from <i>, the index from <u>, and each written
   page restyles `.bars i` in its own <style> block. `.bars.na i` (0,2,1) outranks
   a page's `.bars i` (0,1,1) whatever the source order, so the not-scored track
   survives the cascade without touching nineteen pages. */
/* the compare tool's own bar element */
.bars2.na i{background:transparent;
  background-image:repeating-linear-gradient(-45deg,var(--rule-hi) 0 1px,transparent 1px 3px);
  border:1px solid var(--rule-hi);opacity:.75}
.bars.na i{background:transparent;
  background-image:repeating-linear-gradient(-45deg,var(--rule-hi) 0 1px,transparent 1px 3px);
  border:1px solid var(--rule-hi);opacity:.75}
.bars.na u{background:transparent;
  background-image:repeating-linear-gradient(-45deg,var(--rule-hi) 0 1px,transparent 1px 3px);
  border:1px solid var(--rule-hi);opacity:.75}
@media(max-width:600px){.sigmini{grid-template-columns:repeat(3,1fr);gap:10px 14px}}

/* ---------- chips / filters ---------- */
.chip{flex:0 0 auto;background:var(--surface);border:1px solid var(--rule-hi);
  border-radius:var(--r-pill);padding:7px 14px;font-size:13px;color:var(--dim);
  cursor:pointer;white-space:nowrap;transition:.15s;font-family:inherit}
.chip:hover{color:var(--txt);border-color:var(--faint)}
.chip.on{background:var(--txt);border-color:var(--txt);color:var(--bg);font-weight:600}
.chip .ct{font-family:var(--f-mono);font-size:10.5px;opacity:.55;margin-left:6px}

/* ---------- panels ---------- */
.panel{border:1px solid var(--rule-hi);border-radius:var(--r);background:var(--surface);
  padding:var(--s5);box-shadow:var(--edge)}
.callout{border-left:2px solid var(--accent);padding:2px 0 2px var(--s4);color:var(--dim);
  font-size:14.5px;line-height:1.62;max-width:70ch}
.callout b{color:var(--txt);font-weight:500}

/* ---------- footer ---------- */
footer{border-top:1px solid var(--rule);padding:var(--s7) 0 var(--s8);
  color:var(--faint);font-size:12.5px;line-height:1.7}
footer b{color:var(--dim);font-weight:500}
.flinks{display:flex;gap:20px;flex-wrap:wrap;font-family:var(--f-mono);font-size:11px;
  letter-spacing:.8px;text-transform:uppercase}
.flinks a:hover{color:var(--txt)}

/* .ldk not .lk: check_design flagged .lk colliding with an existing class on
   brand/, privacy/ and terms/. The rule here is scoped to .ledger so it would
   probably not have bitten, but "probably" is what the .sig collision also had
   going for it. Renamed rather than exempted. */
.ledger{border-top:1px solid var(--rule);border-bottom:1px solid var(--rule);margin:26px 0 30px}
.ledger .lrow{display:flex;gap:16px;align-items:flex-start;padding:14px 0;border-bottom:1px solid var(--rule)}
.ledger .lrow:last-child{border-bottom:none}
.ledger .ldk{font-family:var(--jb);font-size:9px;letter-spacing:2.2px;text-transform:uppercase;
  color:var(--faint);flex:0 0 104px;padding-top:3px;display:block}
.ledger .lrow p{margin:0;font-size:14px;line-height:1.62;color:var(--dim)}
.ledger .lrow b{color:var(--txt)}
.ledger .lfor .ldk{color:var(--yes)}
.ledger .lagainst .ldk{color:var(--no)}
.ledger .lopen .ldk{color:var(--dep)}
@media(max-width:560px){
  .ledger .lrow{flex-direction:column;gap:6px}
  .ledger .ldk{flex:none;padding-top:0}
}

/* --- The elevation utilities ----------------------------------------------
   Added 9 Sep 2026 for the design elevation pass (references: the sci-wiki's
   glow-on-black and Formula Coaching's radial hero washes; Ben, 9 Sep).
   Three opt-in classes a page places in its own markup. Defined AFTER the
   `body > *` z-rule on purpose: .halo and .ghostwm must be able to sit at
   z-index 1, above the molecular field and below the content, and at equal
   specificity (0,0,1) the later rule wins.

   One accent, still: every glow here is the teal or the body white at low
   alpha. Nothing introduces a second colour. */

/* Radial glow wash behind a hero. Full-width and clipped so nothing here can
   ever widen the document -- the render gate fails on horizontal overflow. */
.halo{position:absolute;top:-140px;left:0;width:100%;height:840px;z-index:1;
  pointer-events:none;
  background:radial-gradient(46% 40% at 50% 32%,rgba(76,111,255,.07),transparent 70%)}

/* Ghost watermark word behind a hero. Decorative, aria-hidden always.
   Full-width with overflow:hidden: the glyphs crop at the viewport edge (the
   reference look) instead of widening the page. */
.ghostwm{position:absolute;top:70px;left:0;width:100%;text-align:center;
  overflow:hidden;z-index:1;
  pointer-events:none;user-select:none;font-family:var(--f-display);font-weight:700;
  font-size:clamp(110px,21vw,300px);letter-spacing:-.04em;line-height:1;
  color:rgba(233,235,237,.022);white-space:nowrap}

/* Display-type glow for the one biggest heading on a hero. Subtle: the teal
   halo reads as light on the lens, not as a colour change. */
.heroglow{text-shadow:0 0 18px rgba(233,235,237,.07),0 0 64px rgba(76,111,255,.16)}

/* Oversized stat numeral, sci-wiki register: the number IS the design. */
.statxl{font-family:var(--f-display);font-weight:700;font-size:clamp(34px,4.6vw,54px);
  letter-spacing:-.03em;line-height:1;font-variant-numeric:tabular-nums}
