/* Batsy the Bat. Look: a cozy night in the tree hollow. Night-blue page, cream paper for the watercolors.
   Motifs: the round porthole window (image masks) and the scalloped wing edge (dividers, footer). */
:root {
  color-scheme: dark;
  --bg: #141a3a;          /* night through the round window */
  --bg-2: #1c2350;
  --surface: #232b5e;
  --ink: #f8f3e8;
  --muted: #bcc3e6;
  --paper: #fbf6ea;       /* watercolor paper */
  --paper-ink: #2b2250;
  --lav: #c9b6e8;         /* Batsy's fur */
  --lav-deep: #8e72c2;
  --gold: #f4c95d;        /* the scarf */
  --gold-ink: #3a2a05;
  --pink: #f6aaa4;        /* ears */
  --wood: #a7703b;
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font: "Nunito", "Avenir Next", system-ui, -apple-system, sans-serif;
  --step-small: clamp(.9rem, .87rem + .1vw, 1rem);
  --step-body: clamp(1.1rem, 1.05rem + .25vw, 1.25rem);
  --step-lead: clamp(1.2rem, 1.1rem + .6vw, 1.6rem);
  --step-h2: clamp(2rem, 1.3rem + 2.6vw, 3.6rem);
  --step-h1: clamp(2.8rem, 1.6rem + 5vw, 6rem);
  --edge: clamp(16px, 4vw, 56px);
  --gap: clamp(72px, 9vw, 140px);
  --r: 28px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; overflow-x: clip; }
html {
  background:
    radial-gradient(ellipse 60% 30% at 80% 25%, #29327a 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 20% 62%, #261f5a 0%, transparent 70%),
    var(--bg);
  background-size: 100% 100vh, 100% 100vh, auto;
  background-repeat: repeat-y, repeat-y, repeat;
  min-height: 100%;
}
body {
  margin: 0; color: var(--ink); font: var(--step-body)/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, figure { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.05; text-wrap: balance; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--gold); color: var(--gold-ink); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--gold); color: var(--gold-ink); padding: 10px 16px; border-radius: 12px; }
.skip:focus { left: 16px; }
.wrap { max-width: 1280px; margin-inline: auto; padding-inline: var(--edge); }
.section { padding-block: var(--gap) 0; }
.h2 { font-size: var(--step-h2); margin-bottom: .4em; }
.sub { font-size: var(--step-lead); color: var(--muted); max-width: 40ch; margin-bottom: 40px; }
.eyebrow { font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: var(--step-small); color: var(--gold); margin-bottom: 18px; }

/* buttons: scalloped pill */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 30px;
  background: var(--gold); color: var(--gold-ink); border: 0; border-radius: 999px;
  font: 800 var(--step-body)/1 var(--font); text-decoration: none; cursor: pointer;
  box-shadow: 0 6px 0 #c79a2c; transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #c79a2c; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #c79a2c; }
.btn--sm { min-height: 46px; padding: 0 22px; font-size: var(--step-small); box-shadow: 0 4px 0 #c79a2c; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--lav); }
.btn--ghost:hover { background: rgba(201, 182, 232, .12); box-shadow: inset 0 0 0 2px var(--lav); }
.link { font-weight: 800; color: var(--gold); text-underline-offset: 4px; }
.pill { font: 700 var(--step-small)/1 var(--font); min-height: 46px; padding: 0 20px; border-radius: 999px; border: 2px solid var(--lav-deep); background: transparent; color: var(--ink); cursor: pointer; transition: background .2s, color .2s; }
.pill[aria-selected="true"] { background: var(--lav); color: var(--paper-ink); border-color: var(--lav); }

/* porthole: the round window of the hollow */
.porthole { border-radius: 50%; overflow: hidden; background: var(--paper); border: 10px solid var(--wood); box-shadow: 0 0 0 4px #6b4421, 0 30px 60px rgba(0, 0, 0, .45); aspect-ratio: 1; }
.porthole img { width: 100%; height: 100%; object-fit: cover; }

/* top bar */
.bar { display: flex; align-items: center; gap: 24px; padding-block: 18px; position: sticky; top: 0; z-index: 20; }
.bar::before { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); background: rgba(20, 26, 58, .72); pointer-events: none; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__moon { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 65% 40%, transparent 52%, var(--gold) 54%); filter: drop-shadow(0 0 8px #f4c95d66); }
.brand__word { font-family: var(--display); font-weight: 700; font-size: 1.5rem; line-height: 1; }
.brand__word small { font-size: .6em; font-weight: 500; color: var(--lav); }
.bar > .brand + .btn { margin-left: auto; }
.bar__nav { display: flex; gap: 26px; margin-left: auto; }
.bar__nav a { text-decoration: none; font-weight: 700; padding-block: 8px; position: relative; }
.bar__nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 3px; border-radius: 3px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.bar__nav a:hover::after { transform: none; }

/* hero */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 5vw, 80px); align-items: center; padding-top: clamp(24px, 5vw, 64px); }
h1 { font-size: var(--step-h1); font-weight: 700; margin-bottom: 24px; }
.hero h1 { margin-bottom: 44px; }
.h1l { white-space: nowrap; }
.hl { color: var(--lav); position: relative; white-space: nowrap; display: inline-block; isolation: isolate; }
.hl__t { position: relative; z-index: 1; }
.hl__brush { position: absolute; left: -1%; width: 102%; bottom: -.16em; height: .2em; z-index: 0; opacity: .95; transform: scaleX(0); transform-origin: left; animation: draw 1s .5s var(--ease) forwards; pointer-events: none; overflow: visible; }
.nb { white-space: nowrap; }
@keyframes draw { to { transform: none; } }
.lead { font-size: var(--step-lead); color: var(--muted); max-width: 34ch; margin-bottom: 32px; }
.cta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 28px; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li { padding: 8px 16px; border-radius: 999px; background: var(--surface); font-weight: 700; font-size: var(--step-small); color: var(--lav); }
.hero__art { position: relative; justify-self: center; width: min(100%, 520px); }
.tilt { position: relative; transform: perspective(1000px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)); transition: transform .5s var(--ease); }
.sticker { position: absolute; font-family: var(--display); font-weight: 700; padding: 10px 18px; border-radius: 999px; box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.sticker--a { top: 4%; left: -6%; background: var(--pink); color: #4a1d28; transform: rotate(-8deg); }
.sticker--b { bottom: 6%; right: -4%; background: var(--gold); color: var(--gold-ink); transform: rotate(6deg); }
.star { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px 2px #f4c95d99; animation: twinkle 3s infinite; }
.s1 { top: -4%; right: 10%; } .s2 { top: 30%; right: -8%; animation-delay: .8s; width: 7px; height: 7px; } .s3 { bottom: -2%; left: 6%; animation-delay: 1.6s; }
@keyframes twinkle { 50% { opacity: .25; transform: scale(.6); } }

/* marquee */
.marquee { margin-top: clamp(48px, 7vw, 96px); overflow: hidden; background: var(--lav); color: var(--paper-ink); transform: rotate(-1.2deg); }
.marquee__track { display: flex; gap: 48px; width: max-content; padding-block: 16px; animation: slide 30s linear infinite; font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 1rem + 1.6vw, 2.2rem); }
.marquee__track span::after { content: "✦"; margin-left: 48px; color: var(--lav-deep); }
@keyframes slide { to { transform: translateX(-50%); } }

/* bento */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(190px, auto); gap: 18px; }
.card { border-radius: var(--r); padding: 28px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; overflow: hidden; }
.card h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); }
.card p { font-size: 1.05rem; opacity: .85; }
.card--lav { background: var(--lav); color: var(--paper-ink); grid-column: span 2; }
.card--img { padding: 0; grid-column: span 2; grid-row: span 2; }
.card--img img { width: 100%; height: 100%; object-fit: cover; }
.card--gold { background: var(--gold); color: var(--gold-ink); grid-column: span 1; grid-row: span 2; }
.card--night { background: var(--surface); grid-column: span 1; grid-row: span 2; }
.card--gold, .card--night { justify-content: flex-start; }
.card--pink { background: var(--pink); color: #4a1d28; grid-column: span 2; }

/* books */
.shelf { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; max-width: 920px; }
.book { background: var(--surface); border-radius: var(--r); padding: 28px; display: flex; flex-direction: column; gap: 10px; transition: transform .3s var(--ease); }
.book:hover { transform: translateY(-6px) rotate(-.6deg); }
.book .cover { width: 72%; margin: 0 auto 14px; }
.book .cover img { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 14px 28px rgba(0,0,0,.45), -6px 0 0 rgba(255,255,255,.12) inset; }
.book h3 { font-size: 1.9rem; }
.book p { color: var(--muted); }
.book .link { margin-top: auto; padding-top: 8px; }
.tag { font-weight: 800; font-size: var(--step-small); letter-spacing: .12em; text-transform: uppercase; color: var(--gold) !important; }
.book--soon { background: transparent; border: 2px dashed var(--lav-deep); }
.book--soon .cover img { filter: saturate(.8) brightness(.9); }

/* feelings */
.feel__picker { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.feel__panel { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; background: var(--bg-2); border-radius: 40px; padding: clamp(24px, 4vw, 56px); }
.feel__body h3 { font-size: clamp(1.8rem, 1.3rem + 1.8vw, 3rem); margin-bottom: 10px; }
.feel__body > p { color: var(--muted); max-width: 44ch; margin-bottom: 22px; font-size: var(--step-lead, 1.15rem); }
.steps { list-style: none; counter-reset: s; display: grid; gap: 14px; margin: 0 0 28px; padding: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; font: 600 clamp(1.15rem, 1rem + .7vw, 1.5rem)/1.3 var(--display); color: var(--ink); }
.steps li::before { content: counter(s); width: 44px; height: 44px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; font: 700 1.3rem/1 var(--display); }
.feel__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; }
.breath { display: flex; align-items: center; gap: 18px; }
.breath i { flex: none; width: 110px; height: 110px; border-radius: 50%; border: 3px solid var(--lav); background: rgba(201,182,232,.22); transform: scale(.65); transition: transform 4s ease-in-out; }
.breath.on i { transform: scale(1); background: rgba(201,182,232,.85); }
.breath span { font: 700 1.4rem/1 var(--display); color: var(--lav); min-width: 7.5ch; }
/* peek inside */
.peek { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.peek figure { background: var(--paper); border-radius: 18px; padding: 10px 10px 14px; transition: transform .3s var(--ease); box-shadow: 0 16px 36px rgba(0,0,0,.35); display: flex; flex-direction: column; margin: 0; }
.peek figure:nth-child(odd) { transform: rotate(-1.6deg); } .peek figure:nth-child(even) { transform: rotate(1.4deg) translateY(14px); }
.peek figure:hover { transform: rotate(0) scale(1.03); }
.peek__pg { aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: #fff; }
.peek__pg img { width: 100%; height: 100%; object-fit: contain; display: block; }
.peek figcaption { color: var(--paper-ink); font-family: var(--display); font-weight: 600; text-align: center; padding-top: 10px; white-space: nowrap; font-size: clamp(.95rem, .85rem + .4vw, 1.2rem); }

/* parents + join */
.parents__card { background: var(--paper); color: var(--paper-ink); border-radius: 44px; padding: clamp(28px, 5vw, 72px); max-width: 920px; margin-inline: auto; }
.parents__card p { max-width: 54ch; margin-bottom: 20px; }
#play .parents__card { text-align: center; }
#play .parents__card p { margin-inline: auto; }
.ticks { list-style: none; padding: 0; display: grid; gap: 10px; margin-bottom: 28px; font-weight: 700; }
.ticks li::before { content: "✓"; display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 12px; border-radius: 50%; background: var(--lav); }
.join { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; background: var(--lav); color: var(--paper-ink); border-radius: 44px; padding: clamp(28px, 5vw, 64px); }
.join p { max-width: 36ch; }
.join__form { display: flex; flex-wrap: wrap; gap: 12px; }
.join__form input { flex: 1 1 220px; min-height: 56px; padding: 0 22px; border-radius: 999px; border: 3px solid var(--paper-ink); background: var(--paper); font: 700 var(--step-body) var(--font); color: var(--paper-ink); }
.join__msg { flex-basis: 100%; font-weight: 800; min-height: 1.5em; }

/* footer with scalloped wing edge */
.foot { margin-top: var(--gap); padding-block: 0 48px; text-align: center; display: grid; gap: 6px; color: var(--muted); }
.foot__scallop { height: 14px; width: 100%; margin: 0 0 36px; opacity: .6; overflow: hidden; }
.foot__scallop svg { display: block; margin: 0 auto; fill: var(--lav-deep); }
.foot a { color: var(--ink); text-underline-offset: 3px; margin-left: 10px; }
.foot .brand__word { color: var(--ink); }

/* reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.peek figure.reveal:not(.in) { opacity: 0; }

@media (max-width: 900px) {
  .hero, .feel__panel, .join { grid-template-columns: 1fr; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .card--lav, .card--pink, .card--img { grid-column: span 2; }
  .card--gold, .card--night { grid-column: span 1; grid-row: span 1; }
  .card--img { grid-row: span 1; aspect-ratio: 4/3; }
  .shelf { grid-template-columns: 1fr; }
  .peek { grid-template-columns: repeat(2, 1fr); }
  .bar__nav { display: none; } .bar .btn { margin-left: auto; }
  .hero__art { order: -1; width: min(78%, 360px); }
  .feel__art { max-width: 280px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee__track, .star, .hl__brush { animation: none; }
  .hl__brush { transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .tilt, .breath i { transition: none; }
}

/* gift pages */
.gift { padding-block: 24px 0; }
.gift .join { margin-top: 28px; }
.games { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 28px 0 0; }
.game { background: var(--surface); border-radius: var(--r); padding: 28px; border: 3px dashed rgba(201, 182, 232, .35); display: flex; flex-direction: column; align-items: flex-start; }
.game > :first-child { margin-top: 0; }
.game > :last-child { margin-bottom: 0; }
.game .btn { margin-top: auto; }
.game p:not(.tag):not(:last-child) { margin-bottom: 26px; }
.game h3 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.8rem); margin-bottom: 6px; }
@media (max-width: 900px) { .games { grid-template-columns: 1fr; } .join { grid-template-columns: 1fr; } }
