/* The tilted word bands must never widen the page. */
#main { overflow-x: clip; }

/* Opening 3D window */
.hero { padding-top: 14px; }
.stage {
  --glow: #c6a5fd;
  position: relative;
  isolation: isolate;
  width: min(100% - 28px, 1760px);
  height: clamp(560px, calc(100vh - 175px), 900px);
  height: clamp(560px, calc(100svh - 175px), 900px);
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid #5d4a78;
  border-radius: 28px;
  background:
    radial-gradient(ellipse 65% 45% at 50% 66%, color-mix(in srgb, var(--glow) 34%, transparent), transparent 70%),
    radial-gradient(ellipse at 12% 0, #6a35b8aa, transparent 48%),
    radial-gradient(ellipse at 92% 8%, #c2368a88, transparent 46%),
    radial-gradient(ellipse at 50% 108%, #4b3bd6aa, transparent 55%),
    #120a1d;
  transition: background .6s;
}
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; opacity: 0; user-select: none; }
.stage-canvas:active { cursor: grabbing; }
.stage-still { position: absolute; left: 50%; bottom: 5%; width: min(58%, 620px); height: auto; translate: -50% 0; border: 1px solid #7b62a0; border-radius: 16px; box-shadow: 0 30px 90px -20px #b77bff88; }
.stage[data-mode="live"] .stage-canvas { opacity: 1; }
.stage[data-mode="live"] .stage-still { visibility: hidden; }
.stage-top { position: relative; z-index: 1; padding: clamp(16px, 3vw, 36px) 20px 0; text-align: center; pointer-events: none; }
.stage-flag { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 9px; font-size: 14px; font-weight: 650; }
.mega { margin: 10px 0 0; font-size: clamp(3.4rem, 10.4vw, 10.5rem); font-weight: 750; line-height: .9; letter-spacing: -.065em; text-shadow: 0 6px 40px #120a1dcc; }
.mega span, .mega em { display: inline-block; white-space: nowrap; }
.mega em { color: transparent; background: linear-gradient(100deg, #8f8bff, #d79bff 45%, #ff7ac6); -webkit-background-clip: text; background-clip: text; padding-right: .08em; text-shadow: none; }
.mega i { display: inline-block; font-style: inherit; }
/* A clipped gradient does not reach moved letters, so each letter carries its own. */
.mega.is-split em { background: none; }
.mega.is-split em i { color: transparent; background: linear-gradient(180deg, #a9a2ff, #e19cff 55%, #ff7ac6); -webkit-background-clip: text; background-clip: text; padding: 0 .04em .16em; margin: 0 -.04em -.16em; }
.stage-count { position: absolute; left: 24px; bottom: 14px; z-index: 1; font: 300 clamp(40px, 7vw, 90px)/1 var(--sans); font-variant-numeric: tabular-nums; }
.stage-count[hidden], .stage-hud[hidden] { display: none; }
.stage-hud { position: absolute; z-index: 2; left: 50%; bottom: 18px; translate: -50% 0; display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 20px); }
.stage-hud button { min-width: 3rem; min-height: 3rem; padding: .45rem .9rem; color: var(--ink); background: #1d1329d9; border: 1px solid #77609b; border-radius: 999px; font: 700 15px var(--sans); cursor: pointer; backdrop-filter: blur(8px); }
.stage-hud button:hover { border-color: var(--glow); }
.stage-hud button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.stage-hud .stage-open { display: grid; justify-items: center; min-width: min(46vw, 19rem); padding: .55rem 1.4rem; border: 2px solid var(--glow); box-shadow: 0 0 36px -8px var(--glow); }
.stage-open strong { font-size: clamp(18px, 2.2vw, 26px); letter-spacing: -.03em; }
.stage-open span { color: var(--muted); font-size: 13px; font-weight: 500; }
.stage-hud .stage-pause { position: absolute; right: calc(100% + 8px); font-size: 13px; }
.hero-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px 32px; padding-block: 26px; }
.hero-foot p { max-width: 38rem; color: var(--muted); font-size: clamp(17px, 1.6vw, 21px); line-height: 1.5; }
.hero-foot .contact-button { margin: 0; border-radius: 999px; padding: .85rem 1.5rem; font-size: 16px; }

/* Word bands that slide as you scroll */
.bands { margin-bottom: clamp(30px, 6vw, 80px); padding-block: 12px; overflow: hidden; rotate: -1.6deg; scale: 1.03; }
.band { display: flex; align-items: center; gap: .35em; width: max-content; font-size: clamp(44px, 8vw, 112px); font-weight: 750; line-height: 1.12; letter-spacing: -.05em; white-space: nowrap; will-change: transform; }
.band b { color: #ff7ac6; font-size: .42em; }
.bands > div + div .band { color: transparent; -webkit-text-stroke: 1.5px #b99be8; }
.bands > div + div .band b { -webkit-text-stroke: 0; color: #8f8bff; }

/* Statement that lights up word by word */
.statement { max-width: 1100px; margin-bottom: clamp(60px, 9vw, 130px); font-size: clamp(30px, 4.8vw, 68px); font-weight: 600; line-height: 1.16; letter-spacing: -.04em; }
.statement.is-ready span { color: #5b4f6b; transition: color .3s; }
.statement.is-ready span.is-lit { color: var(--ink); }

.cursor-bubble { position: fixed; left: 0; top: 0; z-index: 30; padding: 9px 16px; margin: 18px 0 0 18px; color: #1b1424; background: var(--accent); border-radius: 999px; font: 800 13px var(--sans); white-space: nowrap; pointer-events: none; opacity: 0; scale: .5; }
.cursor-bubble.is-on { opacity: 1; scale: 1; }

@media (prefers-reduced-motion: no-preference) {
  .mega i { animation: letter-in .9s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--n, 0) * 55ms + .15s); translate: 0 calc(var(--near, 0) * -.16em); rotate: calc(var(--near, 0) * -7deg); scale: calc(1 + var(--near, 0) * .12); transition: translate .25s cubic-bezier(.2,.75,.25,1.6), rotate .25s, scale .25s; }
  @keyframes letter-in { from { opacity: 0; transform: translateY(.7em) rotate(14deg); } }
  .cursor-bubble { transition: opacity .18s, scale .22s cubic-bezier(.2,.75,.25,1.5); }
  .contact-button, .hub-back { transition: translate .2s ease-out, background .2s; }
}
@media (prefers-reduced-motion: reduce) {
  .bands { rotate: none; scale: 1; }
  .band { flex-wrap: wrap; justify-content: center; width: auto; white-space: normal; font-size: clamp(26px, 4vw, 48px); }
  /* Standing still, one copy of each word is enough. */
  .band > :nth-child(n+11) { display: none; }
}
@media (max-width: 760px) {
  .stage { width: calc(100% - 16px); height: clamp(430px, calc(100svh - 140px), 760px); border-radius: 20px; }
  .mega { font-size: clamp(3.2rem, 19vw, 6.4rem); }
  .mega span, .mega em { display: block; }
  .stage-hud { bottom: 64px; }
  .stage-hud .stage-open { min-width: 0; width: min(56vw, 18rem); padding-inline: .6rem; }
  .stage-hud .stage-pause { right: auto; left: 50%; top: calc(100% + 6px); translate: -50% 0; min-height: 2.75rem; }
  .stage-still { width: 86%; bottom: 12%; }
}
/* Short, wide screens: a landscape phone */
@media (max-height: 520px) and (min-width: 600px) {
  .stage { height: max(340px, calc(100svh - 16px)); }
  .stage-top { padding-top: 12px; }
  .mega { margin-top: 4px; font-size: 3.2rem; }
  .mega span, .mega em { display: inline-block; }
  .stage-hud { bottom: 10px; }
  .stage-hud .stage-pause { left: auto; right: calc(100% + 8px); top: auto; translate: none; }
  .stage-still { width: 44%; bottom: 8%; }
}
