/* ─────────────────────────────────────────────────────────────
   "My formula" section
   ───────────────────────────────────────────────────────────── */
.formula {
  --f-bg: #ffffff;
  --f-bg-2: #ebeffb;   /* blue at 8% on white */
  --f-paper: #ffffff;
  --f-blue: #0133cc;
  --f-ink: #002fcb;      /* process steps */
  --f-mauve: #d6def7;   /* blue at 16% on white */
  --f-tone: rgba(0, 51, 204, 0.8);   /* second tone for supporting text */
  --f-spring: cubic-bezier(0.34, 1.36, 0.64, 1);
  --f-ease: cubic-bezier(0.22, 1, 0.36, 1);

  position: relative;
  color: var(--f-blue);
  font-family: var(--font);
  padding: 56px 0 100px;
  isolation: isolate;
  overflow-x: clip;
}

/* Background panel grows from an inset card to full-bleed as you scroll in */
.formula-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--f-bg);
  clip-path: inset(var(--inset, 0px) round var(--radius, 0px));
}

.formula-inner {
  max-width: 1308px;
  margin: 0 auto;
  padding: 0 48px;
}

/* Scroll-driven elements get transform/opacity/filter set per frame */
[data-fx], .step, .phase-tag { will-change: transform, opacity, filter; }

/* ── Heading ───────────────────────────────────────────────── */
.formula-heading {
  padding: 10px;
  margin-bottom: 25px;
  text-align: center;
  font-size: clamp(34px, 4vw, 60px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

/* ── Tabs ────────────────────────────────────────────────────── */
.formula-tabs {
  position: relative;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  width: fit-content;
  margin: 0 auto;
}
.tab {
  position: relative;
  z-index: 1;
  padding: 16px 24px;
  border: 1.5px solid var(--f-blue);
  border-radius: 999px;
  background: transparent;
  color: var(--f-blue);
  font: 900 23px/1 var(--font);
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.45s var(--f-spring), background-color 0.3s, opacity 0.25s;
}
.tab:hover { transform: translateY(-3px); }
.tab:not([aria-selected='true']):hover { background: rgba(0, 51, 204, 0.06); }
.tab:not([aria-selected='true']):active { transform: translateY(0) scale(0.96); transition-duration: 0.12s; }
.tab:focus-visible { outline: 2px solid var(--f-blue); outline-offset: 4px; }
.tab-label { display: inline-block; transition: transform 0.45s var(--f-spring); }
.tab[aria-selected='true'] .tab-label { transform: scale(1.03); }

/* Sliding pill behind the active tab */
.tab-indicator {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--f-mauve);
  transition: transform 0.6s var(--f-spring), width 0.6s var(--f-spring), translate 0.45s var(--f-spring), opacity 0.25s;
  pointer-events: none;
}
/* follow the active tab's hover lift */
.formula-tabs:has(.tab[aria-selected='true']:hover) .tab-indicator { translate: 0 -3px; }

/* in-card tabs crossfade with the floating bar */
.formula-tabs.is-docked .tab, .formula-tabs.is-docked .tab-indicator { opacity: 0; }

/* ── Floating tab bar (takes over from the in-card tabs at the top of the screen) ──
   Appears at the in-card tabs' exact size, then eases down to a compact size once
   it has taken over (.is-compact), so it stays out of the content's way. */
.tab-dock {
  --s: 1;
  --compact: 0.74;
  --blue-18: rgba(1, 51, 204, 0.18);
  position: fixed;
  left: 50%;
  top: var(--dock-top, 16px);
  z-index: 50;
  max-width: calc(100vw - 24px);
  padding: 8px;
  border-radius: 130px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 0 0 1px var(--blue-18), 0 14px 36px -14px rgba(1, 51, 204, 0.35);
  font-family: var(--font);
  opacity: 0;
  transform: translateX(-50%) scale(1);
  transform-origin: 50% 0;
  transition: transform 0.55s var(--ease-out), opacity 0.25s;
  pointer-events: none;
}
.tab-dock.is-shown { opacity: 1; pointer-events: auto; }
.tab-dock.is-compact { transform: translateX(-50%) scale(var(--compact)); }
.dock-track {
  position: relative;
  display: flex;
  gap: calc(18px * var(--s));
  overflow-x: auto;
  scrollbar-width: none;
  padding-top: 4px; margin-top: -4px; /* room for the hover lift */
}
.dock-track::-webkit-scrollbar { display: none; }
.dock-tab {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  padding: calc(16px * var(--s)) calc(24px * var(--s));
  border: 1.5px solid var(--blue);
  border-radius: 999px;
  background: transparent;
  color: var(--blue);
  font: 900 calc(23px * var(--s))/1 var(--font);
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.45s var(--spring), background-color 0.3s;
}
.dock-tab:hover { transform: translateY(-3px); }
.dock-tab:not([aria-pressed='true']):hover { background: rgba(0, 51, 204, 0.06); }
.dock-tab:not([aria-pressed='true']):active { transform: translateY(0) scale(0.96); transition-duration: 0.12s; }
.dock-tab[aria-pressed='true'] .tab-label { transform: scale(1.03); }
.dock-tab .tab-label { display: inline-block; transition: transform 0.45s var(--spring); }
.dock-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.dock-indicator {
  position: absolute;
  top: 0; left: 0;
  border-radius: 999px;
  background: #d6def7; /* blue at 16% on white, as in the card */
  transition: transform 0.6s var(--spring), width 0.6s var(--spring), translate 0.45s var(--spring);
  pointer-events: none;
}
.dock-track:has(.dock-tab[aria-pressed='true']:hover) .dock-indicator { translate: 0 -3px; }
@media (prefers-reduced-motion: reduce) {
  .tab-dock, .dock-tab, .dock-indicator { transition: opacity 0.2s; }
}
@media (max-width: 640px) {
  .tab-dock { --s: 0.7; --compact: 0.9; padding: 6px; }
  .dock-track { mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 24px), transparent); padding-inline: 4px; }
}

/* ── Blurb ───────────────────────────────────────────────────── */
.formula-blurb-wrap { margin: 44px auto 88px; max-width: 1060px; }
.formula-blurb {
  text-align: center;
  font-size: clamp(22px, 2.2vw, 31px);
  line-height: 1.3;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

/* Blur swap: shared by blurb, step text, visual label + glance */
.formula .swap {
  transition: opacity 0.32s var(--f-ease), filter 0.32s var(--f-ease), transform 0.32s var(--f-ease);
}
.formula .swap.is-out { opacity: 0; filter: blur(8px); transform: translateY(-8px); }
.formula .swap.is-in  { opacity: 0; filter: blur(8px); transform: translateY(8px); transition: none; }

/* ── Panel ───────────────────────────────────────────────────── */
.formula-panel { display: flex; flex-direction: column; gap: 72px; }

/* ── At a glance ─────────────────────────────────────────────── */
.formula-overview {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.formula-glance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; margin: 0; }
.glance-item { padding-top: 14px; border-top: 1.5px solid rgba(0, 51, 204, 0.18); }
.glance-item dt { font-size: 15px; color: var(--f-tone); }
.glance-item dd { margin: 8px 0 0; font-size: 25px; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }

/* ── Process card ────────────────────────────────────────────
   A service-specific preview (mini step dots + summary) that unfolds
   into the full timeline below it. */
.process { --unfold: 0.75s; }
.process-toggle {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px 48px;
  padding: 26px 26px 26px 36px;
  border: 1.5px solid var(--f-blue);
  border-radius: 28px;
  background: var(--f-bg-2);
  color: var(--f-blue);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 18px 40px -28px rgba(1, 51, 204, 0.5);
  transition: box-shadow 0.4s var(--f-ease), background-color 0.3s;
}
.process-toggle:hover { box-shadow: 0 26px 50px -26px rgba(1, 51, 204, 0.55); background: #e3e9fa; }
.process-toggle:focus-visible { outline: 2px solid var(--f-blue); outline-offset: 4px; }

.process-intro { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.process-eyebrow { font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.process-title { font-size: clamp(24px, 2.2vw, 32px); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.process-service { display: inline-block; }

/* Mini preview of the steps */
.process-preview { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.process-mini { display: flex; align-items: center; }
.mini-node {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 1px solid var(--f-ink);
  border-radius: 50%;
  background: var(--f-paper);
  color: var(--f-ink);
  font-size: 13px;
  font-weight: 900;
}
.mini-node.is-optional { border-style: dashed; }
.mini-line { width: 14px; height: 1px; background: var(--f-ink); }
.mini-line--phase { width: 22px; background: repeating-linear-gradient(90deg, var(--f-ink) 0 2px, transparent 2px 4px); }
.process-meta { font-size: 15px; font-weight: 500; color: var(--f-tone); white-space: nowrap; }
/* hover: a wave runs along the dots, previewing the journey */
.process-toggle:hover .mini-node { animation: miniWave 0.7s var(--f-ease) calc(var(--i) * 55ms) both; }
@keyframes miniWave {
  0% { transform: none; }
  35% { transform: translateY(-6px); background: var(--f-ink); color: var(--f-paper); }
  100% { transform: none; }
}

/* Action pill: "See every step" with a plus that turns into a minus */
.process-action {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 10px 10px 22px;
  border: 1.5px solid var(--f-blue);
  border-radius: 999px;
  background: var(--f-paper);
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
  transition: background-color 0.3s, color 0.3s, transform 0.45s var(--f-spring);
}
.process-toggle:hover .process-action { background: var(--f-blue); color: var(--f-paper); transform: translateX(-2px); }
.process-icon {
  position: relative;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--f-blue);
  transition: background-color 0.3s, transform 0.6s var(--f-spring);
}
.process-icon::before, .process-icon::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 14px; height: 2px;
  margin: -1px 0 0 -7px;
  border-radius: 2px;
  background: var(--f-paper);
  transition: transform 0.5s var(--f-spring), background-color 0.3s;
}
.process-icon::after { transform: rotate(90deg); }
.process-toggle:hover .process-icon { background: var(--f-paper); }
.process-toggle:hover .process-icon::before, .process-toggle:hover .process-icon::after { background: var(--f-blue); }
.process-toggle:hover .process-icon { transform: rotate(90deg); }
.process.is-open .process-icon { transform: rotate(180deg); }
.process.is-open .process-icon::after { transform: rotate(0deg); }

/* Unfold: animate the row from 0fr to 1fr so the height is always exact */
.process-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--unfold) cubic-bezier(0.22, 1, 0.36, 1);
}
.process.is-open .process-body { grid-template-rows: 1fr; }
.process-clip { min-height: 0; overflow: hidden; overflow-anchor: none; }
.process .timeline { padding-top: 64px; }

/* Steps cascade in on open: node pops, text rises, connector draws down */
.process.is-revealing .step-num { animation: nodeIn 0.6s var(--f-spring) calc(var(--i) * 90ms + 150ms) both; }
.process.is-revealing .step-body { animation: textIn 0.7s var(--f-ease) calc(var(--i) * 90ms + 200ms) both; }
.process.is-revealing .step::after { transform-origin: top; animation: lineIn 0.5s var(--f-ease) calc(var(--i) * 90ms + 320ms) both; }
.process.is-revealing .phase-tag { animation: textIn 0.7s var(--f-ease) calc(var(--i) * 90ms + 150ms) both; }
.process.is-revealing .phase + .phase::before { animation: fadeIn 0.6s var(--f-ease) calc(var(--i) * 90ms + 200ms) both; }
@keyframes nodeIn { from { opacity: 0; transform: scale(0.6); } }
@keyframes textIn { from { opacity: 0; filter: blur(6px); transform: translateY(14px); } }
@keyframes lineIn { from { transform: scaleY(0); } }
@keyframes fadeIn { from { opacity: 0; } }

/* Hide link at the end of the steps */
.process-close {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 48px auto 0;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--f-blue);
  font: 700 16px/1 var(--font);
  cursor: pointer;
  transition: background-color 0.3s;
}
.process-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.45s var(--f-spring); }
.process-close:hover { background: rgba(0, 51, 204, 0.06); }
.process-close:hover svg { transform: translateY(-3px); }
.process-close:focus-visible { outline: 2px solid var(--f-blue); outline-offset: 2px; }

@media (max-width: 960px) {
  .process-toggle { grid-template-columns: minmax(0, 1fr) auto; }
  .process-preview { grid-column: 1 / -1; grid-row: 2; align-items: flex-start; }
}
@media (max-width: 640px) {
  .process-toggle { grid-template-columns: minmax(0, 1fr); padding: 22px; border-radius: 22px; gap: 18px; }
  .process-action { justify-self: start; grid-row: 3; font-size: 16px; }
  .process-preview { grid-row: 2; }
  .mini-node { width: 24px; height: 24px; font-size: 11px; }
  .mini-line { width: 8px; }
  .mini-line--phase { width: 14px; }
  .process .timeline { padding-top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .process-body { transition: none; }
  .process-toggle:hover .mini-node { animation: none; }
}

/* ── Process steps ───────────────────────────────────────────── */
/* Phases sit in a column; a vertical tag runs beside each one and a
   dotted rule separates them. Connectors join every pair of nodes. */
.timeline { --tag: 26px; --gutter: 37px; --node: 72px; --gap: 50px; --cross: 25px; padding-left: var(--gutter); color: var(--f-ink); }
.phase {
  position: relative;
  display: grid;
  grid-template-columns: var(--tag) minmax(0, 1fr);
  column-gap: 15px;
}
.phase + .phase { margin-top: var(--cross); padding-top: var(--cross); }
.phase + .phase::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(var(--gutter) * -1);
  width: min(935px, calc(100% + var(--gutter)));
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--f-ink) 0 2px, transparent 2px 4px);
}
/* The bar is an ordinary block that stretches to the phase's height; only
   the label inside is vertical. (A vertical-text box that stretches itself
   gets resized frame by frame in iOS Safari, which made the bar flicker.) */
.phase-tag {
  margin: 0;
  background: var(--f-ink);
  color: var(--f-paper);
  contain: paint;
}
.phase-tag-text {
  display: block;
  writing-mode: vertical-rl;
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 14px;
  white-space: nowrap;
}
.phase--outline .phase-tag { background: var(--f-paper); color: var(--f-ink); box-shadow: inset 0 0 0 1px var(--f-ink); }

.phase-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--gap); }
.step { position: relative; display: flex; align-items: flex-start; gap: 16px; }
.step-num {
  flex-shrink: 0;
  width: var(--node); height: var(--node);
  display: grid;
  place-items: center;
  border: 1px solid var(--f-ink);
  border-radius: 50%;
  background: var(--f-bg);
  font-size: 24px;
  font-weight: 900;
  transition: background-color 0.3s var(--f-ease), color 0.3s var(--f-ease);
}
.timeline .step:hover .step-num { background: var(--f-ink); color: var(--f-paper); }

/* Connector from this node down to the next one */
.step::after {
  content: '';
  position: absolute;
  left: calc(var(--node) / 2 - 0.5px);
  top: var(--node);
  bottom: calc(var(--gap) * -1);
  width: 1px;
  background: var(--f-ink);
}
.phase:not(:last-child) .step:last-child::after { bottom: calc(var(--cross) * -2); }
.phase:last-child .step:last-child::after { display: none; }

/* Text sits centred on the node when the description is one line */
.step-body { flex: 1; min-width: 0; padding-top: calc((var(--node) - 61px) / 2); display: flex; flex-direction: column; gap: 10px; }
.step-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 12px;
  row-gap: 6px;
  font-size: 22px;
  font-weight: 900;
  line-height: 26px;
  letter-spacing: -0.005em;
}
.step-sep { margin: 0 -4px; }
.step-time { display: inline-block; font-weight: 500; }
.step-desc { font-size: 18px; line-height: 1.4; max-width: 62ch; }
.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--f-ink);
  color: var(--f-paper);
  font-size: 12px;
  font-weight: 500;
  line-height: 14px;
  letter-spacing: 0;
  transition: transform 0.45s var(--f-spring);
}
.badge--outline { background: var(--f-paper); color: var(--f-ink); box-shadow: inset 0 0 0 1px var(--f-ink); }
.step:hover .badge { transform: rotate(-6deg) scale(1.08); }

/* ── Visual ──────────────────────────────────────────────────── */
.formula-visual-wrap { perspective: 1000px; }
.formula-visual {
  position: relative;
  padding: 46px 18px 14px;
  border: 1.5px solid var(--f-blue);
  border-radius: 28px;
  background: var(--f-bg-2);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  box-shadow: 0 30px 60px -30px rgba(0, 51, 204, 0.35);
}
.formula-visual::after { /* soft glare that follows the pointer */
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.45), transparent 45%);
  opacity: var(--glare, 0);
  transition: opacity 0.4s;
  pointer-events: none;
}
.visual-label {
  position: absolute;
  top: 18px; left: 22px;
  font: 700 14px/1 var(--font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.scenes { position: relative; aspect-ratio: 4 / 3; }
.scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  filter: blur(12px);
  transform: scale(0.94);
  transition: opacity 0.5s var(--f-ease), filter 0.5s var(--f-ease), transform 0.6s var(--f-spring);
}
.scene.is-active { opacity: 1; filter: blur(0); transform: none; }
.scene svg { width: 100%; height: 100%; overflow: visible; }

/* ── CTA ─────────────────────────────────────────────────────── */
.formula-cta-wrap { display: flex; justify-content: center; margin-top: 72px; }
.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 10px 4px 14px;
  color: var(--f-blue);
  text-decoration: none;
  font-size: clamp(24px, 2.4vw, 36px);
  font-weight: 900;
  letter-spacing: -0.01em;
  transform: translate(var(--mx, 0px), var(--my, 0px));
}
.cta:focus-visible { outline: 2px solid var(--f-blue); outline-offset: 8px; border-radius: 8px; }


.cta-arrow {
  display: grid;
  place-items: center;
  width: 1.35em; height: 1.35em;
  border-radius: 50%;
  flex-shrink: 0; /* keep it a circle when the text wraps */
  border: 1.5px solid var(--f-blue);
  transition: background-color 0.35s, transform 0.55s var(--f-spring);
}
.cta-arrow svg {
  width: 55%; height: 55%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(-45deg);
  transition: transform 0.55s var(--f-spring);
}
.cta:hover .cta-arrow { background: var(--f-blue); color: var(--f-bg); transform: scale(1.12); }
.cta:hover .cta-arrow svg { transform: rotate(0deg) translateX(1px); }

/* Underline: retracts to the right, then redraws from the left */
.cta-line { position: absolute; left: 4px; right: calc(1.35em + 20px); bottom: 8px; height: 1.5px; }
.cta-line::before, .cta-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  transition: transform 0.5s var(--f-ease);
}
.cta-line::before { transform-origin: right; }
.cta-line::after { transform-origin: left; transform: scaleX(0); }
.cta:hover .cta-line::before { transform: scaleX(0); }
.cta:hover .cta-line::after { transform: scaleX(1); transition-delay: 0.22s; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .formula-overview { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .formula-visual-wrap { max-width: 460px; }
  .formula-panel { gap: 64px; }
}
@media (max-width: 760px) {
  .formula { padding: 48px 0 80px; }
  .formula-inner { padding: 0 20px; }
  .formula-tabs { gap: 10px; }
  .tab { font-size: 16px; padding: 12px 16px; }
  .formula-blurb-wrap { margin: 32px auto 48px; }
  .glance-item dd { font-size: 20px; }
  .formula-glance { gap: 20px 24px; }
  .timeline { --node: 48px; --gutter: 0px; --gap: 18px; }
  .phase { column-gap: 12px; }
  .step { gap: 12px; }
  .step-num { font-size: 18px; }
  .step-body { padding-top: 0; gap: 6px; }
  .step-title { font-size: 18px; line-height: 22px; padding-top: 13px; }
  .step-desc { font-size: 16px; }
  /* phones: no blur on the steps (large blurred layers flicker on iOS) */
  [data-fx], .step { will-change: transform, opacity; }
  .phase-tag { will-change: auto; }
  .process.is-revealing .phase-tag { animation-name: fadeIn; }
  @keyframes textIn { from { opacity: 0; transform: translateY(14px); } }
}

/* ─────────────────────────────────────────────────────────────
   Scene illustrations (SVG, 400×300). Base styles = the finished
   frame, so reduced-motion users see a complete still image.
   ───────────────────────────────────────────────────────────── */
.scene svg * { transform-box: fill-box; transform-origin: center; }
.scene text { font-family: var(--font); font-weight: 700; }
.s-frame { fill: var(--f-paper); stroke: var(--f-blue); stroke-width: 2; }
.s-line  { fill: none; stroke: var(--f-blue); stroke-width: 2; }
.s-blue  { fill: var(--f-blue); }
.s-mauve { fill: #bfccf2; }   /* blue at 25% on white */
.s-peach { fill: var(--f-bg-2); }
.s-soft  { fill: var(--f-blue); opacity: 0.3; }
.s-ghost { fill: none; stroke: var(--f-blue); stroke-width: 1.5; opacity: 0.35; }
.s-cursor { fill: var(--f-blue); stroke: var(--f-paper); stroke-width: 1.5; stroke-linejoin: round; }
.s-ring { fill: none; stroke: var(--f-blue); stroke-width: 2; opacity: 0; }

/* Landing page: final frame */
.scene .lp-bar { transform-origin: left center; }
.lp-cursor, .nf-cursor { opacity: 0; }
/* New feature: final frame */
.nf-rows { transform: translateY(66px); }
.nf-knob { transform: translateX(16px); fill: var(--f-paper); }
/* New product: final frame */
.np-draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.np-el { stroke: var(--f-blue); stroke-width: 1.5; stroke-dasharray: 4 3; stroke-opacity: 0; }
.np-conf { opacity: 0; }
/* UX audit: final frame */
.ux-glass { opacity: 0; }
.ux-hl { fill: none; stroke: var(--f-blue); stroke-width: 1.5; stroke-dasharray: 5 4; }
.scene .ux-bar { transform-origin: left center; }
.ux-score { fill: none; stroke: var(--f-paper); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 28; transform: rotate(-90deg); }

@media (prefers-reduced-motion: no-preference) {
  .scene.is-active .loop { animation: sLoop var(--dur) infinite; }
  .scene.is-active [data-a] { animation-duration: var(--dur); animation-iteration-count: infinite; animation-fill-mode: both; }
  .scene--landing { --dur: 6s; }
  .scene--feature { --dur: 6s; }
  .scene--product { --dur: 7s; }
  .scene--audit   { --dur: 7.5s; }
  .scene--redesign { --dur: 7s; }
  /* pause everything while the section is off screen */
  .formula:not(.is-visible) .scene * { animation-play-state: paused !important; }

  /* Landing page */
  .is-active .lp-bar1   { animation-name: lpBar1; }
  .is-active .lp-bar2   { animation-name: lpBar2; }
  .is-active .lp-sub    { animation-name: lpSub; }
  .is-active .lp-img    { animation-name: lpImg; }
  .is-active .lp-cta    { animation-name: lpCta; }
  .is-active .lp-cursor { animation-name: lpCursor; }
  .is-active .lp-ring   { animation-name: lpRing; }
  .is-active .lp-scroll { animation-name: lpScroll; }
  .is-active .lp-card1  { animation-name: lpCard1; }
  .is-active .lp-card2  { animation-name: lpCard2; }
  .is-active .lp-card3  { animation-name: lpCard3; }
  .is-active .lp-quote  { animation-name: lpQuote; }

  /* New feature */
  .is-active .nf-rows   { animation-name: nfRows; }
  .is-active .nf-new    { animation-name: nfNew; }
  .is-active .nf-pill   { animation-name: nfPill; }
  .is-active .nf-cursor { animation-name: nfCursor; }
  .is-active .nf-track  { animation-name: nfTrack; }
  .is-active .nf-knob   { animation-name: nfKnob; }
  .is-active .nf-ring   { animation-name: nfRing; }
  .is-active .nf-spark1 { animation-name: nfSpark1; }
  .is-active .nf-spark2 { animation-name: nfSpark2; }
  .is-active .nf-spark3 { animation-name: nfSpark3; }

  /* New product */
  .is-active .np-draw1  { animation-name: npDraw1; }
  .is-active .np-draw2  { animation-name: npDraw2; }
  .is-active .np-desk   { animation-name: npDesk; }
  .is-active .np-el     { animation-name: npEl; }
  .is-active .np-phone  { animation-name: npPhone; }
  .is-active .np-tag    { animation-name: npTag; }
  .is-active .np-conf   { animation-name: npConf; }

  /* Redesign */
  .is-active .rd-handle, .is-active .rd-wipe { animation-name: rdWipe; }

  /* UX audit */
  .is-active .ux-glass  { animation-name: uxGlass; }
  .is-active .ux-hl1    { animation-name: uxHl1; }
  .is-active .ux-hl2    { animation-name: uxHl2; }
  .is-active .ux-hl3    { animation-name: uxHl3; }
  .is-active .ux-pin1   { animation-name: uxPin1; }
  .is-active .ux-pin2   { animation-name: uxPin2; }
  .is-active .ux-pin3   { animation-name: uxPin3; }
  .is-active .ux-row1   { animation-name: uxRow1; }
  .is-active .ux-row2   { animation-name: uxRow2; }
  .is-active .ux-row3   { animation-name: uxRow3; }
  .is-active .ux-score  { animation-name: uxScore; }
  .is-active .ux-num    { animation-name: uxNum; }
}

@keyframes sLoop { 0% { opacity: 0; } 4%, 93% { opacity: 1; } 100% { opacity: 0; } }

/* Landing page — headline builds, cursor clicks the CTA, page scrolls */
@keyframes lpBar1 { 0%, 6% { transform: scaleX(0); } 16%, 100% { transform: scaleX(1); } }
@keyframes lpBar2 { 0%, 9% { transform: scaleX(0); } 19%, 100% { transform: scaleX(1); } }
@keyframes lpSub  { 0%, 12% { opacity: 0; } 22%, 100% { opacity: 1; } }
@keyframes lpImg  { 0%, 8% { opacity: 0; transform: scale(0.85); } 20%, 100% { opacity: 1; transform: none; } }
@keyframes lpCta {
  0%, 14% { transform: scale(0); }
  21% { transform: scale(1.1); }
  25%, 39% { transform: scale(1); }
  41% { transform: scale(0.9); }
  45%, 100% { transform: scale(1); }
}
@keyframes lpCursor {
  0%, 20% { opacity: 0; transform: translate(330px, 270px); }
  25% { opacity: 1; transform: translate(320px, 262px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  38%, 56% { opacity: 1; transform: translate(96px, 174px); }
  62%, 100% { opacity: 0; transform: translate(108px, 188px); }
}
@keyframes lpRing { 0%, 40% { opacity: 0; transform: scale(0.2); } 41% { opacity: 0.8; } 52%, 100% { opacity: 0; transform: scale(1.8); } }
@keyframes lpScroll {
  0%, 58% { transform: translateY(0); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  72%, 100% { transform: translateY(-118px); }
}
@keyframes lpCard1 { 0%, 64% { opacity: 0; transform: translateY(14px); } 74%, 100% { opacity: 1; transform: none; } }
@keyframes lpCard2 { 0%, 66% { opacity: 0; transform: translateY(14px); } 76%, 100% { opacity: 1; transform: none; } }
@keyframes lpCard3 { 0%, 68% { opacity: 0; transform: translateY(14px); } 78%, 100% { opacity: 1; transform: none; } }
@keyframes lpQuote { 0%, 72% { opacity: 0; transform: translateY(14px); } 82%, 100% { opacity: 1; transform: none; } }

/* New feature — the list makes room, a new component snaps in, gets switched on */
@keyframes nfRows {
  0%, 14% { transform: translateY(0); animation-timing-function: cubic-bezier(0.34, 1.4, 0.64, 1); }
  26%, 100% { transform: translateY(66px); }
}
@keyframes nfNew {
  0%, 17% { opacity: 0; transform: translateY(-22px) scale(0.92); animation-timing-function: cubic-bezier(0.34, 1.4, 0.64, 1); }
  29%, 100% { opacity: 1; transform: none; }
}
@keyframes nfPill { 0%, 30% { transform: scale(0); } 35% { transform: scale(1.25); } 39%, 100% { transform: scale(1); } }
@keyframes nfCursor {
  0%, 30% { opacity: 0; transform: translate(330px, 270px); }
  34% { opacity: 1; transform: translate(320px, 262px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  45%, 58% { opacity: 1; transform: translate(322px, 101px); }
  64%, 100% { opacity: 0; transform: translate(336px, 116px); }
}
@keyframes nfTrack { 0%, 47% { fill: rgba(0, 51, 204, 0); } 51%, 100% { fill: #0033cc; } }
@keyframes nfKnob {
  0%, 47% { transform: translateX(0); fill: #0033cc; animation-timing-function: cubic-bezier(0.34, 1.4, 0.64, 1); }
  52%, 100% { transform: translateX(16px); fill: #ffffff; }
}
@keyframes nfRing { 0%, 46% { opacity: 0; transform: scale(0.2); } 47% { opacity: 0.8; } 58%, 100% { opacity: 0; transform: scale(1.8); } }
@keyframes nfSpark1 { 0%, 29% { transform: scale(0) rotate(0); } 35% { transform: scale(1) rotate(45deg); } 45%, 100% { transform: scale(0) rotate(90deg); } }
@keyframes nfSpark2 { 0%, 32% { transform: scale(0) rotate(0); } 38% { transform: scale(1) rotate(45deg); } 48%, 100% { transform: scale(0) rotate(90deg); } }
@keyframes nfSpark3 { 0%, 35% { transform: scale(0) rotate(0); } 41% { transform: scale(1) rotate(45deg); } 51%, 100% { transform: scale(0) rotate(90deg); } }

/* New product — sketch → wireframe → polished screens → launch */
@keyframes npDraw1 { 0%, 2% { stroke-dashoffset: 1; fill-opacity: 0; } 20% { stroke-dashoffset: 0; fill-opacity: 0; } 28%, 100% { stroke-dashoffset: 0; fill-opacity: 1; } }
@keyframes npDraw2 { 0%, 6% { stroke-dashoffset: 1; fill-opacity: 0; } 24% { stroke-dashoffset: 0; fill-opacity: 0; } 30%, 100% { stroke-dashoffset: 0; fill-opacity: 1; } }
@keyframes npDesk  { 0%, 2% { transform: translateX(-12px); } 22%, 100% { transform: none; } }
@keyframes npEl {
  0%, 22% { opacity: 0; fill-opacity: 0; stroke-opacity: 1; }
  30%, 44% { opacity: 1; fill-opacity: 0; stroke-opacity: 1; }
  56%, 100% { opacity: 1; fill-opacity: 1; stroke-opacity: 0; }
}
@keyframes npPhone {
  0%, 58% { transform: none; animation-timing-function: cubic-bezier(0.34, 1.4, 0.64, 1); }
  64% { transform: translateY(-10px); }
  72%, 100% { transform: translateY(-4px); }
}
@keyframes npTag { 0%, 62% { opacity: 0; transform: scale(0); } 68% { opacity: 1; transform: scale(1.12); } 72%, 100% { opacity: 1; transform: scale(1); } }
@keyframes npConf {
  0%, 62% { opacity: 0; transform: translate(0, 0) scale(0.4); }
  65% { opacity: 1; }
  82%, 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
}

/* Redesign — a before/after slider sweeps across the page */
@keyframes rdWipe {
  0%, 8% { transform: translateX(120px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  36%, 52% { transform: translateX(-120px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  72%, 100% { transform: translateX(0); }
}

/* UX audit — magnifier sweeps, issues get pinned, report fills in */
@keyframes uxGlass {
  0% { opacity: 0; transform: translate(190px, 260px); }
  6% { opacity: 1; transform: translate(186px, 236px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  15%, 24% { transform: translate(178px, 52px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  36%, 46% { transform: translate(74px, 208px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  57%, 68% { opacity: 1; transform: translate(156px, 206px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  80%, 100% { opacity: 0; transform: translate(220px, 262px); }
}
@keyframes uxHl1 { 0%, 16% { opacity: 0; transform: scale(1.08); } 21%, 100% { opacity: 1; transform: none; } }
@keyframes uxHl2 { 0%, 38% { opacity: 0; transform: scale(1.08); } 43%, 100% { opacity: 1; transform: none; } }
@keyframes uxHl3 { 0%, 59% { opacity: 0; transform: scale(1.08); } 64%, 100% { opacity: 1; transform: none; } }
@keyframes uxPin1 { 0%, 19% { transform: scale(0); } 23% { transform: scale(1.25); } 26%, 100% { transform: scale(1); } }
@keyframes uxPin2 { 0%, 41% { transform: scale(0); } 45% { transform: scale(1.25); } 48%, 100% { transform: scale(1); } }
@keyframes uxPin3 { 0%, 62% { transform: scale(0); } 66% { transform: scale(1.25); } 69%, 100% { transform: scale(1); } }
@keyframes uxRow1 { 0%, 21% { opacity: 0; transform: translateX(10px); } 28%, 100% { opacity: 1; transform: none; } }
@keyframes uxRow2 { 0%, 43% { opacity: 0; transform: translateX(10px); } 50%, 100% { opacity: 1; transform: none; } }
@keyframes uxRow3 { 0%, 64% { opacity: 0; transform: translateX(10px); } 71%, 100% { opacity: 1; transform: none; } }
@keyframes uxScore { 0%, 8% { stroke-dashoffset: 100; } 76%, 100% { stroke-dashoffset: 28; } }
@keyframes uxNum { 0%, 72% { opacity: 0; } 78%, 100% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .tab, .tab-indicator, .step-num, .formula .swap, .scene, .cta-arrow { transition: none !important; }
}
