/* =====================================================================================
   FENVA SCROLLY — shared pinned "scrollytelling" module (Bruce 2026-10-23)
   API + markup contract: see the header of js/fenva-scrolly.js. Reused by /ordering-process,
   /about (timeline) and /quality; page-specific looks go in the page, not here.
   Base rules (no .is-scrolly) = the static stacked list shown with no JS / reduced motion.
   ===================================================================================== */
.scrolly { --sc-top: 76px; --sc-bot: 0px; --sc-p: 0; --sc-n1: 7; --sc-step: 460px; --sc-tail: 200px; --sc-panel: 240px; position: relative; }
@media (max-width: 767.98px) { .scrolly { --sc-bot: calc(65px + env(safe-area-inset-bottom, 0px)); } }
.scrolly .sc-list { list-style: none; margin: 0; padding: 0; }
.scrolly .sc-rail { display: none; }
.scrolly .sc-hint { display: none; }
.scrolly .sc-art { position: relative; overflow: hidden; background: #F4F7FC; display: flex; align-items: center; justify-content: center; }
/* drawings: a 4:3 box sized by HEIGHT, centred, clipped — never sized by width alone */
.scrolly .sc-art-box { height: 100%; aspect-ratio: 4 / 3; max-width: 100%; overflow: hidden; flex: none; }
.scrolly .sc-art-box > svg { display: block; width: 100%; height: 100%; }
.scrolly .sc-art-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.scrolly .sc-count { font-family: var(--font-mono, "IBM Plex Mono", monospace); font-size: 14px; color: #3C588F; letter-spacing: .08em; }
.scrolly .sc-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* card typography (shared default; a page may override inside its own scope) */
.scrolly .sc-card h3 { margin: 0; color: #0F172A; font-size: 24px; line-height: 1.2; font-weight: 700; }
.scrolly .sc-card p { margin: 0; color: #334155; font-size: 17px; line-height: 1.6; max-width: 66ch; }
.scrolly .sc-links { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 15px; font-weight: 600; }
.scrolly .sc-links a { color: #1A5CE0; text-decoration: none; min-height: 28px; display: inline-flex; align-items: center; }
.scrolly .sc-links a:hover { text-decoration: underline; }
.scrolly .sc-cta { align-self: flex-start; }
@media (max-width: 1023.98px) {
  .scrolly .sc-card h3 { font-size: 20px; }
  .scrolly .sc-card p { font-size: 15px; line-height: 1.55; }
  .scrolly .sc-links { font-size: 14px; gap: 2px 16px; }
}

/* ---- static list, desktop: text left, 360×240 illustration right, 1px card ---- */
@media (min-width: 1024px) {
  .scrolly .sc-list { display: flex; flex-direction: column; gap: 20px; }
  .scrolly .sc-item { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: center;
    border: 1px solid #E2E8F0; border-radius: 12px; padding: 28px; background: #fff; }
  .scrolly .sc-num { display: none; }
  .scrolly .sc-card { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
  .scrolly .sc-art { grid-column: 2; grid-row: 1; height: 240px; border-radius: 10px; }
}
/* ---- static list, mobile: number pill on a 2px line, 150px illustration, then the copy ---- */
@media (max-width: 1023.98px) {
  .scrolly .sc-item { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 14px; padding-bottom: 28px; }
  .scrolly .sc-item:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: #CBD5E1; }
  .scrolly .sc-num { grid-column: 1; grid-row: 1 / span 2; position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 999px;
    display: grid; place-items: center; background: #3C588F; color: #fff; font-family: var(--font-mono, monospace); font-weight: 600; font-size: 15px; }
  .scrolly .sc-art { grid-column: 2; grid-row: 1; height: 150px; border-radius: 10px; margin-bottom: 12px; }
  .scrolly .sc-card { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
}

/* =========================== PINNED MODE (.is-scrolly, set by JS) =========================== */
.scrolly.is-scrolly { height: calc(var(--sc-h) + var(--sc-n1) * var(--sc-step) + var(--sc-tail)); }
.scrolly.is-scrolly .sc-stage { position: sticky; top: var(--sc-top); height: var(--sc-h); box-sizing: border-box; display: grid; overflow: hidden; background: #fff; }
.scrolly.is-scrolly .sc-list,
.scrolly.is-scrolly .sc-item { display: contents; }
.scrolly.is-scrolly .sc-item::before { content: none; }
.scrolly.is-scrolly .sc-num { display: none; }
.scrolly.is-scrolly .sc-rail { display: block; position: relative; }
.scrolly.is-scrolly .sc-rail-list { list-style: none; margin: 0; padding: 0; position: relative; }
.scrolly.is-scrolly .sc-btn { position: relative; border: 0; background: none; padding: 0; margin: 0; font: inherit; cursor: pointer; color: inherit; }
.scrolly.is-scrolly .sc-btn:focus-visible { outline: 2px solid #1A5CE0; outline-offset: 2px; border-radius: 8px; }
.scrolly.is-scrolly .sc-dot { display: flex; align-items: center; justify-content: center; box-sizing: border-box; border-radius: 50%;
  font-family: var(--font-mono, "IBM Plex Mono", monospace); background: #fff; color: #64748B; border: 2px solid #CBD5E1;
  transition: background .3s, color .3s, border-color .3s, width .3s, height .3s, box-shadow .3s; }
.scrolly.is-scrolly .sc-btn[data-sc-state="past"] .sc-dot { background: #3C588F; border-color: #3C588F; color: #fff; }
.scrolly.is-scrolly .sc-btn[data-sc-state="active"] .sc-dot { background: #1A5CE0; border-color: #1A5CE0; color: #fff; }
.scrolly.is-scrolly .sc-line { position: absolute; background: #E2E8F0; }
.scrolly.is-scrolly .sc-fill { position: absolute; left: 0; top: 0; background: #3C588F; }
.scrolly.is-scrolly .sc-card,
.scrolly.is-scrolly .sc-art { grid-row: 1; opacity: 0; pointer-events: none; }
.scrolly.is-scrolly [data-sc-state="active"] > .sc-card,
.scrolly.is-scrolly [data-sc-state="active"] > .sc-art { opacity: 1; pointer-events: auto; transform: none; z-index: 1; }
.scrolly.is-scrolly .sc-card { display: flex; flex-direction: column; min-width: 0; min-height: 0; transition: opacity .45s ease, transform .45s ease; }
.scrolly.is-scrolly .sc-art { transform: scale(1.04); transition: opacity .6s ease, transform .8s ease; }
.scrolly.is-scrolly .sc-hint { display: flex; align-items: center; gap: 8px; margin: 0; color: #64748B; }
.scrolly.is-scrolly .sc-hint svg { flex: none; }

/* ---- desktop stage: rail | card | illustration ---- */
@media (min-width: 1024px) {
  .scrolly.is-scrolly { --sc-h: min(calc(100vh - var(--sc-top)), 860px); }
  @supports (height: 100svh) { .scrolly.is-scrolly { --sc-h: min(calc(100svh - var(--sc-top)), 860px); } }
  .scrolly.is-scrolly .sc-stage { grid-template-columns: 300px minmax(0, 1fr) minmax(0, 1.15fr); grid-template-rows: minmax(0, 1fr);
    column-gap: 56px; padding: 48px 64px; align-items: center; max-width: 1440px; margin: 0 auto; }
  .scrolly.is-scrolly .sc-rail { grid-column: 1; grid-row: 1; align-self: center; }
  .scrolly.is-scrolly .sc-rail-list { display: flex; flex-direction: column; gap: 4px; }
  .scrolly.is-scrolly .sc-line { left: 21px; top: 22px; bottom: 22px; width: 2px; }
  .scrolly.is-scrolly .sc-fill { width: 2px; height: calc(100% * var(--sc-p)); transition: height .4s ease; }
  .scrolly.is-scrolly .sc-btn { display: flex; align-items: center; gap: 14px; min-height: 48px; width: 100%; text-align: left; }
  .scrolly.is-scrolly .sc-dot { flex: none; width: 44px; height: 44px; font-size: 15px; }
  .scrolly.is-scrolly .sc-btn-t { font-size: 15px; font-weight: 500; color: #64748B; line-height: 1.3; }
  .scrolly.is-scrolly .sc-btn[data-sc-state="active"] .sc-btn-t { font-size: 16px; font-weight: 600; color: #0F172A; }
  .scrolly.is-scrolly .sc-card { grid-column: 2; align-self: stretch; justify-content: center; gap: 18px; transform: translateY(28px); }
  .scrolly.is-scrolly [data-sc-state="past"] > .sc-card { transform: translateY(-28px); }
  .scrolly.is-scrolly .sc-art { grid-column: 3; height: min(560px, calc(var(--sc-h) - 96px)); border-radius: 16px; align-self: center; }
  .scrolly.is-scrolly .sc-card h3 { font-size: 34px; line-height: 1.15; }
  .scrolly.is-scrolly .sc-card p { font-size: 18px; line-height: 1.65; }
  .scrolly.is-scrolly .sc-hint { font-size: 14px; margin-top: 8px; }
  .scrolly.is-scrolly .sc-hint-m { display: none; }
  /* fit guard tiers (added by JS only when a card would overflow) */
  .scrolly.is-scrolly.sc-tight .sc-stage { column-gap: 40px; padding: 32px 40px; grid-template-columns: 260px minmax(0, 1fr) minmax(0, 1fr); }
  .scrolly.is-scrolly.sc-tight .sc-card { gap: 12px; }
  .scrolly.is-scrolly.sc-tight .sc-card h3 { font-size: 28px; }
  .scrolly.is-scrolly.sc-tight .sc-card p { font-size: 16px; line-height: 1.55; }
  .scrolly.is-scrolly.sc-tighter .sc-hint { display: none; }
}
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .scrolly.is-scrolly .sc-stage { grid-template-columns: 240px minmax(0, 1fr) minmax(0, 1fr); column-gap: 36px; padding: 40px 32px; }
}

/* ---- mobile / tablet stage (pinned VERTICAL, no swipe): number rail, 4:3 panel, card ---- */
@media (max-width: 1023.98px) {
  .scrolly.is-scrolly { --sc-h: calc(100vh - var(--sc-top) - var(--sc-bot)); }
  @supports (height: 100svh) { .scrolly.is-scrolly { --sc-h: calc(100svh - var(--sc-top) - var(--sc-bot)); } }
  .scrolly.is-scrolly .sc-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto var(--sc-panel) minmax(0, 1fr);
    row-gap: 14px; padding: 12px 16px 16px; }
  .scrolly.is-scrolly .sc-rail { grid-row: 1; grid-column: 1; }
  .scrolly.is-scrolly .sc-rail-list { display: grid; grid-template-columns: repeat(var(--sc-cols, 8), minmax(0, 1fr)); }
  .scrolly.is-scrolly .sc-line { top: 21px; height: 2px; left: calc(50% / var(--sc-cols, 8)); right: calc(50% / var(--sc-cols, 8)); }
  .scrolly.is-scrolly .sc-fill { height: 2px; width: calc(100% * var(--sc-p)); transition: width .35s ease; }
  .scrolly.is-scrolly .sc-btn { height: 44px; width: 100%; display: flex; align-items: center; justify-content: center; }
  .scrolly.is-scrolly .sc-btn-t { display: none; }
  .scrolly.is-scrolly .sc-dot { width: 22px; height: 22px; font-size: 11px; }
  .scrolly.is-scrolly .sc-btn[data-sc-state="past"] .sc-dot { color: #fff; }
  .scrolly.is-scrolly .sc-btn[data-sc-state="active"] .sc-dot { width: 30px; height: 30px; font-size: 14px; font-weight: 600; box-shadow: 0 0 0 3px #fff; }
  .scrolly.is-scrolly .sc-btn[data-sc-state="next"] .sc-dot { color: #94A3B8; }
  .scrolly.is-scrolly .sc-art { grid-row: 2; grid-column: 1; height: var(--sc-panel); border-radius: 12px; margin: 0; transition: opacity .5s ease, transform .6s ease; }
  .scrolly.is-scrolly .sc-card { grid-row: 3; grid-column: 1; align-self: stretch; gap: 8px; transform: translateY(20px); transition: opacity .4s ease, transform .4s ease; }
  .scrolly.is-scrolly [data-sc-state="past"] > .sc-card { transform: translateY(-20px); }
  .scrolly.is-scrolly .sc-count { font-size: 12px; }
  .scrolly.is-scrolly .sc-card h3 { font-size: 21px; line-height: 1.2; }
  .scrolly.is-scrolly .sc-card p { font-size: 15px; line-height: 1.5; }
  .scrolly.is-scrolly .sc-meta { justify-content: space-between; gap: 8px; }
  .scrolly.is-scrolly .sc-hint { font-size: 13px; gap: 6px; margin-top: auto; padding-top: 4px; }
  .scrolly.is-scrolly .sc-hint-d { display: none; }
  .scrolly.is-scrolly.sc-tight .sc-stage { row-gap: 10px; padding: 8px 16px 10px; }
  .scrolly.is-scrolly.sc-tight .sc-card { gap: 6px; }
  .scrolly.is-scrolly.sc-tight .sc-card h3 { font-size: 19px; }
  .scrolly.is-scrolly.sc-tight .sc-card p { font-size: 14px; line-height: 1.45; }
  .scrolly.is-scrolly.sc-tighter .sc-hint { display: none; }
}
@media (max-width: 1023.98px) and (max-height: 699.98px) {
  .scrolly.is-scrolly { --sc-panel: 180px; }
}

/* =====================================================================================
   OPT-IN COMPACT STAGE: .scrolly.sc-intro (layout pass 2026-10-24, approved boards; spec =
   design/tighten_css_block.md). Un-migrated scrolly sections (no .sc-intro) are unchanged.
   Markup: the section intro goes INSIDE the stage as <div class="sc-head"><div class="intro">…</div>[controls]</div>,
   first child of .sc-stage; the section gets .sc-section. Page sets --sc-rail-w / --sc-row inline or in its own CSS.
   Desktop pinned: intro row on top, then rail | card | art, all top-aligned. The stage height is CONTENT-DRIVEN:
   js measures it and writes --sc-h (falls back to .sc-tight, then to the static list, if it cannot fit the viewport).
   Mobile pinned: js lifts .sc-head out of the stage (above it), so the phone stage is the module default.
   .sc-simple = 2-column variant (number rail + text card, no art column).
   ===================================================================================== */
.scrolly.sc-intro .sc-head { min-width: 0; }
.scrolly.sc-intro .sc-head > .intro { margin-bottom: 0; }
.scrolly.sc-intro:not(.is-scrolly) .sc-stage { max-width: var(--container, 1200px); margin-inline: auto; padding-inline: var(--gutter, 24px); }
.scrolly.sc-intro:not(.is-scrolly) .sc-head { margin-bottom: var(--space-10, 40px); }
/* head lifted above a phone stage by js */
.scrolly.sc-intro > .sc-head { max-width: var(--container, 1200px); margin: 0 auto var(--space-8, 32px); padding-inline: var(--gutter, 24px); }
/* aside (e.g. /quality "Good to know"): sits where it is authored; js moves it under the desktop rail as a separate block,
   clear of the rail line (js ends the line at the last dot centre, relay 6) */
.scrolly .sc-rail .sc-aside { margin-top: 16px; position: relative; z-index: 1; }
@media (min-width: 1024px) {
  .scrolly.sc-simple:not(.is-scrolly) .sc-item { grid-template-columns: minmax(0, 1fr); }
  .section.sc-section:has(> .scrolly.sc-intro.is-scrolly) { padding-block: 0; }
  .scrolly.sc-intro.is-scrolly .sc-stage { height: auto;
    grid-template-columns: var(--sc-rail-w, 220px) minmax(0, 1fr) calc(var(--sc-row, 240px) * 4 / 3);
    grid-template-rows: auto auto; column-gap: 40px; row-gap: 24px; padding: 40px 64px; align-items: start; align-content: start; }
  .scrolly.sc-intro.is-scrolly .sc-head { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
  .scrolly.sc-intro.is-scrolly .sc-rail { grid-column: 1; grid-row: 2; align-self: start; }
  .scrolly.sc-intro.is-scrolly .sc-card,
  .scrolly.sc-intro.is-scrolly .sc-art { grid-row: 2; }
  /* card: top-aligned, 24 px padding, 12 px gap; never stretched or centred */
  .scrolly.sc-intro.is-scrolly .sc-card { align-self: start; justify-content: flex-start; gap: 12px; padding: 24px; box-sizing: border-box;
    background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; transform: translateY(16px); }
  .scrolly.sc-intro.is-scrolly [data-sc-state="past"] > .sc-card { transform: translateY(-16px); }
  .scrolly.sc-intro.is-scrolly [data-sc-state="active"] > .sc-card { transform: none; }
  .scrolly.sc-intro.is-scrolly .sc-card h3 { font-size: 28px; }
  .scrolly.sc-intro.is-scrolly .sc-card p { font-size: 17px; line-height: 1.6; }
  .scrolly.sc-intro.is-scrolly .sc-hint { margin-top: 0; }
  /* art fills its column and the row (row height >= --sc-row; column = 4:3 of it) */
  .scrolly.sc-intro.is-scrolly .sc-art { grid-column: 3; align-self: stretch; height: auto; min-height: var(--sc-row, 0px); border-radius: 12px; }
  /* compact rail: 36 px rows */
  .scrolly.sc-intro.is-scrolly .sc-rail-list { gap: 0; }
  .scrolly.sc-intro.is-scrolly .sc-btn { min-height: 36px; gap: 10px; }
  .scrolly.sc-intro.is-scrolly .sc-dot { width: 28px; height: 28px; font-size: 13px; }
  .scrolly.sc-intro.is-scrolly .sc-line { left: 13px; top: 18px; bottom: 18px; }
  .scrolly.sc-intro.is-scrolly .sc-btn-t { font-size: 14px; }
  .scrolly.sc-intro.is-scrolly .sc-btn[data-sc-state="active"] .sc-btn-t { font-size: 15px; }
  /* fit tiers (js, only when the stage would not fit the viewport) */
  .scrolly.sc-intro.is-scrolly.sc-tight .sc-stage { padding: 24px 40px; row-gap: 16px; column-gap: 32px; }
  .scrolly.sc-intro.is-scrolly.sc-tight .sc-card h3 { font-size: 24px; }
  .scrolly.sc-intro.is-scrolly.sc-tight .sc-card p { font-size: 16px; line-height: 1.55; }
  /* simple: number rail | text card, no art column */
  .scrolly.sc-intro.sc-simple.is-scrolly .sc-stage { grid-template-columns: var(--sc-rail-w, 220px) minmax(0, 1fr); background: transparent;
    border-top: 1px solid #DCE2EA; border-bottom: 1px solid #DCE2EA; }
  .scrolly.sc-intro.sc-simple.is-scrolly .sc-card { grid-column: 2; justify-self: start; width: 100%; max-width: 900px; box-shadow: var(--shadow-sm, 0 1px 2px rgba(15,23,42,.06));
    transition: opacity .32s cubic-bezier(0.22, 0.61, 0.36, 1), transform .32s cubic-bezier(0.22, 0.61, 0.36, 1); }
  .scrolly.sc-intro.sc-simple.is-scrolly .sc-card p { max-width: none; }
}
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .scrolly.sc-intro.is-scrolly .sc-stage { grid-template-columns: var(--sc-rail-w, 220px) minmax(0, 1fr) minmax(0, .85fr); column-gap: 28px; padding: 32px; }
  .scrolly.sc-intro.is-scrolly .sc-art { min-height: min(var(--sc-row, 0px), 280px); }
  .scrolly.sc-intro.sc-simple.is-scrolly .sc-stage { grid-template-columns: var(--sc-rail-w, 220px) minmax(0, 1fr); }
}

/* =====================================================================================
   OPT-IN CARD-HEIGHT ROW: .scrolly.sc-intro.sc-full (relay 5, 2026-10-24, Bruce: "It should stay as the card height,
   rather than going so down" — supersedes relay 3's fill-the-viewport). js measures (.sc-measure: cards at content
   height, art collapsed) the tallest card and the rail, compacts a taller rail (.sc-rail-c), and writes ONE row height
   per section to --sc-rowh = max(tallest card, rail). Every card and the art fill exactly that row (art top = card top,
   art bottom = card bottom); the stage is content height (--sc-h, measured), still pinned under the header.
   A stage without a .sc-head (e.g. /ordering-process, intro kept above the track) gets no head row.
   ===================================================================================== */
@media (min-width: 1024px) {
  .scrolly.sc-intro.sc-full.is-scrolly .sc-stage { height: var(--sc-h); grid-template-rows: auto var(--sc-rowh, auto); }
  .scrolly.sc-intro.sc-full.is-scrolly.sc-measure .sc-stage { height: auto; grid-template-rows: auto auto; }
  .scrolly.sc-intro.sc-full.is-scrolly .sc-stage:not(:has(> .sc-head)) { grid-template-rows: 0 var(--sc-rowh, auto); row-gap: 0; }
  .scrolly.sc-intro.sc-full.is-scrolly.sc-measure .sc-stage:not(:has(> .sc-head)) { grid-template-rows: 0 auto; }
  .scrolly.sc-intro.sc-full.is-scrolly .sc-rail { align-self: start; }
  .scrolly.sc-intro.sc-full.is-scrolly .sc-card { align-self: stretch; padding: 28px; gap: 14px; }
  .scrolly.sc-intro.sc-full.is-scrolly .sc-card > .sc-hint { margin-top: auto; padding-top: 8px; }
  .scrolly.sc-intro.sc-full.is-scrolly .sc-art { align-self: stretch; height: auto; min-height: 0; max-height: var(--sc-rowh, none); }
  .scrolly.sc-intro.sc-full.is-scrolly.sc-measure .sc-card { align-self: start; }
  .scrolly.sc-intro.sc-full.is-scrolly.sc-measure .sc-art { height: 0; }
  .scrolly.sc-intro.sc-full.is-scrolly.sc-tight .sc-card { padding: 20px; gap: 10px; }
  /* rail taller than the tallest card: tighter row spacing first */
  .scrolly.sc-intro.sc-full.is-scrolly.sc-rail-c .sc-btn { min-height: 30px; }
}
@media (min-width: 1280px) {
  /* the art column keeps relay 3's width; its height is the card row */
  .scrolly.sc-intro.sc-full.is-scrolly .sc-stage { grid-template-columns: var(--sc-rail-w, 220px) minmax(0, 1fr) minmax(0, 1.15fr); }
}

/* =====================================================================================
   SIMPLE SCROLLY ROW (relay 6, 2026-10-24, Bruce: the 8-step "From RFQ to post-delivery support" is a vertical scroll
   again, board RfqSteps8): .sc-intro.sc-simple gets the relay-5 card-height rule. js writes ONE row height per section to
   --sc-rowh = max(tallest card, rail) (no rail compaction: the board's 36 px rail rows stay); the stage = intro + that
   row (content height, measured into --sc-h), pinned under the header. Cards stay content height (board: top-aligned).
   ===================================================================================== */
@media (min-width: 1024px) {
  .scrolly.sc-intro.sc-simple.is-scrolly .sc-stage { height: var(--sc-h); grid-template-rows: auto var(--sc-rowh, auto); }
  .scrolly.sc-intro.sc-simple.is-scrolly.sc-measure .sc-stage { height: auto; grid-template-rows: auto auto; }
  .scrolly.sc-intro.sc-simple.is-scrolly .sc-card { align-self: start; }
  .scrolly.sc-intro.sc-simple.is-scrolly .sc-stage,
  .scrolly.sc-intro.sc-simple.sc-full.is-scrolly .sc-stage { grid-template-columns: var(--sc-rail-w, 220px) minmax(0, 1fr); }
}
