/* ==========================================================================
   Outcomes page (.out-*)
   Hero with results + example screens · metric cards · impact calculator · stories teaser
   ========================================================================== */

/* ---------- Hero ---------- */
.out-hero { padding-top: calc(var(--header-h) + clamp(48px, 6vw, 84px)); padding-bottom: clamp(72px, 9vw, 128px); }
.out-hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
/* Restrained firelight behind the example screens, plus faint vertical data streaks (concept texture, <= 3%). */
.out-hero__bg::before {
  content: ""; position: absolute; right: -14%; top: 4%; width: min(1100px, 110vw); aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(242, 161, 91, 0.12), rgba(199, 102, 44, 0.045) 48%, transparent 74%);
}
/* Streaks stay behind the visual side, clear of the copy and its small captions. */
.out-hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(214, 226, 240, 0.028) 0 1px, transparent 1px 112px);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 62%, transparent 100%), linear-gradient(90deg, transparent 45%, #000 70%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 62%, transparent 100%), linear-gradient(90deg, transparent 45%, #000 70%);
  mask-composite: intersect;
}
.out-hero__grid { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.out-hero h1 { line-height: 1.02; letter-spacing: -0.035em; max-width: 9.2em; } /* size: shared --fs-h1 */
.out-hero .lede { max-width: 30em; }

/* Stat list with hairlines (concept deck-05) */
.out-stats__kicker { margin-top: clamp(40px, 4vw, 56px); font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); }
.out-stats { list-style: none; margin-top: 14px; }
.out-stats .stat-row { grid-template-columns: clamp(132px, 12vw, 176px) minmax(0, 1fr); gap: 24px; padding-block: 18px; }
.out-stats .stat-value { font-size: clamp(2.35rem, 1.75rem + 1.7vw, 3.2rem); white-space: nowrap; }
.out-stats__label { color: var(--text); font-size: var(--fs-small); line-height: 1.4; }
.out-stats__where { margin-top: 5px; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.02em; color: var(--text-3); }
.stat-value .out-unit { font-size: 0.4em; letter-spacing: 0; vertical-align: 0.95em; font-weight: 400; }

/* Example screens */
.out-hero__visual { position: relative; margin: 0; display: grid; gap: 16px; isolation: isolate; }
.out-hero__visual::before {
  content: ""; position: absolute; inset: 10% -8% -4% -8%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(242, 161, 91, 0.16), rgba(125, 180, 255, 0.05) 60%, transparent);
  filter: blur(30px);
}
.out-hero__visual .panel { box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9); }
.out-hero__visual .bars { height: clamp(120px, 12vw, 164px); }
/* Read before the figures: the caption leads the figure. */
.out-caption { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: -4px; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.02em; color: var(--text-2); }
.out-caption span { width: 18px; height: 1px; background: var(--ember); opacity: 0.8; }
/* Panel titles from the shared mocks, rendered as paragraphs (see asExample in outcomes.mjs). */
.out-mock-title { font-family: var(--font-display); font-size: 1rem; font-weight: 500; letter-spacing: -0.005em; line-height: 1.25; color: var(--text); }

/* ---------- What moves ---------- */
.out-metrics { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: clamp(48px, 6vw, 72px); }
.out-metric {
  --p: var(--ember); --p2: var(--p);
  position: relative; display: flex; flex-direction: column; padding: clamp(24px, 2.2vw, 30px); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)), var(--surface);
  border: 1px solid var(--line); overflow: hidden; isolation: isolate; transition: border-color 0.35s;
}
/* Product-colored top edge and a faint glow: product color where it is earned. */
.out-metric::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent 4%, var(--p) 30%, var(--p2) 70%, transparent 96%); opacity: 0.85; }
.out-metric::after { content: ""; position: absolute; left: 12%; right: 12%; top: -55%; height: 80%; z-index: -1; background: radial-gradient(closest-side, color-mix(in srgb, var(--p) 16%, transparent), transparent); opacity: 0.55; transition: opacity 0.45s var(--ease); }
.out-metric:hover, .out-metric:focus-within { border-color: color-mix(in srgb, var(--p) 32%, var(--line)); }
.out-metric:hover::after, .out-metric:focus-within::after { opacity: 1; }
/* The query container is a wrapper, not the card: containment on the card would stop it being a subgrid. */
.out-metric__head { container: out-metric / inline-size; }
.out-metric__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
/* Narrow cards: stack area and goal in every card, not only where the longer labels wrap,
   so the headings in a row stay level ("Prior authorization" + its pill needs ~315px). */
@container out-metric (max-width: 330px) {
  .out-metric__top { flex-direction: column; align-items: flex-start; gap: 10px; }
}
.out-metric__area { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: color-mix(in srgb, var(--p) 62%, var(--text)); }
.out-metric__goal { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border: 1px solid var(--line-strong); border-radius: 999px; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-2); white-space: nowrap; }
.out-metric__goal svg { width: 14px; height: 14px; color: color-mix(in srgb, var(--p) 75%, var(--text)); }
.out-metric h3 { margin-top: clamp(28px, 3vw, 40px); font-size: clamp(1.4rem, 1.15rem + 0.6vw, 1.7rem); font-weight: 400; letter-spacing: -0.025em; line-height: 1.15; }
.out-metric__text { margin-top: 14px; font-size: 0.9375rem; line-height: 1.6; color: var(--text-2); }
.out-metric__foot { margin-top: auto; padding-top: 28px; }
/* Cards in a row share three row tracks (head, body, foot), so the "Moved by" rules stay level when
   one card's chips wrap. Heading and text share one track: a wrapped heading never opens a gap
   under the heading of its neighbours. */
@supports (grid-template-rows: subgrid) {
  .out-metric { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; }
  .out-metric__foot { margin-top: 0; }
}
.out-metric__by { padding-top: 18px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.out-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.out-chip {
  display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 6px 14px 6px 7px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.02); color: var(--text); font-size: 0.875rem; font-weight: 500;
  transition: border-color 0.2s, background-color 0.2s;
}
.out-chip .pmark { width: 24px; height: 24px; }
.out-chip:hover { border-color: color-mix(in srgb, var(--p, var(--ember)) 60%, transparent); background: color-mix(in srgb, var(--p, var(--ember)) 9%, transparent); }
.out-chip--platform { padding-left: 12px; }
.out-chip--platform img { width: auto; height: 24px; }

/* ---------- Impact calculator ---------- */
.out-impact { border-top: 1px solid var(--line); }
.out-calc {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); margin-top: clamp(44px, 5.5vw, 72px);
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008)), var(--surface);
  box-shadow: 0 50px 100px -50px rgba(0, 0, 0, 0.9);
  overflow: hidden; overflow: clip; /* clip keeps position: sticky working inside */
}
.out-calc__inputs { display: grid; gap: 44px; padding: clamp(24px, 3.6vw, 52px); }
.out-calc fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 30px; }
.out-calc legend { display: flex; align-items: center; gap: 14px; width: 100%; padding: 0; margin-bottom: 26px; font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); }
.out-calc legend::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.out-field { display: grid; gap: 4px; } /* the 40px range adds its own air around the 4px track */
.out-field__row { display: flex; align-items: baseline; align-items: last baseline; justify-content: space-between; gap: 20px; }
.out-field label { color: var(--text); font-size: 0.9375rem; font-weight: 500; line-height: 1.4; }
.out-field output { flex: none; font-family: var(--font-display); font-size: 1.125rem; font-weight: 400; color: var(--text); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.out-field__scale { display: flex; justify-content: space-between; margin-top: -2px; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-3); }
.out-field__hint { margin-top: 6px; font-size: var(--fs-xs); color: var(--text-2); line-height: 1.5; }
.out-tag { display: table; margin-bottom: 8px; padding: 2px 8px; border: 1px solid rgba(242, 161, 91, 0.42); border-radius: 999px; background: rgba(242, 161, 91, 0.06); font-family: var(--font-mono); font-size: 0.625rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ember); vertical-align: 2px; }
/* 40px hit area (44px on touch); the visible track stays 4px. */
.out-calc .range { height: 40px; cursor: pointer; background: linear-gradient(90deg, var(--ember) var(--fill, 50%), var(--surface-3) var(--fill, 50%)) center / 100% 4px no-repeat; border-radius: 0; }
@media (pointer: coarse) { .out-calc .range { height: 44px; } }
.out-calc .range::-moz-range-track { background: transparent; }
/* The shared .range rule removes the outline; restore a clear focus ring here. */
.out-calc .range:focus-visible { outline: 2px solid var(--ember-hot); outline-offset: 2px; border-radius: 6px; }
.out-calc .range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 6px rgba(242, 161, 91, 0.45); }

.out-calc__results { position: relative; isolation: isolate; padding: clamp(24px, 3.6vw, 52px); border-left: 1px solid var(--line); background: linear-gradient(180deg, rgba(7, 9, 12, 0.5), rgba(7, 9, 12, 0.82)); }
.out-calc__results::before {
  content: ""; position: absolute; left: 50%; bottom: -28%; width: 150%; aspect-ratio: 2 / 1; transform: translateX(-50%); z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(242, 161, 91, 0.2), rgba(199, 102, 44, 0.07) 55%, transparent);
}
.out-calc__sticky { position: sticky; top: calc(var(--header-h) + 32px); }
/* Short laptop screens: the whole panel (with the formulas open) would not fit while pinned. */
@media (min-width: 901px) and (max-height: 860px) { .out-calc__sticky { position: static; } }
.out-res__kicker { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ember); }
.out-res__kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 3px rgba(242, 161, 91, 0.2), 0 0 14px rgba(242, 161, 91, 0.6); }
.out-res__main, .out-res__rest { container-type: inline-size; }
.out-res__main > div { margin-top: 28px; }
.out-res__label { font-size: 0.9375rem; color: var(--text-2); }
.out-res__big {
  margin-top: 12px; font-family: var(--font-display); font-weight: 300; letter-spacing: -0.045em; line-height: 1;
  font-size: 3rem; font-size: clamp(2.2rem, 12.5cqi, 4.6rem);
  color: var(--ember); font-variant-numeric: tabular-nums; text-shadow: 0 0 48px rgba(242, 161, 91, 0.28); overflow-wrap: anywhere;
}
.out-res__list { margin: 36px 0 0; }
.out-res__list > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; padding-block: 16px; border-top: 1px solid var(--line); }
.out-res__list > div:last-child { border-bottom: 1px solid var(--line); }
.out-res__list dt { font-size: 0.9375rem; color: var(--text-2); }
.out-res__list dd { margin: 0; margin-left: auto; font-family: var(--font-display); font-size: clamp(1.35rem, 1.15rem + 0.55vw, 1.7rem); font-weight: 300; letter-spacing: -0.025em; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Narrow results column (tablet two-column, phones): label above value on every row. */
@container (max-width: 440px) {
  .out-res__list > div { flex-direction: column; align-items: flex-start; gap: 4px; }
  .out-res__list dd { margin-left: 0; }
}
.out-calc__note { margin-top: 24px; font-size: var(--fs-xs); line-height: 1.65; color: var(--text-2); max-width: 44em; }
.out-calc__note [data-out] { color: var(--ember-hot); font-weight: 600; font-variant-numeric: tabular-nums; }
/* "Both are adjustable on the left / above": the sliders sit above the results in one column. */
.out-where-narrow { display: none; }
.out-how { margin-top: 10px; }
.out-how summary { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding-block: 10px; cursor: pointer; list-style: none; font-size: 0.875rem; font-weight: 500; color: var(--text); }
.out-how summary::-webkit-details-marker { display: none; }
.out-how summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2); transform: rotate(-45deg); transition: transform 0.25s var(--ease); }
.out-how[open] summary::before { transform: rotate(45deg) translate(-2px, -1px); }
.out-how summary:hover { color: var(--ember-hot); }
.out-how ol { list-style: none; display: grid; gap: 8px; margin-top: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.02); font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.55; color: var(--text-2); }
.out-how b { color: var(--text); font-weight: 500; }
.out-res__cta { margin-top: 28px; }

/* ---------- Stories teaser ---------- */
.out-stories__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 48px; }
.out-stories__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: clamp(44px, 5.5vw, 72px); }
.out-story {
  --p: var(--ember);
  position: relative; display: flex; flex-direction: column; padding: clamp(24px, 2.2vw, 30px); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)), var(--surface);
  border: 1px solid var(--line); overflow: hidden; isolation: isolate; transition: border-color 0.35s, transform 0.35s var(--ease);
}
.out-story::before { content: ""; position: absolute; inset: auto -20% -60% -20%; height: 90%; z-index: -1; background: radial-gradient(closest-side, color-mix(in srgb, var(--p) 26%, transparent), transparent); opacity: 0; transition: opacity 0.45s var(--ease); }
.out-story:hover, .out-story:focus-within { border-color: color-mix(in srgb, var(--p) 42%, transparent); }
.out-story:hover::before, .out-story:focus-within::before { opacity: 1; }
@media (prefers-reduced-motion: no-preference) { .out-story:hover, .out-story:focus-within { transform: translateY(-4px); } }
.out-story__where { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: color-mix(in srgb, var(--p) 55%, var(--text)); }
.out-story h3 { margin-top: 16px; font-size: clamp(1.15rem, 1.05rem + 0.35vw, 1.3rem); font-weight: 400; line-height: 1.35; letter-spacing: -0.015em; }
.out-story__stat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: auto; padding-top: 36px; }
.out-story__stat .stat-value { font-size: clamp(2.4rem, 1.95rem + 1.3vw, 3.1rem); white-space: nowrap; }
.out-story__label { font-size: 0.9375rem; color: var(--text-2); }
.out-story__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.out-story__marks { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 0.8125rem; color: var(--text-2); }
.out-story__marks span:last-child { margin-left: 4px; }
.out-story__go { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--text); transition: border-color 0.3s, background-color 0.3s; }
.out-story__go svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease); }
.out-story:hover .out-story__go, .out-story:focus-within .out-story__go { border-color: color-mix(in srgb, var(--p) 70%, transparent); background: color-mix(in srgb, var(--p) 14%, transparent); }
@media (prefers-reduced-motion: no-preference) { .out-story:hover .out-story__go svg { transform: translateX(2px); } }
.out-story a.cover { position: absolute; inset: 0; z-index: 1; }
.out-story a.cover:focus-visible { outline-offset: -3px; border-radius: var(--radius); }

/* ---------- Responsive ---------- */
/* Small laptops: a wider copy column keeps the h1 on two lines and both hero actions on one row.
   The default split still breaks the h1 onto three lines up to ~1115px, so the band runs to 1139px. */
@media (min-width: 901px) and (max-width: 1139px) {
  .out-hero__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 40px; }
}
/* 901-940px: the copy column is ~406px; a tighter gap keeps "Estimate your impact" beside the button. */
@media (min-width: 901px) and (max-width: 940px) {
  .out-hero .actions { column-gap: 20px; }
}
/* Three metric cards per row stop lining up below ~1250px; two per row keeps the headings level. */
@media (max-width: 1250px) {
  .out-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .out-stories__grid { grid-template-columns: minmax(0, 1fr); }
  .out-story { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 40px; }
  .out-story__where, .out-story h3 { grid-column: 1; }
  .out-story__stat { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; align-items: flex-end; text-align: right; padding-top: 0; margin-top: 0; gap: 8px; }
  .out-story__foot { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .out-hero__bg::after { display: none; }
  .out-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .out-where-wide { display: none; }
  .out-where-narrow { display: inline; }
  /* Keep a focused control clear of the pinned summary bar (about 95px tall). */
  .out-calc .range, .out-calc summary, .out-calc a { scroll-margin-bottom: 128px; }
  .out-hero__visual { max-width: 640px; }
  .out-calc { grid-template-columns: minmax(0, 1fr); }
  /* Single column: the headline figure becomes a summary bar that stays at the bottom of the
     screen while the sliders are in view, then settles into place above the other results. */
  .out-calc__results, .out-calc__sticky { display: contents; }
  .out-calc__results::before { content: none; }
  .out-res__main {
    position: sticky; bottom: 0; z-index: 2;
    padding: 16px clamp(24px, 3.6vw, 52px) calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line-strong);
    background: rgb(9, 12, 16);
    box-shadow: 0 -18px 32px -22px rgba(0, 0, 0, 0.9);
  }
  .out-res__main .out-res__kicker { display: none; }
  .out-res__main > div { margin-top: 0; }
  .out-res__label { font-size: var(--fs-xs); }
  .out-res__big { margin-top: 6px; font-size: 2.2rem; font-size: clamp(1.9rem, 11.5cqi, 3rem); }
  .out-res__rest {
    position: relative; isolation: isolate; overflow: hidden;
    margin-top: -1px; /* no subpixel seam under the summary bar */
    padding: 5px clamp(24px, 3.6vw, 52px) clamp(28px, 4vw, 44px);
    background: rgb(9, 12, 16);
  }
  .out-res__rest::before {
    content: ""; position: absolute; left: 50%; bottom: -40%; width: 150%; aspect-ratio: 2 / 1; transform: translateX(-50%); z-index: -1; pointer-events: none;
    background: radial-gradient(closest-side, rgba(242, 161, 91, 0.18), rgba(199, 102, 44, 0.06) 55%, transparent);
  }
  .out-res__list { margin-top: 8px; }
}
@media (max-width: 640px) {
  .out-metrics { grid-template-columns: minmax(0, 1fr); }
  .out-story { display: flex; }
  .out-story__stat { flex-direction: row; align-items: baseline; text-align: left; margin-top: auto; padding-top: 32px; gap: 6px 14px; }
  .out-stats .stat-row { grid-template-columns: 116px minmax(0, 1fr); gap: 18px; }
  .out-field__row { gap: 14px; }
  .out-field label { font-size: 0.875rem; }
  .out-calc__inputs { gap: 36px; }
  .out-caption { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .out-metric, .out-metric::after, .out-story, .out-story::before, .out-chip, .out-how summary::before { transition: none; }
}
