@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("assets/fonts/plus-jakarta-sans-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: Poppins;
  src: url("assets/fonts/poppins-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Poppins;
  src: url("assets/fonts/poppins-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #05001d;
  --surface: #100b27;
  --text: #fafafa;
  --text-muted: #c1bdcd;
  --primary: #bb00ff;
  --primary-hover: #a600e3;
  --violet: #5521c3;
  --amber: #f7771b;
  --border: rgb(255 255 255 / 12%);
  --button-radius: 8px;
  --container: 1200px;
  --font-display: "Plus Jakarta Sans", Poppins, system-ui, sans-serif;
  --font-body: Poppins, system-ui, sans-serif;
  --gutter: clamp(1.5rem, 6vw, 6rem);
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
}

.intro,
.scene {
  box-sizing: border-box;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.intro {
  padding-block: clamp(4rem, 12vw, 9rem);
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.02;
  text-wrap: balance;
}

.intro h1 {
  max-inline-size: 18ch;
  margin-bottom: 1.5rem;
  font-size: clamp(2.5rem, 7vw, 4.6rem);
}

.intro p {
  margin-block: 0.5rem;
  max-inline-size: 52ch;
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin-top: 2rem;
}

.cta {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 136px;
  padding: 14px 24px;
  border: 1px solid var(--primary);
  border-radius: var(--button-radius);
  background: var(--primary);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 160ms ease-out, border-color 160ms ease-out;
}

.cta:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.cta.secondary {
  background: var(--surface);
  border-color: transparent;
}

.cta.secondary:hover {
  background: #211736;
}

.cta:focus-visible {
  border-color: var(--text);
  outline: none;
}

.story-stage {
  overflow: clip;
  position: relative;
  isolation: isolate;
  background: #05001d;
}

.story-page {
  scrollbar-width: none;
}

.story-page::-webkit-scrollbar {
  display: none;
}

.story-panorama,
.story-film,
.story-shots,
.story-cutaway,
.story-shade,
.story-light,
.story-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.story-panorama {
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 25% 59%;
}

.story-shots {
  z-index: -3;
}

.story-cutaway {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 54%;
  opacity: 0;
  transform-origin: 50% 60%;
}

.story-film {
  z-index: -3;
  display: none;
  width: 100%;
  height: 100%;
  background: #05001d;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.is-animated:not(.is-finale-preview) .story-film {
  display: block;
}

.is-animated:not(.is-finale-preview) .story-panorama,
.story-shots {
  visibility: hidden;
}

.story-shade {
  z-index: -1;
  background:
    linear-gradient(90deg, rgb(5 0 29 / 25%), transparent 68%),
    linear-gradient(180deg, rgb(5 0 29 / 16%), transparent 32%, rgb(5 0 29 / 18%));
}

.story-light,
.story-glow {
  z-index: -2;
}

.story-light {
  background: radial-gradient(ellipse at 80% 66%, color-mix(in srgb, var(--violet) 24%, transparent), transparent 62%);
}

.story-glow {
  background: radial-gradient(ellipse at 25% 78%, color-mix(in srgb, var(--amber) 15%, transparent), transparent 54%);
}

.scene {
  display: grid;
  align-content: center;
  min-height: 72svh;
  padding-block: 5rem;
}

.scene[data-paused] {
  display: none;
}

.scene h1,
.scene h2 {
  max-inline-size: 18ch;
  font-size: clamp(2.45rem, 7.7vw, 7.5rem);
}

.portrait-break {
  display: none;
}

.is-animated .story-stage {
  height: 100svh;
  overflow: clip;
  contain: paint;
}

.story:not(.is-animated) .story-panorama,
.story:not(.is-animated) .story-shade,
.story:not(.is-animated) .story-light,
.story:not(.is-animated) .story-glow {
  position: fixed;
}

.story-skip {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  min-width: 4rem;
  height: 44px;
  padding-inline: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgb(5 0 29 / 78%);
  color: var(--text);
  font: 600 0.875rem var(--font-body);
  transform: translateX(-50%);
  cursor: pointer;
}

.story-skip-frame {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.scene-closing h2:focus {
  outline: none;
}

.story-skip:focus-visible {
  border-color: var(--text);
  outline: none;
}

.scene-word {
  display: inline-block;
}

.is-animated .scene {
  position: absolute;
  inset: 0;
  min-height: 0;
  padding-block: max(1.25rem, env(safe-area-inset-top), env(safe-area-inset-bottom));
  pointer-events: none;
}

.is-animated .scene-opening {
  padding-inline: var(--gutter);
  justify-items: center;
}

.is-animated .scene-opening .scene-content {
  max-width: min(90vw, 64rem);
  text-align: left;
}

.is-animated .scene-opening h1 {
  max-inline-size: none;
  font-size: clamp(3.7rem, 6vw, 6.2rem);
  line-height: 1.08;
}

.is-animated .scene-opening .portrait-break {
  display: block;
}

.middleman-logos {
  display: none;
}

.is-animated .middleman-logos {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(0.7rem, 2vw, 2rem);
  margin-top: clamp(1.8rem, 3svh, 2.6rem);
}

.is-animated .middleman-logos[data-paused] {
  display: none;
}

.middleman-logo {
  width: clamp(3rem, 4vw, 4.5rem);
  height: clamp(3rem, 4vw, 4.5rem);
  flex: none;
  overflow: visible;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.middleman-logo .logo-body {
  fill: #d78bff;
  stroke: none;
  filter: drop-shadow(0 0 5px #b950ff) drop-shadow(0 0 12px #8620e8);
}

.middleman-logo .logo-accent-fill,
.middleman-logo .logo-mark {
  fill: #ffc279;
  stroke: none;
  filter: drop-shadow(0 0 5px #ff9c50) drop-shadow(0 0 10px #bf5d30);
}

.middleman-logo .logo-accent,
.middleman-logo .logo-strike {
  fill: none;
  stroke: #ffc279;
  stroke-width: 3;
  filter: drop-shadow(0 0 5px #ff9c50) drop-shadow(0 0 10px #bf5d30);
}

.middleman-logo .logo-strike {
  stroke-width: 4;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.middleman-notices {
  display: none;
}

.is-animated .middleman-notices {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  justify-items: center;
  row-gap: clamp(2.25rem, 5svh, 4rem);
  overflow: hidden;
  pointer-events: none;
}

.middleman-skyline {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  background: #05001d;
  opacity: 0;
}

.middleman-skyline picture,
.middleman-skyline img {
  display: block;
  width: 100%;
  height: 100%;
}

.middleman-skyline img {
  object-fit: fill;
}

.middleman-skyline::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, rgb(5 0 29 / 36%), rgb(5 0 29 / 75%) 52%, rgb(5 0 29 / 50%));
  content: "";
}

.middleman-face,
.middleman-notices span {
  position: relative;
  z-index: 3;
}

.middleman-face {
  --face-color: #d58bff;
  grid-area: 1 / 1;
  width: clamp(4.5rem, 7vw, 6.5rem);
  overflow: visible;
  fill: none;
  stroke: var(--face-color);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px var(--face-color)) drop-shadow(0 0 16px var(--face-color));
  opacity: 0;
}

.middleman-face stop {
  stop-color: var(--face-color);
}

.middleman-face .face-disc {
  fill: url(#face-glass);
  stroke: none;
}

.middleman-face .face-orbit {
  stroke-width: 0.9;
  stroke-opacity: 0.28;
}

.middleman-face .face-ring {
  stroke-width: 2.6;
}

.middleman-face .face-glint {
  stroke-width: 1.3;
  stroke-opacity: 0.7;
}

.middleman-face .face-art,
.middleman-face .face-state {
  transform-origin: 50% 50%;
}

.middleman-face .face-state {
  opacity: 0;
}

.middleman-notices span {
  grid-area: 2 / 1;
  color: #e6aaff;
  font: 700 clamp(2rem, 4.8vw, 4.8rem) var(--font-body);
  letter-spacing: 0.07em;
  white-space: nowrap;
  text-shadow: 0 0 7px #c260ff, 0 0 17px #952fff;
  opacity: 0;
}

.middleman-notices span:nth-child(even) { color: #ffc279; text-shadow: 0 0 8px #ea8a42; }

@media (orientation: portrait) {
  .is-animated .scene-opening {
    align-content: center;
    padding-inline-start: var(--gutter);
    justify-items: stretch;
  }

  .is-animated .scene-opening .scene-content {
    max-width: none;
    text-align: left;
    transform: none;
  }

  .is-animated .scene-opening h1 {
    font-size: min(var(--portrait-title-size), 15svh, 6.4rem);
    line-height: 1.03;
  }

  .middleman-notices span {
    font-size: clamp(1.45rem, 6vw, 2.2rem);
  }

  .middleman-face {
    width: clamp(5.5rem, 23vw, 7rem);
  }

  .middleman-logo {
    width: clamp(4.5rem, 18vw, 6rem);
    height: clamp(4.5rem, 18vw, 6rem);
  }
}

.is-animated .scene-closing:not([inert]) .actions {
  pointer-events: auto;
}

@media (max-height: 500px) {
  .is-animated .scene h1,
  .is-animated .scene h2 {
    font-size: clamp(1.65rem, 7svh, 3.5rem);
  }

  .is-animated .actions {
    margin-top: 1rem;
  }
}

@media (max-width: 600px) and (orientation: portrait) {
  .story-produce-shot {
    object-position: right center;
    transform-origin: right center;
  }

  .scene {
    container-type: inline-size;
    padding-inline: max(1.25rem, env(safe-area-inset-left))
      max(1.25rem, env(safe-area-inset-right));
  }

  .portrait-break {
    display: initial;
  }

  .scene h1,
  .scene h2 {
    max-inline-size: none;
    font-size: min(var(--portrait-title-size), 15svh, 6.4rem);
    line-height: 1.03;
    text-wrap: wrap;
  }

  .scene-opening {
    --portrait-title-size: 15.65cqw;
  }

  .scene-shops {
    --portrait-title-size: 15.4cqw;
  }

  .scene-payments {
    --portrait-title-size: 13.7cqw;
  }

  .scene-conversations {
    --portrait-title-size: 11.8cqw;
  }

  .scene-payments .scene-content {
    text-align: left;
  }

  .scene-shops .scene-content,
  .scene-conversations .scene-content {
    text-align: right;
  }

  .scene-shops .scene-mark-frame,
  .scene-conversations .scene-mark-frame {
    margin-inline-start: auto;
  }

  .scene-closing {
    --portrait-title-size: 14.9cqw;
  }

  .scene-closing .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
    width: 100%;
    margin-top: 1.25rem;
  }

  .scene-closing .cta {
    min-width: 0;
    padding-inline: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta {
    transition: none;
  }
}

.story-effects {
  position: absolute;
  z-index: -2;
  inset: 0;
  pointer-events: none;
}

.story-effect {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.effect-gate {
  background: radial-gradient(ellipse at 10% 55%, rgb(155 40 255 / 35%), transparent 50%);
}

.effect-shops {
  background: radial-gradient(ellipse at 68% 75%, rgb(255 138 35 / 24%), transparent 56%);
}

.effect-payment {
  background: radial-gradient(ellipse at 49% 68%, rgb(255 195 99 / 43%), transparent 23%);
}

.effect-private {
  background: radial-gradient(ellipse at 74% 54%, rgb(123 63 255 / 27%), transparent 48%);
}

.effect-bazaar {
  background: radial-gradient(ellipse at 85% 55%, rgb(197 59 255 / 25%), transparent 54%);
}

.scene-mark-frame {
  display: grid;
  width: fit-content;
  transform-origin: center;
  transform-style: preserve-3d;
}

.scene-mark-face {
  grid-area: 1 / 1;
  backface-visibility: hidden;
  transform: translateZ(0.5px);
}

.scene-mark-frame.is-single-face {
  transform-style: flat;
}

.scene-mark-frame.is-single-face .scene-mark-face {
  backface-visibility: visible;
  transform: none;
}

.scene-mark-reverse {
  transform: rotateY(180deg) translateZ(0.5px);
}

.scene-mark {
  --mark-glow: 0.38;
  display: none;
  width: clamp(2.65rem, 5vw, 4.75rem);
  height: auto;
  margin-bottom: 0.75rem;
  color: color-mix(in srgb, #e1acff, white calc(var(--mark-glow) * 25%));
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter:
    drop-shadow(0 0 2px rgb(239 199 255 / 88%))
    drop-shadow(0 0 5px rgb(187 0 255 / 88%))
    drop-shadow(0 0 10px rgb(116 32 224 / 64%));
  opacity: 0;
}

.is-animated .scene-mark {
  display: block;
}

.scene-mark [pathLength] {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.scene-mark .mark-accent {
  stroke: #ffc279;
  filter: drop-shadow(0 0 3px rgb(255 147 56 / 85%));
}

.scene-mark .mark-plasma {
  stroke: #fff1ff;
  stroke-width: 2.5;
  stroke-dasharray: 0.18 0.82;
  opacity: 0;
}

.scene-mark .mark-plasma.mark-accent {
  stroke: #fff2c4;
}

.story-trails {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.story-trails path {
  fill: none;
  opacity: 0;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  stroke-width: 1.5;
}

.trail-far {
  stroke: #d184ff;
}

.trail-near {
  stroke: #ffc279;
  filter: drop-shadow(0 0 7px #ca3cff);
}

.story-street-shot {
  object-position: 54% 56%;
}

.story-air {
  position: absolute;
  z-index: -2;
  inset: 0;
  pointer-events: none;
  overflow: clip;
  display: none;
}

.is-animated .story-air {
  display: block;
}

.air-haze,
.air-near {
  position: absolute;
  inset: 0 -18%;
}

.air-haze {
  background:
    radial-gradient(ellipse 31% 12% at 43% 84%, rgb(172 103 255 / 18%), transparent),
    radial-gradient(ellipse 23% 17% at 75% 72%, rgb(255 166 79 / 12%), transparent);
}

.air-near::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 5% 10% at 18% 81%, rgb(255 150 61 / 17%), transparent),
    radial-gradient(ellipse 6% 13% at 84% 71%, rgb(175 77 255 / 15%), transparent);
}

.air-near i {
  position: absolute;
  width: var(--size, 4px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffc388;
  box-shadow: 0 0 8px #e28044;
  opacity: 0;
}

.air-near i:nth-child(1) { top: 73%; left: 23%; }
.air-near i:nth-child(2) { top: 63%; left: 35%; --size: 3px; }
.air-near i:nth-child(3) { top: 81%; left: 48%; --size: 7px; filter: blur(2px); }
.air-near i:nth-child(4) { top: 27%; left: 56%; --size: 3px; }
.air-near i:nth-child(5) { top: 67%; left: 64%; background: #e1acff; box-shadow: 0 0 9px #bd4cff; }
.air-near i:nth-child(6) { top: 83%; left: 76%; --size: 5px; filter: blur(1px); }
.air-near i:nth-child(7) { top: 46%; left: 85%; --size: 3px; }

@media (max-width: 600px) and (orientation: portrait) {
  .scene-mark {
    width: clamp(4.65rem, 21vw, 6.4rem);
    filter:
      drop-shadow(0 0 2px rgb(239 199 255 / 88%))
      drop-shadow(0 0 7px rgb(187 0 255 / 92%));
  }
}

.story-title-underlay {
  position: absolute;
  z-index: -1;
  inset: 12% 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 62% 48% at max(30%, calc(50% - 210px)) 50%,
    rgb(5 0 29 / 65%) 0%,
    rgb(5 0 29 / 34%) 42%,
    transparent 100%
  );
}

.story-stage:has(.scene-opening:not([inert])) .story-title-underlay {
  opacity: 0.35;
}

.story-foreground {
  position: absolute;
  z-index: -2;
  inset: 0;
  pointer-events: none;
  overflow: clip;
}

.story-foreground img {
  position: absolute;
  bottom: 0;
  height: 100%;
  width: clamp(5rem, 22vw, 22rem);
  object-fit: cover;
  opacity: 0;
  visibility: hidden;
}

.foreground-stall {
  left: 0;
  mask-image: linear-gradient(90deg, #000 10%, rgb(0 0 0 / 80%) 40%, transparent 100%);
}

.foreground-lantern {
  right: 0;
  mask-image: linear-gradient(270deg, #000 10%, rgb(0 0 0 / 84%) 36%, transparent 100%);
}

@media (max-width: 600px) and (orientation: portrait) {
  .story-title-underlay {
    inset: 18% -8%;
    background: radial-gradient(ellipse at 38% 50%, rgb(5 0 29 / 72%), rgb(5 0 29 / 30%) 52%, transparent 79%);
  }

  .story-foreground img {
    width: 28vw;
  }
}

.story-prelude {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.25rem var(--gutter) 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6.2vw, 6rem);
  font-weight: 600;
  line-height: 1.02;
  text-align: center;
}

@media (max-width: 600px) and (orientation: portrait) {
  .story-prelude {
    font-size: min(22vw, 15svh, 6.4rem);
  }
}

.is-animated .story-prelude {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  padding-block: 0;
  visibility: hidden;
  pointer-events: none;
}

.story-navigation-veil {
  position: fixed;
  z-index: 20;
  inset: 0;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.closing-sentence {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .intro-starting .story-stage {
    height: 100svh;
    overflow: hidden;
    visibility: hidden;
  }
}

/* Finale comparisons use the same closing scene and viewport layout. */
.story-finale-option {
  position: absolute;
  z-index: -3;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.is-finale-preview .story-panorama,
.is-finale-preview .story-prelude,
.is-finale-preview .scene:not(.scene-closing) {
  display: none;
}

.is-finale-preview .scene-closing .scene-mark {
  --mark-glow: 0.46;
  opacity: 1;
}

.is-finale-preview .scene-mark [pathLength] {
  stroke-dashoffset: 0;
}

.story-finale-shot {
  object-position: center;
  transform-origin: center;
}

.closing-phrase {
  display: inline-block;
}

.has-typing-indicator {
  position: relative;
}

.typing-indicator {
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: 0.17em;
  display: inline-flex;
  gap: 0.085em;
}

.typing-indicator > span {
  width: 0.085em;
  height: 0.085em;
  border-radius: 50%;
  background: #e1acff;
}

.prelude-word {
  display: inline-block;
}

/* Entry screen stays above the prepared film until the viewer starts it. */
.intro-gate { display: none; }
.intro-gated .intro-gate:not([hidden]) {
  display: grid;
  position: fixed;
  inset: 0;
  z-index: 100;
  place-items: center;
  background: var(--bg);
}
.intro-gate-art, .intro-gate-shade { position: absolute; inset: 0; }
.intro-gate-art { overflow: hidden; }
.intro-gate-art img { width: 100%; height: 100%; object-fit: cover; object-position: center; filter: blur(18px) saturate(0.65); transform: scale(1.08); }
.intro-gate-shade { background: radial-gradient(ellipse at 50% 40%, rgb(95 24 144 / 24%), rgb(5 0 29 / 70%) 75%), linear-gradient(180deg, rgb(5 0 29 / 25%), rgb(5 0 29 / 55%)); }
.intro-gate-content { position: relative; display: grid; justify-items: center; gap: 2.5rem; width: min(560px, calc(100% - 40px)); }
.intro-gate-mark-slot svg {
  display: block;
  width: clamp(100px, 14vw, 160px);
  height: auto;
  fill: none;
  stroke: #f6dcff;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px #bb00ff) drop-shadow(0 0 22px #8823ef);
}
.intro-gate-mark-slot .mark-accent { stroke: #ffba72; }
.intro-gate-actions { display: grid; grid-template-columns: 1fr; gap: 12px; width: min(100%, 320px); }
.intro-gate-actions .cta { min-width: 0; padding-inline: 12px; font: inherit; cursor: pointer; }
.intro-gate-actions .cta:focus-visible { outline: none; border: 2px solid white; }
@media (max-width: 600px) {
  .intro-gate-content { gap: 2rem; align-self: center; margin-bottom: 0; }
  .intro-gate-art img { object-position: center; }
  .intro-gate-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
}


@media (max-width: 600px) and (orientation: portrait) {
  /* Keep the heading on the same visual centre as the entry composition.
     The icon sits above it without displacing the headline. */
  .is-animated .scene-opening .scene-content { position: relative; }
  .is-animated .scene-opening .scene-mark-frame {
    position: absolute;
    bottom: 100%;
    margin-bottom: 0.75rem;
  }
  .is-animated .scene-opening .scene-mark { margin-bottom: 0; }
}
