/* ==========================================================================
   PEPWELL DESIGN SYSTEM — 02 SYSTEM
   Reset, primitives, components. Depends on tokens.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   RESET
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--pw-font-sans);
  font-size: var(--pw-t-sm);
  line-height: var(--pw-leading-body);
  letter-spacing: var(--pw-track-body);
  color: var(--pw-ink-2);
  background: var(--pw-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1, "cv05" 1;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--pw-signal); outline-offset: 2px; border-radius: var(--pw-r-xs); }

/* --------------------------------------------------------------------------
   GROUND — the graph rule. Two frequencies: fine cells, heavy majors.
   Masked so it fades rather than tiling to the horizon.
   -------------------------------------------------------------------------- */
.pw-ground { position: relative; }
.pw-ground::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(to right,  var(--pw-graph-c2) 1px, transparent 1px),
    linear-gradient(to bottom, var(--pw-graph-c2) 1px, transparent 1px),
    linear-gradient(to right,  var(--pw-graph-c1) 1px, transparent 1px),
    linear-gradient(to bottom, var(--pw-graph-c1) 1px, transparent 1px);
  background-size:
    var(--pw-graph-lg) var(--pw-graph-lg),
    var(--pw-graph-lg) var(--pw-graph-lg),
    var(--pw-graph-sm) var(--pw-graph-sm),
    var(--pw-graph-sm) var(--pw-graph-sm);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 20%, transparent 78%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 20%, transparent 78%);
}
.pw-ground > * { position: relative; z-index: 1; }

/* Reactive lattice canvas. When present it supersedes the CSS graph rule —
   the static rule stays as the no-JS / reduced-motion / touch fallback. */
.pw-lattice { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 120% 100% at 50% 40%, #000 45%, transparent 92%);
          mask-image: radial-gradient(ellipse 120% 100% at 50% 40%, #000 45%, transparent 92%); }
.pw-ground:has(.pw-lattice)::before { display: none; }

/* --------------------------------------------------------------------------
   LAYOUT
   -------------------------------------------------------------------------- */
.pw-shell { width: 100%; max-width: var(--pw-max); margin-inline: auto; padding-inline: var(--pw-gutter); }
.pw-prose { max-width: var(--pw-max-text); }
.pw-section { padding-block: var(--pw-s11); }
.pw-section--tight { padding-block: var(--pw-s9); }
/* Optical, not scalar. A dense data section and a two-line closing statement
   need different air around them even though both are "a section". */
.pw-section--major { padding-block: var(--pw-s12) var(--pw-s11); }
.pw-rule { height: 1px; background: var(--pw-line); border: 0; }

/* --------------------------------------------------------------------------
   TYPOGRAPHY
   -------------------------------------------------------------------------- */
.pw-display {
  font-size: var(--pw-t-display); font-weight: var(--pw-w-bold);
  line-height: var(--pw-leading-tight); letter-spacing: var(--pw-track-display);
  color: var(--pw-ink); text-wrap: balance;
}
.pw-h1 { font-size: var(--pw-t-h1); font-weight: var(--pw-w-bold); line-height: var(--pw-leading-head); letter-spacing: var(--pw-track-head); color: var(--pw-ink); text-wrap: balance; }
.pw-h2 { font-size: var(--pw-t-h2); font-weight: var(--pw-w-semi); line-height: var(--pw-leading-head); letter-spacing: var(--pw-track-head); color: var(--pw-ink); text-wrap: balance; }
.pw-h3 { font-size: var(--pw-t-h3); font-weight: var(--pw-w-semi); line-height: 1.3; letter-spacing: -0.014em; color: var(--pw-ink); }
.pw-h4 { font-size: var(--pw-t-h4); font-weight: var(--pw-w-semi); line-height: 1.4; letter-spacing: -0.01em; color: var(--pw-ink); }

.pw-lead { font-size: var(--pw-t-body); line-height: 1.55; color: var(--pw-ink-3); text-wrap: pretty; }
.pw-body { font-size: var(--pw-t-body); line-height: var(--pw-leading-body); color: var(--pw-ink-2); }
.pw-small { font-size: var(--pw-t-xs); line-height: 1.55; color: var(--pw-ink-3); }

/* Journal italic — reserved for statements of uncertainty. Used sparingly,
   it becomes the voice of the product's intellectual honesty. */
.pw-journal {
  font-family: var(--pw-font-serif);
  font-style: italic; font-weight: 400;
  font-size: 1.1875rem; line-height: 1.5;
  letter-spacing: -0.01em; color: var(--pw-ink-2);
}

/* Mono eyebrow — the instrument label. */
.pw-eyebrow {
  font-family: var(--pw-font-mono);
  font-size: var(--pw-t-micro); font-weight: var(--pw-w-med);
  letter-spacing: var(--pw-track-micro); text-transform: uppercase;
  color: var(--pw-ink-3);
}
.pw-eyebrow--signal { color: var(--pw-signal); }
.pw-eyebrow--rule { display: flex; align-items: center; gap: var(--pw-s3); }
.pw-eyebrow--rule::after { content: ""; height: 1px; flex: 1; background: var(--pw-line); }

.pw-mono { font-family: var(--pw-font-mono); font-variant-numeric: tabular-nums; }
.pw-num  { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* --------------------------------------------------------------------------
   EVIDENCE TIER — the signature primitive.
   Confidence = ink density. A is solid; E is a dashed void.
   -------------------------------------------------------------------------- */
.pw-tier {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding-inline: 7px;
  font-family: var(--pw-font-mono); font-size: var(--pw-t-micro); font-weight: var(--pw-w-semi);
  letter-spacing: 0.06em; line-height: 1;
  border-radius: var(--pw-r-xs); border: 1px solid transparent;
  flex-shrink: 0; user-select: none;
}
.pw-tier[data-tier="A"] { background: var(--pw-tier-a-bg); color: var(--pw-tier-a-fg); border-color: var(--pw-tier-a-bd); }
.pw-tier[data-tier="B"] { background: var(--pw-tier-b-bg); color: var(--pw-tier-b-fg); border-color: var(--pw-tier-b-bd); }
.pw-tier[data-tier="C"] { background: var(--pw-tier-c-bg); color: var(--pw-tier-c-fg); border-color: var(--pw-tier-c-bd); }
.pw-tier[data-tier="D"] { background: var(--pw-tier-d-bg); color: var(--pw-tier-d-fg); border-color: var(--pw-tier-d-bd); }
/* E is dashed and empty on purpose — there is nothing solid to stand on. */
.pw-tier[data-tier="E"] { background: var(--pw-tier-e-bg); color: var(--pw-tier-e-fg); border-color: var(--pw-tier-e-bd); border-style: dashed; }

/* Tier + label lockup */
.pw-tier-lockup { display: inline-flex; align-items: center; gap: var(--pw-s2); }
.pw-tier-lockup .pw-tier-label {
  font-size: var(--pw-t-xs); font-weight: var(--pw-w-med); color: var(--pw-ink-3); letter-spacing: -0.004em;
}

/* Tier meter — 5 segments, filled to the tier's position. Reads at a glance
   without numbers, and degrades honestly: E shows one hollow segment. */
.pw-meter { display: inline-flex; gap: 3px; align-items: center; }
.pw-meter i {
  display: block; width: 15px; height: 5px; border-radius: 1.5px;
  background: var(--pw-sunken-2); border: 1px solid transparent;
}
.pw-meter[data-tier="A"] i:nth-child(-n+5) { background: var(--pw-tier-a-bg); }
.pw-meter[data-tier="B"] i:nth-child(-n+4) { background: var(--pw-tier-b-bg); }
.pw-meter[data-tier="C"] i:nth-child(-n+3) { background: #939EEE; }
.pw-meter[data-tier="D"] i:nth-child(-n+2) { background: var(--pw-tier-d-bd); }
.pw-meter[data-tier="E"] i:nth-child(-n+1) { background: transparent; border-color: var(--pw-tier-e-bd); border-style: dashed; }

/* --------------------------------------------------------------------------
   BUTTONS
   -------------------------------------------------------------------------- */
.pw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--pw-s2);
  height: 40px; padding-inline: var(--pw-s5);
  font-size: var(--pw-t-sm); font-weight: var(--pw-w-semi); letter-spacing: -0.008em;
  border-radius: var(--pw-r-sm); border: 1px solid transparent;
  white-space: nowrap; cursor: pointer;
  transition: background var(--pw-dur-2) var(--pw-ease),
              border-color var(--pw-dur-2) var(--pw-ease),
              box-shadow var(--pw-dur-2) var(--pw-ease),
              transform var(--pw-dur-1) var(--pw-ease);
}
.pw-btn:active { transform: translateY(0.5px); }
.pw-btn svg { width: 15px; height: 15px; }

.pw-btn--primary { background: var(--pw-signal); color: #fff; box-shadow: var(--pw-e1); }
.pw-btn--primary:hover { background: var(--pw-signal-h); box-shadow: var(--pw-e2); }
.pw-btn--primary:active { background: var(--pw-signal-a); }

.pw-btn--secondary { background: var(--pw-surface); color: var(--pw-ink); border-color: var(--pw-line-2); box-shadow: var(--pw-e1); }
.pw-btn--secondary:hover { border-color: var(--pw-line-3); background: var(--pw-paper); }

.pw-btn--ghost { background: transparent; color: var(--pw-ink-2); }
.pw-btn--ghost:hover { background: var(--pw-sunken); color: var(--pw-ink); }

.pw-btn--lg { height: 46px; padding-inline: var(--pw-s6); font-size: var(--pw-t-body); }
.pw-btn--sm { height: 32px; padding-inline: var(--pw-s4); font-size: var(--pw-t-xs); }

/* Link with an underline that draws in from the left on hover. */
.pw-link {
  color: var(--pw-signal); font-weight: var(--pw-w-med);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size var(--pw-dur-3) var(--pw-ease-out);
  padding-bottom: 1px;
}
.pw-link:hover { background-size: 100% 1px; }

/* --------------------------------------------------------------------------
   BADGES / PILLS
   -------------------------------------------------------------------------- */
.pw-badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding-inline: 8px;
  font-family: var(--pw-font-mono); font-size: var(--pw-t-micro); font-weight: var(--pw-w-med);
  letter-spacing: 0.07em; text-transform: uppercase;
  border-radius: var(--pw-r-xs); border: 1px solid;
  background: var(--pw-sunken); color: var(--pw-ink-3); border-color: var(--pw-line);
}
.pw-badge--signal { background: var(--pw-signal-t1); color: var(--pw-signal-ink); border-color: var(--pw-signal-t2); }
.pw-badge--moss   { background: var(--pw-moss-t1);   color: var(--pw-moss-ink);   border-color: var(--pw-moss-t2); }
.pw-badge--sand   { background: var(--pw-sand-t1);   color: var(--pw-sand-ink);   border-color: var(--pw-sand-t2); }
.pw-badge--burnt  { background: var(--pw-burnt-t1);  color: var(--pw-burnt-ink);  border-color: var(--pw-burnt-t2); }
.pw-badge__dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   CARDS
   -------------------------------------------------------------------------- */
.pw-card {
  background: var(--pw-surface);
  border: var(--pw-hairline) solid var(--pw-line);
  border-radius: var(--pw-r-lg);
  padding: var(--pw-s6);
  transition: border-color var(--pw-dur-2) var(--pw-ease), box-shadow var(--pw-dur-2) var(--pw-ease), transform var(--pw-dur-2) var(--pw-ease);
}
.pw-card--interactive { cursor: pointer; }
.pw-card--interactive:hover { border-color: var(--pw-line-2); box-shadow: var(--pw-e2); transform: translateY(-2px); }
.pw-card--flush { padding: 0; overflow: hidden; }
.pw-card__head { padding: var(--pw-s5) var(--pw-s6); border-bottom: var(--pw-hairline) solid var(--pw-line); display: flex; align-items: center; gap: var(--pw-s3); }
.pw-card__body { padding: var(--pw-s6); }
.pw-card__foot { padding: var(--pw-s4) var(--pw-s6); border-top: var(--pw-hairline) solid var(--pw-line); background: var(--pw-paper); }

/* Compound card: a peptide entry. The product's atomic unit. */
.pw-entry { display: flex; flex-direction: column; gap: var(--pw-s4); }
.pw-entry__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--pw-s4); }
.pw-entry__name { font-size: var(--pw-t-h3); font-weight: var(--pw-w-semi); letter-spacing: -0.016em; color: var(--pw-ink); line-height: 1.2; }
.pw-entry__alias { font-family: var(--pw-font-mono); font-size: var(--pw-t-micro); letter-spacing: 0.06em; color: var(--pw-ink-4); text-transform: uppercase; margin-top: 4px; }
.pw-entry__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pw-s2) var(--pw-s4); padding-top: var(--pw-s4); border-top: var(--pw-hairline) solid var(--pw-line); }
.pw-entry__stat { display: flex; align-items: baseline; gap: 6px; font-size: var(--pw-t-xs); color: var(--pw-ink-3); }
.pw-entry__stat b { font-family: var(--pw-font-mono); font-weight: var(--pw-w-semi); color: var(--pw-ink); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   DATA TABLE — instrument-grade. Hairlines, tabular numerals, no zebra.
   -------------------------------------------------------------------------- */
.pw-table { width: 100%; border-collapse: collapse; font-size: var(--pw-t-xs); }
.pw-table th {
  text-align: left; font-family: var(--pw-font-mono); font-size: var(--pw-t-micro); font-weight: var(--pw-w-med);
  letter-spacing: var(--pw-track-micro); text-transform: uppercase; color: var(--pw-ink-3);
  padding: var(--pw-s3) var(--pw-s4); border-bottom: var(--pw-hairline) solid var(--pw-line-2); white-space: nowrap;
}
.pw-table td { padding: var(--pw-s4); border-bottom: var(--pw-hairline) solid var(--pw-line); color: var(--pw-ink-2); vertical-align: middle; }
.pw-table tbody tr { transition: background var(--pw-dur-1) var(--pw-ease); }
.pw-table tbody tr:hover { background: var(--pw-paper); }
.pw-table tbody tr:last-child td { border-bottom: 0; }
.pw-table .num { font-family: var(--pw-font-mono); font-variant-numeric: tabular-nums; text-align: right; color: var(--pw-ink); }
.pw-table .strong { font-weight: var(--pw-w-semi); color: var(--pw-ink); }

/* --------------------------------------------------------------------------
   NOTE — the honesty statements.

   Deliberately NOT a tinted alert box with a left rule and a round icon.
   That pattern ships in every UI kit on earth and reads as generic the
   instant you see it. It also triple-signals: tinted fill AND colored
   border AND colored icon, all saying one thing.

   Instead: a filed record. Flat paper, a mono classification label set in
   the margin like a case file, and one hairline of color at the top edge.
   Colour appears exactly once, in the label — everything else stays ink.
   -------------------------------------------------------------------------- */
.pw-note {
  display: grid; grid-template-columns: 108px 1fr; gap: var(--pw-s6);
  padding: var(--pw-s5) var(--pw-s6);
  background: var(--pw-surface);
  border: var(--pw-hairline) solid var(--pw-line);
  border-top: 2px solid var(--pw-ink-3);
  border-radius: 0 0 var(--pw-r-sm) var(--pw-r-sm);
}
.pw-note__tag {
  font-family: var(--pw-font-mono); font-size: var(--pw-t-micro); font-weight: var(--pw-w-med);
  letter-spacing: var(--pw-track-micro); text-transform: uppercase;
  color: var(--pw-ink-3); line-height: 1.5; padding-top: 1px;
}
/* Hanging index number — the filed-record cue. */
.pw-note__tag b { display: block; font-weight: var(--pw-w-med); color: var(--pw-ink-4); margin-bottom: 2px; }
.pw-note__title { font-weight: var(--pw-w-semi); color: var(--pw-ink); font-size: var(--pw-t-sm); margin-bottom: 4px; letter-spacing: -0.008em; }
.pw-note__text { font-size: var(--pw-t-xs); color: var(--pw-ink-3); line-height: 1.6; max-width: 68ch; }

.pw-note--signal { border-top-color: var(--pw-signal); }
.pw-note--signal .pw-note__tag { color: var(--pw-signal); }
.pw-note--burnt  { border-top-color: var(--pw-burnt); }
.pw-note--burnt  .pw-note__tag { color: var(--pw-burnt); }
.pw-note--sand   { border-top-color: var(--pw-sand); }
.pw-note--sand   .pw-note__tag { color: var(--pw-sand-ink); }

@media (max-width: 620px) {
  .pw-note { grid-template-columns: 1fr; gap: var(--pw-s3); }
}

/* --------------------------------------------------------------------------
   SOURCE CITATION — every claim carries its receipt.
   -------------------------------------------------------------------------- */
.pw-cite {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--pw-font-mono); font-size: var(--pw-t-micro);
  letter-spacing: 0.04em; color: var(--pw-ink-3);
  border-bottom: 1px dotted var(--pw-line-3); padding-bottom: 1px;
  transition: color var(--pw-dur-2) var(--pw-ease), border-color var(--pw-dur-2) var(--pw-ease);
}
.pw-cite:hover { color: var(--pw-signal); border-bottom-color: var(--pw-signal); }
.pw-cite svg { width: 11px; height: 11px; opacity: .6; }

/* Last-reviewed stamp — the trust artifact. */
.pw-stamp {
  display: inline-flex; align-items: center; gap: var(--pw-s2);
  font-family: var(--pw-font-mono); font-size: var(--pw-t-micro);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--pw-ink-3);
}
.pw-stamp__tick { width: 13px; height: 13px; color: var(--pw-moss); flex-shrink: 0; }

/* --------------------------------------------------------------------------
   INPUTS
   -------------------------------------------------------------------------- */
.pw-field { display: flex; flex-direction: column; gap: 6px; }
.pw-label { font-size: var(--pw-t-xs); font-weight: var(--pw-w-semi); color: var(--pw-ink); letter-spacing: -0.004em; }
.pw-input {
  height: 40px; padding-inline: var(--pw-s4);
  /* A form control's edge is functional, not decorative: it stays a full 1px
     (never thinned to .5 on retina) and uses a darker alpha than the
     hairlines, so the field is unambiguously a field. */
  background: var(--pw-surface); border: 1px solid var(--pw-line-input);
  border-radius: var(--pw-r-sm); font-size: var(--pw-t-sm); color: var(--pw-ink);
  transition: border-color var(--pw-dur-2) var(--pw-ease), box-shadow var(--pw-dur-2) var(--pw-ease);
  width: 100%;
}
.pw-input::placeholder { color: var(--pw-ink-4); }
.pw-input:hover { border-color: var(--pw-line-3); }
.pw-input:focus { outline: none; border-color: var(--pw-signal); box-shadow: var(--pw-e-focus); }

/* Inline capture: input + button share one bordered shell (Ramp-style). */
.pw-capture {
  display: flex; align-items: center; gap: var(--pw-s2);
  background: var(--pw-surface); border: var(--pw-hairline) solid var(--pw-line-2);
  border-radius: var(--pw-r-md); padding: 5px 5px 5px var(--pw-s4);
  box-shadow: var(--pw-e1); max-width: 460px;
  transition: border-color var(--pw-dur-2) var(--pw-ease), box-shadow var(--pw-dur-2) var(--pw-ease);
}
.pw-capture:focus-within { border-color: var(--pw-signal); box-shadow: var(--pw-e-focus); }
.pw-capture input { flex: 1; min-width: 0; height: 38px; border: none; outline: none; background: none; font-size: var(--pw-t-sm); color: var(--pw-ink); }
.pw-capture input::placeholder { color: var(--pw-ink-4); }

/* Touch: 40px controls sit under the 44px minimum tap target. On coarse
   pointers the capture stacks and both halves grow to a comfortable size —
   a cramped signup button is a conversion bug, not just a nicety. */
@media (pointer: coarse), (max-width: 560px) {
  .pw-capture { flex-direction: column; align-items: stretch; gap: var(--pw-s2); padding: var(--pw-s2); }
  .pw-capture input.pw-capture-input,
  .pw-capture input { min-height: 46px; height: 46px; padding-inline: var(--pw-s3); font-size: 1rem; flex: 0 0 auto; }
  .pw-capture .pw-btn { min-height: 46px; height: 46px; width: 100%; }
}

/* Signup feedback. Sits under the capture; empty until it has something to
   say, so it never reserves dead space. */
.pw-signup-status {
  font-family: var(--pw-font-mono); font-size: var(--pw-t-micro);
  letter-spacing: 0.06em; line-height: 1.5; margin-top: var(--pw-s3);
  min-height: 1em;
}
.pw-signup-status:empty { margin-top: 0; min-height: 0; }
.pw-signup-status[data-kind="ok"]    { color: var(--pw-moss); }
.pw-signup-status[data-kind="error"] { color: var(--pw-burnt); }
/* On the dark block the base colours don't have contrast. */
.news .pw-signup-status[data-kind="ok"]    { color: #7FD8A6; }
.news .pw-signup-status[data-kind="error"] { color: #FFA87A; }

/* Search field with leading glyph */
.pw-search { position: relative; }
.pw-search .pw-input { padding-left: 38px; }
.pw-search__icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--pw-ink-4); pointer-events: none; }

/* --------------------------------------------------------------------------
   REGISTER FILTER
   A filter, not a search: everything is already on the page. Injected by
   filter.js so the register works without JavaScript.
   -------------------------------------------------------------------------- */
/* The filter is table furniture, not a standalone card. It sits directly on
   the register's top rule so the two read as one object — the earlier version
   floated as a third bordered box between the legend and the rows, which is
   what made the whole block look like stacked components rather than a page. */
.reg-filter {
  display: flex; align-items: center; gap: var(--pw-s4); flex-wrap: wrap;
  /* The legend disclosure sits directly above this and is injected at
     runtime, so nothing else creates the gap — without the top padding the
     filter crowds "New here?". */
  padding-top: var(--pw-s6);
  padding-bottom: var(--pw-s4);
}
.reg-filter__field { flex: 1 1 300px; max-width: 380px; }
/* 44px minimum tap target — the later coarse-pointer block would otherwise
   win on source order, so this needs the extra class for specificity. */
.reg-filter .reg-filter__field .pw-input {
  padding-right: 38px; height: 44px; min-height: 44px;
}

.reg-filter__clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: var(--pw-r-xs);
  display: flex; align-items: center; justify-content: center;
  color: var(--pw-ink-3); cursor: pointer;
  transition: background var(--pw-dur-1) var(--pw-ease), color var(--pw-dur-1) var(--pw-ease);
}
.reg-filter__clear:hover { background: var(--pw-sunken); color: var(--pw-ink); }
.reg-filter__clear svg { width: 14px; height: 14px; }

/* Chips sit inline with the field, not on their own row. */
.reg-filter__row {
  display: flex; align-items: center; gap: var(--pw-s5);
  flex: 1 1 auto; justify-content: space-between; flex-wrap: wrap;
}
.reg-filter__chips { display: flex; gap: var(--pw-s4); flex-wrap: wrap; }

/* Toggles with a real affordance. Borderless text read as static labels —
   people didn't know they were clickable. A checkbox glyph says "toggle"
   without adding a fourth bordered box to the row. */
.reg-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px 5px 8px; border-radius: var(--pw-r-sm);
  font-family: var(--pw-font-mono); font-size: var(--pw-t-micro);
  letter-spacing: var(--pw-track-micro); text-transform: uppercase;
  color: var(--pw-ink-2); background: none;
  border: 1px solid transparent; cursor: pointer;
  transition: color var(--pw-dur-2) var(--pw-ease),
              background var(--pw-dur-2) var(--pw-ease),
              border-color var(--pw-dur-2) var(--pw-ease);
}
/* The box itself is the signal that this is a control. */
.reg-chip::before {
  content: ""; width: 13px; height: 13px; flex-shrink: 0;
  /* This glyph IS the affordance that says the chip is clickable, so its
     edge is a control boundary and needs the functional token, not a
     decorative hairline (--pw-line-3 measured 1.79:1). */
  border: 1.5px solid var(--pw-line-input); border-radius: 3px;
  transition: background var(--pw-dur-2) var(--pw-ease),
              border-color var(--pw-dur-2) var(--pw-ease);
}
.reg-chip:hover { color: var(--pw-ink); background: var(--pw-sunken); }
.reg-chip:hover::before { border-color: var(--pw-ink-3); }
.reg-chip[aria-pressed="true"] {
  color: var(--pw-signal-ink); background: var(--pw-signal-t1);
  border-color: var(--pw-signal-t2);
}
.reg-chip[aria-pressed="true"]::before {
  background: var(--pw-signal); border-color: var(--pw-signal);
  /* checkmark */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 4.5 6.2 11.5 3 8.3'/%3E%3C/svg%3E");
  background-size: 11px; background-repeat: no-repeat; background-position: center;
}

/* Empty until filtering starts — "13 of 13" on load is noise. */
.reg-filter__count {
  font-family: var(--pw-font-mono); font-size: var(--pw-t-micro);
  letter-spacing: var(--pw-track-micro); text-transform: uppercase;
  color: var(--pw-ink-3); min-height: 1em;
}

.reg-filter__empty {
  padding: var(--pw-s8) var(--pw-s4); text-align: center;
  font-size: var(--pw-t-sm); color: var(--pw-ink-3);
}
.reg-filter__reset {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--pw-signal);
}

@media (max-width: 620px) {
  .reg-filter__field { max-width: none; }
  .reg-filter__row { align-items: flex-start; }
}

/* --------------------------------------------------------------------------
   NAV
   -------------------------------------------------------------------------- */
.pw-nav {
  position: sticky; top: 0; z-index: 50; height: var(--pw-nav-h);
  background: rgba(251,252,253,.82); backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: var(--pw-hairline) solid var(--pw-line);
}
.pw-nav__inner { height: 100%; display: flex; align-items: center; gap: var(--pw-s7); }
.pw-nav__links { display: flex; align-items: center; gap: var(--pw-s6); margin-right: auto; }
.pw-nav__link {
  font-size: var(--pw-t-sm); font-weight: var(--pw-w-med); color: var(--pw-ink-2);
  transition: color var(--pw-dur-2) var(--pw-ease);
}
.pw-nav__link:hover { color: var(--pw-ink); }
.pw-nav__actions { display: flex; align-items: center; gap: var(--pw-s3); }

/* --------------------------------------------------------------------------
   LOGO — four descending bars: solid, 62%, 34%, then a hollow outline.
   Evidence thinning out to nothing, stated in four shapes.

   The fourth bar is a SOLID low-opacity outline, not a dashed one. Dashes
   fragment into unreadable specks below ~40px and the "empty container"
   meaning is lost — which is the whole point of the mark.
   -------------------------------------------------------------------------- */
.pw-logo {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--pw-signal); flex-shrink: 0; white-space: nowrap;
}
.pw-logo__glyph { width: 26px; height: 26px; min-width: 26px; flex-shrink: 0; display: block; }
.pw-logo__word {
  font-size: 1.0625rem; font-weight: var(--pw-w-bold); letter-spacing: -0.032em;
  color: var(--pw-ink); line-height: 1; flex-shrink: 0; white-space: nowrap;
}
/* The name is long. Below tablet the nav drops to the mark alone rather than
   letting a three-word wordmark crowd out the CTA. */
@media (max-width: 560px) {
  .pw-nav .pw-logo__word { display: none; }
}

/* Legacy wordmark — the mark is a 5-segment evidence meter. */
.pw-mark { display: inline-flex; align-items: center; gap: 9px; }
.pw-mark__glyph { display: flex; gap: 2px; align-items: flex-end; height: 18px; }
.pw-mark__glyph i { display: block; width: 3px; border-radius: 1px; background: var(--pw-signal); }
.pw-mark__glyph i:nth-child(1) { height: 18px; }
.pw-mark__glyph i:nth-child(2) { height: 14px; opacity: .8; }
.pw-mark__glyph i:nth-child(3) { height: 10px; opacity: .55; }
.pw-mark__glyph i:nth-child(4) { height: 7px; opacity: .35; }
.pw-mark__glyph i:nth-child(5) { height: 4px; background: none; border: 1px dashed var(--pw-line-3); width: 3px; }
.pw-mark__word { font-size: 1.1875rem; font-weight: var(--pw-w-bold); letter-spacing: -0.03em; color: var(--pw-ink); }

/* --------------------------------------------------------------------------
   WATCH BUTTON — the core consumer action. Following a compound is framed
   as instrumentation ("watch this reading"), never as endorsement.
   -------------------------------------------------------------------------- */
.pw-watch {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding-inline: var(--pw-s4);
  font-size: var(--pw-t-xs); font-weight: var(--pw-w-semi); letter-spacing: -0.006em;
  color: var(--pw-ink); background: var(--pw-surface);
  border: var(--pw-hairline) solid var(--pw-line-2); border-radius: var(--pw-r-sm);
  transition: border-color var(--pw-dur-2) var(--pw-ease),
              background var(--pw-dur-2) var(--pw-ease),
              color var(--pw-dur-2) var(--pw-ease);
}
.pw-watch:hover { border-color: var(--pw-signal); color: var(--pw-signal); }
.pw-watch__glyph { width: 14px; height: 14px; flex-shrink: 0; }
/* Watched state: filled, and the glyph's dashed ring closes to solid. */
.pw-watch[aria-pressed="true"] { background: var(--pw-signal); border-color: var(--pw-signal); color: #fff; }
.pw-watch[aria-pressed="true"]:hover { background: var(--pw-signal-h); color: #fff; }
.pw-watch[aria-pressed="true"] .pw-watch__off { display: none; }
.pw-watch .pw-watch__on { display: none; }
.pw-watch[aria-pressed="true"] .pw-watch__on { display: block; }

/* --------------------------------------------------------------------------
   TRIAL TRACK — where a compound actually is in human testing.
   Four stages; filled to the furthest reached. Unreached stages stay hollow,
   consistent with the tier scale: nothing solid means nothing established.
   -------------------------------------------------------------------------- */
.pw-track { display: flex; align-items: center; gap: 0; width: 100%; }
.pw-track__seg { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pw-track__bar { height: 4px; border-radius: 2px; background: var(--pw-sunken-2); }
.pw-track__lbl {
  font-family: var(--pw-font-mono); font-size: 9.5px; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--pw-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pw-track__seg + .pw-track__seg { margin-left: 3px; }
.pw-track[data-stage="preclinical"] .pw-track__seg:nth-child(-n+1) .pw-track__bar,
.pw-track[data-stage="phase1"]      .pw-track__seg:nth-child(-n+2) .pw-track__bar,
.pw-track[data-stage="phase2"]      .pw-track__seg:nth-child(-n+3) .pw-track__bar,
.pw-track[data-stage="phase3"]      .pw-track__seg:nth-child(-n+4) .pw-track__bar { background: var(--pw-signal); }
.pw-track[data-stage="preclinical"] .pw-track__seg:nth-child(-n+1) .pw-track__lbl,
.pw-track[data-stage="phase1"]      .pw-track__seg:nth-child(-n+2) .pw-track__lbl,
.pw-track[data-stage="phase2"]      .pw-track__seg:nth-child(-n+3) .pw-track__lbl,
.pw-track[data-stage="phase3"]      .pw-track__seg:nth-child(-n+4) .pw-track__lbl { color: var(--pw-ink-2); }
/* Preclinical is sand, not cobalt — animal data is not human data. */
.pw-track[data-stage="preclinical"] .pw-track__seg:nth-child(1) .pw-track__bar { background: var(--pw-sand); }
.pw-track[data-stage="none"] .pw-track__bar { background: var(--pw-sunken-2); }

/* --------------------------------------------------------------------------
   CLAIM CHECK — what the internet says vs. what the evidence says.
   The product's editorial voice made structural.
   -------------------------------------------------------------------------- */
.pw-claim { border: var(--pw-hairline) solid var(--pw-line); border-radius: var(--pw-r-md); overflow: hidden; background: var(--pw-surface); }
.pw-claim + .pw-claim { margin-top: var(--pw-s3); }
.pw-claim__said {
  display: flex; gap: var(--pw-s3); align-items: flex-start;
  padding: var(--pw-s4) var(--pw-s5); background: var(--pw-sunken);
  border-bottom: var(--pw-hairline) solid var(--pw-line);
}
.pw-claim__mark {
  font-family: var(--pw-font-mono); font-size: var(--pw-t-micro); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--pw-ink-3); flex-shrink: 0; padding-top: 2px; width: 62px;
}
.pw-claim__quote { font-size: var(--pw-t-sm); color: var(--pw-ink-2); font-style: italic; line-height: 1.45; }
.pw-claim__real { display: flex; gap: var(--pw-s3); align-items: flex-start; padding: var(--pw-s4) var(--pw-s5); }
.pw-claim__real .pw-claim__mark { color: var(--pw-signal); }
.pw-claim__verdict { font-size: var(--pw-t-sm); color: var(--pw-ink); line-height: 1.5; }
.pw-claim__verdict b { font-weight: var(--pw-w-semi); }
@media (max-width: 620px) {
  .pw-claim__said, .pw-claim__real { flex-direction: column; gap: var(--pw-s2); }
  .pw-claim__mark { width: auto; }
}

/* --------------------------------------------------------------------------
   STAT STRIP — dense factual row, hairline-divided.
   -------------------------------------------------------------------------- */
.pw-stats { display: flex; flex-wrap: wrap; border: var(--pw-hairline) solid var(--pw-line); border-radius: var(--pw-r-md); background: var(--pw-surface); overflow: hidden; }
.pw-stats__item { flex: 1 1 160px; padding: var(--pw-s5); border-right: var(--pw-hairline) solid var(--pw-line); }
.pw-stats__item:last-child { border-right: 0; }
.pw-stats__k { font-family: var(--pw-font-mono); font-size: var(--pw-t-micro); letter-spacing: var(--pw-track-micro); text-transform: uppercase; color: var(--pw-ink-3); display: block; margin-bottom: 7px; }
.pw-stats__v { font-size: 1.5rem; font-weight: var(--pw-w-bold); letter-spacing: -0.03em; color: var(--pw-ink); font-variant-numeric: tabular-nums; line-height: 1; }
.pw-stats__v small { font-size: 0.875rem; font-weight: var(--pw-w-med); color: var(--pw-ink-3); letter-spacing: 0; }

/* --------------------------------------------------------------------------
   MOTION — one orchestrated entrance. Staggered, decelerating, subtle.
   -------------------------------------------------------------------------- */
@keyframes pw-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pw-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pw-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.pw-rise { animation: pw-rise var(--pw-dur-4) var(--pw-ease-out) both; }
.pw-stagger > * { animation: pw-rise var(--pw-dur-4) var(--pw-ease-out) both; }
.pw-stagger > *:nth-child(1) { animation-delay: 0ms; }
.pw-stagger > *:nth-child(2) { animation-delay: 70ms; }
.pw-stagger > *:nth-child(3) { animation-delay: 140ms; }
.pw-stagger > *:nth-child(4) { animation-delay: 210ms; }
.pw-stagger > *:nth-child(5) { animation-delay: 280ms; }
.pw-stagger > *:nth-child(6) { animation-delay: 350ms; }
.pw-draw-rule { transform-origin: left; animation: pw-draw var(--pw-dur-4) var(--pw-ease-out) both; }

/* --------------------------------------------------------------------------
   UTILITIES — a deliberately short list. Components carry the weight.
   -------------------------------------------------------------------------- */
.pw-stack   { display: flex; flex-direction: column; }
.pw-row     { display: flex; align-items: center; }
.pw-wrap    { flex-wrap: wrap; }
.pw-between { justify-content: space-between; }
.pw-center  { align-items: center; }
.pw-baseline{ align-items: baseline; }
.pw-grow    { flex: 1; }
.pw-g1 { gap: var(--pw-s1); } .pw-g2 { gap: var(--pw-s2); } .pw-g3 { gap: var(--pw-s3); }
.pw-g4 { gap: var(--pw-s4); } .pw-g5 { gap: var(--pw-s5); } .pw-g6 { gap: var(--pw-s6); }
.pw-g7 { gap: var(--pw-s7); } .pw-g8 { gap: var(--pw-s8); } .pw-g9 { gap: var(--pw-s9); }
.pw-grid { display: grid; gap: var(--pw-s5); }
.pw-grid--2 { grid-template-columns: repeat(2, 1fr); }
.pw-grid--3 { grid-template-columns: repeat(3, 1fr); }
.pw-grid--4 { grid-template-columns: repeat(4, 1fr); }
.pw-mt2 { margin-top: var(--pw-s2); } .pw-mt3 { margin-top: var(--pw-s3); }
.pw-mt4 { margin-top: var(--pw-s4); } .pw-mt5 { margin-top: var(--pw-s5); }
.pw-mt6 { margin-top: var(--pw-s6); } .pw-mt7 { margin-top: var(--pw-s7); }
.pw-mt8 { margin-top: var(--pw-s8); } .pw-mt9 { margin-top: var(--pw-s9); }
.pw-muted { color: var(--pw-ink-3); }
.pw-ink   { color: var(--pw-ink); }

@media (max-width: 900px) {
  .pw-grid--3, .pw-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .pw-nav__links { display: none; }
}
@media (max-width: 620px) {
  .pw-grid--2, .pw-grid--3, .pw-grid--4 { grid-template-columns: 1fr; }
  /* The modifiers set their own padding-block, so they need naming here too
     or they keep desktop spacing on a phone. */
  .pw-section, .pw-section--major { padding-block: var(--pw-s9); }
  .pw-section--tight { padding-block: var(--pw-s8); }
  .pw-stats__item { flex-basis: 50%; border-bottom: var(--pw-hairline) solid var(--pw-line); }
}

/* ---- Data tables ------------------------------------------------------
   The trial table is the artifact this whole site exists to show, so it
   gets real typesetting rather than browser defaults.
   - separate/0 (not collapse) so per-cell rules never double up
   - tnum+lnum on the whole table: NCT ids, years and enrollment counts all
     need to align in a column, not only the cells we tagged .num
   - a strong rule under the header, then near-invisible row rules — row
     height does the separating work                                      */
/* Must be on .pw-table — a bare `table` selector loses to it. */
.pw-table { border-collapse: separate; border-spacing: 0; }
table, .cp-tbl, [data-register] {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
th {
  border-bottom: var(--pw-hairline) solid var(--pw-line-2);
  font-variant-numeric: normal;
}
td { border-bottom: var(--pw-hairline) solid var(--pw-line); }
tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------------------
   Footer.
   Was inline in index.html while every other page shipped a linkless stub.
   Shared here so a compound page — where search and AI traffic actually
   lands — is not a dead end. Generated by src/site/footer.js.
   --------------------------------------------------------------------------- */
footer .foot { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: var(--pw-s6); }
@media (max-width: 780px) { footer .foot { grid-template-columns: 1fr 1fr; } }
footer .foot-h {
  font-family: var(--pw-font-mono); font-size: var(--pw-t-micro);
  letter-spacing: var(--pw-track-micro); text-transform: uppercase;
  color: var(--pw-ink-4); margin-bottom: var(--pw-s3); font-weight: var(--pw-w-med);
}
footer a { display: block; font-size: var(--pw-t-xs); color: var(--pw-ink-2); padding-block: 4px; }
footer a:hover { color: var(--pw-signal); }

/* The current page, listed for orientation but not linked to itself. Not
   focusable: tabbing to a link that reloads the page you are on is noise. */
.foot-here { display: block; font-size: var(--pw-t-xs); color: var(--pw-ink-4); padding-block: 4px; }

/* Receipts, restated where people land after reading. */
.foot-stats { display: flex; flex-wrap: wrap; gap: var(--pw-s2) var(--pw-s5); margin-top: var(--pw-s5); }
.foot-stats span {
  font-family: var(--pw-font-mono); font-size: var(--pw-t-micro);
  letter-spacing: .08em; text-transform: uppercase; color: var(--pw-ink-3);
}
.foot-stats b { color: var(--pw-ink); font-weight: var(--pw-w-semi); font-variant-numeric: tabular-nums; }

/* Someone who reads to the bottom is the most likely subscriber on the page. */
.foot-cta {
  display: grid; grid-template-columns: 1fr auto; gap: var(--pw-s6);
  align-items: center; margin-top: var(--pw-s8);
  padding: var(--pw-s6); border: var(--pw-hairline) solid var(--pw-line);
  border-radius: var(--pw-r-md); background: var(--pw-surface);
}
/* min() rather than a bare min-width so the field can never exceed its
   column on a narrow screen. */
.foot-cta .pw-capture { min-width: min(340px, 100%); }
@media (max-width: 820px) {
  .foot-cta { grid-template-columns: 1fr; }
  .foot-cta .pw-capture { min-width: 0; }
}
