/* ==========================================================================
   core.css — Playroom design tokens, reset and typography
   --------------------------------------------------------------------------
   A bright, rounded, toy-like system: cream paper, a friendly ink navy, and
   five candy accents used as flat fills rather than print inks. Every token is
   prefixed `--pop-` and every class `pop-` so nothing collides with another
   stylesheet.

   Contrast note: pastel fills are decorative surfaces and always carry
   ink-coloured text. Where an accent is used *as text*, the `-text` variant is
   the accessible one (all >= 4.5:1 on the cream background).
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;500;600;700;800&display=optional");

/* Metric-compatible local fallbacks keep the font swap from moving layout. */
@font-face {
  font-family: "Fredoka Fallback";
  src: local("Verdana"), local("Tahoma");
  size-adjust: 92%;
  ascent-override: 98%;
  descent-override: 27%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Nunito Fallback";
  src: local("Segoe UI"), local("Arial");
  size-adjust: 98%;
  ascent-override: 94%;
  descent-override: 26%;
  line-gap-override: 0%;
}

:root {
  /* Surfaces ------------------------------------------------------------ */
  --pop-cream: #fff7f0;
  --pop-cream-deep: #ffeedd;
  --pop-white: #ffffff;
  --pop-ink: #202934;
  --pop-ink-2: #5a6672;

  /* Candy accents: fills are bright, *-text passes AA on cream ------------- */
  --pop-orange: #ff6b35;
  --pop-orange-text: #b83208;
  --pop-sun: #ffc53d;
  --pop-sun-text: #8a5a00;
  --pop-mint: #8fe3cc;
  --pop-mint-text: #0a7357;
  --pop-pink: #ffdde8;
  --pop-pink-text: #b0245c;
  --pop-sky: #bce3ff;
  --pop-sky-text: #144c72;
  --pop-lav: #dcd3ff;
  --pop-lav-text: #523898;

  /* Lines & shadows ----------------------------------------------------- */
  --pop-line: #f0e2d6;
  --pop-line-strong: #e2cfc0;
  --pop-shadow-sm: 0 4px 0 rgba(32, 41, 52, 0.1);
  --pop-shadow-md: 0 10px 24px -12px rgba(32, 41, 52, 0.28);
  --pop-shadow-lg: 0 26px 50px -28px rgba(32, 41, 52, 0.4);

  /* Type ---------------------------------------------------------------- */
  --pop-display: "Fredoka", "Fredoka Fallback", "Verdana", sans-serif;
  --pop-body: "Nunito", "Nunito Fallback", "Segoe UI", Arial, sans-serif;

  /* Shape & rhythm ------------------------------------------------------ */
  --pop-r-sm: 12px;
  --pop-r-md: 18px;
  --pop-r-lg: 26px;
  --pop-r-xl: 34px;
  --pop-r-pill: 999px;
  --pop-wrap: 1240px;
  --pop-gutter: clamp(1rem, 4vw, 2.5rem);
  --pop-band: clamp(2.5rem, 6vw, 5rem);

  /* Motion: springy, bouncy, never slow ---------------------------------- */
  --pop-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --pop-ease: cubic-bezier(0.2, 0.8, 0.3, 1);
  --pop-fast: 160ms;
  --pop-mid: 300ms;

  color-scheme: light;
}

/* Reset ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
}

body {
  min-height: 100vh;
  background-color: var(--pop-cream);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255, 197, 61, 0.22), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(143, 227, 204, 0.22), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(255, 221, 232, 0.3), transparent 45%);
  background-repeat: no-repeat;
  color: var(--pop-ink);
  font-family: var(--pop-body);
  font-size: clamp(1rem, 0.96rem + 0.18vw, 1.075rem);
  font-weight: 500;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
canvas,
iframe {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  background-color: var(--pop-cream-deep);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

hr {
  border: 0;
  border-top: 2px dashed var(--pop-line-strong);
}

:focus-visible {
  outline: 3px solid var(--pop-orange);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--pop-sun);
  color: var(--pop-ink);
}

/* Typography ------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--pop-display);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.3rem, 1.2rem + 4.6vw, 4.1rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.65rem, 1.2rem + 1.8vw, 2.4rem);
}

h3 {
  font-size: clamp(1.15rem, 1.02rem + 0.6vw, 1.4rem);
  line-height: 1.2;
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: 800;
}

/* Shared utilities ------------------------------------------------------- */
.pop-wrap {
  width: 100%;
  max-width: var(--pop-wrap);
  margin-inline: auto;
  padding-inline: var(--pop-gutter);
}

/* Chunky all-caps label, the playful cousin of an eyebrow */
.pop-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.75rem;
  border-radius: var(--pop-r-pill);
  background: var(--pop-white);
  box-shadow: var(--pop-shadow-sm);
  font-family: var(--pop-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pop-ink-2);
}

.pop-label::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--pop-orange);
}

.pop-label--sun::before {
  background: var(--pop-sun);
}

.pop-label--mint::before {
  background: var(--pop-mint-text);
}

.pop-label--pink::before {
  background: var(--pop-pink-text);
}

.pop-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.pop-skip {
  position: absolute;
  top: 0.75rem;
  left: 50%;
  z-index: 300;
  transform: translate(-50%, -200%);
  padding: 0.7rem 1.2rem;
  border-radius: var(--pop-r-pill);
  background: var(--pop-ink);
  color: var(--pop-cream);
  font-family: var(--pop-display);
  font-weight: 600;
  font-size: 0.8rem;
  text-decoration: none;
  transition: transform var(--pop-fast) var(--pop-ease);
}

.pop-skip:focus {
  transform: translate(-50%, 0);
}

/* Reveal: opacity + transform only, so it cannot cause layout shift. */
.pop-reveal {
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition:
    opacity var(--pop-mid) var(--pop-ease),
    transform var(--pop-mid) var(--pop-spring);
  transition-delay: var(--pop-delay, 0ms);
}

.pop-reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .pop-reveal {
    opacity: 1;
    transform: none;
  }
}
