/* Shared look: colors, type, buttons, the screens and the pause button. */
:root {
  --night: #1d1327;      /* the room */
  --night-2: #2b1d3a;    /* raised surfaces */
  --line: #4a3660;       /* borders */
  --cream: #fbefe4;      /* text, frosting, paper */
  --muted: #c4afc8;      /* secondary text */
  --ink: #3a2442;        /* text on paper */
  --flame: #ffb54a;      /* candlelight, accent */
  --rose: #ee8aa4;       /* cake, highlights */
  --good: #63bf93;       /* right spot */
  --near: #e7bd4c;       /* in the word */
  --miss: #47375a;       /* not in the word */
  --g1: #e7bd4c; --g2: #63bf93; --g3: #7aa7e6; --g4: #c58ae0; /* conexo groups */

  --display: "Caprasimo", "Cooper Black", Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font: 16px/1.5 var(--body);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main { min-height: 100%; padding-inline: 16px; }

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 36rem;
  margin: 0 auto;
  padding-block: 2.5rem 3rem;
  min-height: 100%;
  text-align: center;
  position: relative;
}
.screen.active { display: flex; animation: rise 1s ease backwards; }
.screen.leaving { opacity: 0; transition: opacity 1s ease; }
@keyframes rise { from { opacity: 0; } }

h1, h2 { margin: 0; text-wrap: balance; font-weight: 400; }
.big { font-family: var(--display); font-size: clamp(2.6rem, 11vw, 4.2rem); line-height: 1.05; color: var(--cream); }
.title { font-family: var(--display); font-size: clamp(1.7rem, 6vw, 2.3rem); line-height: 1.15; }
.title.sm { font-size: 1.5rem; }
.lede { margin: 0; color: var(--muted); max-width: 30rem; font-size: 1.05rem; }
.fine { margin: 0; color: var(--muted); font-size: .85rem; min-height: 1.3em; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 800; color: var(--flame); }
.eyebrow.dark { color: #b0566f; }

.btn {
  font: 800 1rem var(--body);
  color: var(--night);
  background: var(--flame);
  border: 0;
  border-radius: 999px;
  padding: .85rem 1.6rem;
  cursor: pointer;
  box-shadow: 0 .5rem 1.6rem -0.6rem rgba(255, 181, 74, .7);
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--cream); border: 1.5px solid var(--line); box-shadow: none; }
.btn.small { padding: .55rem 1rem; font-size: .9rem; }
.btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: 0; color: var(--muted); font: 600 .85rem var(--body); text-decoration: underline; cursor: pointer; margin-top: 1rem; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; }

.screen.active.instant { animation: none; }
main { position: relative; z-index: 1; }

/* pause button: pauses every CSS animation in the story too */
body.paused *, body.paused *::before, body.paused *::after { animation-play-state: paused !important; }
.playpause {
  position: fixed; z-index: 20; left: 50%; bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
  width: 3.1rem; height: 3.1rem; margin-left: -1.55rem; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(43, 29, 58, .92); border: 1.5px solid var(--line); color: var(--cream);
  transition: transform .15s ease, background .15s ease;
}
.playpause:hover { background: rgba(74, 54, 96, .9); }
.playpause:active { transform: scale(.94); }
.playpause svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }
.playpause .i-play, .playpause.is-paused .i-pause { display: none; }
.playpause.is-paused .i-play { display: block; }


#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
