/* Two states of one page: "sober" (default) and "dosed" (data-dose="on"). */
:root {
  --bg: #f2f1ec;
  --bg-2: #e8e7e0;
  --ink: #0d0e0d;
  --muted: #696c66;
  --line: rgba(13, 14, 13, .16);
  --accent: #0d0e0d;
  --accent-ink: #f2f1ec;
  --signal: #0a9d63;
  --danger: #d8392b;
  --cap-a: #ffffff;
  --cap-b: #d6d8d0;
  --cap-text: #7b7e77;
  --wall: #d3d4cc;
  --glow: rgba(0, 0, 0, 0);
  --gut: clamp(16px, 4vw, 48px);
  color-scheme: light;
}

:root[data-dose="on"] {
  --bg: #060706;
  --bg-2: #0e100d;
  --ink: #eef0e8;
  --muted: #8b9086;
  --line: rgba(238, 240, 232, .14);
  --accent: #b9ff2c;
  --accent-ink: #060706;
  --signal: #b9ff2c;
  --danger: #ff5247;
  --cap-a: #b9ff2c;
  --cap-b: #141613;
  --cap-text: #b9ff2c;
  --wall: #141613;
  --glow: rgba(185, 255, 44, .38);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 "Onest", system-ui, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

/* paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, p, dl, dd { margin: 0; }

.wrap { width: min(1240px, 100% - 2 * var(--gut)); margin-inline: auto; }
.mono { font: 400 12px/1.4 "JetBrains Mono", ui-monospace, Consolas, monospace; letter-spacing: .04em; text-transform: uppercase; }

/* dose transition: the new state grows as a circle from the click point */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }

/* ---------- intro film ---------- */
/* The film is dark and ends on a blank off-white cover, the same colour as the page, so
   the overlay keeps its own colours in both page states. */
.intro { --ix: 50vw; --iy: 50vh; position: fixed; inset: 0; z-index: 200; display: none; place-items: center; background: #030403; overflow: hidden; }
.intro-on .intro { display: grid; }
.intro-on body { overflow: hidden; }
.intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .45s ease; }
.intro-playing .intro canvas { opacity: 1; }
placebo-logo.intro__mark { height: 76px; --logo-mark: #b9ff2c; animation: intro-wait 1.1s ease-in-out infinite; }
.intro-playing .intro__mark { display: none; }
@keyframes intro-wait { 50% { rotate: -20deg; scale: .9; opacity: .5; } }
/* letterbox bars */
.intro::before, .intro::after { content: ""; position: absolute; left: 0; right: 0; z-index: 1; height: 7vh; background: #000; transition: translate .5s ease; }
.intro::before { top: 0; }
.intro::after { bottom: 0; }
.intro__flash { position: absolute; inset: 0; z-index: 2; background: #f2f1ec; opacity: 0; pointer-events: none; }
.intro__tag { position: absolute; left: var(--gut); bottom: calc(7vh + 14px); z-index: 1; color: rgba(238, 240, 232, .55); font-size: 10px; }
.intro__skip { position: absolute; right: var(--gut); bottom: calc(7vh + 8px); z-index: 3; padding: 9px 15px; border: 1px solid rgba(238, 240, 232, .28); border-radius: 99px; background: rgba(3, 4, 3, .5); backdrop-filter: blur(8px); color: #eef0e8; font-size: 10px; }
.intro__skip:hover { border-color: #b9ff2c; color: #b9ff2c; }
.intro-out .intro { animation: intro-out 1s cubic-bezier(.7, 0, .2, 1) forwards; }
.intro-out .intro__skip, .intro-out .intro__tag { display: none; }
@keyframes intro-out { from { clip-path: circle(150vmax at var(--ix) var(--iy)); } to { clip-path: circle(0 at var(--ix) var(--iy)); } }
/* the hero's first-paint animations wait until the overlay starts to close */
.intro-on:not(.intro-out) :is(.hero__line, .capsule, .hero__meta, .ecg, .hero__foot) { animation-play-state: paused; }

/* ---------- ticker ---------- */
.ticker { background: var(--accent); color: var(--accent-ink); overflow: hidden; height: 34px; display: flex; align-items: center; }
.ticker__track { display: flex; white-space: nowrap; font: 600 12px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; animation: ticker 48s linear infinite; }
.ticker__track span { padding-right: 3ch; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav__in { display: flex; align-items: center; gap: 24px; height: 68px; }
/* The logo is one element, <placebo-logo>, defined in brand/logo.js. The wordmark takes
   `color`, the mark takes `--logo-mark`: ink while sober, the accent once dosed. */
placebo-logo { display: inline-block; height: 28px; color: var(--ink); --logo-mark: var(--ink); vertical-align: middle; }
placebo-logo svg { display: block; width: auto; height: 100%; }
:root[data-dose="on"] placebo-logo { --logo-mark: var(--accent); }
.logo { display: inline-flex; align-items: center; }
.rc__brand placebo-logo { height: 30px; color: var(--paper-ink); --logo-mark: var(--paper-ink); }
.pill-ico { width: 30px; height: 14px; border-radius: 99px; rotate: -35deg; background: linear-gradient(90deg, var(--cap-a) 50%, var(--ink) 50%); box-shadow: inset 0 0 0 1.5px var(--ink); }
.nav__links { display: flex; gap: 16px; margin-left: auto; font-size: 13px; color: var(--muted); }
.nav__links a { transition: color .2s; }
.nav__links a:hover { color: var(--ink); }
.nav__cab { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; font-size: 14px; font-weight: 600; transition: border-color .2s; will-change: transform; }
.nav__cab:hover { border-color: var(--ink); }
/* the full row of links needs about 960px; below that only the logo, cabinet and switch stay */
@media (max-width: 960px) {
  .nav__links { display: none; }
  .nav__cab { margin-left: auto; }
}

.dose { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 6px 0; font-weight: 600; font-size: 14px; }
.dose__track { width: 50px; height: 28px; border-radius: 99px; border: 1.5px solid var(--ink); padding: 3px; display: block; transition: background-color .25s; }
.dose__knob { display: block; width: 19px; height: 19px; border-radius: 50%; background: var(--ink); transition: translate .35s cubic-bezier(.2, 1.5, .4, 1), background-color .25s; }
.dose[aria-pressed="true"] .dose__track { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 22px var(--glow); }
.dose[aria-pressed="true"] .dose__knob { translate: 22px 0; background: var(--accent-ink); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 54px; padding: 0 28px; border-radius: 99px; border: 1.5px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15px; white-space: nowrap; box-shadow: 0 0 34px var(--glow); transition: scale .2s; will-change: transform; }
.btn:hover { scale: 1.03; }
.btn:active { scale: .97; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn--sm { height: 42px; padding: 0 20px; font-size: 14px; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

/* ---------- hero ---------- */
.hero { position: relative; padding-block: clamp(28px, 6vh, 64px) clamp(48px, 9vh, 110px); min-height: calc(100svh - 102px); display: flex; flex-direction: column; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 28px; color: var(--muted); padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.hero__title { font: 800 clamp(36px, 8.2vw, 126px)/.96 "Unbounded", sans-serif; letter-spacing: -.055em; margin-top: clamp(28px, 7vh, 80px); position: relative; z-index: 1; }
.hero__line { display: block; }
/* stroke is painted under the fill, so glyph overlaps do not show through */
.hero__line--2 { color: var(--bg); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
:root[data-dose="on"] .hero__line--2 { color: var(--accent); -webkit-text-stroke: 0; text-shadow: 0 0 60px var(--glow); }

.capsule-wrap { position: absolute; right: 0; top: clamp(58px, 9vh, 104px); perspective: 900px; z-index: 2; display: grid; justify-items: end; gap: 26px; animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { translate: 0 -14px; } }
.capsule { --rx: 0deg; --ry: 0deg; width: clamp(190px, 25vw, 390px); aspect-ratio: 2.5 / 1; border: 0; padding: 0; background: none; position: relative; transform: rotate(-22deg) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s ease-out; filter: drop-shadow(0 34px 38px rgba(0, 0, 0, .28)) drop-shadow(0 0 70px var(--glow)); }
.capsule__half { position: absolute; top: 0; bottom: 0; width: 50.4%; transition: translate .55s cubic-bezier(.2, 1.5, .4, 1); }
.capsule__half::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255, 255, 255, .85) 4%, rgba(255, 255, 255, 0) 30%, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, .3) 100%); }
.capsule__half--a { left: 0; border-radius: 999px 0 0 999px; background: var(--cap-a); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.capsule__half--b { right: 0; border-radius: 0 999px 999px 0; background: var(--cap-b); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); display: grid; place-content: center; justify-items: start; gap: 2px; color: var(--cap-text); }
.capsule__half--b b { font: 800 clamp(11px, 1.5vw, 21px)/1 "Unbounded", sans-serif; letter-spacing: .06em; }
.capsule__half--b em { font: 600 clamp(9px, 1vw, 13px)/1 "JetBrains Mono", monospace; font-style: normal; letter-spacing: .1em; }
.capsule.is-open .capsule__half--a { translate: -16% 0; }
.capsule.is-open .capsule__half--b { translate: 16% 0; }
.capsule__hint { color: var(--muted); }

/* flat line while sober, heartbeat once dosed */
.ecg { margin-top: clamp(24px, 5vh, 56px); display: grid; gap: 8px; }
.ecg svg { display: block; width: 100%; height: 64px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ecg path { fill: none; stroke: var(--muted); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ecg__beat { display: none; }
.ecg__label { color: var(--muted); }
:root[data-dose="on"] .ecg__flat { display: none; }
:root[data-dose="on"] .ecg__beat { display: block; stroke: var(--accent); filter: drop-shadow(0 0 5px var(--accent)); }
:root[data-dose="on"] .ecg__run { animation: ecg 5s linear infinite; }
:root[data-dose="on"] .ecg__label { color: var(--accent); }
@keyframes ecg { to { transform: translateX(-1200px); } }

/* first paint */
.hero__line { animation: rise .95s cubic-bezier(.2, .8, .2, 1) backwards; }
.hero__line--2 { animation-delay: .12s; }
@keyframes rise { from { clip-path: inset(0 0 100% 0); translate: 0 45%; } to { clip-path: inset(-30% -10% -30% -10%); translate: 0 0; } }
.capsule { animation: drop 1.1s cubic-bezier(.2, 1.3, .4, 1) .25s backwards; }
@keyframes drop { from { opacity: 0; scale: .55; rotate: -50deg; } }
.hero__meta, .ecg, .hero__foot { animation: fade .9s ease .45s backwards; }
@keyframes fade { from { opacity: 0; translate: 0 14px; } }

/* the moment the dose kicks in */
.kick main { animation: kick .75s cubic-bezier(.2, .8, .2, 1); }
@keyframes kick { from { filter: blur(4px) saturate(2.2); scale: 1.018; } }

.hero__foot { margin-top: auto; padding-top: clamp(32px, 7vh, 72px); display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 24px 48px; position: relative; z-index: 3; }
.hero__lead { max-width: 44ch; font-size: clamp(16px, 1.5vw, 19px); color: var(--muted); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- sections ---------- */
.section { padding-block: clamp(64px, 11vh, 132px); border-top: 1px solid var(--line); }
.section__head { max-width: 760px; margin-bottom: clamp(28px, 5vh, 52px); display: grid; gap: 14px; }
.eyebrow { color: var(--signal); }
.section__head h2 { font: 600 clamp(28px, 4.6vw, 62px)/1.02 "Unbounded", sans-serif; letter-spacing: -.045em; }
.section__head p { color: var(--muted); max-width: 52ch; font-size: 17px; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.split .section__head { position: sticky; top: 104px; margin-bottom: 0; }

.reveal { opacity: 0; translate: 0 26px; transition: opacity .8s ease, translate .8s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.is-in { opacity: 1; translate: 0 0; }

.teaser__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
/* anchors land below the sticky header */
.section[id] { scroll-margin-top: 72px; }

/* ---------- trial ---------- */
.trial { border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--bg-2); }
.trial__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); color: var(--muted); }
.trial__score b { color: var(--ink); font-weight: 600; }
.trial__state { display: inline-flex; align-items: center; gap: 8px; }
.trial__state i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
:root[data-dose="on"] .trial__state i { background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: blink 1.2s steps(2) infinite; }
:root[data-dose="on"] .trial__state b { color: var(--accent); }
.trial__state b { font-weight: 400; }
@keyframes blink { 50% { opacity: .25; } }
#trialCanvas { display: block; width: 100%; height: clamp(300px, 50vw, 600px); cursor: crosshair; touch-action: pan-y; user-select: none; }
.trial__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.toggles button { height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: none; font-size: 13px; color: var(--muted); transition: background-color .2s, color .2s, border-color .2s; }
.toggles button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
:root[data-dose="on"] .toggles button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
:root[data-dose="off"] .toggles { opacity: .45; pointer-events: none; }

/* ---------- facts label ---------- */
.facts { border: 2px solid var(--ink); border-radius: 6px; padding: clamp(18px, 3vw, 30px); background: var(--bg); }
.facts__title { font: 800 clamp(34px, 5vw, 58px)/1 "Unbounded", sans-serif; letter-spacing: -.05em; padding-bottom: 12px; border-bottom: 10px solid var(--ink); }
.facts__sub { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 3px solid var(--ink); color: var(--muted); }
.facts dl > div { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 600; font-size: 17px; }
.facts dd.facts__desc { grid-column: 1; color: var(--muted); font-size: 14px; }
.facts dd.facts__val { grid-row: 1 / span 2; grid-column: 2; align-self: center; font: 600 14px/1 "JetBrains Mono", monospace; letter-spacing: .06em; min-width: 9ch; text-align: right; }
:root[data-dose="on"] .facts dd.facts__val { color: var(--accent); }
.facts__note { padding-top: 14px; color: var(--muted); }

/* ---------- shelf ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.box { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); padding: 22px 22px 22px 34px; display: grid; gap: 18px; min-height: 250px; transition: translate .35s cubic-bezier(.2, .8, .2, 1), border-color .2s; }
.box::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 12px; background: var(--accent); }
.box:hover { translate: 0 -6px; border-color: var(--ink); }
.box__rx { display: flex; justify-content: space-between; color: var(--muted); }
.box__name { font: 600 clamp(22px, 2.4vw, 30px)/1.05 "Unbounded", sans-serif; letter-spacing: -.04em; }
.box__name small { display: block; font: 400 12px/1.4 "JetBrains Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.box__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
:root[data-dose="on"] .status[data-state="ok"] i { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
:root[data-dose="on"] .status[data-state="update"] i { background: #ffb020; }
.box__price { font-weight: 600; }

/* ---------- courses ---------- */
.courses { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
.course { position: relative; border: 1px solid var(--line); border-radius: 22px; background: var(--bg-2); padding: 22px; display: grid; gap: 20px; }
.course--hit { border-color: var(--accent); box-shadow: 0 0 44px -12px var(--glow); }
.course__tag { position: absolute; top: 18px; right: 18px; padding: 5px 10px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font: 600 11px/1 "JetBrains Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.blister { height: 132px; border-radius: 14px; padding: 14px; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, var(--pw))); align-content: center; justify-content: center; gap: 6px; background: linear-gradient(135deg, color-mix(in srgb, var(--ink) 13%, transparent), color-mix(in srgb, var(--ink) 3%, transparent) 45%, color-mix(in srgb, var(--ink) 10%, transparent)); border: 1px solid var(--line); }
.blister i { width: 100%; aspect-ratio: 2.3 / 1; border-radius: 99px; background: var(--cap-b); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 3px rgba(0, 0, 0, .22), 0 2px 4px rgba(0, 0, 0, .18); transition: transform .4s cubic-bezier(.2, 1.7, .4, 1), background-color .2s; transition-delay: calc(var(--i) * 16ms); }
.course:hover .blister i { transform: translateY(-4px) scale(1.07); background: var(--accent); }
.course__name { font: 600 24px/1 "Unbounded", sans-serif; letter-spacing: -.04em; }
.course__sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.course__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.course__price { font: 600 26px/1 "Unbounded", sans-serif; letter-spacing: -.04em; }

/* ---------- loader window ---------- */
.lw { max-width: 1000px; margin-inline: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); overflow: hidden; box-shadow: 0 44px 90px -44px rgba(0, 0, 0, .5), 0 0 90px -34px var(--glow); }
.lw.reveal { transform: perspective(1400px) rotateX(13deg) scale(.94); transform-origin: 50% 100%; transition: opacity .8s ease, translate .8s cubic-bezier(.2, .8, .2, 1), transform 1.2s cubic-bezier(.2, .8, .2, 1); }
.lw.reveal.is-in { transform: none; }

.lw__bar { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.lw__brand { display: inline-flex; align-items: center; }
.lw__brand placebo-logo { height: 24px; }
.lw__tag { margin-left: auto; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 10px; }
.lw__ctl { display: inline-flex; gap: 16px; color: var(--muted); }
.lw__ctl i { position: relative; width: 11px; height: 11px; }
.lw__ctl i::before, .lw__ctl i:last-child::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid currentColor; }
.lw__ctl i:last-child::before { rotate: 45deg; }
.lw__ctl i:last-child::after { rotate: -45deg; }

.lw__body { position: relative; display: grid; grid-template-columns: 172px minmax(0, 1fr); min-height: 452px; }
.lw__rail { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-right: 1px solid var(--line); }
.lw__rail button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 10px; background: none; font-size: 14px; color: var(--muted); text-align: left; transition: background-color .2s, color .2s; }
.lw__rail button:hover { color: var(--ink); }
.lw__rail button[aria-pressed="true"] { background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink); }
.lw__rail svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.lw__patient { margin-top: auto; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.lw__patient b { color: var(--ink); font-size: 13px; font-weight: 600; }

.lw__view { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.lw__view[hidden] { display: none; }
.lw__view--single { display: block; padding: 22px; }

.lw__list { display: grid; align-content: start; gap: 6px; padding: 12px; border-right: 1px solid var(--line); }
.lw__list button { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; padding: 12px; border: 1px solid transparent; border-radius: 12px; background: none; text-align: left; color: var(--muted); transition: background-color .2s, border-color .2s; }
.lw__list button:hover { border-color: var(--line); }
.lw__list button[aria-pressed="true"] { border-color: var(--line); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.lw__list b { font-weight: 600; font-size: 15px; color: var(--ink); }
.lw__list small { font: 400 10px/1 "JetBrains Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.lw__list .status { grid-column: 1 / -1; font-size: 12px; }

.lw__detail { display: grid; align-content: start; justify-items: start; gap: 18px; padding: 22px; }
.lw__head { display: flex; align-items: start; justify-content: space-between; gap: 12px; width: 100%; }
.lw__head small { color: var(--muted); font-size: 10px; }
.lw__head h3 { margin: 6px 0 0; font: 600 clamp(20px, 2.5vw, 28px)/1.05 "Unbounded", sans-serif; letter-spacing: -.04em; }
.lw__meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; width: 100%; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); }
.lw__meta div { display: grid; gap: 5px; padding: 10px 12px; background: var(--bg-2); }
.lw__meta dt { color: var(--muted); font-size: 10px; }
.lw__meta dd { color: var(--ink); font-size: 12px; }

.lw__proc { display: flex; align-items: center; gap: 22px; width: 100%; }
.ring { position: relative; flex: none; width: 108px; height: 108px; }
.ring svg { width: 100%; height: 100%; rotate: -90deg; }
.ring circle { fill: none; stroke-width: 6; }
.ring__bg { stroke: var(--line); }
.ring__fg { stroke: var(--signal); stroke-linecap: round; transition: stroke-dashoffset .7s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 0 6px var(--glow)); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 600 18px/1 "Unbounded", sans-serif; letter-spacing: -.04em; }

.loader__steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font: 400 13px/1.3 "JetBrains Mono", monospace; }
.loader__steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.loader__steps li::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid currentColor; }
.loader__steps li[data-state="active"] { color: var(--ink); }
.loader__steps li[data-state="active"]::before { animation: blink .5s steps(2) infinite; background: currentColor; }
.loader__steps li[data-state="done"] { color: var(--ink); }
.loader__steps li[data-state="done"]::before { background: var(--signal); border-color: var(--signal); }
.loader__steps li[data-state="fail"]::before { background: var(--danger); border-color: var(--danger); }
.loader__result { min-height: 1.55em; font-size: 14px; color: var(--muted); }
.loader__result[data-kind="ok"] { color: var(--signal); }
.loader__result[data-kind="fail"] { color: var(--danger); }
.btn:disabled { opacity: .45; pointer-events: none; }

.lw__log { margin: 0; min-height: 360px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--ink) 5%, transparent); font: 400 12px/1.7 "JetBrains Mono", monospace; color: var(--muted); white-space: pre-wrap; }

/* ---------- injection stage (covers the loader while a procedure runs) ---------- */
.inj { --level: 0; position: absolute; inset: 0; z-index: 3; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 20px; padding: clamp(18px, 3vw, 34px); background: var(--bg-2); overflow: hidden; opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; }
.inj.is-on { opacity: 1; visibility: visible; transition: opacity .3s ease; }
.inj::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 34px 34px; opacity: .55; -webkit-mask-image: radial-gradient(closest-side, #000, transparent); mask-image: radial-gradient(closest-side, #000, transparent); }
.inj__stage { position: relative; display: flex; align-items: center; min-height: 0; }

.inj__syringe { flex: 0 1 46%; min-width: 0; overflow: visible; transition: translate .2s cubic-bezier(.3, 1.8, .5, 1); }
.inj.is-stab .inj__syringe { translate: 16px 0; }
.inj.is-fail .inj__syringe { animation: shake .4s; }
.syr__line { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.syr__ticks { stroke-width: 1; opacity: .6; }
.syr__needle { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.syr__stopper { fill: var(--ink); }
.syr__plunger { transform: translateX(calc((1 - var(--level)) * 132px)); }
.syr__liquid { fill: color-mix(in srgb, var(--ink) 18%, transparent); transform-box: fill-box; transform-origin: 100% 50%; transform: scaleX(var(--level)); }
:root[data-dose="on"] .syr__liquid { fill: var(--accent); filter: drop-shadow(0 0 9px var(--glow)); }
.syr__drop { fill: var(--signal); opacity: 0; }
.inj.is-push .syr__drop { animation: drip .45s ease-in infinite; }
@keyframes drip { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: 0; transform: translateX(10px); } }
@keyframes shake { 20% { translate: -7px 0; } 40% { translate: 6px 0; } 60% { translate: -4px 0; } 80% { translate: 3px 0; } }

.inj__flow { flex: 1 1 30px; min-width: 20px; height: 2px; background: repeating-linear-gradient(90deg, var(--signal) 0 8px, transparent 8px 18px); opacity: 0; transition: opacity .2s; animation: flow .32s linear infinite; }
.inj.is-push .inj__flow { opacity: 1; }
@keyframes flow { to { background-position-x: 18px; } }
@keyframes flow-down { to { background-position-y: 18px; } }

.inj__dump { position: relative; flex: none; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--ink) 4%, var(--bg-2)); overflow: hidden; transition: border-color .2s, box-shadow .3s; }
.inj__dump-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.inj__dump-head b { color: var(--ink); font-weight: 600; }
.inj__bytes { font: 400 12px/1.75 "JetBrains Mono", monospace; }
.inj__row { display: flex; gap: 9px; white-space: nowrap; }
.inj__row span { color: var(--muted); margin-right: 6px; }
.inj__row i { font-style: normal; color: var(--muted); opacity: .5; }
.inj__row i.is-drug { color: var(--signal); opacity: 1; text-shadow: 0 0 10px var(--glow); animation: byte .4s; }
.inj__row i.is-saline { opacity: .5; animation: byte-dry .4s; }
@keyframes byte { from { background: var(--signal); color: var(--bg); box-shadow: 0 0 14px var(--signal); } }
@keyframes byte-dry { from { background: color-mix(in srgb, var(--ink) 22%, transparent); opacity: 1; } }
.inj__dump.is-scan::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 30%; background: linear-gradient(transparent, color-mix(in srgb, var(--signal) 30%, transparent), transparent); animation: scan .9s linear; }
@keyframes scan { from { translate: 0 -100%; } to { translate: 0 340%; } }
.inj.is-done .inj__dump { border-color: var(--signal); box-shadow: 0 0 60px -14px var(--glow); }
.inj.is-fail .inj__dump { border-color: var(--danger); animation: shake .4s; }

.inj__wave { position: absolute; right: 14%; top: 50%; width: 40px; height: 40px; margin: -20px; border: 1px solid var(--signal); border-radius: 50%; opacity: 0; pointer-events: none; }
.inj.is-done .inj__wave { animation: wave .9s ease-out; }
@keyframes wave { from { opacity: .9; scale: 1; } to { opacity: 0; scale: 16; } }

.inj__hud { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 12px 22px; }
.inj__pct { font: 800 clamp(52px, 9vw, 104px)/.82 "Unbounded", sans-serif; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.inj__pct span { font-size: .38em; letter-spacing: 0; margin-left: .12em; color: var(--muted); }
:root[data-dose="on"] .inj__pct b { color: var(--accent); text-shadow: 0 0 50px var(--glow); }
.inj__caption { padding-bottom: .9em; color: var(--muted); }
.inj__bar { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.inj__bar i { --s: 0; position: relative; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.inj__bar i::after { content: ""; position: absolute; inset: 0; background: var(--signal); transform-origin: 0 50%; transform: scaleX(var(--s)); }

.inj__stamp { position: absolute; left: 50%; top: 40%; translate: -50% -50%; rotate: -9deg; scale: 2.6; padding: 10px 22px 12px; border: 4px solid currentColor; border-radius: 10px; background: var(--bg-2); color: var(--signal); font: 800 clamp(24px, 5vw, 54px)/1 "Unbounded", sans-serif; letter-spacing: -.03em; text-transform: uppercase; white-space: nowrap; opacity: 0; pointer-events: none; }
.inj__stamp.is-on { opacity: 1; scale: 1; transition: scale .3s cubic-bezier(.2, 1.6, .4, 1), opacity .1s; box-shadow: 0 0 70px -10px var(--glow); }
.inj__stamp[data-kind="fail"] { color: var(--danger); box-shadow: none; }
.inj__stamp[data-kind="none"] { color: var(--muted); box-shadow: none; }

.lw.is-shot { animation: shot .8s ease-out; }
@keyframes shot { 25% { box-shadow: 0 0 0 2px var(--signal), 0 0 140px -6px var(--glow); } }

.lw__foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.lw__syringe { display: inline-flex; align-items: center; gap: 8px; }
.lw__syringe i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.lw__syringe b { font-weight: 400; }
:root[data-dose="on"] .lw__syringe i { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
:root[data-dose="on"] .lw__syringe b { color: var(--accent); }

@media (max-width: 760px) {
  .lw__body { grid-template-columns: 1fr; }
  .lw__rail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .lw__rail button { white-space: nowrap; }
  .lw__patient { display: none; }
  .lw__view { grid-template-columns: 1fr; }
  .lw__view--single { padding: 16px; }
  .lw__list { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .lw__list button { flex: none; min-width: 150px; }
  .lw__proc { gap: 16px; }
  .ring { width: 88px; height: 88px; }
  .lw__log { min-height: 240px; }
  .inj__stage { flex-direction: column; justify-content: center; gap: 6px; }
  .inj__syringe { flex: none; width: 82%; }
  .inj__flow { flex: 0 0 22px; width: 2px; min-width: 0; height: 22px; background: repeating-linear-gradient(180deg, var(--signal) 0 8px, transparent 8px 18px); animation-name: flow-down; }
  .inj__bytes { font-size: 11px; }
  .inj__row { gap: 6px; }
  .inj__wave { right: 50%; top: 70%; }
}

/* ---------- leaflet ---------- */
.leaflet { background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; padding: clamp(18px, 3vw, 34px); background-image: linear-gradient(var(--line), var(--line)), linear-gradient(var(--line), var(--line)); background-size: 100% 1px, 100% 1px; background-position: 0 33.3%, 0 66.6%; background-repeat: no-repeat; }
.leaflet details { border-bottom: 1px solid var(--line); }
.leaflet summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; font-weight: 600; font-size: 18px; }
.leaflet summary::-webkit-details-marker { display: none; }
.leaflet summary::after { content: "+"; font: 400 24px/1 "JetBrains Mono", monospace; transition: rotate .3s; }
.leaflet details[open] summary::after { rotate: 45deg; }
.leaflet details p { color: var(--muted); padding: 0 0 20px; max-width: 58ch; }
.leaflet details ol { margin: 0; padding: 0 0 20px 22px; color: var(--muted); display: grid; gap: 6px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding-top: clamp(48px, 9vh, 96px); overflow: hidden; }
.footer__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.footer__claim { font: 600 clamp(24px, 3.6vw, 48px)/1.05 "Unbounded", sans-serif; letter-spacing: -.045em; max-width: 18ch; }
.footer__word { font: 800 clamp(56px, 18.2vw, 252px)/.8 "Unbounded", sans-serif; letter-spacing: -.07em; margin: clamp(28px, 6vh, 64px) 0 0 -.04em; color: var(--bg); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; user-select: none; }
:root[data-dose="on"] .footer__word { color: var(--accent); -webkit-text-stroke: 0; text-shadow: 0 0 90px var(--glow); }
.footer__legal a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer__legal { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 26px 0; color: var(--muted); border-top: 1px solid var(--line); margin-top: clamp(20px, 4vh, 40px); }

/* ---------- aim assist overlay (dosed, mouse only) ---------- */
.aim { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 70; pointer-events: none; display: none; }
.aim * { fill: none; stroke: var(--accent); vector-effect: non-scaling-stroke; }
#aimFov { stroke-width: 1; stroke-dasharray: 3 7; opacity: .7; }
#aimDot { fill: var(--accent); stroke: none; }
#aimLine { stroke-width: 1; opacity: .75; }
#aimBox { stroke-width: 1.5; }
@media (hover: hover) and (pointer: fine) {
  :root[data-dose="on"] .aim { display: block; }
  :root[data-dose="on"].in-trial .aim { display: none; }
}

.burst { position: fixed; inset: 0; z-index: 75; pointer-events: none; }
.burst i { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: burst .9s cubic-bezier(.1, .8, .2, 1) forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__cab { margin-left: auto; }
  .nav__in { gap: 14px; }
  .split { grid-template-columns: 1fr; }
  .split .section__head { position: static; margin-bottom: clamp(28px, 5vh, 52px); }
  .hero { min-height: 0; }
  .capsule-wrap { position: relative; right: auto; top: auto; margin: 48px auto 8px; justify-items: center; animation: none; }  .capsule { width: min(78vw, 360px); }
}

/* phones: the switch keeps its track, the word next to it goes */
@media (max-width: 520px) {
  .dose__label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker__track, .capsule-wrap, .capsule, .trial__state i, .hero__line, .hero__meta, .ecg, .ecg__run, .hero__foot, .kick main { animation: none !important; }
  .ring__fg, .lw.reveal { transition: none; }
  .lw.reveal { transform: none; }
  .reveal { opacity: 1; translate: none; transition: none; }
  .blister i, .capsule__half, .box { transition: none; }
}
