/* VERXELA home.
   Default = composed static/flow layout. html.stage-on (≥1000px, motion allowed) turns the dark scenes into one pinned stage. */

/* =========================================================
   Shared scene furniture
   ========================================================= */
.stage { position: relative; background: var(--vx-obsidian); }
.stage__bg, .guide { display: none; }

.scene { position: relative; isolation: isolate; overflow: hidden; scroll-margin-top: var(--header-h); }
.scene__bg { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.scene::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--grain, none); background-size: 160px 160px; opacity: 0.045; mix-blend-mode: screen;
}
.scene__light { position: absolute; inset: 0; }
.scene__light--br { background: radial-gradient(70% 80% at 90% 106%, rgba(124, 58, 237, 0.46), rgba(76, 29, 149, 0.22) 45%, rgba(76, 29, 149, 0) 100%); }
.scene__light--b  { background: radial-gradient(60% 70% at 50% 118%, rgba(124, 58, 237, 0.36), rgba(76, 29, 149, 0.16) 45%, rgba(76, 29, 149, 0) 100%); }
.scene__light--r  { background: radial-gradient(60% 80% at 100% 100%, rgba(124, 58, 237, 0.4), rgba(76, 29, 149, 0.2) 45%, rgba(76, 29, 149, 0) 100%); }
.scene__light--bl { background: radial-gradient(60% 70% at 0% 110%, rgba(124, 58, 237, 0.22), rgba(76, 29, 149, 0.1) 45%, rgba(76, 29, 149, 0) 100%); }
.scene__light--c  { background: radial-gradient(42% 52% at 50% 64%, rgba(124, 58, 237, 0.34), rgba(76, 29, 149, 0.16) 45%, rgba(76, 29, 149, 0) 100%); }

.tex-a, .tex-c { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.tex-cine { position: absolute; inset: 0; background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 54px); }

.slot { fill: var(--vx-white); }
.scene__content { position: relative; z-index: 1; }

/* Highlighted query (texture A): placed by JS, hidden until then */
.qhl {
  position: absolute; left: 0; top: 0; z-index: 1; display: none; align-items: center; gap: 0.55ch;
  font: 400 15px/1 var(--font-mono); font-variant-ligatures: none; color: var(--vx-lavender);
  white-space: nowrap; pointer-events: none;
}
.qhl.is-placed { display: inline-flex; }
.qhl__caret { width: 2.4px; height: 1.2em; background: var(--vx-purple); }
.qhl.is-blinking .qhl__caret { animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.qhl.is-dim .qhl__text { color: rgba(146, 146, 157, 0.22); }
.qhl__text { transition: color var(--d-slow) var(--ease); }

/* =========================================================
   Hero: Convergence. Headline above the mark, the two disciplines flanking it, the call below.
   The mark rests exactly where the opening forms it: nothing moves after the intro.
   ========================================================= */
.scene--hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--header-h) + 40px) var(--margin) 72px; }
.hero { width: 100%; max-width: var(--max); margin-inline: auto; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero__head { display: flex; flex-direction: column; align-items: center; }
.hero__label { margin-bottom: var(--s-5); }
.hero__label > .enter { display: inline-block; }
.hero__title { --fs-hero: clamp(44px, min(5.2vw, 7.6vh), 76px); font-size: var(--fs-hero); font-weight: 500; letter-spacing: var(--tr-display); line-height: 1.02; }
.hero__title > .enter { display: block; }
.hero__row { display: block; white-space: nowrap; }
.dot { color: var(--vx-purple); }

.hero__core {
  width: 100%; margin-top: clamp(28px, 4.6vh, 52px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: clamp(36px, 4.2vw, 72px);
}
.hero__pillar { max-width: 19.5rem; }
.hero__pillar--a { justify-self: end; text-align: right; --from: translate3d(32px, 0, 0); }
.hero__pillar--b { justify-self: start; text-align: left; --from: translate3d(-32px, 0, 0); }
.hero__kicker {
  display: flex; align-items: center; gap: 12px;
  font: 500 var(--fs-label)/1.2 var(--font-mono); letter-spacing: var(--tr-label); text-transform: uppercase;
  color: var(--vx-soft); font-variant-ligatures: none;
}
.hero__pillar--a .hero__kicker { justify-content: flex-end; }
.hero__num { color: var(--vx-lavender); }
/* A hairline from each discipline towards the mark: brightest at the mark's side */
.hero__pillar--a .hero__kicker::after,
.hero__pillar--b .hero__kicker::before { content: ""; flex: none; width: clamp(32px, 3.4vw, 56px); height: 1px; }
.hero__pillar--a .hero__kicker::after { background: linear-gradient(90deg, rgba(167, 139, 250, 0), var(--vx-lavender)); transform-origin: 100% 50%; }
.hero__pillar--b .hero__kicker::before { background: linear-gradient(90deg, var(--vx-lavender), rgba(167, 139, 250, 0)); transform-origin: 0 50%; }
.hero__desc { margin-top: var(--s-3); font-size: var(--fs-body); line-height: 1.5; color: rgba(245, 245, 247, 0.76); text-wrap: pretty; }
.hero__visual { position: relative; display: flex; justify-content: center; align-items: center; }
.slot--hero { height: clamp(140px, 22vh, 260px); width: auto; aspect-ratio: 194 / 156; }

.hero__foot { margin-top: clamp(28px, 4.6vh, 52px); display: flex; flex-direction: column; align-items: center; }
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero__secondary { border-color: rgba(245, 245, 247, 0.18); } /* the ghost outline stays visible on the light behind the mark */
.hero__arrow { display: inline-block; transition: transform var(--d-base) var(--ease); }
.hero__secondary:hover .hero__arrow { transform: translateY(2px); }
.hero__micro { margin-top: var(--s-4); color: rgba(245, 245, 247, 0.7); } /* lighter than Muted: it sits on the light behind the mark */
.hero__micro > .enter { display: inline-block; }

/* Scroll cues: hero (flow + static) and one stage-level cue (pinned stage) */
.scroll-hint {
  position: absolute; left: 50%; bottom: 20px; z-index: 1; transform: translateX(-50%);
  font: 500 11px/1 var(--font-mono); letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--vx-muted); font-variant-ligatures: none;
}
.scroll-hint .enter { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cue-chev { width: 9px; height: 9px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); animation: bob 2.4s var(--ease-io) infinite; }
html.static .cue-chev { animation: none; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(45deg); } 50% { transform: translateY(4px) rotate(45deg); } }
.stage-cue { display: none; }

.opening-canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; z-index: 0; pointer-events: none; display: none; }
.opening-canvas.is-playing { display: block; }

/* Opening entrance (time-based, plays once). The headline rises, the two disciplines slide out from
   behind the mark while their hairlines draw outwards, then the call. Static mode never gets .opening. */
html.opening .scene--hero .enter { opacity: 0; transform: translateY(14px); }
html.opening .hero__pillar > .enter { transform: var(--from); }
html.opening .hero__pillar--a .hero__kicker::after,
html.opening .hero__pillar--b .hero__kicker::before { transform: scaleX(0); }
html.opened .scene--hero .enter { opacity: 1; transform: none; transition: opacity var(--d-slow) var(--ease) var(--d, 0ms), transform 800ms var(--ease) var(--d, 0ms); }
html.opened .hero__pillar--a .hero__kicker::after,
html.opened .hero__pillar--b .hero__kicker::before { transform: none; transition: transform 700ms var(--ease) calc(var(--d, 0ms) + 240ms); }
html.opened.opened-fast .scene--hero .enter,
html.opened.opened-fast .hero__kicker::after,
html.opened.opened-fast .hero__kicker::before { transition-duration: var(--d-quick); transition-delay: 0ms; }
html.motion-boot .scene--hero .scene__content,
html.motion-boot .scene--hero .qhl,
html.motion-boot .scene--hero .tex-a { opacity: 0; }

@media (max-width: 999px) {
  /* The light behind the mark: rises with the opening bloom and stays (the bloom hands over to it) */
  .hero__visual::before {
    content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: 360px; height: 360px; margin: -180px 0 0 -180px; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(124, 58, 237, 0.42), rgba(124, 58, 237, 0.18) 45%, rgba(76, 29, 149, 0.06) 75%, rgba(76, 29, 149, 0));
    pointer-events: none;
  }
  html.opening .hero__visual::before { opacity: 0; }
  html.opened .hero__visual::before { opacity: 1; transition: opacity 900ms var(--ease) 600ms; }
  html.opened.opened-fast .hero__visual::before { transition-duration: var(--d-base); transition-delay: 0ms; }
  /* Longest row is ~12.6em: 6.4vw keeps the headline on two lines down to 600 px */
  .hero__title { --fs-hero: clamp(34px, 6.4vw, 60px); }
  .slot--hero { height: clamp(96px, 15vw, 140px); }
  .hero__core { column-gap: clamp(20px, 3.4vw, 36px); }
  .hero__desc { font-size: var(--fs-small); }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 999px) {
  html.motion-ready:not(.opening) .hero__visual::before { animation: halo 9s var(--ease-io) infinite; }
}
@keyframes halo { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@media (max-width: 699px) {
  /* Stacked: headline, mark, the two disciplines, the call */
  .hero__core { grid-template-columns: minmax(0, 1fr); row-gap: var(--s-5); justify-items: center; }
  .hero__visual { order: -1; margin-bottom: var(--s-2); }
  .hero__pillar--a, .hero__pillar--b { justify-self: center; text-align: center; max-width: 24rem; --from: translate3d(0, 14px, 0); }
  .hero__pillar--a .hero__kicker { justify-content: center; }
  .hero__pillar--b .hero__kicker { justify-content: center; }
  .hero__pillar--a .hero__kicker::after, .hero__pillar--b .hero__kicker::before { display: none; }
  .slot--hero { height: 84px; }
}
@media (max-width: 599px) {
  /* Brand rule: texture A is not used in pieces under 600 px; plain ambient light instead. */
  .tex-a, .qhl { display: none !important; }
  .hero__title { --fs-hero: clamp(32px, 9.4vw, 44px); text-wrap: balance; }
  .hero__row { display: inline; white-space: normal; }
  /* Tighter rhythm so the whole composition fits one phone screen */
  .scene--hero { padding-top: calc(var(--header-h) + 24px); }
  .hero__core { margin-top: var(--s-5); row-gap: var(--s-4); }
  .hero__foot { margin-top: var(--s-6); }
  .hero__actions { width: 100%; }
  .hero__actions .btn { flex: 1 1 auto; }
}

/* =========================================================
   Overview
   ========================================================= */
.scene--overview { padding: var(--s-10) var(--margin); }
.overview { max-width: 1160px; margin-inline: auto; }
.overview__head { text-align: center; margin-bottom: clamp(48px, 9vh, 96px); }
.overview__title { margin-top: var(--s-4); font-size: var(--fs-h1); font-weight: 500; letter-spacing: var(--tr-h1); line-height: 1.05; }
.overview__row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); column-gap: 14px; align-items: start; }
.ov-item { --lead: 32px; display: block; color: inherit; text-decoration: none; border-radius: var(--r-button); }
.ov-item--1 { --lead: 51px; }
.ov-rail { display: flex; align-items: center; height: 56px; }
.ov-cross { position: relative; width: 11px; height: 11px; flex: none; margin-right: 8px; }
.ov-cross::before, .ov-cross::after { content: ""; position: absolute; background: rgba(146, 146, 157, 0.7); }
.ov-cross::before { left: 5px; top: 0; width: 1px; height: 11px; }
.ov-cross::after { top: 5px; left: 0; height: 1px; width: 11px; }
.ov-seg { height: 1px; background: rgba(146, 146, 157, 0.42); }
.ov-seg--lead { width: 20px; flex: none; }
.ov-seg--fill { flex: 1; min-width: 16px; }
.ov-label { padding-inline: 12px; white-space: nowrap; }
.ov-arrow { width: 9px; height: 9px; flex: none; margin-left: -8px; border-top: 1px solid rgba(146, 146, 157, 0.7); border-right: 1px solid rgba(146, 146, 157, 0.7); transform: rotate(45deg); }
.ov-body { display: block; padding-left: var(--lead); padding-right: 12px; }
.ov-title { display: block; margin-top: var(--s-2); font-size: var(--fs-h3); font-weight: 500; letter-spacing: var(--tr-h3); line-height: 1.2; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 6px; text-decoration-thickness: 1px; transition: text-decoration-color var(--d-quick) var(--ease); }
.ov-item:hover .ov-title { text-decoration-color: currentColor; }
.ov-desc { display: block; margin-top: var(--s-3); max-width: 25rem; color: var(--vx-muted); font-size: 16px; }
.ov-hub { height: 56px; display: flex; align-items: center; }
.slot--overview { height: 56px; width: auto; aspect-ratio: 194 / 156; }

@media (max-width: 759px) {
  .overview__head { text-align: left; }
  .overview__row { grid-template-columns: 1fr; row-gap: var(--s-5); }
  .ov-hub { justify-content: center; height: 48px; }
  .slot--overview { height: 44px; }
}

/* =========================================================
   Chapters + diagrams
   ========================================================= */
.scene--chapter { padding: var(--s-10) var(--margin); scroll-margin-top: var(--header-h); }
.chapter { max-width: var(--max); margin-inline: auto; display: grid; gap: var(--s-7) var(--s-8); align-items: center; }
.chapter--text-left { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
.chapter--text-right { grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.72fr); }
.chapter__title { margin-top: var(--s-4); font-size: var(--fs-chapter); font-weight: 500; letter-spacing: var(--tr-h1); line-height: 1.04; max-width: 14ch; }
.chapter__body { margin-top: var(--s-5); max-width: 33rem; color: rgba(245, 245, 247, 0.78); }
.chapter__text .text-link { margin-top: var(--s-6); }

.dgm { position: relative; min-width: 0; }
.dgm__box { position: relative; width: 100%; aspect-ratio: var(--ar); margin-inline: auto; }
.dgm__svg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.dgm__label { position: absolute; transform: translateY(-9px); font-size: 13px; line-height: 1.35; color: var(--vx-muted); white-space: nowrap; pointer-events: none; transition: opacity var(--d-slow) var(--ease), color var(--d-base) var(--ease); }
.dgm__k { display: block; font: 500 12px/18px var(--font-mono); letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--vx-soft); font-variant-ligatures: none; transition: color var(--d-base) var(--ease); }
.dgm__v { display: block; }
.dgm__legend { margin-top: var(--s-5); }
.dgm__legend ol { display: grid; gap: var(--s-3); }
.dgm__legend li { display: flex; gap: var(--s-4); align-items: baseline; padding-top: var(--s-3); border-top: 1px solid var(--c-line); color: rgba(245, 245, 247, 0.78); font-size: 15px; }
.dgm__legend .dgm__k { flex: none; min-width: 72px; color: var(--vx-lavender); }
.dgm__legend--flow { counter-reset: flow; }
.dgm__legend--flow li::before { counter-increment: flow; content: "0" counter(flow); font: 500 12px/18px var(--font-mono); color: var(--vx-muted); min-width: 32px; }

@media (min-width: 760px) {
  .dgm__legend { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }
}
@media (max-width: 759px) {
  .dgm__label, .ring-tick, .leader { display: none; }
}

/* Rings (01 · Visibility) */
.ring { fill: none; stroke: var(--vx-lavender); stroke-width: 1.3; stroke-opacity: 0.34; stroke-dasharray: 1 1; stroke-dashoffset: 0; transition: stroke-opacity var(--d-base) var(--ease); }
.ring[data-i="1"] { stroke-opacity: 0.26; }
.ring--faint { stroke-opacity: 0.1 !important; }
.ring.is-active { stroke-opacity: 0.85; }
.ring-tick { fill: none; stroke: rgba(146, 146, 157, 0.6); stroke-width: 1.3; transition: opacity var(--d-base) var(--ease); }
.ring-label.is-active .dgm__k { color: var(--vx-lavender); }

/* Vector (02 · Performance) */
.axis { stroke: rgba(146, 146, 157, 0.32); stroke-width: 1.3; }
.axis-progress { stroke: rgba(245, 245, 247, 0.7); stroke-width: 1.3; }
.axis-end, .bracket { fill: none; stroke: rgba(146, 146, 157, 0.45); stroke-width: 1.3; }
.stage-mark { fill: none; stroke: rgba(146, 146, 157, 0.7); stroke-width: 1.3; transition: stroke var(--d-quick) var(--ease); }
.stage-mark.is-reached { stroke: var(--vx-soft); }
.stage-mark.is-active { stroke: var(--vx-purple); stroke-width: 2.4; }
.chevrons polygon { fill: var(--vx-purple); }
.stage-label { transform: translate(-50%, -100%); font: 500 11px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; font-variant-ligatures: none; color: var(--vx-muted); }
.stage-label.is-reached { color: rgba(245, 245, 247, 0.82); }
.stage-label.is-active { color: var(--vx-white); }
.dgm__label--plain { transform: translateY(-50%); font: 500 11px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--vx-muted); font-variant-ligatures: none; }
.dgm__label--measure { transform: translateX(-50%); font: 500 11px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--vx-muted); font-variant-ligatures: none; }
@media (max-width: 1199px) { .stage-label { letter-spacing: 0.04em; } }

/* System (03) · "Visibility that performs": static in every mode. It follows the pinned stage as a normal section,
   with every part of the mark shown at once and the same weight (no scroll-driven state, no reveal). */
.scene--system { background: var(--vx-obsidian); }
/* its light and hatch start below a clean black top edge (the grain stays continuous): no seam with the section above */
.scene--system .scene__bg {
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 26%); mask-image: linear-gradient(180deg, transparent, #000 26%);
}
.system { max-width: var(--max); margin-inline: auto; display: flex; flex-direction: column; align-items: center; text-align: center; }
.system__head { max-width: 46rem; display: flex; flex-direction: column; align-items: center; }
.system__head .chapter__title { max-width: none; }
.system__head .chapter__body { max-width: 40rem; }
.system__visual { width: 100%; margin-top: clamp(32px, 6vh, 72px); text-align: left; }
.system__visual .dgm__box { width: min(100%, 900px); }
.leader { stroke: rgba(167, 139, 250, 0.55); stroke-width: 1.3; }
.part-label { max-width: 24%; white-space: normal; }
.part-label--left { text-align: right; }
.part-label .dgm__k { color: var(--vx-lavender); }
@media (min-width: 1000px) {
  /* one screen on desktop: the whole explanation is visible without scrolling inside it */
  .scene--system { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding-block: calc(var(--header-h) + 24px) 64px; scroll-margin-top: 0; }
  .scene--system .system { width: 100%; }
  /* when the viewport is short the diagram shrinks; its labels keep a readable width (one line for Signals) */
  .part-label { width: max-content; max-width: max(24%, 15rem); }
  /* the diagram takes the height left after the header, the heading and the padding */
  .system__visual .dgm__box { width: min(100%, 900px, calc((100vh - var(--header-h) - 340px) * 900 / 380)); }
}

@media (max-width: 999px) {
  .chapter--text-left, .chapter--text-right { grid-template-columns: 1fr; }
  .chapter--text-right .chapter__text { order: -1; }
  .chapter__visual { max-width: 640px; }
}

/* =========================================================
   Light sections
   ========================================================= */
.statement__title { margin-top: var(--s-5); max-width: 16ch; font-size: clamp(40px, 6.4vw, 92px); font-weight: 500; letter-spacing: var(--tr-display); line-height: 1; }
.statement__muted { color: var(--vx-purple); }
.statement__cols { margin-top: var(--s-8); margin-left: auto; max-width: 820px; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); color: var(--vx-muted-on-light); }
.statement__cols a { color: var(--vx-obsidian); }
@media (max-width: 759px) { .statement__cols { grid-template-columns: 1fr; gap: var(--s-5); } }

.approach { border-top: 1px solid var(--vx-hairline-on-light); overflow-x: clip; } /* the booking glow ends at the page edge: no sideways scroll */
.approach__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-8); }
.approach__sticky { position: sticky; top: calc(var(--header-h) + 64px); }
.approach__title { margin-top: var(--s-4); max-width: 12ch; font-size: var(--fs-h1); font-weight: 500; letter-spacing: var(--tr-h1); line-height: 1.05; }
.approach__track { margin-top: var(--s-8); width: 64px; height: 320px; }
.track__line { stroke: var(--vx-hairline-on-light); stroke-width: 1; }
.track__mark { fill: none; stroke: var(--vx-muted-on-light); stroke-width: 1; }
.track__chevrons { fill: var(--vx-purple); transform: translateY(304px); transition: transform var(--d-slow) var(--ease); }
.approach__steps { display: grid; }
.step { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: var(--s-5); padding: var(--s-6) 0 var(--s-8); border-top: 1px solid var(--vx-hairline-on-light); }
.step:last-child { padding-bottom: 0; }
.step__n { grid-row: span 2; font: 500 var(--fs-label)/28px var(--font-mono); letter-spacing: var(--tr-label); color: var(--vx-muted-on-light); font-variant-ligatures: none; transition: color var(--d-base) var(--ease); }
.step.is-current .step__n { color: var(--vx-purple); }
.step__title { font-size: var(--fs-h3); font-weight: 500; letter-spacing: var(--tr-h3); line-height: 1.25; }
.step p { margin-top: var(--s-3); max-width: 34rem; color: var(--vx-muted-on-light); }
@media (min-width: 1000px) {
  .step { min-height: 30vh; }
}
@media (max-width: 999px) {
  .approach__grid { grid-template-columns: 1fr; gap: var(--s-7); }
  .approach__sticky { position: static; }
  .approach__track { display: none; }
}
@media (max-width: 599px) {
  /* phones: the number sits above its step, so the text gets the full width */
  .step { grid-template-columns: 1fr; padding: var(--s-5) 0 var(--s-6); }
  .step__n { grid-row: auto; margin-bottom: var(--s-2); line-height: 18px; }
}

/* =========================================================
   Booking (end of How we work): "Start with a first conversation" + Cal.com inline calendar, light theme.
   Every Book a call lands here (#book), clear of the fixed header.
   ========================================================= */
.book { position: relative; isolation: isolate; margin-top: var(--s-9); padding-top: var(--s-8); border-top: 1px solid var(--vx-hairline-on-light); scroll-margin-top: calc(var(--header-h) + 8px); }
/* one light, from the bottom-right edge, behind the card */
.book::after {
  content: ""; position: absolute; z-index: -1; right: -8%; bottom: -12%; width: 64%; height: 78%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(124, 58, 237, 0.2), rgba(167, 139, 250, 0.1) 55%, rgba(167, 139, 250, 0));
}
.book__intro { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-4) var(--s-8); align-items: end; }
.book__title { max-width: 15ch; font-size: var(--fs-h2); font-weight: 500; letter-spacing: var(--tr-h2); line-height: 1.1; color: var(--vx-obsidian); }
.book__lead { max-width: 30rem; color: var(--vx-muted-on-light); font-size: var(--fs-subtitle); line-height: 1.42; }
.book__card {
  position: relative; margin-top: var(--s-7); padding: clamp(6px, 1vw, 14px);
  background: var(--vx-white); border: 1px solid var(--vx-hairline-on-light); border-radius: var(--r-modal);
  box-shadow: 0 1px 2px rgba(8, 8, 8, 0.04), 0 48px 96px -56px rgba(76, 29, 149, 0.42);
}
/* precision crosses at the corners of the card (brand grid) */
.book__cross { position: absolute; width: 13px; height: 13px; pointer-events: none; }
.book__cross::before, .book__cross::after { content: ""; position: absolute; background: var(--vx-purple); opacity: 0.7; }
.book__cross::before { left: 6px; top: 0; width: 1px; height: 13px; }
.book__cross::after { top: 6px; left: 0; width: 13px; height: 1px; }
.book__cross--tl { left: -7px; top: -7px; } .book__cross--tr { right: -7px; top: -7px; }
.book__cross--bl { left: -7px; bottom: -7px; } .book__cross--br { right: -7px; bottom: -7px; }
/* space is reserved before Cal.com answers, so nothing below jumps */
.book__cal { position: relative; min-height: 560px; border-radius: 10px; overflow: hidden; }
.book__cal iframe { display: block; width: 100%; border: 0; }
.book__card.is-ready .book__cal { min-height: 0; }
.book__card.is-failed .book__cal { display: none; }
.book__status {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; pointer-events: none;
  font: 500 var(--fs-label)/1 var(--font-mono); letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--vx-muted-on-light); font-variant-ligatures: none;
}
.book__caret { width: 2px; height: 1.3em; background: var(--vx-purple); animation: caret 1s steps(1) infinite; }
.book__fallback { padding: var(--s-7) var(--s-5); text-align: center; color: var(--vx-muted-on-light); }
.book__fallback a { color: var(--vx-purple); font-weight: 500; text-underline-offset: 5px; }
@media (max-width: 999px) {
  .book__intro { grid-template-columns: 1fr; }
}
@media (max-width: 599px) {
  .book { margin-top: var(--s-8); padding-top: var(--s-7); }
  .book__card { margin-top: var(--s-6); padding: 0; border-radius: var(--r-card); }
  .book__cal { min-height: 520px; border-radius: var(--r-card); }
  .book__cross { display: none; }
}

/* =========================================================
   FAQ (dark): one light from the left edge, floating questions (texture A), 45° cut lines, grain
   ========================================================= */
.faq { overflow: hidden; isolation: isolate; }
.faq__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.faq__light {
  position: absolute; inset: 0;
  background:
    radial-gradient(52% 62% at -6% 86%, rgba(124, 58, 237, 0.5), rgba(124, 58, 237, 0.2) 38%, rgba(76, 29, 149, 0.08) 62%, rgba(76, 29, 149, 0) 100%),
    linear-gradient(180deg, rgba(76, 29, 149, 0.1), rgba(76, 29, 149, 0) 28%);
}
.faq__cut { position: absolute; inset: 0; background-image: repeating-linear-gradient(135deg, rgba(167, 139, 250, 0.07) 0 1px, transparent 1px 54px); -webkit-mask-image: linear-gradient(90deg, #000, rgba(0, 0, 0, 0.35) 45%, transparent 75%); mask-image: linear-gradient(90deg, #000, rgba(0, 0, 0, 0.35) 45%, transparent 75%); }
.faq .tex-a { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; }
.faq__grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-7) var(--s-8); align-items: start; }
.faq__title { margin-top: var(--s-4); max-width: 11ch; font-size: var(--fs-h1); font-weight: 500; letter-spacing: var(--tr-h1); line-height: 1.05; color: var(--vx-white); }
.faq__list { position: relative; }
.faq__list::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, rgba(124, 58, 237, 0.6), var(--c-line) 45%); }
/* Dividers carry the brand: purple at the start, hairline after */
.faq__item { position: relative; transition: background-color var(--d-base) var(--ease); }
.faq__item::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, rgba(124, 58, 237, 0.6), var(--c-line) 45%); pointer-events: none; }
/* …and light up: a hint on hover, full width when open */
.faq__item::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, var(--vx-purple), var(--vx-lavender) 50%, rgba(167, 139, 250, 0));
  box-shadow: 0 0 14px rgba(124, 58, 237, 0.55);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform var(--d-slow) var(--ease);
}
.faq__item:hover::before { transform: scaleX(0.22); }
.faq__item[open]::before { transform: scaleX(1); }
.faq__item[open] { background: linear-gradient(90deg, rgba(124, 58, 237, 0.12), rgba(124, 58, 237, 0) 70%); }
.faq__item summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s-5);
  padding: var(--s-5) var(--s-4) var(--s-5) 0; cursor: pointer; border-radius: var(--r-tag);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__q { font-size: clamp(19px, 1.6vw, 22px); font-weight: 400; letter-spacing: -0.01em; line-height: 1.3; color: rgba(245, 245, 247, 0.86); transition: color var(--d-base) var(--ease), transform var(--d-base) var(--ease); }
.faq__item summary:hover .faq__q { color: var(--vx-white); transform: translateX(6px); }
.faq__item[open] .faq__q { color: var(--vx-white); transform: translateX(16px); }
/* Icon: a cross in a purple ring that turns into the X when open */
.faq__icon {
  position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(124, 58, 237, 0.55); color: var(--vx-lavender);
  transition: transform var(--d-base) var(--ease), background-color var(--d-base) var(--ease), border-color var(--d-base) var(--ease), box-shadow var(--d-base) var(--ease), color var(--d-base) var(--ease);
}
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; background: currentColor; }
.faq__icon::before { left: 15px; top: 9px; width: 1px; height: 13px; }
.faq__icon::after { top: 15px; left: 9px; width: 13px; height: 1px; }
.faq__item summary:hover .faq__icon { background: rgba(124, 58, 237, 0.16); border-color: var(--vx-lavender); box-shadow: 0 0 18px rgba(124, 58, 237, 0.35); }
.faq__item[open] .faq__icon { transform: rotate(45deg); background: var(--vx-purple); border-color: var(--vx-purple); color: var(--vx-white); box-shadow: 0 0 22px rgba(124, 58, 237, 0.45); }
.faq__a { max-width: 40rem; padding: 0 var(--s-8) var(--s-6) 16px; color: rgba(245, 245, 247, 0.74); }
.faq__a p + p { margin-top: var(--s-3); }
.faq__a strong { font-weight: 500; color: var(--vx-lavender); }
.faq__a .text-link { color: var(--vx-soft); text-decoration-color: rgba(124, 58, 237, 0.7); }
.faq .qhl { z-index: 0; }
@media (prefers-reduced-motion: no-preference) {
  html.motion-ready .faq__item { interpolate-size: allow-keywords; }
  html.motion-ready .faq__item::details-content { block-size: 0; overflow: hidden; transition: block-size var(--d-slow) var(--ease), content-visibility var(--d-slow) allow-discrete; }
  html.motion-ready .faq__item[open]::details-content { block-size: auto; }
  html.motion-ready .faq__item[open] .faq__a { animation: faq-in var(--d-slow) var(--ease); }
  html.motion-ready .faq.is-live .faq__light { animation: breathe-soft 10s var(--ease-io) infinite; }
}
@keyframes faq-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 999px) {
  .faq__grid { grid-template-columns: 1fr; }
  .faq__a { padding-right: 0; }
}
@media (max-width: 599px) {
  .faq__item[open] .faq__q { transform: none; }
  .faq__a { padding-left: 0; }
}

/* =========================================================
   Closing (light): one purple light from the bottom-right edge, engraved in purple ink,
   a precision grid of crosses, breathing slowly while on screen
   ========================================================= */
.closing { min-height: 92vh; display: grid; place-items: center; text-align: center; overflow: hidden; isolation: isolate; scroll-margin-top: 0; }
.closing__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.closing__glow {
  position: absolute; inset: -4%;
  background:
    radial-gradient(62% 70% at 100% 108%, rgba(124, 58, 237, 0.42), rgba(124, 58, 237, 0.2) 34%, rgba(167, 139, 250, 0.12) 56%, rgba(167, 139, 250, 0) 80%),
    linear-gradient(0deg, rgba(167, 139, 250, 0.22), rgba(167, 139, 250, 0) 46%);
}
.closing__grid {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M28 23.5v9M23.5 28h9' stroke='%237C3AED' stroke-opacity='.5' stroke-width='1'/%3E%3C/svg%3E");
  background-position: center top;
  -webkit-mask-image: radial-gradient(60% 70% at 0% 0%, #000, rgba(0, 0, 0, 0.4) 45%, transparent 75%);
  mask-image: radial-gradient(60% 70% at 0% 0%, #000, rgba(0, 0, 0, 0.4) 45%, transparent 75%);
}
.closing .tex-c { transform-origin: 100% 100%; }
.closing__cross { position: absolute; width: 13px; height: 13px; }
.closing__cross::before, .closing__cross::after { content: ""; position: absolute; background: var(--vx-purple); }
.closing__cross::before { left: 6px; top: 0; width: 1px; height: 13px; }
.closing__cross::after { top: 6px; left: 0; width: 13px; height: 1px; }
.closing__cross--tl { left: var(--margin); top: clamp(28px, 5vw, 56px); }
.closing__cross--tr { right: var(--margin); top: clamp(28px, 5vw, 56px); }
.closing__cross--bl { left: var(--margin); bottom: clamp(28px, 5vw, 56px); }
.closing__cross--br { right: var(--margin); bottom: clamp(28px, 5vw, 56px); }
/* Clean paper behind the message: texture and light never sit under the text */
.closing__inner { position: relative; max-width: 860px; padding: var(--s-7) var(--margin); display: flex; flex-direction: column; align-items: center; }
.closing__inner::before { content: ""; position: absolute; inset: -14% -18%; z-index: -1; background: radial-gradient(closest-side, rgba(245, 245, 247, 0.96), rgba(245, 245, 247, 0.82) 55%, rgba(245, 245, 247, 0)); pointer-events: none; }
.closing__title { margin-top: var(--s-5); font-size: clamp(40px, 5.2vw, 76px); font-weight: 500; letter-spacing: var(--tr-h1); line-height: 1.02; color: var(--vx-obsidian); }
.closing__accent { color: var(--vx-purple); }
.closing__lead { margin-top: var(--s-5); max-width: 32rem; color: var(--vx-muted-on-light); font-size: var(--fs-subtitle); line-height: 1.42; }
/* The focal point: the one purple button, lit from below */
.closing .btn { margin-top: var(--s-7); box-shadow: 0 18px 44px -12px rgba(124, 58, 237, 0.65), 0 0 0 1px rgba(124, 58, 237, 0.2); }
.closing .btn:hover { box-shadow: 0 22px 54px -12px rgba(124, 58, 237, 0.8), 0 0 0 1px rgba(124, 58, 237, 0.35); }
.closing .micro { margin-top: var(--s-4); }
.closing__alt { margin-top: var(--s-6); font-size: var(--fs-small); color: var(--vx-muted-on-light); }
.closing__alt a { color: var(--vx-purple); font-weight: 500; text-underline-offset: 5px; text-decoration-color: rgba(124, 58, 237, 0.35); }
.closing__alt a:hover { text-decoration-color: currentColor; }
@media (prefers-reduced-motion: no-preference) {
  html.motion-ready .closing.is-live .tex-c { animation: engrave-breathe 7s var(--ease-io) infinite alternate; }
  html.motion-ready .closing.is-live .closing__glow { animation: glow-drift 11s var(--ease-io) infinite alternate; }
}
@keyframes engrave-breathe { from { transform: scale(1); opacity: 0.82; } to { transform: scale(1.035); opacity: 1; } }
@keyframes glow-drift { from { transform: translate3d(0, 0, 0); opacity: 0.88; } to { transform: translate3d(-2.5%, -2%, 0); opacity: 1; } }
@keyframes breathe-soft { 0%, 100% { opacity: 1; } 50% { opacity: 0.8; } }

/* =========================================================
   Pinned stage (html.stage-on)
   ========================================================= */
html.stage-on .stage { height: var(--stage-h, 1200vh); }
html.stage-on .stage__viewport { position: sticky; top: 0; height: 100vh; overflow: hidden; isolation: isolate; }
html.stage-on .stage__bg { display: block; position: absolute; inset: 0; z-index: 0; pointer-events: none; }
html.stage-on .stage__light {
  position: absolute; left: 0; top: 0; width: 1000px; height: 1000px;
  transform-origin: 50% 50%; will-change: transform, opacity; opacity: 0;
}
html.stage-on .stage__light::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(124, 58, 237, 0.55), rgba(124, 58, 237, 0.34) 22%, rgba(76, 29, 149, 0.2) 50%, rgba(76, 29, 149, 0.07) 75%, rgba(76, 29, 149, 0));
}
/* After the opening the light keeps breathing (slow, compositor-only), paused once the stage is left behind */
@media (prefers-reduced-motion: no-preference) {
  html.stage-on.ambient .stage__light::before { animation: breathe 9s var(--ease-io) infinite; }
}
@keyframes breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.84; transform: scale(1.05); } }
.stage__fade { display: none; }
html.stage-on .stage__fade {
  display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; z-index: 2; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, rgba(8, 8, 8, 0), rgba(8, 8, 8, 0.86) 62%, var(--vx-obsidian));
}
html.stage-on .guide {
  display: block; position: absolute; left: 0; top: 0; z-index: 3;
  width: 480px; height: 386px; max-width: none; fill: var(--vx-white);
  transform-origin: 0 0; pointer-events: none;
}
html.stage-on .stage .slot { visibility: hidden; }
html.stage-on .stage .scene__light { display: none; }

html.stage-on .stage .scene {
  position: absolute; inset: 0; z-index: 2; min-height: 0; height: 100%;
  opacity: 0; visibility: hidden;
  transition: opacity var(--d-base) var(--ease), visibility 0s linear var(--d-base);
}
html.stage-on .stage .scene.is-active { opacity: 1; visibility: visible; transition: opacity var(--d-slow) var(--ease) 340ms, visibility 0s linear 0s; }
html.stage-on .stage .scene__content { transition: transform var(--d-slow) var(--ease) 340ms; }
html.stage-on .stage .scene:not(.is-active) .scene__content { transform: translateY(14px); transition: transform var(--d-base) var(--ease); }
html.stage-on .stage .scene.is-replay .scene__content { animation: replay 500ms var(--ease) both; }
html.stage-on .stage .scene.is-replay { transition: none; }
@keyframes replay { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

html.stage-on .scene--hero { padding: var(--header-h) var(--margin) 88px; align-items: center; }
html.stage-on .scene--hero .scene__content { transition: none; transform: none; }
html.stage-on .scroll-hint { display: none; }
html.stage-on .stage-cue {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  position: absolute; left: 50%; bottom: 22px; z-index: 4; transform: translateX(-50%); pointer-events: none;
  font: 500 11px/1 var(--font-mono); letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--vx-muted); font-variant-ligatures: none;
  opacity: 0; transition: opacity var(--d-base) var(--ease);
}
html.stage-on .stage-cue.is-on { opacity: 1; transition-duration: var(--d-slow); }
.stage-cue__label { white-space: nowrap; transition: opacity var(--d-quick) var(--ease); }
.stage-cue.is-swap .stage-cue__label { opacity: 0; }

html.stage-on .scene--overview { display: flex; align-items: center; justify-content: center; padding: calc(var(--header-h) + 16px) var(--margin) 64px; }
html.stage-on .overview { width: 100%; }

html.stage-on .stage .scene--chapter { display: flex; align-items: center; padding: calc(var(--header-h) + 16px) var(--margin) 64px; }
html.stage-on .stage .chapter { width: 100%; }
html.stage-on .stage .scene--chapter .dgm__box { width: min(100%, calc((100vh - var(--header-h) - 120px) * var(--arw) / var(--arh))); }

/* Diagram states driven by the timeline */
html.stage-on .ring-label { opacity: 0; }
html.stage-on .ring-label.is-on { opacity: 1; }
html.stage-on .ring-tick { opacity: 0; }
html.stage-on .ring-tick.is-on { opacity: 1; }
html.stage-on .scene--visibility .qhl.is-placed { opacity: 0; transition: opacity var(--d-slow) var(--ease); }
html.stage-on .scene--visibility.is-active .qhl.is-placed { opacity: 1; transition-delay: 900ms; }

/* Stacked scenes (flow and static, < 1000 px or reduced motion): each scene's light fades out before its edges,
   so one scene meets the next on black instead of a cut line. */
html:not(.stage-on) .stage .scene__bg {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 74%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 74%, transparent 100%);
}
html:not(.stage-on) .stage .scene--hero .scene__bg {
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 78%, transparent 100%);
}

/* =========================================================
   Flow mode (< 1000 px, motion allowed): the stacked scenes keep the stage's light and motion, adapted to touch screens.
   Compositor-only (opacity/transform), one diagram play per visit, nothing runs off screen. Static mode gets none of it.
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  /* the content block stays put; label, title, text and link rise one after another (--rd set in JS) */
  html.motion-ready:not(.stage-on) .stage .scene__content.reveal:not(.is-in) { opacity: 1; transform: none; }
  html.motion-ready:not(.stage-on) .stage .rv { transition: opacity 700ms var(--ease) var(--rd, 0ms), transform 900ms var(--ease) var(--rd, 0ms); }
  html.motion-ready:not(.stage-on) .stage .reveal:not(.is-in) .rv { opacity: 0; transform: translateY(18px); }
  /* ambient light: rises as each scene arrives, then breathes slowly while it is on screen */
  html.motion-ready:not(.stage-on) .stage .scene:not(.scene--hero) .scene__light { transition: opacity 1400ms var(--ease), transform 1800ms var(--ease); }
  html.motion-ready:not(.stage-on) .stage .scene:not(.scene--hero):not(.is-seen) .scene__light { opacity: 0.3; transform: scale(0.9); }
  html.motion-ready:not(.stage-on) .stage .scene.is-live:not(.scene--hero) .scene__light { animation: light-breathe 9s var(--ease-io) 1.6s infinite; }
  html.motion-ready:not(.stage-on) .stage .scene__light--b { transform-origin: 50% 100%; }
  html.motion-ready:not(.stage-on) .stage .scene__light--r { transform-origin: 100% 100%; }
  html.motion-ready:not(.stage-on) .stage .scene__light--bl { transform-origin: 0 100%; }
  /* engraved light (C) breathes, as in the brand motion spec */
  html.motion-ready:not(.stage-on) .stage .scene--performance .tex-c { transform-origin: 0 100%; }
  html.motion-ready:not(.stage-on) .stage .scene--performance.is-live .tex-c { animation: engrave-breathe 7s var(--ease-io) infinite alternate; }
  /* diagrams wait at their first frame and play once in view: rings expand, the vector advances */
  .dgm.is-armed .ring-label:not(.is-on), .dgm.is-armed .ring-tick:not(.is-on) { opacity: 0; }
  .dgm.is-armed .dgm__legend li { opacity: 0; transform: translateY(10px); transition: opacity var(--d-slow) var(--ease), transform var(--d-slow) var(--ease); }
  .dgm.is-played .dgm__legend li { opacity: 1; transform: none; }
  .dgm--rings.is-played .dgm__legend li:nth-child(1) { transition-delay: 420ms; }
  .dgm--rings.is-played .dgm__legend li:nth-child(2) { transition-delay: 660ms; }
  .dgm--vector.is-played .dgm__legend li:nth-child(1) { transition-delay: 300ms; }
  .dgm--vector.is-played .dgm__legend li:nth-child(2) { transition-delay: 520ms; }
  .dgm--vector.is-played .dgm__legend li:nth-child(3) { transition-delay: 740ms; }
  .dgm--vector.is-played .dgm__legend li:nth-child(4) { transition-delay: 980ms; }
}
@keyframes light-breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.8; transform: scale(1.05); } }

/* Measurement + jump helpers */
html.measuring .scene__content { transform: none !important; transition: none !important; }
html.jumping .stage, html.jumping .stage * { transition: none !important; }
html.mode-switch .stage .scene, html.mode-switch .stage .scene__content { transition: none !important; }
