/* ============ Intro: "Monsora" typed while loading, then zooms into the ASCII background ============ */
.intro {
  display: none;
}
html.intro-on .intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.intro-bg {
  position: absolute;
  inset: 0;
  background: #ffffff;
}
.intro-word {
  position: relative;
  display: inline-flex;
  align-items: center;
  font: 700 clamp(44px, 6vw, 72px) / 1 var(--sans);
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  will-change: transform, opacity;
}
.intro-word .caret {
  height: 0.9em;
  width: 3px;
  margin-left: 4px;
  opacity: 1;
  animation: introBlink 1s steps(1) infinite;
}
.intro.typing .intro-word .caret {
  animation: none;
  opacity: 1;
}
@keyframes introBlink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}
html.intro-on,
html.intro-on body {
  overflow: hidden;
}
.ascii-bg,
.hero h1,
.hero .hero-signup,
.hero-glow,
#site-header {
  transition:
    opacity 0.9s ease,
    translate 0.9s cubic-bezier(0.22, 0.8, 0.24, 1);
}
html.intro-on .ascii-bg {
  opacity: 0;
}
.ascii-bg {
  transition-duration: 0.4s;
}
html.intro-on .hero .hero-signup {
  opacity: 0;
  translate: 0 14px;
}
html.intro-on .hero-glow {
  opacity: 0;
}
/* hero title: each line rises from below its own mask, one after the other */
.hero h1 .hl {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}
.hero h1 .hl-in {
  display: inline-block;
  transform: translateY(0);
  transition: transform 1s cubic-bezier(0.22, 0.8, 0.24, 1) 0.25s;
}
.hero h1 .hl + .hl .hl-in {
  transition-delay: 0.4s;
}
html.intro-on .hero h1 .hl-in {
  transform: translateY(115%);
}
@media (prefers-reduced-motion: reduce) {
  .hero h1 .hl-in {
    transition: none;
  }
}
/* intro step 0: the header drops in from the top first (above the intro overlay), then "Monsora" is typed */
html.intro-on #site-header {
  z-index: 210;
  opacity: 0;
  translate: 0 -100%;
}
html.intro-on.intro-head #site-header {
  opacity: 1;
  translate: 0 0;
  transition:
    opacity 0.6s ease,
    translate 0.8s cubic-bezier(0.22, 0.8, 0.24, 1);
}
.hero .hero-signup {
  transition-delay: 0.7s;
}
.hero-glow {
  transition-duration: 1.4s;
  transition-delay: 0.3s;
}
#site-header {
  transition-delay: 0.2s;
}
html:not(.intro-on) .hero h1,
html:not(.intro-on) .hero .hero-signup {
  translate: 0 0;
}
.intro.pre .intro-word {
  visibility: hidden;
}
html.intro-on .intro.gone,
.intro.gone {
  display: none;
}

/* screen-2 images: hidden after the first screen loads, then pop in one by one once the page starts scrolling
     (top-right → top-left → bottom-right → bottom-left) */
html.fly-on:not(.fc-shown) .capsule-folder .fc {
  opacity: 0;
  scale: 0.6;
}
html.fly-on.fc-shown .capsule-folder .fc {
  animation: fcPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
html.fly-on.fc-shown .capsule-folder .fc[data-k="video"] {
  animation-delay: 0s;
}
html.fly-on.fc-shown .capsule-folder .fc[data-k="image1"] {
  animation-delay: 0.16s;
}
html.fly-on.fc-shown .capsule-folder .fc[data-k="prompt"] {
  animation-delay: 0.32s;
}
html.fly-on.fc-shown .capsule-folder .fc[data-k="image2"] {
  animation-delay: 0.48s;
}
html.fly-on.fc-shown .capsule-folder .fc[data-k="audio"] {
  animation-delay: 0.56s;
}
/* Why-now copy rises in (eyebrow → title → body) once the images have popped in */
html.fly-on:not(.fc-shown) .pin-copy > * {
  opacity: 0;
  translate: 0 28px;
}
html.fly-on .pin-copy > * {
  transition:
    opacity 0.7s ease,
    translate 0.9s cubic-bezier(0.22, 0.8, 0.24, 1);
}
html.fly-on.fc-shown .pin-copy > :nth-child(1) {
  transition-delay: 1.15s;
}
html.fly-on.fc-shown .pin-copy > :nth-child(2) {
  transition-delay: 1.27s;
}
html.fly-on.fc-shown .pin-copy > :nth-child(3) {
  transition-delay: 1.39s;
}
/* screen 2: files float loose (their type tabs sit outside the frame); once they start flying in, the frame clips */
html.fly-on.fc-loose .capsule-folder .fc {
  overflow: visible;
  pointer-events: auto;
  cursor: default;
}
/* hovering a file makes it spring upright (and wobble back on leave) — driven by landing-capsule.js */
@media (hover: hover) {
  html.fly-on.fc-loose .capsule-folder .fc:hover {
    z-index: 20 !important;
  }
}
html.fly-on:not(.fc-loose) .capsule-folder .fc {
  border-radius: 24px;
  overflow: hidden;
}
@keyframes fcPop {
  0% {
    opacity: 0;
    scale: 0.6;
  }
  60% {
    opacity: 1;
    scale: 1.06;
  }
  100% {
    opacity: 1;
    scale: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  html.fly-on .capsule-folder .fc {
    animation: none !important;
    opacity: 1 !important;
    scale: 1 !important;
  }
}

/* folder: plain image with a 60% white stroke, no hover state */
html.fly-on .capsule-folder .fc > img:not(.fc-art) {
  border: 3px solid rgba(255, 255, 255, 0.6);
  box-sizing: border-box;
  border-radius: 24px;
}
html.fly-on.fc-in .capsule-folder .fc {
  animation: none;
}
/* screen 2: each file carries a small type tab on the outside of one edge, tilted with the
   card like a file tab, so it never covers the picture; it fades as the file flies into the folder */
.fc-type {
  display: none;
}
html.fly-on .capsule-folder .fc-type {
  position: absolute;
  left: 14px;
  bottom: calc(100% + 6px);
  z-index: 2;
  display: block;
  padding: 4px 10px 5px;
  border-radius: 999px;
  background: var(--c);
  color: #fff;
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(21, 19, 15, 0.16);
  pointer-events: none;
}
/* the front image of the stack and the prompt card carry theirs under the bottom edge */
html.fly-on .capsule-folder .fc[data-k="image2"] .fc-type,
html.fly-on .capsule-folder .fc[data-k="prompt"] .fc-type {
  bottom: auto;
  top: calc(100% + 6px);
}
html.fly-on .capsule-folder .fc[data-k="image2"] .fc-type {
  left: auto;
  right: 14px;
}
