/* ==========================================================================
   stage.css - the VSL stage behind the arrow cut (LAB, 2026-11-13)

   One screen: headline, video, Apply button. The white sheet with
   "FrameEconomics" lies on top until the first scroll; the red arrow cuts it.
     data-mode="clear"  concept 5: the halves fly off, a particle flow shows behind
     data-mode="frame"  concept 1: the halves stop just clear of the video and stay
   After the cut the stage holds still for half a screen (the spacer), then
   scrolls away with a hard bottom edge; the dark page continues below it.

   Without JavaScript (no .fe-stage-on) it is a plain dark section with the
   headline, the video link and the button: no sheet, no hold.
   ========================================================================== */

.fe-stage {
  --fe-sheet: var(--paper, #ffffff);
  --fe-ink: var(--ink, #0b0b0c);
  --fe-arrow: var(--cta, #e23511);
  --fe-pad: clamp(16px, 4.5vh, 56px);
  --fe-gap: clamp(1.1rem, 3.4vh, 2.3rem);
  --fe-chrome: 13rem; /* room kept for headline + button + gaps when sizing the video */
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 320px;
  overflow: hidden;
  isolation: isolate;
  background: var(--ink, #0b0b0c);
}
.fe-stage[data-concept="5"] {
  --fe-gap-bot-default: clamp(2.6rem, 9.5vh, 6.5rem); /* room for the coral "clients" to travel */
  --fe-chrome: 17rem;
  background: radial-gradient(70% 60% at 50% 48%, #161618 0%, var(--ink, #0b0b0c) 70%);
}

/* concept 5 (data-header="top"): the site header comes first and sits on top of the stage.
   Hidden under the sheet until the cut opens (html.fe-head-hidden), then the same glassy
   sticky bar as on every page (html.fe-head-clear no longer changes its look).
   --fe-head = the header's height, measured by stage.js. */
.fe-stage-on .fe-runway--under-header { margin-top: calc(-1 * var(--fe-head, 69px)); }
.fe-stage[data-header="top"] { --fe-chrome: calc(14rem + var(--fe-head, 69px)); }
.fe-stage-on .fe-stage[data-header="top"] .fe-stage-col {
  padding-top: calc(var(--fe-head, 69px) + var(--fe-pad) * 0.5);
}
html.fe-stage-on .site-header {
  transition: opacity 0.55s var(--ease, ease), translate 0.55s var(--ease, ease), visibility 0s,
    background-color 0.35s var(--ease, ease), border-color 0.35s var(--ease, ease);
}
html.fe-head-hidden .site-header {
  opacity: 0;
  visibility: hidden;
  translate: 0 -100%;
  transition: opacity 0.2s, translate 0.2s, visibility 0s linear 0.2s;
}
/* html.fe-head-clear (the stage pinned): the header used to go see-through here; since 2026-11-16 it keeps its
   glass the whole way (Jonas: the particles flew through the wordmark and the button on phones) */

.fe-stage-on .fe-stage { position: sticky; top: 0; }
.fe-runway-spacer { display: none; }
.fe-stage-on .fe-runway-spacer { display: block; height: 50vh; height: 50svh; } /* the half-screen hold */

/* scrub (data-scroll="scrub", the homepage since 2026-11-14): the cut follows the scroll. The spacer is
   the scroll the cut takes (.fe-scrub, about one screen) plus a quarter screen the open stage stays
   pinned (.fe-hold), then it scrolls away. No scroll lock anywhere. */
.fe-stage-on .fe-runway--scrub .fe-runway-spacer { height: auto; }
.fe-scrub { height: 90vh; height: 90svh; }
.fe-hold { height: 25vh; height: 25svh; }
.fe-runway--scrub.fe-no-scrub .fe-scrub { height: 0; } /* reduced motion: no cut to scroll through */

/* room at the bottom of the stage for the "Scroll" hint, so it never touches the button */
.fe-stage-on .fe-stage[data-scroll="scrub"] .fe-stage-col { padding-bottom: calc(var(--fe-pad) + 2.9rem); }
.fe-stage-hint {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: max(0.9rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.35em;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--paper, #fff);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.8s var(--ease, ease), visibility 0s linear 0.8s;
}
.fe-stage-hint.is-shown { opacity: 0.7; visibility: visible; transition: opacity 0.8s var(--ease, ease), visibility 0s; }
.fe-stage-hint span {
  display: block;
  width: 1px;
  height: 1.6rem;
  background: currentColor;
  transform-origin: top;
  animation: fe-sheet-pulse 1.8s var(--ease, ease) infinite;
}

/* ---- the column: headline, video, button ---- */

.fe-stage-col {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--fe-pad) 16px;
  pointer-events: none; /* the gaps let clicks through to the sheet */
}
.fe-stage-col > * { pointer-events: auto; }

.fe-stage-title {
  position: relative;
  z-index: 2;
  max-width: 30ch;
  margin: 0 0 var(--fe-gap-top, var(--fe-gap));
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.75rem, min(1rem + 2.6vw, 6.2svh), 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-align: center;
  text-wrap: balance;
  color: var(--paper, #fff);
}

.fe-video {
  position: relative;
  z-index: 2;
  flex: none;
  width: var(--fe-video-w, 100%);
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 30px 90px -24px rgba(0, 0, 0, 0.85);
}
@media (min-width: 720px) {
  .fe-video {
    width: var(--fe-video-w, min(62vw, 960px, calc((100svh - 2 * var(--fe-pad) - var(--fe-chrome)) * 16 / 9)));
  }
}
/* portrait tablets: plenty of height, so the video takes nearly the full width */
@media (min-width: 720px) and (orientation: portrait) {
  .fe-video {
    width: var(--fe-video-w, min(100%, 900px, calc((100svh - 2 * var(--fe-pad) - var(--fe-chrome)) * 16 / 9)));
  }
  .fe-stage-title { font-size: clamp(1.75rem, 1rem + 3.4vw, 3.4rem); }
}
.fe-video-btn { position: absolute; inset: 0; display: block; color: #fff; }
.fe-video-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease, ease), filter 0.3s var(--ease, ease);
}
.fe-video-btn:hover img { transform: scale(1.02); filter: brightness(1.06); }
.fe-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(52px, 11%, 92px);
  aspect-ratio: 1;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cta, #e23511);
  box-shadow: 0 10px 34px rgba(226, 53, 17, 0.45);
  transition: transform 0.2s var(--ease, ease);
}
.fe-play svg { width: 40%; translate: 8% 0; fill: #fff; }
.fe-video-btn:hover .fe-play { transform: scale(1.07); }
.fe-video-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.6rem 1rem 0.85rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  font-size: clamp(0.72rem, 1.1vw, 0.95rem);
  font-weight: 600;
  letter-spacing: -0.005em;
  text-align: left;
}
.fe-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.fe-stage-cta {
  position: relative;
  z-index: 2;
  flex: none;
  margin-top: var(--fe-gap-bot, var(--fe-gap-bot-default, var(--fe-gap)));
  box-shadow: 0 0 calc(var(--fe-pulse, 0) * 46px) calc(var(--fe-pulse, 0) * 5px) rgb(242 102 78 / calc(var(--fe-pulse, 0) * 0.6));
}

/* ---- the VSL with the camera turn (assets/js/vsl.js, 2026-11-15) ----
   .fe-video stays the 16:9 slot that stage.js fits on the screen; vsl.js adds
   margins above and below while the reel is vertical, and turns .fe-vsl-frame. */
.fe-video--vsl {
  overflow: visible;
  background: none;
  box-shadow: none;
  border-radius: 0;
  z-index: 3;
}
.fe-vsl-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 30px 90px -24px rgba(0, 0, 0, 0.85);
  transform-origin: 50% 50%;
  will-change: transform;
}
.fe-vsl-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.fe-vsl-hit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.fe-vsl-hit:focus-visible { outline: 3px solid var(--red-bright, #f2664e); outline-offset: -3px; }
/* controls layer: upright, the size of what you see (vsl.js sets width/height) */
.fe-vsl-ui {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  pointer-events: none;
}
.fe-vsl-unmute {
  position: absolute;
  left: 50%;
  bottom: 9%;
  translate: -50% 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.25rem 0.8rem 1.05rem;
  border: 0;
  border-radius: 999px;
  background: var(--cta, #e23511);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: clamp(0.92rem, 0.85rem + 0.3vw, 1.05rem);
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 10px 34px rgba(226, 53, 17, 0.5);
  animation: fe-vsl-nudge 2.4s ease-in-out infinite;
  transition: opacity 0.3s, scale 0.3s;
}
.fe-vsl-unmute svg { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }
.fe-video--vsl:not([data-vsl="idle"]):not([data-vsl="preview"]) .fe-vsl-unmute { opacity: 0; scale: 0.9; pointer-events: none; animation: none; }
@keyframes fe-vsl-nudge { 0%, 100% { scale: 1; } 50% { scale: 1.05; } }
/* play / pause: shown while paused or ended, flashed on a tap */
.fe-vsl-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(56px, 18%, 84px);
  aspect-ratio: 1;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.55);
  opacity: 0;
}
.fe-vsl-icon svg { width: 42%; fill: #fff; }
.fe-vsl-icon .i-play { translate: 8% 0; }
.fe-vsl-icon .i-pause, .fe-video--vsl[data-vsl="paused"] .fe-vsl-icon .i-pause,
.fe-video--vsl[data-vsl="ended"] .fe-vsl-icon .i-pause { display: none; }
.fe-vsl-icon[data-kind="pause"] .i-pause { display: block; }
.fe-vsl-icon[data-kind="pause"] .i-play { display: none; }
.fe-video--vsl[data-vsl="paused"] .fe-vsl-icon, .fe-video--vsl[data-vsl="ended"] .fe-vsl-icon { opacity: 1; }
.fe-video--vsl[data-vsl="paused"] .fe-vsl-icon .i-play, .fe-video--vsl[data-vsl="ended"] .fe-vsl-icon .i-play { display: block; }
.fe-vsl-icon.is-flash { animation: fe-vsl-flash 0.7s ease-out; }
.fe-video--vsl[data-vsl="paused"] .fe-vsl-icon.is-flash { animation: none; }
@keyframes fe-vsl-flash { 0% { opacity: 0.95; scale: 0.9; } 100% { opacity: 0; scale: 1.25; } }
/* bottom bar (2026-11-15): volume + full screen buttons and a progress line that runs fast at
   the start and slower later (display only, no seeking). It lives in the upright .fe-vsl-ui, so it
   never turns with the frame. Shown once the video plays with sound. */
.fe-vsl-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s;
}
.fe-video--vsl:is([data-vsl="sound"], [data-vsl="paused"], [data-vsl="ended"]) .fe-vsl-bar { opacity: 1; }
.fe-vsl-ctrls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 0.45rem 0.35rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
  transition: opacity 0.35s;
  pointer-events: none;
}
.fe-video--vsl:is([data-vsl="sound"], [data-vsl="paused"], [data-vsl="ended"]) .fe-vsl-ctrls { pointer-events: auto; }
.fe-video--vsl.is-idle .fe-vsl-ctrls { opacity: 0; pointer-events: none !important; }
.fe-video--vsl.is-idle.is-fs { cursor: none; }
.fe-vsl-vol { display: flex; align-items: center; }
.fe-vsl-mute, .fe-vsl-fs {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.fe-vsl-mute:hover, .fe-vsl-fs:hover { background: rgba(255, 255, 255, 0.14); }
.fe-vsl-mute:focus-visible, .fe-vsl-fs:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.fe-vsl-mute svg, .fe-vsl-fs svg { width: 24px; height: 24px; fill: currentColor; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.fe-vsl-mute .i-muted, .fe-video--vsl.is-muted .fe-vsl-mute .i-vol { display: none; }
.fe-video--vsl.is-muted .fe-vsl-mute .i-muted { display: block; }
.fe-vsl-fs .i-fs-off, .fe-video--vsl.is-fs .fe-vsl-fs .i-fs-on { display: none; }
.fe-video--vsl.is-fs .fe-vsl-fs .i-fs-off { display: block; }
.fe-vsl-volume {
  width: 76px;
  height: 20px;
  margin: 0 0 0 0.2rem;
  accent-color: var(--cta, #e23511);
  cursor: pointer;
  transition: width 0.25s, opacity 0.25s;
}
.fe-video--vsl.no-volume .fe-vsl-volume { display: none; }
@media (hover: hover) {
  .fe-vsl-volume { width: 0; opacity: 0; }
  .fe-vsl-vol:hover .fe-vsl-volume, .fe-vsl-vol:focus-within .fe-vsl-volume { width: 76px; opacity: 1; }
}
.fe-vsl-progress { height: 4px; background: rgba(255, 255, 255, 0.22); }
.fe-vsl-progress span {
  display: block;
  height: 100%;
  background: var(--cta, #e23511);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
/* full screen: the real Fullscreen API where it exists, the same look as a fixed layer on iPhone */
.fe-video--vsl.is-fs {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  z-index: 2147483000;
  background: #000;
}
.fe-video--vsl:fullscreen { background: #000; }
html.fe-vsl-fake-fs .site-header { visibility: hidden; }
html.fe-vsl-fake-fs .fe-stage { z-index: 2147483000; }
/* while the upright box is small (mid-turn) the slider steps aside so both buttons fit */
.fe-video--vsl.is-narrow .fe-vsl-volume { display: none; }
.fe-video--vsl.is-fs .fe-vsl-frame, .fe-video--vsl.is-fs .fe-vsl-bar { border-radius: 0; }
.fe-video--vsl.is-fs .fe-vsl-frame { box-shadow: none; }
@media (prefers-reduced-motion: reduce) {
  .fe-vsl-unmute { animation: none; }
}

/* ---- the particle flow (concept 5) ---- */

.fe-flow {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: opacity 0.8s var(--ease, ease);
}
.fe-stage.is-playing .fe-flow { opacity: 0.35; } /* lights down while the video plays */

/* ---- the sheet (the arrow intro) ---- */

.fe-sheet { display: none; }
.fe-stage-on .fe-sheet {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none; /* the paper itself catches clicks; the cut lets them through */
  background: var(--fe-sheet); /* first paint, before the SVG exists */
}
.fe-sheet.is-ready { background: transparent; }
.fe-sheet.is-done { visibility: hidden; }
.fe-sheet svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  overflow: visible;
}
.fe-sheet svg text { opacity: 0; transition: opacity 0.45s var(--ease, ease); }
.fe-sheet.is-ready svg text { opacity: 1; }

/* concept 1: headline and button sit on the paper, in ink, once the cut has opened */
.fe-stage[data-mode="frame"] .fe-stage-title { z-index: 4; }
.fe-stage[data-mode="frame"] .fe-stage-cta { z-index: 4; }
.fe-stage-on .fe-stage[data-mode="frame"] .fe-stage-title { color: var(--fe-ink); }
.fe-stage-on .fe-stage[data-mode="frame"] .fe-stage-title,
.fe-stage-on .fe-stage[data-mode="frame"] .fe-stage-cta {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease, ease), visibility 0s linear 0.3s;
}
.fe-stage-on .fe-stage[data-mode="frame"].is-open .fe-stage-title,
.fe-stage-on .fe-stage[data-mode="frame"].is-open .fe-stage-cta {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s var(--ease, ease), visibility 0s;
}
.fe-stage-on .fe-stage[data-mode="frame"].is-open .fe-stage-cta { transition-delay: 0.12s; }

.fe-sheet-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding-left: 0.35em;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--fe-ink);
  opacity: 0.7;
  transition: opacity 0.3s var(--ease, ease);
}
.fe-sheet-hint span {
  display: block;
  width: 1px;
  height: 1.6rem;
  background: currentColor;
  transform-origin: top;
  animation: fe-sheet-pulse 1.8s var(--ease, ease) infinite;
}
.fe-stage:not([data-state="poster"]) .fe-sheet-hint { opacity: 0; }
@keyframes fe-sheet-pulse {
  0% { transform: scaleY(0); opacity: 1; }
  70% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}
