@font-face { font-family: 'Bherisi'; src: url('../assets/fonts/Bherisi-Regular.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: 'Nunito'; src: url('../assets/fonts/Nunito-Bold.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: 'Nunito'; src: url('../assets/fonts/Nunito-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: block; }
@font-face { font-family: 'Nunito'; src: url('../assets/fonts/Nunito-ExtraBoldItalic.ttf') format('truetype'); font-weight: 800; font-style: italic; font-display: block; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #3d2160; /* letterbox colour around the 4:3 stage */
  /* iPad / touch: no page bounce, no double-tap zoom, no long-press menus or
     text selection, no grey tap flash. (Nothing visual changes.) */
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

#viewport {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Design-space stage: everything inside is positioned in Figma pixels (3840×2880).
   JS applies a single uniform scale so the stage fits the window without distortion. */
#stage {
  position: relative;
  flex: none;
  width: 3840px;
  height: 2880px;
  overflow: hidden;
  transform-origin: center center;
  background: #3d2160;
}

#stage.is-loading .screen { visibility: hidden; }

/* ---------- Screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 700ms ease, visibility 0s linear 700ms;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 700ms ease, visibility 0s;
}

/* scene-to-scene "cut": the illustration swaps instantly (backgrounds are identical,
   only the girl's pose changes); only the text card + arrow fade */
.screen.no-fade, .screen.no-fade.is-active { transition: none; }

.screen img, .screen p { user-select: none; -webkit-user-drag: none; }

.screen .full {
  position: absolute;
  left: 0;
  top: 0;
  width: 3840px;
  height: 2880px;
  pointer-events: none;
}

.ui { transition: opacity 450ms ease; }
.screen.ui-hidden .ui { opacity: 0; pointer-events: none; }

/* ---------- Opening screen (Frame 34) ---------- */
.opening-title {
  position: absolute;
  left: 952px;
  top: 292px;
  width: 1750px;
  height: 1156px;
  pointer-events: none;
}

.opening-sub {
  position: absolute;
  left: 1920px;
  top: 1440px;
  transform: translateX(-50%);
  font-family: 'Bherisi', serif;
  font-size: 96px;
  line-height: normal;
  color: #563078;
  text-align: center;
  white-space: nowrap;
}

/* ---------- Intro screen (Frame 35) ---------- */
.intro-headline {
  position: absolute;
  left: 1927.5px;
  top: 1044px;
  transform: translateX(-50%);
  font-family: 'Bherisi', serif;
  font-size: 150px;
  line-height: normal;
  color: #ffce0a;
  text-align: center;
  white-space: nowrap;
}

.intro-line {
  position: absolute;
  transform: translateX(-50%);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 90px;
  line-height: normal;
  color: #fff;
  text-align: center;
  white-space: nowrap;
}

.intro-line.wide { width: 2654px; white-space: normal; }

/* ---------- Buttons ---------- */
button.next {
  position: absolute;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button.next:focus-visible { outline: 8px solid #ffce0a; outline-offset: 10px; }

/* Pink pill button (Frames 34 & 35) */
button.pill {
  display: flex;
  gap: 25px;
  align-items: center;
  justify-content: center;
  padding: 50px 100px;
  border-radius: 65px;
  background: #ed2087;
  filter: drop-shadow(0 9px 0 #563078);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 88px;
  line-height: normal;
  color: #fff;
  white-space: nowrap;
}

button.pill img { display: block; width: 90px; height: 90px; flex: none; }

/* Inviting, never distracting: the pink buttons gently "breathe" and the arrow
   nudges forward, so it's clear they can be pressed. Same design, size and place;
   only movement is added. They grow a touch on hover and press down when tapped. */
button.pill {
  animation: pill-breathe 2.4s ease-in-out infinite;
  transition: filter 150ms ease, transform 150ms ease;
}
button.pill img { animation: arrow-nudge 2.4s ease-in-out infinite; }
/* hover only on devices with a real pointer (on iPad a tap would leave it "stuck") */
@media (hover: hover) { button.pill:hover { animation: none; transform: scale(1.06); } }
button.pill:active { animation: none; transform: translateY(9px) scale(0.98); filter: drop-shadow(0 0 0 #563078); }

@keyframes pill-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.045); }
}
@keyframes arrow-nudge {
  0%, 40%, 100% { transform: translateX(0); }
  55%           { transform: translateX(14px); }
  70%           { transform: translateX(0); }
  80%           { transform: translateX(7px); }
}

/* Round arrow (Frames 38–40) */
button.round { width: 200px; height: 200px; padding: 0; border-radius: 50%; }
button.round img { display: block; width: 200px; height: 200px; }

/* ---------- Text cards (Frames 38–40) ---------- */
.card {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #563078;
  border: 6px solid #ffce0a;
  border-radius: 45px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  color: #ffce0a;
  text-align: center;
}

.card p { line-height: normal; white-space: nowrap; }
.card p[style*="width"] { white-space: normal; }

/* ---------- Aunties (blink / talk) + speech bubbles ---------- */
#aunties {
  position: absolute;
  inset: 0;
  pointer-events: none;
  visibility: hidden;
  z-index: 5;
}
#aunties.is-active { visibility: visible; }

/* full 3840×2880 "mouth closed" plate, clipped to one aunty; shown only while
   she blinks or closes her mouth mid-sentence */
.aunty-closed {
  position: absolute;
  left: 0;
  top: 0;
  width: 3840px;
  height: 2880px;
  visibility: hidden;
}
.aunty-closed.is-on { visibility: visible; }

.bubble { position: absolute; inset: 0; visibility: hidden; }
.bubble.is-on { visibility: visible; }

.bubble-box { position: absolute; overflow: hidden; }
.bubble-box img { position: absolute; max-width: none; }

.bubble-text {
  position: absolute;
  transform: translate(-50%, -50%);
  margin: 0;
  font-family: 'Bherisi', serif;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
}

/* quick pop from the tail with one small bounce */
@keyframes bubble-pop {
  0%   { transform: scale(0.35); opacity: 0; }
  25%  { opacity: 1; }
  60%  { transform: scale(1.07); }
  82%  { transform: scale(0.98); }
  100% { transform: scale(1);    opacity: 1; }
}
@keyframes bubble-out {
  0%   { transform: scale(1);   opacity: 1; }
  100% { transform: scale(0.6); opacity: 0; }
}

/* ---------- Grown-up section ---------- */
.g-layer { position: absolute; inset: 0; pointer-events: none; }

/* one aunty's expression (full Figma frame, limited to her window by clip-path) */
.g-aunty { opacity: 0; }
.g-aunty.is-on { opacity: 1; }
.g-aunty.fade-out { transition: opacity 450ms ease; } /* childhood aunties leaving */

/* the girl: her Figma scene masked to her outline; the rig carries her body motion */
.g-rig { position: absolute; inset: 0; will-change: transform; }
.g-pose {
  position: absolute;
  inset: 0;
  visibility: hidden;
  -webkit-mask-size: 3840px 2880px; mask-size: 3840px 2880px;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.g-pose.is-current { visibility: visible; }

/* thinking / head-down screens: one pose that settles into place */
.g-still { position: absolute; inset: 0; pointer-events: none; will-change: transform; }

/* ---------- Twirl ---------- */
#girl { position: absolute; inset: 0; pointer-events: none; }

/* Carries the body motion (gentle dip / lift / lean) for whichever pose is showing */
#rig { position: absolute; inset: 0; will-change: transform; }

/* Every pose keeps its full, untouched 6000×6000 canvas; width = height so the
   aspect ratio is never altered. Only one pose is visible at a time. */
#girl img { position: absolute; visibility: hidden; user-select: none; }
#girl img.is-current { visibility: visible; }
