/* 04 «Як ми працюємо» — Figma node 37:307 and component «Process Scene» 41:485.
   Interaction follows the notes «04 — інтерактив для верстки».
   Design canvas: 1672 × 872 inside a 1800 × 1000 section: scene 1164, gap 32, calculator 476. */

/* --s: one design pixel. Fits the width, and the pinned screen's height. Registered so cqw resolves here. */
@property --s { syntax: "<length>"; inherits: true; initial-value: 1px; }

.process {
  --s: min(100cqw / 1800, (100svh - 32px) / 872);
  position: relative;
  isolation: isolate;
  background: var(--color-bg-inverse);
  color: var(--color-text-inverse);
}
/* the animated wavy gradient (wave-gradient.js): one screen tall, staying with the visitor through
   the long scroll, behind everything; hidden until it has drawn */
.process__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.process__bg canvas { position: sticky; top: 0; display: block; width: 100%; height: min(100%, 100lvh); opacity: 0; transition: opacity .6s ease; }
.process__bg canvas.is-drawn { opacity: 1; }
.process__pin { display: flex; justify-content: center; align-items: center; padding: calc(64 * var(--s)) 0; }
.process__canvas { position: relative; width: calc(1672 * var(--s)); height: calc(872 * var(--s)); }
.process__scene > * { position: absolute; }
.process :focus-visible { outline-color: var(--color-bg-accent); }

/* ───────────── Left column ───────────── */
.process__head { top: calc(8 * var(--s)); left: 0; }
.process__index {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--s));
  padding: calc(9 * var(--s)) calc(16 * var(--s)) calc(7 * var(--s));
  border: 1px solid rgb(251 247 239 / .15);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: calc(14 * var(--s));
  line-height: calc(17 * var(--s));
  letter-spacing: .04em;
  text-transform: uppercase;
}
.process__index::before {
  content: "";
  position: relative;
  top: calc(-1 * var(--s));
  width: calc(8 * var(--s));
  height: calc(8 * var(--s));
  background: url("../assets/process/dot-index.svg") center / contain;
}
.process__title {
  position: absolute;
  top: calc(57 * var(--s)); /* 57: Figma's baseline rounding */
  left: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: calc(44 * var(--s));
  line-height: calc(46 * var(--s));
  letter-spacing: -.025em;
  white-space: nowrap;
  color: var(--color-text-inverse-muted);
}

/* the step number rolls like an odometer */
.odo { top: calc(236 * var(--s)); left: calc(-6 * var(--s)); display: flex; align-items: flex-start; gap: calc(12 * var(--s)); }
.odo__number {
  display: flex;
  padding-right: calc(12 * var(--s)); /* Figma keeps no tracking after the last digit */
  font-family: var(--font-display);
  font-weight: 500;
  font-size: calc(200 * var(--s));
  line-height: calc(176 * var(--s));
  letter-spacing: -.06em;
  color: var(--color-bg-accent);
}
/* the window is 32px wider than the digit box: with negative tracking the glyph sticks out on the right */
.odo__window { display: block; overflow: hidden; width: calc((var(--digit, 100) + 32) * var(--s)); margin-right: calc(-32 * var(--s)); height: calc(176 * var(--s)); transition: width .6s cubic-bezier(.65, 0, .35, 1); }
.odo__reel { display: flex; flex-direction: column; align-items: flex-start; translate: 0 calc(var(--index, 0) * -176 * var(--s)); transition: translate .6s cubic-bezier(.65, 0, .35, 1); }
.odo__reel > span { display: block; height: calc(176 * var(--s)); }
.odo__of { padding-top: calc(22 * var(--s)); font-size: calc(18 * var(--s)); line-height: calc(24 * var(--s)); color: var(--color-text-inverse-subtle); }

/* the five texts share one place; only the active one shows */
.steps { top: calc(446 * var(--s)); left: 0; display: grid; width: calc(476 * var(--s)); margin: 0; padding: 0; list-style: none; }
.step { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: flex-start; gap: calc(20 * var(--s)); }
.step__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: calc(44 * var(--s));
  line-height: calc(46 * var(--s));
  letter-spacing: -.025em;
}
.step__toggle { font: inherit; letter-spacing: inherit; text-align: left; color: inherit; cursor: default; }
.step__num { display: none; }
.step__body { display: flex; flex-direction: column; align-items: flex-start; gap: calc(20 * var(--s)); }
.step__text { width: calc(440 * var(--s)); font-size: calc(18 * var(--s)); line-height: calc(24 * var(--s)); color: var(--color-text-inverse-muted); }
.step__chips { display: flex; flex-wrap: wrap; gap: calc(8 * var(--s)); list-style: none; }
.step__chips li {
  padding: calc(8 * var(--s)) calc(16 * var(--s));
  border: 1px solid rgb(251 247 239 / .15);
  border-radius: var(--radius-full);
  font-size: calc(13 * var(--s));
  line-height: calc(16 * var(--s));
}
.step__chips li:first-child { border: 0; padding: calc(8 * var(--s)) calc(16 * var(--s)); background: var(--color-bg-accent); color: var(--color-text-primary); }

/* ───────────── Timeline ───────────── */
.timeline { top: calc(808 * var(--s)); left: 0; width: calc(476 * var(--s)); height: calc(64 * var(--s)); }
.timeline__track, .timeline__fill {
  position: absolute;
  top: calc(15 * var(--s));
  left: calc(8 * var(--s));
  width: calc(460 * var(--s));
  height: calc(2 * var(--s));
  border-radius: var(--radius-full);
}
.timeline__track { background: rgb(251 247 239 / .15); }
.timeline__fill { background: var(--color-bg-accent); transform-origin: left; transform: scaleX(var(--fill, 0)); transition: transform .35s cubic-bezier(.32, .72, 0, 1); }
/* where the scroll drives it, js/process.js draws every frame itself: a transition would only lag */
.process--pinned .timeline__fill, .process--sticky .timeline__fill { transition: none; will-change: transform; }
.timeline__node {
  position: absolute;
  top: 0;
  width: calc(32 * var(--s));
  height: calc(32 * var(--s));
  color: var(--color-text-inverse-subtle);
}
.timeline__node:nth-of-type(1) { left: calc(-8 * var(--s)); }
.timeline__node:nth-of-type(2) { left: calc(107 * var(--s)); }
.timeline__node:nth-of-type(3) { left: calc(222 * var(--s)); }
.timeline__node:nth-of-type(4) { left: calc(337 * var(--s)); }
.timeline__node:nth-of-type(5) { left: calc(452 * var(--s)); }
.timeline__node::before, .timeline__node::after { content: ""; position: absolute; inset: 0; margin: auto; background-position: center; background-repeat: no-repeat; background-size: contain; }
.timeline__node::before { width: calc(10 * var(--s)); height: calc(10 * var(--s)); background-image: url("../assets/process/node-future.svg"); }
.timeline__node.is-past::before { background-image: url("../assets/process/node-past.svg"); }
.timeline__node.is-active::before { width: calc(32 * var(--s)); height: calc(32 * var(--s)); background-image: url("../assets/process/node-ring.svg"); }
.timeline__node.is-active::after { width: calc(14 * var(--s)); height: calc(14 * var(--s)); background-image: url("../assets/process/node-dot.svg"); }
.timeline__node > span {
  position: absolute;
  top: calc(42 * var(--s));
  left: 50%;
  translate: -50% 0;
  font-size: calc(12 * var(--s));
  line-height: calc(15 * var(--s));
  white-space: nowrap;
  transition: color .2s ease;
}
.timeline__node:nth-of-type(1) > span { left: calc(8 * var(--s)); translate: none; }
.timeline__node:nth-of-type(5) > span { right: calc(8 * var(--s)); left: auto; translate: none; }
.timeline__node.is-active > span { color: var(--color-text-inverse); }
@media (hover: hover) { .timeline__node:hover > span { color: var(--color-text-inverse); } }

/* ───────────── Stage ───────────── */
.stage-box { top: 0; left: calc(524 * var(--s)); width: calc(640 * var(--s)); height: calc(872 * var(--s)); }
.stage {
  /* --t: one design pixel of the 640 × 872 stage */
  --t: var(--s);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: calc(640 * var(--t));
  height: calc(872 * var(--t));
  border-radius: var(--r, calc(28 * var(--t)));
  /* also cut by a clip: iOS Safari lets pictures that are fading or flying show their square
     corners past a rounded «overflow: hidden» */
  clip-path: inset(0 round var(--r, calc(28 * var(--t))));
}
.stage::after { content: ""; position: absolute; inset: 0; z-index: 3; border: 1px solid rgb(251 247 239 / .15); border-radius: inherit; pointer-events: none; }
/* the square render, centred: 872 wide in a 640 window */
.stage__picture { position: absolute; top: 0; left: calc(-116 * var(--t)); width: calc(872 * var(--t)); height: calc(872 * var(--t)); }
.stage__picture > * { position: absolute; inset: 0; width: 100%; height: 100%; }

/* states stack: showing step N keeps 1…N on, so a crossfade never dips through the background */
.state { opacity: 0; transition: opacity .7s ease; }
.state.is-on { opacity: 1; }
.stage[data-step="3"][data-dir="forward"] .state[data-state="3"] { transition-delay: .9s; }
.stage[data-step="4"][data-dir="forward"] .state[data-state="4"] { transition-delay: 1.2s; }
.stage[data-step="5"][data-dir="forward"] .state[data-state="5"] { transition-delay: 1.9s; } /* after the drawn energy has reached the rooms */

/* 03: panels, inverter and battery fly into the outlines drawn on state 02 */
.fly, .light { opacity: 0; pointer-events: none; }
.fly--panels { --from: -3% -16%; --d: 0s; }
.fly--inverter { --from: 16% -9%; --d: .22s; }
.fly--battery { --from: 20% 4%; --d: .36s; }
.stage[data-step="3"][data-dir="forward"] .fly { animation: fly-in .75s cubic-bezier(.23, 1, .32, 1) var(--d) both; }
@keyframes fly-in {
  from { opacity: 0; translate: var(--from); }
  30% { opacity: 1; }
  to { opacity: 1; translate: 0 0; }
}

/* 04: lights come on room by room */
.stage[data-step="4"][data-dir="forward"] .light { animation: light-on .6s ease var(--d) both; }
@keyframes light-on { 0% { opacity: 0; } 25% { opacity: .8; } 40% { opacity: .25; } 65%, 100% { opacity: 1; } }

/* 05: energy lines draw (stroke-dashoffset), then keep running */
.energy { fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.stage[data-step="5"] .energy { opacity: 1; }
.energy__line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.energy__glow { stroke: rgb(255 176 40 / .35); stroke-width: 10; }
.energy__core { stroke: #ffd66b; stroke-width: 2.6; }
.energy__pulse { stroke: #fff6d2; stroke-width: 3.4; stroke-dasharray: 10 54; opacity: 0; }
/* once the render with its own lines has faded in, the drawn ones step back and only the pulses stay bright */
.stage[data-step="5"] .energy__line { animation: energy-draw var(--len) cubic-bezier(.65, 0, .35, 1) var(--d) forwards, energy-settle .7s ease 2.4s forwards; }
.stage[data-step="5"] .energy__pulse { animation: energy-run 1s linear infinite, energy-show .3s ease calc(var(--d) + var(--len)) forwards; }
@keyframes energy-draw { to { stroke-dashoffset: 0; } }
@keyframes energy-settle { to { stroke-opacity: .22; } }
@keyframes energy-run { to { stroke-dashoffset: -64; } }
@keyframes energy-show { to { opacity: .95; } }

/* soft warm light that follows the cursor over the house */
.stage__glow {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: calc(420 * var(--t));
  height: calc(420 * var(--t));
  margin: calc(-210 * var(--t)) 0 0 calc(-210 * var(--t));
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 190 105 / .42), rgb(255 160 70 / .16) 55%, rgb(255 160 70 / 0));
  mix-blend-mode: screen;
  opacity: 0;
  translate: var(--gx, 0px) var(--gy, 0px);
  transition: opacity .4s ease, translate .18s ease-out;
  pointer-events: none;
}
.stage.is-lit .stage__glow { opacity: 1; }

/* ── Pins, status and the energy flow ── */
.pins { position: absolute; inset: 0; z-index: 2; list-style: none; pointer-events: none; }
.pin { position: absolute; top: calc(var(--y) * var(--t)); left: calc(var(--x) * var(--t)); }
.pin::before, .pin::after { content: ""; position: absolute; translate: -50% -50%; top: 0; left: 0; background: center / contain no-repeat; }
.pin::before { width: calc(26 * var(--t)); height: calc(26 * var(--t)); background-image: url("../assets/process/pin-ring.svg"); }
.pin::after { width: calc(8 * var(--t)); height: calc(8 * var(--t)); background-image: url("../assets/process/pin-dot.svg"); }
.pin__label {
  position: absolute;
  top: calc(-16 * var(--t));
  padding: calc(8 * var(--t)) calc(16 * var(--t));
  border-radius: var(--radius-full);
  background: var(--color-bg-surface);
  box-shadow: 0 calc(14 * var(--t)) calc(36 * var(--t)) rgb(38 26 13 / .14);
  font-size: calc(13 * var(--t));
  line-height: calc(16 * var(--t));
  white-space: nowrap;
  color: var(--color-text-primary);
}
.pin__label::before { content: ""; position: absolute; top: calc(50% - .75px); width: calc(24 * var(--t)); height: 1.5px; background: var(--color-bg-accent); }
.pin--right .pin__label { left: calc(37 * var(--t)); }
.pin--right .pin__label::before { right: 100%; }
.pin--left .pin__label { right: calc(37 * var(--t)); }
.pin--left .pin__label::before { left: 100%; }
/* on short screens a label that would leave the picture moves above its pin (process.js) */
.pin .pin__label.is-above { translate: var(--nudge, 0px) calc(-50% - 12px); }
.pin .pin__label.is-above::before { display: none; }

.status, .flow {
  position: absolute;
  z-index: 2;
  left: 50%;
  translate: -50% 0;
  border: 1px solid rgb(251 247 239 / .15);
  border-radius: var(--radius-full);
  background: var(--color-overlay-scrim);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  white-space: nowrap;
}
.status { top: calc(805 * var(--t)); padding: calc(8 * var(--t)) calc(16 * var(--t)); font-size: calc(13 * var(--t)); line-height: calc(16 * var(--t)); }
.flow { top: calc(766 * var(--t)); display: flex; align-items: center; gap: calc(20 * var(--t)); padding: calc(16 * var(--t)) calc(24 * var(--t)); }
.flow p { display: flex; flex-direction: column; gap: calc(2 * var(--t)); }
.flow span { font-size: calc(12 * var(--t)); line-height: calc(15 * var(--t)); color: var(--color-text-inverse-subtle); }
.flow strong { font-weight: 700; font-size: calc(18 * var(--t)); line-height: calc(22 * var(--t)); font-variant-numeric: tabular-nums; }
.flow i { font-style: normal; font-weight: 700; font-size: calc(14 * var(--t)); color: var(--color-bg-accent); } /* fallback arrow: sized to Montserrat's */

/* entrances: plaques arrive one after another, 80 ms apart; they leave together */
.pin, .status, .flow { opacity: 0; transition: opacity .2s ease; }
.pin { scale: .96; }
.pins.is-on .pin, .status.is-on, .flow.is-on {
  opacity: 1;
  scale: 1;
  transition: opacity .35s ease calc(var(--base, .3s) + var(--i, 0) * 80ms), scale .35s cubic-bezier(.23, 1, .32, 1) calc(var(--base, .3s) + var(--i, 0) * 80ms);
}
.status, .flow { --i: 2; scale: none; }
.stage[data-step="3"][data-dir="forward"] { --base: 1s; }
.stage[data-step="4"][data-dir="forward"] { --base: 1.25s; }
.stage[data-step="5"][data-dir="forward"] { --base: 1.4s; }

/* ───────────── Calculator ───────────── */
.calc {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: calc(20 * var(--s));
  width: calc(476 * var(--s));
  height: calc(872 * var(--s));
  padding: calc(32 * var(--s));
  border-radius: calc(28 * var(--s));
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  scroll-margin-top: calc(64 * var(--s));
}
.calc :focus-visible { outline-color: var(--color-bg-strong); }
.calc__head { display: flex; flex-direction: column; align-items: flex-start; gap: calc(10 * var(--s)); }
.calc__title { font-family: var(--font-display); font-weight: 500; font-size: calc(30 * var(--s)); line-height: calc(32 * var(--s)); letter-spacing: -.02em; }
.calc__badge { padding: calc(5 * var(--s)) calc(12 * var(--s)); border-radius: var(--radius-full); background: var(--color-bg-accent); font-size: calc(12 * var(--s)); line-height: calc(15 * var(--s)); }
.calc__field { display: flex; flex-direction: column; gap: calc(10 * var(--s)); margin: 0; padding: 0; border: 0; min-width: 0; }
.calc__label { padding: 0; font-size: calc(13 * var(--s)); line-height: calc(16 * var(--s)); color: var(--color-text-secondary); }
legend.calc__label { float: left; margin-bottom: 0; width: 100%; }
legend + * { clear: both; }

.segmented { display: flex; gap: calc(4 * var(--s)); padding: calc(4 * var(--s)); border-radius: var(--radius-full); background: rgb(28 27 25 / .06); }
.segmented label { position: relative; flex: 1; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block;
  padding: calc(12 * var(--s)) 0;
  border-radius: var(--radius-full);
  font-size: calc(15 * var(--s));
  line-height: calc(23 * var(--s));
  text-align: center;
  transition: background-color .2s ease, color .2s ease;
}
.segmented input:checked + span { background: var(--color-bg-strong); color: var(--color-text-inverse); }
.segmented input:focus-visible + span { outline: 2px solid var(--color-bg-strong); outline-offset: 2px; }
@media (hover: hover) { .segmented input:not(:checked) + span:hover { background: rgb(28 27 25 / .06); } }

.calc__row { display: flex; align-items: center; justify-content: space-between; height: calc(22 * var(--s)); }
.calc__value { position: relative; right: calc(-1 * var(--s)); font-weight: 700; font-size: calc(18 * var(--s)); line-height: calc(22 * var(--s)); font-variant-numeric: tabular-nums; }
.slider {
  --pos: 35.7%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: calc(24 * var(--s));
  margin: 0;
  background: none;
  cursor: pointer;
}
.slider::-webkit-slider-runnable-track {
  height: calc(6 * var(--s));
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-bg-accent) var(--pos), rgb(28 27 25 / .06) var(--pos));
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: calc(24 * var(--s));
  height: calc(24 * var(--s));
  margin-top: calc(-9 * var(--s));
  border: calc(2 * var(--s)) solid var(--color-bg-strong);
  border-radius: 50%;
  background: var(--color-bg-surface);
  box-shadow: 0 calc(14 * var(--s)) calc(36 * var(--s)) rgb(38 26 13 / .14);
}
.slider::-moz-range-track { height: calc(6 * var(--s)); border-radius: var(--radius-full); background: rgb(28 27 25 / .06); }
.slider::-moz-range-progress { height: calc(6 * var(--s)); border-radius: var(--radius-full); background: var(--color-bg-accent); }
.slider::-moz-range-thumb { width: calc(20 * var(--s)); height: calc(20 * var(--s)); border: calc(2 * var(--s)) solid var(--color-bg-strong); border-radius: 50%; background: var(--color-bg-surface); }
.calc__scale { display: flex; justify-content: space-between; font-size: calc(12 * var(--s)); line-height: calc(15 * var(--s)); color: var(--color-text-secondary); }

.calc__toggle { display: flex; align-items: center; justify-content: space-between; gap: calc(16 * var(--s)); font-size: calc(15 * var(--s)); line-height: calc(23 * var(--s)); cursor: pointer; }
.calc__toggle input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  position: relative;
  width: calc(52 * var(--s));
  height: calc(30 * var(--s));
  margin: 0;
  border-radius: var(--radius-full);
  background: rgb(28 27 25 / .14);
  cursor: pointer;
  transition: background-color .2s ease;
}
.calc__toggle input::after {
  content: "";
  position: absolute;
  top: calc(4 * var(--s));
  left: calc(4 * var(--s));
  width: calc(22 * var(--s));
  height: calc(22 * var(--s));
  border-radius: 50%;
  background: var(--color-bg-surface);
  transition: translate .2s cubic-bezier(.23, 1, .32, 1), background-color .2s ease;
}
.calc__toggle input:checked { background: var(--color-bg-strong); }
.calc__toggle input:checked::after { background: var(--color-bg-accent); translate: calc(22 * var(--s)) 0; }

.calc__control {
  width: 100%;
  height: calc(55 * var(--s));
  padding: 0 calc(20 * var(--s));
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: var(--color-bg-page);
  font: 500 calc(15 * var(--s)) / 1.5 var(--font-ui);
  color: var(--color-text-primary);
}
.calc__control::placeholder { color: var(--color-text-secondary); opacity: 1; }
.calc__control.is-invalid { border-color: #b3261e; }
.calc__select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: calc(52 * var(--s));
  background: var(--color-bg-page) url("../assets/process/chevron.svg") no-repeat right calc(23.6 * var(--s)) center;
  background-size: calc(10.8 * var(--s)) calc(6.3 * var(--s));
  cursor: pointer;
}

.calc__result { display: flex; flex-direction: column; gap: calc(12 * var(--s)); padding: calc(20 * var(--s)) calc(24 * var(--s)); border-radius: calc(18 * var(--s)); background: var(--color-bg-inverse); }
.calc__result-title { position: relative; top: calc(1 * var(--s)); font-weight: 600; font-size: calc(14 * var(--s)); line-height: calc(17 * var(--s)); letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-inverse-muted); }
.calc__result div { display: flex; gap: calc(28 * var(--s)); }
.calc__result div p { display: flex; flex-direction: column; gap: calc(2 * var(--s)); }
.calc__result strong { font-weight: 600; font-size: calc(28 * var(--s)); line-height: calc(34 * var(--s)); letter-spacing: -.01em; white-space: nowrap; color: var(--color-bg-accent); }
.calc__result span { font-size: calc(12 * var(--s)); line-height: calc(15 * var(--s)); color: var(--color-text-inverse-subtle); }
.calc__submit { position: relative; width: 100%; flex: none; height: calc(56 * var(--s)); padding-block: 0; font-size: calc(16 * var(--s)); line-height: calc(20 * var(--s)); filter: drop-shadow(0 calc(8 * var(--s)) calc(14 * var(--s)) rgb(244 217 78 / .45)); }
.calc__note { font-size: calc(12 * var(--s)); line-height: calc(15 * var(--s)); color: var(--color-text-secondary); }

/* ───────────── Pinned (set by process.js) ───────────── */
.process--pinned .process__track { height: calc(6 * 100svh); }
.process--pinned .process__pin { position: sticky; top: 0; overflow: hidden; height: 100svh; padding: 0; }

.process--pinned .step, .process--sticky .step { opacity: 0; visibility: hidden; translate: 0 14px; transition: opacity .2s ease, translate .2s ease, visibility 0s .2s; }
.process--pinned .step.is-active, .process--sticky .step.is-active {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
  transition: opacity .45s ease .12s, translate .5s cubic-bezier(.23, 1, .32, 1) .12s;
}

/* ───────────── Narrower windows (below the width the three columns need) ─────────────
   Figma has only the 1800 frame: the scene stacks and stays on screen, the calculator follows it. */
@media (max-width: 1279px) {
  .process { --s: 1px; }
  .process__pin { display: block; padding: 0; }
  .process__canvas { width: auto; height: auto; }
  .process__scene {
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 20px 20px;
  }
  .process__scene > * { position: static; }
  .process__title { position: static; margin-top: 12px; font-size: clamp(24px, 6.6cqw, 40px); line-height: 1.05; white-space: normal; }
  .odo { display: none; }
  .stage-box { order: 2; display: grid; place-items: center; width: 100%; aspect-ratio: 640 / 872; container-type: size; }
  .stage { --t: min(100cqw / 640, 100cqh / 872); }
  .pin__label { font-size: max(10px, 13 * var(--t)); line-height: 1.25; padding: max(4px, 8 * var(--t)) max(8px, 16 * var(--t)); top: max(-10px, -16 * var(--t)); }
  .status { font-size: max(10px, 13 * var(--t)); line-height: 1.25; top: calc(796 * var(--t)); }
  .flow { top: calc(750 * var(--t)); gap: max(8px, 20 * var(--t)); padding: max(6px, 16 * var(--t)) max(12px, 24 * var(--t)); }
  .flow span { font-size: max(9px, 12 * var(--t)); line-height: 1.25; }
  .flow strong { font-size: max(12px, 18 * var(--t)); line-height: 1.25; }
  .flow i { font-size: max(10px, 14 * var(--t)); line-height: 1.25; }
  .steps { order: 3; width: auto; }
  .step { gap: 10px; }
  .step__title { font-size: 26px; line-height: 1.1; }
  .step__num { display: inline-block; margin-right: 10px; color: var(--color-bg-accent); }
  .step__body { gap: 10px; }
  .step__text { width: auto; font-size: 14px; line-height: 1.45; }
  .step__chips li, .step__chips li:first-child { padding: 6px 12px; font-size: 12px; line-height: 15px; }
  .timeline { order: 4; position: relative !important; top: 0; width: 100%; height: 56px; } /* top: the wide layout's 808 */
  .timeline__track, .timeline__fill { left: 16px; right: 16px; top: 15px; width: auto; height: 2px; }
  .timeline__node { width: 32px; height: 32px; }
  .timeline__node:nth-of-type(1) { left: 0; }
  .timeline__node:nth-of-type(2) { left: calc(25% - 8px); }
  .timeline__node:nth-of-type(3) { left: calc(50% - 16px); }
  .timeline__node:nth-of-type(4) { left: calc(75% - 24px); }
  .timeline__node:nth-of-type(5) { left: calc(100% - 32px); }
  .timeline__node::before { width: 10px; height: 10px; }
  .timeline__node.is-active::before { width: 28px; height: 28px; }
  .timeline__node.is-active::after { width: 12px; height: 12px; }
  .timeline__node > span { top: 36px; font-size: 10px; line-height: 13px; }
  .timeline__node:nth-of-type(1) > span { left: 4px; }
  .timeline__node:nth-of-type(5) > span { right: 4px; }

  .calc { position: static; width: auto; height: auto; max-width: 600px; margin: 0 auto; gap: 24px; padding: 28px 20px; border-radius: 28px; scroll-margin-top: 12px; }
  .calc__control, .slider { font-size: 16px; } /* 16px: phones don't zoom into the field */
  .process__canvas > .calc { margin-bottom: 24px; }
  .process__canvas { padding: 0 12px; }
  .process__story { margin: 0 -12px; }

  /* the scene sticks while its own 5 screens scroll past */
  .process--sticky .process__story { height: calc(6 * 100svh); }
  .process--sticky .process__scene { position: sticky; top: 0; height: 100svh; gap: 10px; padding-block: 14px; }
  .process--sticky .stage-box { flex: 1; min-height: 0; aspect-ratio: auto; }
  .process--sticky .process__title { margin-top: 8px; font-size: clamp(20px, 5.4cqw, 32px); }
}
@media (max-width: 1279px) and (max-height: 700px) {
  .process--sticky .process__title, .process--sticky .step__chips { display: none; }
}

/* ───────────── Accordion (reduced motion, or a window too short to pin) ───────────── */
.process--accordion .odo, .process--accordion .timeline { display: none; }
.process--accordion .steps { top: calc(180 * var(--s)); gap: 0; display: flex; flex-direction: column; }
.process--accordion .step { gap: calc(12 * var(--s)); padding: calc(16 * var(--s)) 0; border-top: 1px solid rgb(251 247 239 / .15); }
.process--accordion .step__title { align-self: stretch; font-size: calc(26 * var(--s)); line-height: calc(30 * var(--s)); }
.process--accordion .step__toggle { display: flex; width: 100%; gap: calc(14 * var(--s)); cursor: pointer; }
.process--accordion .step__num { display: block; color: var(--color-bg-accent); }
.process--accordion .step:not(.is-active) .step__body { display: none; }
.process--accordion .state, .process--accordion .energy, .process--accordion .pin, .process--accordion .status, .process--accordion .flow { transition: none !important; }
.process--accordion .fly, .process--accordion .light, .process--accordion .stage__glow { display: none; }
.process--accordion .stage .energy { display: none; }
@media (max-width: 1279px) {
  .process--accordion .steps { order: 3; }
  .process--accordion .step__title { font-size: 22px; line-height: 1.2; }
  .process--accordion .step { gap: 10px; padding: 14px 0; }
}
