/* ==========================================================================
   Gel4Med redesign — MISC.CSS
   Isolated, page-section stylesheets that are NOT bound to the core type
   scale (Hero + H1–H6 + the 6-step copy scale). Each one gets its own small,
   internally-consistent set of sizes instead of borrowing from the core 13 —
   a dense data table or a stage tracker has different needs than a headline.

   Currently: PIPELINE (the accordion table + its accordion detail rows,
   used on the homepage and every platform page). ROADMAP is expected to
   join this file the same way once that page exists — add it as its own
   clearly-bannered section below, don't merge it into Pipeline's rules.

   Load AFTER styles.css (uses its --pipe-* custom properties and spacing
   tokens) and after platform.css.
   ========================================================================== */

/* ============================================================ PIPELINE == */


.pipe-head {
  display: grid;
  grid-template-columns: var(--pipe-cols, 1.1fr 1.1fr 2.6fr 40px);
  gap: var(--s-6);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--pipe-line);
}
.pipe-head .label { color: var(--pipe-muted); }
/* Right padding matches the per-row stage label so the headers align to the
   track itself, not to the track + label. */
.pipe-stages { display: flex; justify-content: space-between; padding-right: calc(88px + var(--s-4)); }
.pipe-stages span { font-family: var(--font-mono); font-size: var(--fs-lb); line-height: var(--lh-lb); letter-spacing: 0.08em; text-transform: uppercase; color: var(--pipe-muted); }

.pipe-row { border-bottom: 1px solid var(--pipe-line); }
.pipe-row-btn {
  display: grid;
  grid-template-columns: var(--pipe-cols, 1.1fr 1.1fr 2.6fr 40px);
  gap: var(--s-6);
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding-block: var(--s-4);
  text-align: left;
  transition: background-color 0.24s var(--ease);
}
.pipe-row-btn[aria-expanded] { cursor: pointer; }
.pipe-row.is-static .pipe-row-btn { cursor: default; }
.pipe-row-btn:hover { background: var(--pipe-hover); }
.pipe-row.is-static .pipe-row-btn:hover { background: transparent; }

.pipe-name { font-size: var(--fs-bl); line-height: var(--lh-bl); color: var(--pipe-ink); font-weight: 500; }
.pipe-ind { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--pipe-muted); }
.pipe-row.is-static .pipe-name { color: var(--pipe-muted); }

.pipe-track { position: relative; height: 8px; background: var(--pipe-track); border-radius: 999px; overflow: hidden; }
.pipe-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0;
  background: var(--pipe-bar);
  border-radius: 999px;
  transition: width 1.1s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.pipe-row.is-in .pipe-fill { width: var(--w); }
.pipe-bar-wrap { display: flex; align-items: center; gap: var(--s-4); }
.pipe-bar-wrap .pipe-track { flex: 1; }
.pipe-stage-label { font-family: var(--font-mono); font-size: var(--fs-lb); line-height: var(--lh-lb); letter-spacing: 0.08em; text-transform: uppercase; color: var(--pipe-ink); white-space: nowrap; min-width: 88px; }
.pipe-row.is-static .pipe-stage-label { color: var(--pipe-muted); }

.pipe-chev { justify-self: end; width: 40px; height: 40px; display: grid; place-items: center; color: var(--pipe-muted); }
.pipe-chev i { display: block; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px,-2px); transition: transform 0.3s var(--ease); }
.pipe-row-btn[aria-expanded="true"] .pipe-chev i { transform: rotate(225deg) translate(-2px,-2px); }

.pipe-detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.45s var(--ease-out); }
.pipe-detail.is-open { grid-template-rows: 1fr; }
.pipe-detail > div { overflow: hidden; }
.pipe-detail-in { padding: var(--s-2) 0 var(--s-8); max-width: 76ch; }
.pipe-detail-in p { color: var(--pipe-muted); font-size: var(--fs-b); line-height: var(--lh-b); }
.pipe-detail-in p + p { margin-top: var(--s-4); }
.pipe-detail-in .label { color: var(--pipe-ink); margin-bottom: var(--s-3); display: block; }
.pipe-meta { display: flex; flex-wrap: wrap; gap: var(--s-6); margin-top: var(--s-6); }
.pipe-meta div { display: flex; flex-direction: column; gap: var(--s-1); }
.pipe-meta dt { font-family: var(--font-mono); font-size: var(--fs-lb); line-height: var(--lh-lb); letter-spacing: 0.1em; text-transform: uppercase; color: var(--pipe-muted); }
.pipe-meta dd { margin: 0; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--pipe-ink); }

@media (max-width: 860px) {
  .pipe-head { display: none; }
  .pipe-row-btn { grid-template-columns: 1fr 40px; row-gap: var(--s-3); align-items: start; }
  .pipe-name { grid-column: 1; }
  .pipe-chev { grid-row: 1; grid-column: 2; }
  .pipe-ind, .pipe-bar-wrap { grid-column: 1 / -1; }
}


h1, h2, h3, .lede, .vision-copy, .quote blockquote, .pipe-foot h3, .panel-pull {
  font-family: var(--font-display);
  font-weight: 200;
  letter-spacing: -0.012em;
}

/* Pipeline ------------------------------------------------------------------ */
.pipeline-sec { background: var(--black); border-block: 1px solid rgba(255,255,255,0.08); }
.pipe-top { margin-bottom: var(--s-12); }
.pipe-top h2 { font-size: var(--fs-h1); line-height: var(--lh-h1); }
.pipe-fill { box-shadow: 0 0 18px rgba(100,216,234,0.55); }
.pipe-foot { margin-top: var(--s-16); max-width: 62ch; }
.pipe-foot h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); margin-bottom: var(--s-4); }
.pipe-foot p { color: var(--dark-ink-2); }

/* Pipeline column headers and footer labels sit on dark too. */
.pipe-head .label,
.pipe-stages span,
.foot .label { color: rgba(242, 245, 246, 0.78); }

/* ==========================================================================
   PIPELINE — real assets, light ground, room to breathe.
   Cyan is weak on white (1.6:1), so the fills use the deeper #00b8d5 from
   their own palette; the pale cyan stays for the completed rows' glow.
   ========================================================================== */
.pipeline-sec {
  background: linear-gradient(180deg, #f6fbfc 0%, #eef7fa 100%);
  color: var(--text-on-light);
  border-block: 1px solid #dfeaee;
  padding-block: var(--section-pad);
}
.pipeline-sec .label { color: var(--ink-2); }
.pipeline-sec h2 { color: var(--text-on-light); margin-bottom: var(--s-16); }
.pl-legend,
.pl-head {
  display: grid;
  grid-template-columns: 1.5fr 1.35fr 3.2fr 1.5fr 44px;
  gap: var(--s-6);
  align-items: center;
  width: 100%;
  text-align: left;
}
.pl-legend { padding-block: var(--s-4) var(--s-3); }
.pl-stages { display: flex; justify-content: space-between; }
.pl-stages span {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--slate);
}

.pl-row { border-bottom: 1px solid #dbe8ec; }
.pl-head {
  min-height: 104px;                 /* was cramped — this is the breathing room */
  padding-block: var(--s-6);
  transition: background-color 0.25s var(--ease);
}
.pl-row:not(.is-static) .pl-head { cursor: pointer; }
.pl-row:not(.is-static) .pl-head:hover { background: rgba(0, 184, 213, 0.06); }

.pl-asset { font-size: 18px; line-height: 28px; color: var(--ink); font-weight: 500; }
.pl-area  { font-size: 15px; line-height: 24px; color: var(--ink-2); }
.pl-stage {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--slate-2); justify-self: start;
}

.pl-track {
  position: relative; height: 14px;
  background: #dde7ea; border-radius: 999px; overflow: hidden;
}
.pl-fill {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: linear-gradient(90deg, #00b8d5 0%, #38cfe4 100%);
  border-radius: 999px;
  transition: width 1.15s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.pl-row.is-in .pl-fill { width: var(--w); }
/* The two shipping products get the brand cyan and a lift. */
.pl-row:nth-child(2) .pl-fill,
.pl-row:nth-child(3) .pl-fill {
  background: linear-gradient(90deg, #00b8d5 0%, var(--cyan) 100%);
  box-shadow: 0 0 16px rgba(0, 184, 213, 0.45);
}
.pl-row.is-static .pl-asset { color: var(--ink-2); }

.pl-chev { justify-self: end; width: 44px; height: 44px; display: grid; place-items: center; color: var(--slate); }
.pl-chev i {
  display: block; width: 9px; height: 9px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px,-2px);
  transition: transform 0.3s var(--ease);
}
.pl-head[aria-expanded="true"] .pl-chev i { transform: rotate(225deg) translate(-2px,-2px); }

.pl-detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.45s var(--ease-out); }
.pl-detail.is-open { grid-template-rows: 1fr; }
.pl-detail > div { overflow: hidden; }
.pl-detail-in { padding: 0 0 var(--s-8); max-width: 76ch; }
.pl-detail-in p { color: var(--ink-2); }
.pl-meta { display: flex; flex-wrap: wrap; gap: var(--s-8); margin-top: var(--s-6); }
.pl-meta div { display: flex; flex-direction: column; gap: 2px; }
.pl-meta dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate); }
.pl-meta dd { margin: 0; font-size: 15px; color: var(--ink); }

.pipeline-sec .pipe-foot { margin-top: var(--s-24); max-width: 62ch; }
.pipeline-sec .pipe-foot h4 { color: var(--ink); margin-bottom: var(--s-4); }
.pipeline-sec .pipe-foot p { color: var(--ink-2); }
.pipeline-sec .inline-link { color: var(--ink); border-bottom-color: #00b8d5; }

@media (max-width: 900px) {
  .pl-legend { display: none; }
  .pl-head { grid-template-columns: 1fr 44px; row-gap: var(--s-3); align-items: start; min-height: 0; }
  .pl-asset { grid-column: 1; }
  .pl-chev { grid-row: 1; grid-column: 2; }
  .pl-area, .pl-track, .pl-stage { grid-column: 1 / -1; }
}



.pl-legend,
.pl-head {
  grid-template-columns: 1.35fr 1.5fr 4.6fr 44px;
  gap: var(--s-6);
}

.pl-legend { padding: 0 var(--s-6) var(--s-4); align-items: end; }
.pl-h {
  font-size: 14px; line-height: 20px; font-weight: 500;
  color: var(--ink-2);
  font-family: var(--font-body);
  letter-spacing: 0; text-transform: none;
}
.pl-h--group { display: flex; flex-direction: column; gap: var(--s-3); }
.pl-stages { display: flex; justify-content: space-between; gap: var(--s-4); }
.pl-stages span {
  font-family: var(--font-body);
  font-size: 12px; line-height: 16px;
  letter-spacing: 0; text-transform: none;
  color: var(--slate);
  white-space: pre;                 /* never wrap — this was the bug */
}

/* Rows as cards ---------------------------------------------------------- */
.pl-row { border-bottom: 0; margin-bottom: var(--s-2); }
.pl-head {
  min-height: 76px;
  padding: var(--s-4) var(--s-6);
  background: #e9f2f7;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
/* Hover was barely visible — now a clear step darker plus a border. */
.pl-row:not(.is-static) .pl-head:hover {
  background: #d6e8f0;
  border-color: #9fc6d6;
}
.pl-row:not(.is-static) .pl-head:focus-visible { border-color: #00b8d5; }
.pl-row.is-static .pl-head { background: #eff5f8; }

.pl-asset { font-size: 17px; line-height: 24px; font-weight: 500; color: #143a4a; }
.pl-area  { font-size: 15px; line-height: 24px; color: var(--ink-2); }

/* Track + dot + inline stage label --------------------------------------- */
.pl-prog { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: var(--s-6); align-items: center; }
.pl-track { height: 4px; background: #c7dae2; border-radius: 999px; overflow: visible; }
.pl-fill {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: #00b8d5; border-radius: 999px;
  transition: width 1.15s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.pl-row.is-in .pl-fill { width: var(--w); }
.pl-row:nth-child(2) .pl-fill, .pl-row:nth-child(3) .pl-fill { background: #0aa6c4; }
.pl-stage {
  font-family: var(--font-body);
  font-size: 13px; line-height: 20px;
  letter-spacing: 0; text-transform: none;
  color: var(--ink-2); white-space: pre; justify-self: start;
}
.pl-row.is-static .pl-asset { color: #4a6070; }

.pl-chev { color: #5d737b; }
.pl-detail-in { padding: var(--s-4) var(--s-6) var(--s-8); }

@media (max-width: 1100px) {
  .pl-stages span { font-size: 11px; }
  .pl-legend, .pl-head { grid-template-columns: 1.2fr 1.3fr 4.8fr 40px; }
}

@media (max-width: 900px) {
  .pl-legend { display: none; }
  .pl-head { grid-template-columns: 1fr 40px; row-gap: var(--s-3); align-items: start; padding: var(--s-6); }
  .pl-prog { grid-column: 1 / -1; grid-template-columns: minmax(0,1fr) auto; }
}


/* --------------------------------------------------------------------------
   PIPELINE — header labels unified, marker dot removed.
   Every label in the header row now shares one treatment; previously the
   first two were 14px/500 and the stage labels 12px/regular, so the row read
   as two different things. The dot made the track look like a slider control,
   which implied it was draggable. Gone.
   -------------------------------------------------------------------------- */
.pl-h--group { gap: 0; }

.pl-h,
.pl-stages span {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-2);
  white-space: pre;
  border-bottom: 0;
  padding-bottom: 0;
}

.pl-legend { align-items: center; }

/* No dot — the fill simply ends, rounded. Slightly thicker now that the
   marker is gone, so the bar still has presence. */
.pl-track { height: 6px; overflow: hidden; }

/* --------------------------------------------------------------------------
   PIPELINE — heavier headers, larger type.
   All six header labels now carry the heavy treatment (the one the first two
   had), and the whole table steps up a size. Therapeutic Area is free to wrap
   to two lines; the asset column already does.
   -------------------------------------------------------------------------- */
.pl-h,
.pl-stages span {
  font-size: 15px;
  line-height: 24px;
  font-weight: 600;
  color: var(--ink);
}

.pl-asset { font-size: 19px; line-height: 28px; font-weight: 600; }
.pl-area  { font-size: 17px; line-height: 24px; color: var(--ink-2); white-space: normal; }
.pl-stage { font-size: 15px; line-height: 24px; color: var(--ink-2); white-space: normal; }

.pl-head { min-height: 92px; }
.pl-detail-in p { font-size: 16px; line-height: 24px; }
.pl-meta dt { font-size: 12px; }
.pl-meta dd { font-size: 16px; }

@media (max-width: 1100px) {
  .pl-h, .pl-stages span { font-size: 13px; line-height: 20px; }
  .pl-asset { font-size: 17px; }
  .pl-area, .pl-stage { font-size: 15px; }
}


/* Pipeline statement — replaces the heading that just repeated the label. */
.pipe-statement { margin-bottom: var(--s-6); }


/* Statement now stands alone — it needs the space the sub-copy was holding. */
.pipe-statement { max-width: none; margin-bottom: var(--s-16); }
@media (max-width: 640px) { .pipe-statement { max-width: 100%; margin-bottom: var(--s-12); }
}


/* Pipeline bars — 1.15s was over before you could register where each one
   stopped. Slowed, with a per-row stagger so the eight fill in sequence
   rather than all at once. */
.pl-fill { transition: width 2.2s cubic-bezier(0.16, 0.84, 0.28, 1); }

@media (prefers-reduced-motion: reduce) {
  .pl-fill { transition: none; width: var(--w); }
}

/* ============================================================= ROADMAP == */
/* Desktop: a switchback road in its own 1920x1068 space, with the milestones
   as live text sitting on it. Everything on the map scales together with the
   map (--u is one unit of that space), so stops never drift off the road.
   Tablet and phone: the same list stacked down a straight cyan line. */

/* No bottom padding: the team section below is the same white ground, so the
   two read as one chapter, and the gap between them is the in-section content
   gap (96 desktop, 80 tablet, 56 phone) rather than a full section's 160. */
.rm { padding-block: var(--section-pad) 0; }
.rm + .tm { padding-top: var(--content-gap); }
.rm-h { max-width: 26ch; margin-bottom: var(--s-16); }

/* Tighter side padding than a normal section: the map is a diagram, not a
   column of text, and every pixel of width buys legibility in its labels. */
.rm-wrap { padding-inline: var(--s-6); }
.rm-stage {
  position: relative;
  /* 20% wider than the content column: the map carries a lot of small type. */
  max-width: 1536px;
  margin-inline: auto;
  aspect-ratio: 1920 / 1068;   /* ends just under the last row's copy */
  container-type: inline-size;
}
.rm-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.rm-road, .rm-road-base { fill: none; stroke-width: 16; }
.rm-road-base { stroke: var(--line); }   /* the "unbuilt" road, added by js/about.js */
.rm-road { stroke: var(--cyan); }        /* drawn on by js/about.js */

.rm-list { list-style: none; margin: 0; padding: 0; --u: calc(100cqw / 1920); }
/* Each stop hangs from its disc: the disc's centre sits on the road at x, y,
   and the year and copy line up with the disc's left edge below it. */
.rm-stop {
  position: absolute;
  left: calc((var(--x) - 44) * var(--u));
  top: calc((var(--y) - 44) * var(--u));
  width: calc(330 * var(--u));
  display: flex; flex-direction: column; align-items: flex-start;
}
.rm-ico {
  display: block; box-sizing: border-box;
  width: calc(88 * var(--u)); height: calc(88 * var(--u));
  padding: calc(20 * var(--u));
  margin-bottom: calc(20 * var(--u));
  background: var(--white);
  border: calc(3 * var(--u)) solid var(--cyan);
  border-radius: var(--r-circle);
  color: var(--text-on-light);
}
.rm-ico svg { display: block; width: 100%; height: 100%; }
.rm-year {
  font-family: var(--serif); font-weight: 500; color: var(--text-on-light);
  font-size: calc(28 * var(--u)); line-height: calc(36 * var(--u));
  margin: 0 0 calc(8 * var(--u));
}
.rm-copy {
  font-size: calc(21 * var(--u)); line-height: calc(30 * var(--u));
  color: var(--text-second-on-light); margin: 0;
}

/* Timed arrival (desktop, set up by js/about.js): each stop rises in as the
   road reaches it, instead of when it scrolls into view. --reach is its delay. */
@media (min-width: 1025px) {
  .rm-stage.is-timed .rm-stop[data-reveal] { opacity: 0; transform: translateY(8px); transition-delay: var(--reach, 0ms); }
  .rm-stage.is-drawing .rm-stop[data-reveal] { opacity: 1; transform: none; }
}

/* Invisible sentinel: it exists only to receive .is-in from the shared reveal
   observer at the right moment. Nothing is drawn for it. */
.rm-trigger {
  position: absolute; left: 50%; top: 65%;
  width: 1px; height: 1px; opacity: 0; pointer-events: none;
}

@media (max-width: 1024px) {
  .rm-wrap { padding-inline: var(--gutter); }
  .rm-stage { aspect-ratio: auto; max-width: var(--w-reading); container-type: normal; }
  .rm-svg, .rm-trigger { display: none; }

  .rm-list { position: relative; }
  /* The road, straightened: runs from the first stop down past the last. */
  .rm-list::before {
    content: ""; position: absolute; left: 26px; top: 28px; bottom: 0; width: 4px;
    background: linear-gradient(to bottom, var(--cyan) 85%, transparent);
  }
  .rm-stop {
    position: relative; left: auto; top: auto; width: auto;
    display: grid; grid-template-columns: 56px 1fr; column-gap: var(--s-6);
    align-items: start; text-align: left;
    padding-bottom: var(--s-12);
  }
  .rm-year {
    grid-column: 2; font-size: var(--h5-size); line-height: var(--h5-line);
    margin: 10px 0 var(--s-2);
  }
  .rm-copy { grid-column: 2; font-size: var(--body-size); line-height: var(--body-line); }
  .rm-ico {
    grid-column: 1; grid-row: 1 / span 2; position: relative;
    width: 56px; height: 56px; margin: 0; padding: 14px; border-width: 2px;
    z-index: 2;
  }
}

/* Tablet and phone: the straight road draws itself as you scroll (on
   request). A pale "unbuilt" line runs the full length; the cyan line grows
   down over it, its tip held a little below mid-screen (the 60% line set by
   the inset), so it moves at the reader's pace and pulls back on scroll-up.
   Each ring turns from pale to cyan as the line reaches it. Pure CSS
   scroll-driven animation, no script; browsers without it (Firefox today)
   and reduced motion keep the fully drawn line. */
@supports (animation-timeline: view()) {
  @media (max-width: 1024px) and (prefers-reduced-motion: no-preference) {
    /* 1px short of 40%: a zero-height window leaves the timeline inactive. */
    .rm-list { view-timeline: --rm-line block; view-timeline-inset: 60% calc(40% - 1px); }
    .rm-list::after {
      content: ""; position: absolute; left: 26px; top: 28px; bottom: 0; width: 4px;
      background: linear-gradient(to bottom, var(--line) 85%, transparent);
    }
    .rm-list::before {
      z-index: 1;
      transform-origin: top;
      animation: rm-grow linear both;
      animation-timeline: --rm-line;
    }
    .rm-ico {
      animation: rm-lit linear both;
      animation-timeline: view(block 60% calc(40% - 1px));
    }
  }
}
@keyframes rm-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes rm-lit { 0%, 40% { border-color: var(--line); } 60%, 100% { border-color: var(--cyan); } }
@media (prefers-reduced-motion: reduce) { .rm-road { stroke-dashoffset: 0 !important; } }
