/* Company pages. Loaded after site.css, which holds the tokens, nav, buttons and the wordmark.
   Same contract as the homepage: this file alone is a complete static page, and `.film-on`
   turns each page's one scene into a pinned stage that js/page.js scrubs with scroll. */

/* ---------- Hero: the company's name set like the homepage wordmark ---------- */
.hero {
  min-height: 88vh; min-height: 88svh;
  display: grid; align-content: end; justify-items: start;
  gap: clamp(1.5rem, 4vh, 2.75rem);
  padding: 7.5rem var(--pad) clamp(2rem, 6vh, 3.5rem);
}
/* A company's page opens under a wash of its own color, strongest at the top right. */
[data-co] .hero {
  background:
    radial-gradient(75% 62% at 88% 0%, color-mix(in srgb, var(--accent) 30%, transparent) 0%, transparent 72%),
    radial-gradient(60% 46% at 0% 6%, color-mix(in srgb, var(--accent) 11%, transparent) 0%, transparent 70%);
}
/* --em-s and --em-w are the measured width of the name in em: stacked (phone) and on one line. */
.hero__mark { font-size: min(8.5rem, calc((100vw - 2 * var(--pad)) / var(--em-s))); }
@media (min-width: 760px) { .hero__mark { font-size: min(10.5rem, calc((100vw - 2 * var(--pad)) / var(--em-w))); } }
/* Room for descenders inside the mask line without moving the period off the baseline. */
.hero__mark .ln { padding: 0 .04em .2em 0; margin: 0 -.04em -.16em 0; }
/* The period follows the last word, on its baseline, so it stays with the name when the lines stack. */
.hero__mark .mark__dot { display: inline-block; margin: 0 0 0 .05em; }
.hero__mark .ln > span { display: block; }
.hero__row { display: grid; gap: 1.5rem; width: 100%; }
.hero__lede { max-width: 28ch; font-size: clamp(1.25rem, 1rem + 1.2vw, 2rem); line-height: 1.28; text-wrap: balance; }
.hero__meta { margin-top: .6rem; color: var(--ink-2); }
.hero__ctawrap { padding: 6px; margin: -6px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn svg { margin-left: .4rem; }
@media (min-width: 900px) { .hero__row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }

/* The company's logo sits above its name and comes up first. */
.hero__logo .logo { --logo-h: clamp(2.75rem, 2.3rem + 1.6vw, 4rem); }
.film-on .hero__logo > * { animation: rise 800ms var(--ease-out) both 40ms; }
.film-on .hero__mark .ln > span { animation: rise 900ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms + 120ms); }
.film-on .hero__mark .mark__dot { animation: land 520ms var(--ease-out) both 760ms; }
.film-on .hero__row .drop > * { animation: rise 800ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms + 700ms); }

/* ---------- Notes: the plain facts, a heading beside its paragraphs ---------- */
.notes { padding: var(--section) var(--pad); max-width: calc(1320px + 2 * var(--pad)); margin: 0 auto; }
.notes__row { display: grid; gap: 1rem; padding: clamp(2rem, 5vw, 3.5rem) 0; border-top: 1px solid var(--hair); }
.notes__row:first-child { border-top: 0; padding-top: 0; }
.notes__row:last-child { padding-bottom: 0; }
.notes__row h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.5rem); }
.notes__body { display: grid; gap: 1.1rem; }
.notes__body p { max-width: 44ch; font-size: clamp(1.125rem, 1rem + .7vw, 1.6rem); line-height: 1.4; text-wrap: pretty; }
.notes__body p.fine { font-size: 1rem; line-height: 1.5; color: var(--ink-2); }
.notes__body a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
@media (hover: hover) and (pointer: fine) { .notes__body a:hover { text-decoration-thickness: 2px; } }
@media (min-width: 900px) {
  .notes__row { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: clamp(2rem, 6vw, 6rem); }
}

/* Who gets paid what (Rx Peps Direct). */
.ledger { margin: .4rem 0; max-width: 46rem; }
.ledger > div { display: grid; grid-template-columns: 12.5rem minmax(0, 1fr); gap: 1rem; align-items: baseline; padding: 1.1rem 0; border-top: 1px solid var(--hair); }
.ledger > div:last-child { border-bottom: 1px solid var(--hair); }
.ledger dt { font: 760 clamp(1.5rem, 1.2rem + 1vw, 2rem)/1 var(--font-display); font-variation-settings: "wdth" 112; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ledger dd { margin: 0; color: var(--ink-2); max-width: 40ch; font-size: clamp(1rem, .95rem + .3vw, 1.1875rem); }
@media (max-width: 640px) { .ledger > div { grid-template-columns: 1fr; gap: .35rem; } }

/* Who does what (ConduitMD). */
.duo { display: grid; gap: 1.75rem; max-width: 46rem; }
.duo h3 { font: 600 1rem/1.3 var(--font-text); color: var(--ink-2); margin-bottom: .5rem; }
.duo li { padding: .7rem 0; border-top: 1px solid var(--hair); font-size: clamp(1.0625rem, 1rem + .4vw, 1.3rem); }
@media (min-width: 560px) { .duo { grid-template-columns: 1fr 1fr; column-gap: clamp(1.5rem, 4vw, 3rem); } }

/* ---------- Band: a supplied chart at full width (Recovery Delivered) ---------- */
.band { background: var(--flood-grad, var(--flood)); color: var(--on-flood); padding: var(--section) var(--pad); }
.band__in { max-width: 1320px; margin: 0 auto; display: grid; gap: clamp(1.5rem, 4vw, 3rem); }
.band__head { display: grid; gap: .75rem; }
.band__head p { color: var(--on-flood-2); max-width: 44ch; }
.band .fig__plot { flex: none; height: clamp(180px, 34vw, 420px); }
.band .fig__axis { font-size: .875rem; }
.band ::selection, .film--chart ::selection { background: var(--flood-accent); }
.film-on .band .fig__ink { clip-path: inset(-12px 100% -12px -12px); transition: clip-path 1900ms var(--ease-in-out) 200ms; }
.film-on .band.is-in .fig__ink { clip-path: inset(-12px); }
.film-on .band.is-in .fig__end { scale: 1; transition-delay: 2000ms; }

/* ---------- Next company and footer ---------- */
.next { display: block; border-top: 1px solid var(--hair); padding: clamp(2.5rem, 7vw, 5rem) var(--pad); }
.next__in { max-width: 1320px; margin: 0 auto; display: grid; gap: .75rem; }
.next__name {
  display: block; padding-bottom: .12em;
  font: 800 clamp(2.1rem, 1rem + 5.4vw, 5.5rem)/1 var(--font-display);
  font-variation-settings: "wdth" 125, "wght" 800; letter-spacing: -.035em;
}
/* The last word, its period and the arrow wrap together. */
.next__tail { white-space: nowrap; }
.next__name .pd { width: .2em; height: .2em; margin-left: .05em; }
.next__name svg { display: inline-block; width: .6em; height: .6em; margin-left: .3em; vertical-align: -.03em; transition: transform 320ms var(--ease-out); }
.next__label { color: var(--ink-2); }
.next:active .next__name svg { transform: translateX(4px); }
@media (hover: hover) and (pointer: fine) { .next:hover .next__name svg { transform: translateX(10px); } }

.foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
  border-top: 1px solid var(--hair);
  padding: 2rem var(--pad) max(2rem, env(safe-area-inset-bottom));
}
.foot__brand { font: 760 1.125rem/1 var(--font-display); font-variation-settings: "wdth" 112; letter-spacing: -.01em; padding: .75rem 0; }
.foot__links { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
.foot__fine { flex-basis: 100%; color: var(--ink-2); font-size: .875rem; }

/* =====================================================================
   Rx Peps Direct: the visitor chart draws as you scroll, the period riding the tip of the line.
   ===================================================================== */
.film--chart { background: var(--flood-grad, var(--flood)); color: var(--on-flood); }
.chart { max-width: calc(1320px + 2 * var(--pad)); margin: 0 auto; padding: var(--section) var(--pad); display: grid; gap: clamp(1rem, 2.6vh, 1.75rem); }
.chart__head h2 {
  font: 800 clamp(4.5rem, 2rem + 13vw, 9rem)/.9 var(--font-display);
  font-variation-settings: "wdth" 125, "wght" 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  [data-co="rx"] .chart__head h2 {
    width: fit-content; padding-block: .06em; margin-block: -.06em;
    background: var(--num-grad); -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
  }
}
.chart__head p { margin-top: .5rem; color: var(--on-flood-2); font-size: clamp(1.125rem, 1rem + .6vw, 1.5rem); }
.chart__plot { position: relative; height: clamp(180px, 38vw, 420px); margin-right: 9px; border-bottom: 1px solid color-mix(in srgb, var(--on-flood) 24%, transparent); }
.chart__ink { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart__tip { position: absolute; right: -8px; top: var(--end); width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--flood-accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--flood-accent) 24%, transparent); }
.chart__axis { display: flex; justify-content: space-between; gap: 1rem; margin-right: 9px; font-size: .875rem; color: var(--on-flood-2); }
.chart__notes { display: grid; gap: .35rem; font-size: clamp(1.0625rem, 1rem + .5vw, 1.375rem); }
.chart__notes span { display: block; padding: .1em 0; }
@media (min-width: 700px) {
  .chart__notes { grid-template-columns: 1fr 1fr; }
  .chart__notes p + p { text-align: right; }
}
.film-on .film--chart { height: 320vh; }
.film-on .chart { height: 100%; padding-block: 6rem 1.5rem; grid-template-rows: auto minmax(0, 1fr) auto auto; }
.film-on .chart__plot { height: auto; min-height: 0; }
.film-on .chart__tip { right: auto; left: 0; top: 0; margin: -8px 0 0 -8px; will-change: transform; }

/* =====================================================================
   Recovery Delivered: the clinic travels to the patient and becomes a phone.
   ===================================================================== */
.near { padding: var(--section) var(--pad); display: grid; gap: 1.5rem; justify-items: center; text-align: center; }
.near__lines { display: grid; gap: 1.25rem; justify-items: center; }
.near__line {
  max-width: 17ch; padding-bottom: .14em;
  font: 760 clamp(1.9rem, 1rem + 4.2vw, 4.25rem)/1.04 var(--font-display);
  font-variation-settings: "wdth" 112; letter-spacing: -.025em; text-wrap: balance;
}
.near__line > span { display: block; }
.near__rig { display: none; }

.film-on .film--near { height: 380vh; }
.film-on .near { height: 100%; padding-block: 6.5rem 2.5rem; grid-template-rows: minmax(0, 1fr) auto; gap: 1rem; }
.film-on .near__lines { display: block; position: relative; width: 100%; }
.film-on .near__line { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 100%; }
.film-on .near__rig { display: block; position: relative; width: min(100%, 860px); height: clamp(210px, 36vh, 320px); }
.near__rig > * { position: absolute; }
.near__rail { left: 24px; right: 24px; top: 50%; height: 2px; margin-top: -1px; background: var(--hair); }
.near__shape, .near__hole { inset: 0; will-change: clip-path; }
.near__shape { background: var(--ink); }
.near__hole { background: var(--canvas); }
.near__notch { left: 50%; top: 0; width: 34px; height: 6px; margin-left: -17px; border-radius: 3px; background: var(--ink); }
.near__you, .near__pro { left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; will-change: transform; }
.near__you { background: var(--accent); }
.near__pro { background: var(--ink); }
.near__tag { top: calc(50% + 38px); translate: -50% 0; font-size: .9375rem; color: var(--ink-2); white-space: nowrap; }
.near__tag--you { left: 24px; }
.near__tag--clinic { left: calc(100% - 24px); }

/* =====================================================================
   ConduitMD: the business's name on the front, the medical side rolling out from behind it.
   ===================================================================== */
.stack { max-width: calc(1180px + 2 * var(--pad)); margin: 0 auto; padding: var(--section) var(--pad); display: grid; gap: clamp(1.25rem, 3.5vh, 2.5rem); }
.stack__title { font-size: clamp(1.8rem, 1rem + 3.4vw, 3.75rem); }
.stack__title span { display: block; }
.stack__card { display: grid; gap: 12px; }
.stack__front, .stack__back { position: relative; border-radius: var(--r-card); padding: clamp(1.25rem, 2.4vw, 2.25rem); display: grid; gap: .9rem; align-content: start; }
.stack__front { z-index: 1; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); }
.stack__back { background: var(--flood-grad, var(--flood)); color: var(--on-flood); box-shadow: inset 0 1px 0 rgb(255 255 255 / .14); }
.stack__label { font-size: .9375rem; color: var(--ink-2); }
.stack__back .stack__label { color: var(--on-flood-2); }
.stack__brands { display: grid; gap: .2rem; font: 800 clamp(1.7rem, 1rem + 3.2vw, 3.4rem)/1.04 var(--font-display); font-variation-settings: "wdth" 125, "wght" 800; letter-spacing: -.035em; }
.stack__brand { padding-bottom: .14em; }
.stack__brand > span { display: block; }
.stack__owns { color: var(--ink-2); max-width: 32ch; }
.stack__list { position: relative; }
.stack__steps li { display: flex; align-items: center; gap: .9rem; min-height: 44px; font: 600 clamp(1.0625rem, 1rem + .5vw, 1.375rem)/1.2 var(--font-text); letter-spacing: -.01em; }
.stack__steps li::before { content: ""; flex: none; width: 10px; height: 10px; margin-left: 6px; border-radius: 50%; background: var(--flood-accent); transition: background-color 260ms ease, scale 420ms var(--ease-out); }
.stack__rail, .stack__runner { display: none; }
@media (min-width: 900px) {
  .stack__card { grid-template-columns: 1fr 1fr; min-height: clamp(300px, 46vh, 460px); }
  .stack__front { align-content: space-between; }
  .stack__back { align-content: center; }
}
@media (max-height: 760px) { .stack__owns { display: none; } .stack__steps li { min-height: 36px; } }

.film-on .film--stack { height: 400vh; }
.film-on .stack { height: 100%; align-content: center; padding-block: 5.75rem 1.25rem; }
.film-on .stack__brands { display: block; position: relative; height: 2.2em; }
.film-on .stack__brand { position: absolute; left: 0; top: 0; width: 100%; }
.film-on .stack__back { will-change: clip-path, transform; }
.film-on .stack__rail { display: block; position: absolute; left: 10px; top: 22px; bottom: 22px; width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--on-flood) 20%, transparent); }
.film-on .stack__runner { display: block; position: absolute; left: 0; top: 0; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; background: var(--flood-accent); will-change: transform; }
.film-on .stack__steps li { position: relative; z-index: 1; transition: color 320ms ease, opacity 320ms ease; }
.film-on .stack__steps li:not(.is-lit) { color: var(--on-flood-2); opacity: .6; }
.film-on .stack__steps li:not(.is-lit)::before { background: color-mix(in srgb, var(--on-flood) 34%, var(--flood)); scale: .7; }
.film-on .stack__title-b { transition: color 420ms ease, opacity 420ms ease; }
.film-on .stack__title-b:not(.is-lit) { color: var(--ink-2); opacity: .45; }
@media (max-height: 760px) { .film-on .film--stack .stack__steps li { min-height: 32px; } .film-on .stack__rail { top: 16px; bottom: 16px; } }

/* =====================================================================
   The Drug Rehab Agency: ten years count up, then the ten dots become the period after "Sold".
   ===================================================================== */
.decade { padding: var(--section) var(--pad); display: grid; gap: 2rem; justify-items: center; text-align: center; }
.decade__slot { display: grid; gap: 2rem; justify-items: center; }
.decade__count {
  font: 800 clamp(6rem, 2rem + 24vw, 15rem)/.9 var(--font-display);
  font-variation-settings: "wdth" 125, "wght" 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums;
}
.decade__plus { display: inline-block; }
.decade__label { margin-top: .5rem; font-size: clamp(1.125rem, 1rem + .8vw, 1.75rem); color: var(--ink-2); }
.decade__sold {
  display: inline-flex; align-items: flex-end;
  font: 800 clamp(4.5rem, 2rem + 16vw, 12rem)/.92 var(--font-display);
  font-variation-settings: "wdth" 125, "wght" 800; letter-spacing: -.035em; padding-bottom: .04em;
}
.decade__period { flex: none; width: .2em; height: .2em; margin: 0 0 .145em .05em; border-radius: 50%; background: var(--accent); }
.decade__dots { display: none; }

.film-on .film--decade { height: 320vh; }
.film-on .decade { height: 100%; align-content: center; padding-block: 6rem 2rem; }
.film-on .decade__slot { gap: 0; }
.film-on .decade__slot > * { grid-area: 1 / 1; align-self: center; padding: .12em .1em 0; }
.film-on .decade__period { visibility: hidden; }
.film-on .decade__dots { display: flex; gap: clamp(7px, 2.2vw, 20px); }
.decade__dots i { width: clamp(12px, 2.6vw, 18px); aspect-ratio: 1; border-radius: 50%; background: var(--hair); transition: background-color 220ms ease; will-change: transform; }
.decade__dots i.is-lit { background: var(--accent); }
