/* Gorillion · "whimsical tactile storybook" theme, shared by every page.
   Cream paper with grain, a feathered white vignette, muted pastels, rounded editorial type,
   tactile paper buttons. Readability first: ink is dark brown on cream. */
@font-face { font-family: "Fraunces"; src: url(/fonts/Fraunces.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Nunito"; src: url(/fonts/Nunito.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --paper: #f7efdc; --paper-2: #fbf6ea; --paper-3: #efe3c8;
  --ink: #4a3a2c; --ink-soft: #7d6a57; --ink-faint: #ab9a85;
  --sage: #a9b98f; --sage-d: #7f9268; --dusty: #9fb4c7; --dusty-d: #7790a6;
  --peach: #eebc9a; --peach-d: #d9967a; --butter: #f2d888; --banana: #f0cf62;
  --lavender: #b9aacb; --brown: #8a6a4f; --berry: #c97a7e;
  --shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 2px 0 rgba(120,90,60,.10), 0 6px 14px -6px rgba(90,60,30,.35);
  --inset: inset 0 2px 5px rgba(110,80,50,.18), inset 0 -1px 0 rgba(255,255,255,.6);
  --r: 18px;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font: 500 18px/1.45 "Nunito", ui-rounded, system-ui, sans-serif;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(159,180,199,.18), transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(238,188,154,.16), transparent 50%),
    var(--paper);
}
/* paper grain over everything (cheap: one tiny tiled SVG noise) */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .36 0 0 0 0 .25 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* feathered white vignette fading into the cream page */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse 75% 70% at 50% 45%, transparent 62%, rgba(255,253,246,.55) 82%, rgba(255,253,246,.92) 100%);
}

h1, h2, h3, .display { font-family: "Fraunces", Georgia, serif; font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 72; font-weight: 650; letter-spacing: -.01em; line-height: 1.1; margin: 0 0 .3em; }
.hide { display: none !important; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }

/* a sheet of paper lying in the scene */
.sheet {
  background: var(--paper-2); border-radius: var(--r); padding: 18px 20px; position: relative;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 10px 24px -14px rgba(90,60,30,.45), 0 2px 4px -2px rgba(90,60,30,.18);
}
.sheet::before { /* faint deckled tone at the edges */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 18px rgba(196,170,130,.25);
}

.btn, button {
  font: 750 18px/1 "Nunito", system-ui, sans-serif; color: var(--ink); cursor: pointer;
  padding: 13px 22px; border: 0; border-radius: 26px 22px 28px 24px / 24px 28px 22px 26px;
  background: var(--butter); box-shadow: var(--shadow);
  transition: transform .12s steps(2), box-shadow .12s;
}
.btn:hover, button:hover { transform: translateY(-1px) rotate(-.4deg); }
.btn:active, button:active { transform: translateY(1px); box-shadow: var(--inset); }
.btn.sage, button.sage { background: var(--sage); }
.btn.quiet, button.quiet { background: var(--paper-3); color: var(--ink-soft); font-weight: 650; font-size: 15px; padding: 9px 16px; }
button:disabled { opacity: .45; cursor: default; transform: none; }

input[type=text], input:not([type]) {
  font: 650 22px/1.2 "Nunito", system-ui, sans-serif; color: var(--ink); width: 100%;
  padding: 14px 18px; border: 0; border-radius: 16px; background: #fffaf0; box-shadow: var(--inset);
  outline: none;
}
input:focus { box-shadow: var(--inset), 0 0 0 3px rgba(169,185,143,.55); }
input::placeholder { color: var(--ink-faint); }

/* little paper tags for found answers */
.tag {
  display: inline-block; margin: 3px; padding: 4px 11px 5px; border-radius: 10px 12px 9px 11px;
  background: #fffaf0; font-weight: 700; font-size: 16px; box-shadow: 0 1px 2px rgba(90,60,30,.18);
  transform: rotate(var(--tilt, 0deg));
}
.tag.uncommon { background: #e6eef4; }
.tag.rare { background: #fbecc0; }
.tag .pts { color: var(--ink-soft); font-weight: 600; font-size: 13px; margin-left: 4px; }

/* stop-motion helpers: movement in held frames, never silky */
@keyframes pop-in { 0% { transform: scale(.6) rotate(-6deg); opacity: 0 } 60% { transform: scale(1.08) rotate(2deg); opacity: 1 } 100% { transform: scale(1) rotate(var(--tilt, 0deg)) } }
.pop { animation: pop-in .36s steps(4) both; }
@keyframes wobble { 0%, 100% { transform: rotate(0) } 33% { transform: rotate(-1.5deg) } 66% { transform: rotate(1.2deg) } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01s !important; transition: none !important; } }

/* the illustrated scene feathers softly into the page */
.scene-wrap { -webkit-mask-image: radial-gradient(ellipse 62% 68% at 50% 50%, #000 58%, transparent 100%); mask-image: radial-gradient(ellipse 62% 68% at 50% 50%, #000 58%, transparent 100%); }
svg.scene { width: 100%; height: auto; display: block; }
