/* Shared page setup and components used across chapters. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--blush);
  color: var(--cocoa);
  font: 400 var(--text)/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button { font: inherit; }

/* One full-screen stage; each chapter fills it in turn. */
.stage {
  position: fixed;
  inset: 0;
  height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* Small label above a heading, as on the original site */
.label {
  margin: 0 0 4px;
  font: 700 var(--text-small)/1.3 var(--font-sans);
  color: var(--rouge);
}

/* Puffy heart-red bubble button ("ready?") */
.bubble-btn {
  display: inline-block;
  min-height: 48px;
  padding: 15px 40px 16px;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: #fff;
  font: 800 19px/1 var(--font-sans);
  letter-spacing: .01em;
  background: radial-gradient(120% 140% at 30% 15%, #FF7A8C 0%, var(--heart) 55%, var(--heart-deep) 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, .35),
    inset 0 -4px 0 rgba(150, 20, 40, .25),
    0 12px 22px -10px rgba(230, 57, 80, .65);
  transition: transform .2s var(--ease-bounce);
}
.bubble-btn:hover { transform: translateY(-2px) scale(1.03); }
.bubble-btn:active { transform: scale(.92, .86); }
.bubble-btn:focus-visible { outline: 3px solid var(--candy); outline-offset: 4px; }

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

/* A chapter fills the stage as one calm column */
.chapter {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.4dvh, 22px);
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  text-align: center;
}
.chapter-head { flex: none; }
.chapter-title {
  margin: 0;
  font: 600 clamp(30px, 7.5vw, 44px)/1.05 var(--font-serif);
  color: var(--cocoa);
  text-wrap: balance;
}
.chapter-hint {
  margin: 0;
  font: 600 var(--text-small)/1.35 var(--font-sans);
  color: var(--cocoa-soft);
}
.continue-wrap { flex: none; }
.bubble-btn:disabled { cursor: default; }

/* Short screens (a phone turned sideways): tighter spacing, smaller headings */
@media (max-height: 520px) {
  .chapter { gap: 8px; padding-top: 12px; padding-bottom: 12px; }
  .chapter-title { font-size: 26px; }
  .bubble-btn { min-height: 44px; padding: 12px 32px 13px; font-size: 17px; }
}
.stage:focus { outline: none; }

/* The very first screen: tap anywhere to begin */
.begin {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  border: 0;
  background: none;
  color: var(--cocoa);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.begin:focus { outline: none; }
.begin:focus-visible .begin-text { outline: 3px solid var(--candy); outline-offset: 8px; border-radius: 12px; }
.begin-heart { width: 46px; color: var(--rouge); animation: begin-beat 1.6s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgba(251, 111, 146, .35)); }
.begin-heart svg { display: block; width: 100%; height: auto; }
.begin-text { font: italic 600 clamp(26px, 2vw + 18px, 34px)/1.2 var(--font-serif); }
.begin-note { font: 700 13px/1 var(--font-sans); letter-spacing: .04em; color: var(--cocoa-soft); }
@keyframes begin-beat { 0%, 60%, 100% { transform: scale(1); } 15% { transform: scale(1.14); } 30% { transform: scale(.98); } 45% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .begin-heart { animation: none; } }
