/* tiny luck: paper, ink, accent. that is the whole palette, same as the app. */
@font-face {
  font-family: "Grug Hand";
  src: url("fonts/GrugHand-Regular.ttf") format("truetype");
  font-display: swap;
}
:root {
  --paper: #fbf9f3;
  --ink: #1c1917;
  --ink-rgb: 28, 25, 23;
  --accent: #29784a;
  --faint: rgba(28, 25, 23, 0.55);
  --head: 84px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171a17;
    --ink: #f0ede6;
    --ink-rgb: 240, 237, 230;
    --accent: #8fcc9e;
    --faint: rgba(240, 237, 230, 0.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #171a17;
  --ink: #f0ede6;
  --ink-rgb: 240, 237, 230;
  --accent: #8fcc9e;
  --faint: rgba(240, 237, 230, 0.55);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Grug Hand", "Comic Sans MS", cursive;
  font-size: 18px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
h1, h2, p { margin: 0; font-weight: normal; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* drawn text: the real text stays in the DOM, the pen strokes sit on top */
[data-ink] { display: block; line-height: 1; }
[data-ink].inked { font-size: 0; }
.ink-svg { display: inline-block; max-width: 100%; height: auto; overflow: visible; vertical-align: top; }
html:not(.ink-ready) [data-ink] { visibility: hidden; }
span[data-ink] { display: inline-block; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; height: var(--head); }
.wordmark { display: flex; align-items: center; gap: 10px; }
.wordmark .mark { width: 44px; height: 44px; }
.top-right { display: flex; align-items: center; gap: 18px; }
.theme { display: flex; align-items: center; gap: 8px; -webkit-tap-highlight-color: transparent; }
.theme-icon { display: block; width: 30px; height: 30px; transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1); }
.theme-icon svg { display: block; overflow: visible; }
.theme:hover .theme-icon { transform: rotate(-14deg) scale(1.08); }
.theme:active .theme-icon { transform: scale(0.9); }
.theme:focus-visible { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 50%; }

/* buttons drawn as wobbly boxes, same as the app */
.sketch { position: relative; display: inline-block; padding: 11px 18px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.sketch.small { padding: 8px 14px; }
.sketch-box { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.sketch > :not(.sketch-box) { position: relative; }
.btn { transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1); }
.btn:hover { transform: rotate(-1deg); }
.btn:active { transform: scale(0.95) rotate(-1.6deg); }
.btn:focus-visible { outline: 2px dashed var(--accent); outline-offset: 4px; }
.btn[aria-disabled="true"] { cursor: default; }
.btn[aria-disabled="true"]:hover, .btn[aria-disabled="true"]:active { transform: none; }
.link { border-bottom: 1.5px solid var(--faint); }

/* the stage: one slide at a time */
.stage { position: relative; flex: 1; min-height: calc(100svh - var(--head) - 56px); overflow: hidden; }
.slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  text-align: center;
  opacity: 0; transform: translateX(70px); visibility: hidden; pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s linear 0.45s;
}
.slide.active { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.slide.leaving { visibility: visible; opacity: 0; transform: translateX(-70px); }
.slide.entering { transition: none; transform: translateX(70px); opacity: 0; }
.pop { opacity: 0; transform: scale(0.92); pointer-events: none; }
.pop.in { animation: pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; pointer-events: auto; }
@keyframes pop { to { opacity: 1; transform: scale(1); } }

/* hero: the moments, then the point */
.hero .moments { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; overflow: hidden; width: 100%; transition: transform 0.45s ease-in, opacity 0.45s ease-in; }
.moments.out { transform: translateY(-60px); opacity: 0; }
.moment { display: flex; align-items: flex-end; justify-content: center; overflow: hidden; transition: height 0.42s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease; }
.moment .ink-svg { margin-top: 18px; }
.point { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }
.point.shown { opacity: 1; pointer-events: auto; }
.point .pop { margin-top: 26px; }

/* the tour, one place per slide */
.stop-text { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.note { opacity: 0; transform: translateY(6px); transition: opacity 0.5s ease 0.9s, transform 0.5s ease 0.9s; }
.stop.in .note { opacity: 1; transform: none; }
.phone { position: relative; height: min(380px, calc(100svh - var(--head) - 300px)); min-height: 240px; aspect-ratio: 280 / 380; }
.phone-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.phone-label { position: absolute; transform: translate(-50%, -50%); opacity: 0; transition: opacity 0.25s ease; white-space: nowrap; }
.phone.labels-in .phone-label { opacity: 1; }
.phone-clover { position: absolute; transform: scale(0.4); opacity: 0; transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease; }
.phone.clover-in .phone-clover { transform: scale(1); opacity: 1; }
.phone-plus { position: absolute; display: flex; align-items: center; gap: 3px; transform: translate(-50%, -50%) scale(0.5); opacity: 0; transition: transform 0.45s cubic-bezier(0.34, 1.7, 0.64, 1), opacity 0.25s ease; }
.phone.plus-in .phone-plus { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.stop .pop { margin-top: 4px; }

/* the send-off */
.sendoff { gap: 12px; }
.mascot-wrap { position: relative; width: 240px; height: 240px; margin-bottom: 8px; }
.mascot { position: absolute; inset: 0; width: 240px; height: 240px; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.mascot:focus-visible { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: 50%; }
.mascot.pressed { animation: press 0.36s ease-out; }
.says { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); white-space: nowrap; opacity: 0; transition: opacity 0.35s ease; pointer-events: none; }
.says.shown { opacity: 1; }
.floater { position: absolute; top: 10%; transform: translate(-50%, 0); opacity: 1; transition: transform 0.9s ease-out, opacity 0.9s ease-out; pointer-events: none; display: flex; align-items: center; gap: 3px; }
.floater.up { transform: translate(-50%, -52px); opacity: 0; }
.tapline { position: relative; height: 22px; width: 100%; }
.tapline > * { position: absolute; left: 50%; top: 0; transform: translateX(-50%); transition: opacity 0.3s ease; white-space: nowrap; }
.hint.gone, .count:not(.shown) { opacity: 0; }
@keyframes press { 0% { transform: scale(1); } 20% { transform: scale(0.9); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.burst { position: absolute; left: 50%; top: 50%; width: 456px; height: 408px; transform: translate(-50%, -50%); pointer-events: none; }
.yay { opacity: 0; transition: opacity 0.4s ease; }
.sendoff.yay .yay { opacity: 1; }
.sendoff .pop { margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.again { margin-top: 6px; border-bottom: 1.5px solid transparent; }
.again:hover { border-bottom-color: var(--faint); }

/* plain pages: credits, nothing here */
.page { flex: 1; min-height: calc(100svh - var(--head) - 56px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.page .cta-row { margin-top: 18px; }

/* footer: quiet, pinned to the bottom */
.foot { height: 56px; display: flex; align-items: center; justify-content: center; gap: 22px; }
.quiet { opacity: 0.8; }
.quiet:hover { opacity: 1; }
.noscript { padding: 20px 24px; text-align: center; }

@media (max-width: 640px) {
  .wrap { padding-left: 18px; padding-right: 18px; }
  .wordmark .mark { width: 36px; height: 36px; }
  .top-right { gap: 12px; }
  .phone { height: min(380px, calc(100svh - var(--head) - 280px)); }
  .mascot-wrap, .mascot { width: 200px; height: 200px; }
  .burst { width: 380px; height: 340px; }
  .foot { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .note, .phone-clover, .phone-plus, .phone-label, .point, .moments, .moment, .yay, .slide, .theme-dot { transition: none !important; }
  .pop.in { animation: none; opacity: 1; transform: none; }
  .slide, .slide.leaving { transform: none; }
}
