/* whimsical.gmcat.io: a walk from night to morning. Sky colours are set by site.js as the page scrolls. */
:root {
  --sky-top: #120c26; --sky-bottom: #2b1f4d; --ink: #fff8ee; --ink-soft: #e6dcf5;
  --card: rgba(28, 18, 56, .55); --card-line: rgba(255, 255, 255, .28);
  --accent: #ffcf6b; --pink: #ff9ec7; --purple: #402e4d;
  --star-op: 1; --sun-y: 110vh; --moon-y: 14vh; --cloud-op: .25;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Quicksand", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--sky-bottom); line-height: 1.6; font-size: 1.08rem; overflow-x: hidden; }
body.day { --ink: #2c1f3d; --ink-soft: #4b3b5e; --card: rgba(255, 255, 255, .84); --card-line: rgba(64, 46, 77, .18); }
.chapter { text-shadow: 0 1px 10px rgba(10, 6, 30, .55); }
body.day .chapter { text-shadow: 0 1px 10px rgba(255, 255, 255, .85); }
.gm-card, .back, .good-things a, .prompt, .star-note { text-shadow: none; }
a { color: var(--accent); text-underline-offset: 3px; }
body.day a { color: #7a3fb0; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }

/* sky */
.sky { position: fixed; inset: 0; z-index: -2; background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom)); transition: background .2s linear; }
.stars { position: absolute; inset: 0; opacity: var(--star-op); }
.stars i { position: absolute; width: 3px; height: 3px; background: #fff; border-radius: 1px; animation: twinkle 3s ease-in-out infinite; }
.sun { position: absolute; left: 74%; top: var(--sun-y); width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, #fff6c9 0 38%, #ffd36b 40% 58%, rgba(255, 190, 90, .35) 60%, transparent 72%); }
.moon { position: absolute; left: 12%; top: var(--moon-y); width: 64px; height: 64px; border-radius: 50%; box-shadow: 14px 10px 0 0 #fff3cf; opacity: var(--star-op); }
.clouds { position: absolute; inset: 0; opacity: var(--cloud-op); }
.cloud { position: absolute; width: 180px; height: 48px; background: #fff; border-radius: 40px; animation: drift linear infinite; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 80px; height: 80px; left: 26px; top: -40px; }
.cloud::after { width: 60px; height: 60px; left: 92px; top: -26px; }
.c1 { top: 14%; animation-duration: 70s; animation-delay: -10s; }
.c2 { top: 36%; animation-duration: 95s; animation-delay: -60s; transform: scale(.7); }
.c3 { top: 60%; animation-duration: 80s; animation-delay: -35s; transform: scale(1.2); }
.c4 { top: 82%; animation-duration: 110s; animation-delay: -80s; transform: scale(.85); }
@keyframes drift { from { left: -260px; } to { left: 110vw; } }
@keyframes twinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* tap sparkles */
.sparkle-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.spark { position: absolute; font-size: 18px; animation: pop 1s ease-out forwards; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.4); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1); opacity: 0; } }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; backdrop-filter: blur(6px); background: linear-gradient(180deg, var(--sky-top) 40%, transparent); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; }
body.day .brand { color: var(--ink); }
.dots { display: flex; gap: 6px; }
.dots a { width: 12px; height: 12px; border-radius: 50%; background: var(--card-line); font-size: 0; transition: transform .2s, background .2s; }
.dots a.on { background: var(--accent); transform: scale(1.35); }

/* chapters */
main { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.chapter { min-height: 92vh; padding: 12vh 0 8vh; display: flex; flex-direction: column; justify-content: center; }
.chapter > * { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.chapter.seen > * { opacity: 1; transform: none; }
h1 { font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.1; margin: .3em 0; text-align: center; }
h2 { font-size: clamp(1.6rem, 4.2vw, 2.5rem); line-height: 1.2; margin: .2em 0 .5em; }
.center { text-align: center; max-width: 680px; margin-left: auto; margin-right: auto; }
#gm h2, #together h2, #turn h2 { text-align: center; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 800; color: var(--pink); margin: 0; }
#gm .kicker, #together .kicker, #turn .kicker { text-align: center; }
body.day .kicker { color: #b8407e; }
.chip { align-self: center; padding: 6px 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--card-line); font-size: .85rem; margin: 0; }
.lede { text-align: center; max-width: 600px; margin: 0 auto; color: var(--ink-soft); font-size: 1.15rem; }
.small { font-size: .88rem; color: var(--ink-soft); }
.quiet { color: var(--ink-soft); font-style: italic; }
.hush { color: var(--pink); }
.split { display: grid; grid-template-columns: 240px 1fr; gap: 36px; align-items: center; }
.split.rev { grid-template-columns: 1fr 240px; }
.split img { width: 100%; height: auto; }
@media (max-width: 720px) { .split, .split.rev { grid-template-columns: 1fr; } .split img { width: 180px; margin: 0 auto; } .split.rev img { order: -1; } }

/* hero stage */
.stage { position: relative; width: 240px; height: 240px; margin: 28px auto 12px; }
.cat { width: 240px; height: 240px; transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.cat.sleeping { animation: breathe 3.6s ease-in-out infinite; }
.cat.awake { animation: hop .6s ease; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03, .98); } }
@keyframes hop { 0% { transform: translateY(0); } 40% { transform: translateY(-26px); } 100% { transform: translateY(0); } }
.zzz { position: absolute; right: 8px; top: 8px; font-weight: 800; color: var(--ink-soft); font-size: 1.4rem; }
.zzz b, .zzz i { display: inline-block; font-style: normal; animation: zfloat 2.4s ease-in-out infinite; }
.zzz b { font-size: 1.1em; animation-delay: .4s; } .zzz i { font-size: 1.3em; animation-delay: .8s; }
@keyframes zfloat { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-10px); opacity: 1; } }
.bubble { position: absolute; right: -36px; top: -10px; background: #fff; color: var(--purple); font-weight: 900; font-size: 1.6rem; padding: 6px 16px; border-radius: 18px; animation: hop .6s ease; }
.bubble::after { content: ""; position: absolute; left: 14px; bottom: -10px; border: 10px solid transparent; border-top-color: #fff; border-bottom: 0; }
.hint { text-align: center; color: var(--ink-soft); font-size: .9rem; }

.big-btn { align-self: center; font: inherit; font-weight: 800; font-size: 1.15rem; padding: 14px 28px; border-radius: 99px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #ffe08f, #ffbf47); color: #3a2a12; box-shadow: 0 6px 0 #c98a1c; transition: transform .1s, box-shadow .1s; }
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #c98a1c; }
.big-btn.soft { background: var(--card); color: var(--ink); border: 1px solid var(--card-line); box-shadow: none; }
.big-btn:focus-visible, .flip:focus-visible, .pond:focus-visible, .starfield:focus-visible, .good-things a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* origin */
.prompt { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; background: rgba(0, 0, 0, .28); color: #fff; padding: 12px 16px; border-radius: 12px; min-height: 3.2em; }
.caret { display: inline-block; width: .55em; height: 1.1em; background: var(--accent); vertical-align: -.15em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.float { animation: float 5s ease-in-out infinite; }
.float.slow { animation-duration: 7s; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-14px) rotate(1deg); } }

/* GM cards */
.cards { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 26px 0; }
.flip { position: relative; width: 210px; height: 150px; border: 0; padding: 0; background: none; cursor: pointer; perspective: 800px; font: inherit; color: inherit; }
.flip > span { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; border-radius: 20px; backface-visibility: hidden; transition: transform .7s cubic-bezier(.3, 1.4, .5, 1); text-align: center; }
.front { background: var(--card); border: 2px dashed var(--card-line); font-size: 2rem; font-weight: 900; }
.front b { color: var(--pink); }
.back { background: #fff; color: var(--purple); font-size: 1.25rem; font-weight: 700; transform: rotateY(180deg); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.back b { color: #c2457f; }
.flip[aria-pressed="true"] .front { transform: rotateY(-180deg); }
.flip[aria-pressed="true"] .back { transform: rotateY(0); }
.flip:hover .front { transform: rotate(-2deg) scale(1.03); }
.flip[aria-pressed="true"]:hover .front { transform: rotateY(-180deg); }

/* pond */
.pond { position: relative; height: 240px; margin-top: 26px; border-radius: 50% / 40%; overflow: hidden; cursor: pointer;
  background: radial-gradient(ellipse at 50% 40%, #8fd6ff, #3d8bd1 70%, #2d6aa8); box-shadow: inset 0 -12px 30px rgba(0, 0, 0, .25); }
.pond-hint { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: rgba(255, 255, 255, .75); font-weight: 800; letter-spacing: .1em; pointer-events: none; }
.ripple { position: absolute; border: 3px solid rgba(255, 255, 255, .85); border-radius: 50%; transform: translate(-50%, -50%); animation: ripple 2.4s ease-out forwards; pointer-events: none; }
@keyframes ripple { from { width: 10px; height: 6px; opacity: 1; } to { width: 520px; height: 300px; opacity: 0; } }
.pond-word { position: absolute; transform: translate(-50%, -50%); color: #fff; font-weight: 800; font-size: .95rem; white-space: nowrap; text-shadow: 0 2px 6px rgba(0, 0, 0, .35); animation: rise 2.6s ease-out forwards; pointer-events: none; }
@keyframes rise { from { opacity: 0; margin-top: 0; } 20% { opacity: 1; } to { opacity: 0; margin-top: -60px; } }

/* friends + starfield */
.friends { display: flex; justify-content: center; align-items: flex-end; gap: 22px; margin: 26px 0 10px; flex-wrap: wrap; }
.friends figure { margin: 0; text-align: center; font-weight: 800; font-size: .9rem; }
.friends img { height: 140px; width: auto; }
.bob { animation: bob 2.4s ease-in-out infinite; }
.bob.d1 { animation-delay: .4s; } .bob.d2 { animation-delay: .8s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.starfield { position: relative; height: 280px; margin-top: 16px; border-radius: 24px; overflow: hidden; cursor: crosshair;
  background: linear-gradient(180deg, #0d0a20, #2a1c52); border: 1px solid var(--card-line); }
.lit { position: absolute; width: 22px; height: 22px; transform: translate(-50%, -50%); pointer-events: none; animation: litIn .6s cubic-bezier(.3, 1.8, .5, 1); }
.lit::before { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; color: #ffe27a; font-size: 22px; text-shadow: 0 0 12px #ffd24a; animation: twinkle 2.6s ease-in-out infinite; }
@keyframes litIn { from { transform: translate(-50%, -50%) scale(0); } to { transform: translate(-50%, -50%) scale(1); } }
.star-note { position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, .12); color: #fff; text-align: center; font-weight: 700; pointer-events: none; }

/* good things */
.good-things { list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.good-things a { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 10px; padding: 16px; border-radius: 18px; text-decoration: none;
  background: var(--card); border: 1px solid var(--card-line); color: var(--ink); transition: transform .2s; }
.good-things a:hover { transform: translateY(-4px) rotate(-.5deg); }
.good-things .em { grid-row: span 2; font-size: 1.8rem; line-height: 1; }
.good-things span:last-child { color: var(--ink-soft); font-size: .92rem; }

/* finale */
.gm-card { display: flex; align-items: center; gap: 18px; max-width: 560px; margin: 22px auto; padding: 18px 22px; background: #fff; color: var(--purple); border-radius: 22px; box-shadow: 0 12px 36px rgba(0, 0, 0, .18); }
.gm-card img { flex: none; width: 100px; height: 100px; }
.gm-card p { margin: 0; font-size: 1.25rem; font-weight: 700; }
.gm-card.swap p { animation: hop .5s ease; }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.goodnight { text-align: center; margin-top: 8vh; }
.goodnight img { width: 160px; height: auto; }
.goodnight p { font-size: 1.2rem; }

.foot { text-align: center; padding: 30px 20px 50px; }
.foot a { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .chapter > * { opacity: 1; transform: none; }
}

/* 404 */
.lost .chapter { min-height: 80vh; }
.lost .chapter img { margin: 0 auto; }

@media (max-width: 600px) { .sun { width: 84px; height: 84px; left: 78%; } .moon { width: 46px; height: 46px; } }
.flip > span > i { font-style: normal; }
