/* ========================================================================
   Afro Panda — Design System (Canopy Era)
   Brand: Created by Black storytellers. Built for every child. Ages 2–6.
   Last updated: 2026-05-08
   ======================================================================== */

/* ------------------------------------------------------------------------
   1. TOKENS — colors, type, spacing, radius, shadow, motion
   ------------------------------------------------------------------------ */
:root {
  /* Brand palette — locked per Brand Bible v1.2 */
  --c-yellow:      #FFD966;  /* Sunshine Yellow */
  --c-tangerine:   #FF6B4A;  /* Tangerine */
  --c-mint:        #6BD4A8;  /* Mint */
  --c-sky:         #5BB8FF;  /* Sky Blue */
  --c-purple:      #B57BFF;  /* Soft Purple */
  --c-warm-white:  #FFFDF5;  /* Warm White (canvas) */

  /* Tonal neutrals — warm-biased, never cold gray */
  --c-ink:         #2A2018;  /* primary text */
  --c-ink-muted:   #5C4A3A;  /* secondary text */
  --c-ink-soft:    #9A8674;  /* tertiary text */
  --c-line:        #EFE5D4;  /* hairline borders */
  --c-surface:     #FFFFFF;  /* card / panel bg */
  --c-shade:       #FBF5E7;  /* subtle warm shade */

  /* Semantic accents (use sparingly) */
  --c-accent:      var(--c-tangerine);   /* primary CTA */
  --c-accent-2:    var(--c-sky);         /* secondary CTA */
  --c-focus:       #2D7FFF;              /* focus ring */

  /* Typography */
  --font-display:  "Fredoka One", "Fredoka", system-ui, sans-serif;
  --font-body:     "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --fs-xs:   0.75rem;   /* 12 */
  --fs-sm:   0.875rem;  /* 14 */
  --fs-md:   1rem;      /* 16 */
  --fs-lg:   1.125rem;  /* 18 */
  --fs-xl:   1.375rem;  /* 22 */
  --fs-2xl:  1.75rem;   /* 28 */
  --fs-3xl:  2.5rem;    /* 40 */
  --fs-4xl:  3.5rem;    /* 56 */
  --fs-5xl:  4.5rem;    /* 72 — display */

  --lh-tight:  1.1;
  --lh-snug:   1.3;
  --lh-base:   1.6;
  --lh-loose:  1.8;

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  /* Spacing scale — 8pt grid */
  --s-1:   0.25rem;   /* 4 */
  --s-2:   0.5rem;    /* 8 */
  --s-3:   0.75rem;   /* 12 */
  --s-4:   1rem;      /* 16 */
  --s-5:   1.5rem;    /* 24 */
  --s-6:   2rem;      /* 32 */
  --s-7:   3rem;      /* 48 */
  --s-8:   4rem;      /* 64 */
  --s-9:   6rem;      /* 96 */
  --s-10:  8rem;      /* 128 */

  /* Radius — soft and friendly, never sharp */
  --r-sm:  8px;
  --r-md:  16px;
  --r-lg:  24px;
  --r-xl:  32px;
  --r-pill: 9999px;

  /* Shadows — warm-tinted, soft */
  --sh-sm:  0 1px 2px rgba(42, 32, 24, 0.06);
  --sh-md:  0 4px 12px rgba(42, 32, 24, 0.08);
  --sh-lg:  0 12px 32px rgba(42, 32, 24, 0.12);
  --sh-xl:  0 24px 60px rgba(42, 32, 24, 0.16);

  /* Motion */
  --t-fast:    120ms;
  --t-base:    200ms;
  --t-slow:    400ms;
  --easing:    cubic-bezier(0.4, 0, 0.2, 1);
  --easing-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --container:    1200px;
  --container-narrow: 880px;
  --gutter:       clamp(1rem, 4vw, 2.5rem);

  /* Z-index */
  --z-nav:    100;
  --z-modal:  200;
  --z-toast:  300;
}

/* ------------------------------------------------------------------------
   2. RESET + BASE
   ------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-base);
  color: var(--c-ink);
  background: var(--c-warm-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Prevents horizontal scroll on mobile when blobs/stickers/marquees
     extend slightly past the viewport edge. overflow-x: clip preserves
     position: sticky on the header (which overflow: hidden would break). */
  overflow-x: clip;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: 4px; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
button:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }

ul, ol { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  color: var(--c-ink);
}

h1 { font-size: clamp(var(--fs-3xl), 6vw, var(--fs-5xl)); }
h2 { font-size: clamp(var(--fs-2xl), 4vw, var(--fs-4xl)); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); font-family: var(--font-body); font-weight: var(--fw-semibold); }

p { max-width: 60ch; }
p + p { margin-top: var(--s-4); }

::selection { background: var(--c-yellow); color: var(--c-ink); }

/* ------------------------------------------------------------------------
   3. LAYOUT PRIMITIVES
   ------------------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: var(--container-narrow); }

.section {
  padding-block: clamp(var(--s-7), 8vw, var(--s-10));
  position: relative;
  /* Clip decorative blobs to section bounds — prevents horizontal scroll on mobile */
  overflow: clip;
}

.section--shade { background: var(--c-shade); }

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }
.stack-xl > * + * { margin-top: var(--s-8); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-tangerine);
  margin-bottom: var(--s-3);
}

.lead {
  font-size: var(--fs-lg);
  line-height: var(--lh-base);
  color: var(--c-ink-muted);
  max-width: 56ch;
}

/* ------------------------------------------------------------------------
   4. HEADER + NAV
   ------------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: rgba(255, 253, 245, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--c-line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--s-3);
  gap: var(--s-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--c-ink);
}

.brand__logo {
  height: 36px;
  width: auto;
  display: block;
}

@media (max-width: 480px) {
  .brand__logo { height: 30px; }
}

.nav {
  display: flex;
  gap: var(--s-5);
  font-family: var(--font-body);
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
}

.nav a {
  color: var(--c-ink-muted);
  padding-block: var(--s-2);
  position: relative;
  transition: color var(--t-base) var(--easing);
}

.nav a:hover { color: var(--c-ink); }

.nav a[aria-current="page"] {
  color: var(--c-ink);
}

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 3px;
  background: var(--c-tangerine);
  border-radius: var(--r-pill);
}

/* Hamburger toggle — hidden on desktop, shown on mobile */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  background: var(--c-shade);
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--c-ink);
  transition: background var(--t-base) var(--easing);
}

.nav-toggle:hover { background: var(--c-yellow); }

@media (max-width: 720px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* Mobile drawer — slides in from right, full-height card */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(20, 14, 8, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  opacity: 0;
  transition: opacity var(--t-base) var(--easing);
}

.nav-drawer[data-open="true"] {
  display: block;
  opacity: 1;
}

.nav-drawer__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(86vw, 380px);
  background: var(--c-warm-white);
  padding: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  transform: translateX(100%);
  transition: transform var(--t-base) var(--easing);
  box-shadow: var(--sh-xl);
}

.nav-drawer[data-open="true"] .nav-drawer__panel {
  transform: translateX(0);
}

.nav-drawer__close {
  align-self: flex-end;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  background: var(--c-shade);
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--c-ink);
}

.nav-drawer__links {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.nav-drawer__links a {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  color: var(--c-ink);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  transition: background var(--t-base) var(--easing);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-drawer__links a:hover,
.nav-drawer__links a[aria-current="page"] {
  background: var(--c-yellow);
}

.nav-drawer__links a::after {
  content: "→";
  opacity: 0.4;
  transition: transform var(--t-base) var(--easing-bounce), opacity var(--t-base);
}

.nav-drawer__links a:hover::after {
  opacity: 1;
  transform: translateX(4px);
}

/* ------------------------------------------------------------------------
   5. BUTTONS
   ------------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-md);
  line-height: 1;
  transition:
    transform var(--t-base) var(--easing-bounce),
    box-shadow var(--t-base) var(--easing),
    background var(--t-base) var(--easing);
  white-space: nowrap;
}

.btn--primary {
  background: var(--c-tangerine);
  color: var(--c-warm-white);
  box-shadow: var(--sh-md);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-lg);
  background: #ff5832;
}

.btn--secondary {
  background: var(--c-warm-white);
  color: var(--c-ink);
  border: 2px solid var(--c-ink);
}
.btn--secondary:hover {
  transform: translateY(-2px);
  background: var(--c-yellow);
  border-color: var(--c-ink);
}

.btn--ghost {
  color: var(--c-ink);
  padding-inline: var(--s-3);
}
.btn--ghost:hover {
  background: var(--c-shade);
}

/* ------------------------------------------------------------------------
   6. HERO — full-bleed immersive image, text in negative space
   Image dominates. Text in upper-left over sky (the cleanest negative space).
   ------------------------------------------------------------------------ */
.hero {
  position: relative;
  margin-top: var(--s-4);
  border-radius: var(--r-xl);
  overflow: hidden;
  isolation: isolate;
  /* Aspect ratio mirrors the image; clamps height on giant screens */
  height: clamp(560px, 78vh, 820px);
  box-shadow: var(--sh-lg);
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Subtle scrim only at the top — protects text contrast in upper-left
   without darkening the characters in the lower-center of the frame */
.hero__media::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top left,
      rgba(20, 14, 8, 0.55) 0%,
      rgba(20, 14, 8, 0.25) 28%,
      rgba(20, 14, 8, 0) 60%);
  pointer-events: none;
}

.hero__copy {
  position: relative;
  z-index: 1;
  padding: clamp(var(--s-6), 5vw, var(--s-8));
  max-width: 560px;
  color: var(--c-warm-white);
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.hero__copy-top { /* sits in upper-left negative space */ }

.hero__copy-bottom {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-4);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(var(--fs-3xl), 7vw, var(--fs-5xl));
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--c-warm-white);
  text-shadow: 0 2px 24px rgba(20, 14, 8, 0.45);
}

/* Yellow blob highlight behind accent word — readable over scrim */
.hero__title .accent {
  position: relative;
  display: inline-block;
  z-index: 0;
  color: var(--c-ink);
}
.hero__title .accent::before {
  content: "";
  position: absolute;
  inset: 6% -8% -4% -8%;
  background: var(--c-yellow);
  border-radius: 56% 44% 60% 40% / 50% 60% 40% 50%;
  z-index: -1;
  transform: rotate(-2deg);
  box-shadow: 0 2px 12px rgba(20,14,8,0.18);
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: clamp(var(--fs-md), 1.6vw, var(--fs-lg));
  line-height: var(--lh-snug);
  color: rgba(255, 253, 245, 0.95);
  margin-top: var(--s-5);
  max-width: 36ch;
  text-shadow: 0 1px 14px rgba(20, 14, 8, 0.5);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

/* Floating stickers — placed in negative space (upper-right & lower-right),
   never over characters (which sit left-of-center). */
.sticker {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-warm-white);
  font-family: var(--font-display);
  font-size: var(--fs-md);
  color: var(--c-ink);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-md);
  border: 2px solid var(--c-ink);
  z-index: 2;
  pointer-events: none;
  white-space: nowrap;
}

.sticker--ages {
  top: 6%;
  right: 5%;
  background: var(--c-tangerine);
  color: var(--c-warm-white);
  border-color: var(--c-warm-white);
  transform: rotate(6deg);
}

.sticker--canopy {
  bottom: 7%;
  right: 5%;
  background: var(--c-sky);
  color: var(--c-ink);
  transform: rotate(-4deg);
}

@media (max-width: 720px) {
  /* Stacked mobile hero: image card on top, copy card below.
     Replaces the desktop full-bleed overlay so the 16:9 hero image
     reads well at narrow widths and the CTAs / stickers don't collide. */
  .hero {
    height: auto;
    display: flex;
    flex-direction: column;
  }
  .hero__media {
    position: relative;
    inset: auto;
    aspect-ratio: 16 / 9;
    width: 100%;
    flex-shrink: 0;
  }
  .hero__media::before { display: none; } /* scrim not needed when copy isn't overlaid */
  .hero__copy {
    position: relative;
    height: auto;
    max-width: none;
    padding: var(--s-6) var(--s-5);
    background: linear-gradient(180deg, #2A2018 0%, #1A130D 100%);
  }
  .hero__copy-top { margin-bottom: var(--s-2); }
  .hero__copy-bottom { margin-top: var(--s-5); }

  /* Stickers float over the image only, never over the copy block.
     Both anchor to top of .hero so they sit on the image area. */
  .sticker { font-size: var(--fs-sm); padding: var(--s-2) var(--s-3); }
  .sticker--ages {
    top: var(--s-3);
    right: var(--s-3);
    bottom: auto;
    left: auto;
  }
  .sticker--canopy {
    top: var(--s-3);
    left: var(--s-3);
    bottom: auto;
    right: auto;
  }
}

/* Hand-drawn squiggle under hero accent word */
.squiggle {
  display: block;
  width: 100%;
  height: 14px;
  margin-top: -6px;
  color: var(--c-tangerine);
}

/* ------------------------------------------------------------------------
   6b. MARQUEE — playful brand-word strip below the hero
   ------------------------------------------------------------------------ */
.marquee {
  margin-top: var(--s-7);
  background: var(--c-ink);
  color: var(--c-warm-white);
  padding-block: var(--s-3);
  border-radius: var(--r-pill);
  overflow: hidden;
  position: relative;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  letter-spacing: 0.04em;
  display: flex;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.marquee__track {
  display: inline-flex;
  gap: var(--s-7);
  padding-right: var(--s-7);
  animation: marquee 28s linear infinite;
  flex-shrink: 0;
}

.marquee__dot { color: var(--c-yellow); display: inline-block; transform: translateY(-3px); }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
}

/* ------------------------------------------------------------------------
   6c. COLOR BLOB — soft decorative shape behind sections
   ------------------------------------------------------------------------ */
.blob {
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 56% 44% 60% 40% / 50% 60% 40% 50%;
  filter: blur(40px);
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
}
.blob--yellow { background: var(--c-yellow); }
.blob--mint   { background: var(--c-mint); }
.blob--purple { background: var(--c-purple); }
.blob--sky    { background: var(--c-sky); }
.blob--orange { background: var(--c-tangerine); }

.section { position: relative; isolation: isolate; }

/* ------------------------------------------------------------------------
   7. CHARACTER CARD — staggered + tilted for personality
   ------------------------------------------------------------------------ */
.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-5);
}

.cast-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition:
    transform var(--t-base) var(--easing-bounce),
    box-shadow var(--t-base) var(--easing);
  position: relative;
}

/* Each card sits at a slightly different rotation -- breaks the grid feel */
.cast-card:nth-child(1) { transform: rotate(-1deg); }
.cast-card:nth-child(2) { transform: rotate( 1deg); }
.cast-card:nth-child(3) { transform: rotate(-1.5deg); }
.cast-card:nth-child(4) { transform: rotate( 0.5deg); }

.cast-card:hover {
  transform: translateY(-6px) rotate(0deg);
  box-shadow: var(--sh-lg);
}

/* Background color blob behind each card image, tinted per character */
.cast-card[data-accent="ap"] .cast-card__img      { background: #FFF4D8; }
.cast-card[data-accent="sheldon"] .cast-card__img { background: #DCF6EB; }
.cast-card[data-accent="kawaii"] .cast-card__img  { background: #FFE0D6; }
.cast-card[data-accent="arias"] .cast-card__img   { background: #DCEFFF; }

.cast-card__img {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.cast-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--easing);
}

.cast-card:hover .cast-card__img img {
  transform: scale(1.04);
}

.cast-card__body {
  padding: var(--s-5);
}

.cast-card__name {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  line-height: var(--lh-tight);
  color: var(--c-ink);
}

.cast-card__role {
  display: inline-block;
  margin-top: var(--s-1);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-tangerine);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cast-card__bio {
  margin-top: var(--s-3);
  color: var(--c-ink-muted);
  font-size: var(--fs-md);
  line-height: var(--lh-base);
}

/* Accent bar — varies per character (slot via inline style or modifier) */
.cast-card[data-accent="ap"]      { border-top: 6px solid var(--c-yellow); }
.cast-card[data-accent="sheldon"] { border-top: 6px solid var(--c-mint); }
.cast-card[data-accent="kawaii"]  { border-top: 6px solid var(--c-tangerine); }
.cast-card[data-accent="arias"]   { border-top: 6px solid var(--c-sky); }

/* ------------------------------------------------------------------------
   7a. WORLD CARD — full-bleed image with text overlay (clickable)
   ------------------------------------------------------------------------ */
.world-card {
  position: relative;
  display: block;
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 21 / 9;
  box-shadow: var(--sh-md);
  isolation: isolate;
  transition: transform var(--t-base) var(--easing), box-shadow var(--t-base) var(--easing);
}

.world-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-lg);
}

.world-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.world-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(var(--s-6), 5vw, var(--s-8));
  color: var(--c-warm-white);
  background:
    linear-gradient(180deg,
      rgba(20,14,8,0)  35%,
      rgba(20,14,8,0.75) 100%);
}

.world-card__title {
  font-family: var(--font-display);
  font-size: clamp(var(--fs-3xl), 6vw, var(--fs-5xl));
  line-height: 0.95;
  color: var(--c-warm-white);
  text-shadow: 0 2px 18px rgba(20,14,8,0.5);
  margin-top: var(--s-2);
}

.world-card__body {
  font-size: clamp(var(--fs-md), 1.4vw, var(--fs-lg));
  color: rgba(255, 253, 245, 0.95);
  margin-top: var(--s-3);
  text-shadow: 0 1px 10px rgba(20,14,8,0.5);
  max-width: 38ch;
}

.world-card__cta {
  display: inline-block;
  margin-top: var(--s-5);
  padding: var(--s-3) var(--s-5);
  background: var(--c-warm-white);
  color: var(--c-ink);
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  align-self: flex-start;
  transition: transform var(--t-base) var(--easing-bounce);
}

.world-card:hover .world-card__cta {
  transform: translateX(4px);
}

.world-card--16x9 { aspect-ratio: 16 / 9; }

@media (max-width: 720px) {
  .world-card { aspect-ratio: 4/5; }
  .world-card--16x9 { aspect-ratio: 4/5; }
}

/* ------------------------------------------------------------------------
   7b. STORYTIME SPLIT — copy left, image right (or stacked on mobile)
   ------------------------------------------------------------------------ */
.storytime-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-8);
  align-items: center;
}

@media (max-width: 880px) {
  .storytime-split { grid-template-columns: 1fr; gap: var(--s-6); }
}

.storytime-figure {
  position: relative;
  transform: rotate(-1deg);
}

.storytime-figure img {
  width: 100%;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  aspect-ratio: 16/9;
  object-fit: cover;
}

.storytime-figure::before {
  content: "";
  position: absolute;
  inset: -12px -12px -12px -12px;
  border: 3px dashed var(--c-tangerine);
  border-radius: var(--r-lg);
  z-index: -1;
  transform: rotate(2deg);
  opacity: 0.5;
}

/* ------------------------------------------------------------------------
   7c. TREE LAYERS — three-layer breakdown of the Great Tree
   ------------------------------------------------------------------------ */
.tree-layers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}

@media (max-width: 720px) {
  .tree-layers { grid-template-columns: 1fr; }
}

.layer-card {
  background: var(--c-surface);
  padding: var(--s-6);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  transition:
    transform var(--t-base) var(--easing-bounce),
    box-shadow var(--t-base) var(--easing);
  position: relative;
  overflow: hidden;
}

.layer-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-md);
}

.layer-card__num {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  color: var(--c-yellow);
  line-height: 1;
  margin-bottom: var(--s-3);
  letter-spacing: -0.02em;
  -webkit-text-stroke: 2px var(--c-ink);
  text-stroke: 2px var(--c-ink);
}

.layer-card:nth-child(1) .layer-card__num { color: var(--c-yellow); }
.layer-card:nth-child(2) .layer-card__num { color: var(--c-mint); }
.layer-card:nth-child(3) .layer-card__num { color: var(--c-sky); }

.layer-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  color: var(--c-ink);
  margin-bottom: var(--s-3);
  letter-spacing: -0.01em;
}

.layer-card p {
  color: var(--c-ink-muted);
  font-size: var(--fs-md);
  line-height: var(--lh-base);
}

/* ------------------------------------------------------------------------
   8. VIDEO TILE / GRID
   ------------------------------------------------------------------------ */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-5);
}

.video-tile {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition:
    transform var(--t-base) var(--easing-bounce),
    box-shadow var(--t-base) var(--easing);
}

.video-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-lg);
}

.video-tile__thumb {
  aspect-ratio: 16 / 9;
  background: var(--c-shade);
  position: relative;
  overflow: hidden;
}

.video-tile__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-tile__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(42,32,24,0) 50%, rgba(42,32,24,0.4) 100%);
  color: var(--c-warm-white);
  font-size: 3rem;
  opacity: 0;
  transition: opacity var(--t-base) var(--easing);
}

.video-tile:hover .video-tile__play { opacity: 1; }

.video-tile__body { padding: var(--s-4) var(--s-5) var(--s-5); }
.video-tile__title { font-family: var(--font-body); font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: var(--lh-snug); }

/* ------------------------------------------------------------------------
   9. SECTION INTRO (eyebrow + title + lead, centered or left)
   ------------------------------------------------------------------------ */
.section-intro {
  margin-bottom: var(--s-7);
  max-width: 720px;
}

.section-intro--center {
  margin-inline: auto;
  text-align: center;
}

.section-intro--center .lead { margin-inline: auto; }

/* ------------------------------------------------------------------------
   10. FOOTER
   ------------------------------------------------------------------------ */
.site-footer {
  background: var(--c-ink);
  color: var(--c-warm-white);
  padding-block: var(--s-8);
  margin-top: var(--s-9);
}

.site-footer a { color: rgba(255,253,245,0.8); transition: color var(--t-base) var(--easing); }
.site-footer a:hover { color: var(--c-yellow); }

.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--s-6);
}

@media (max-width: 720px) {
  .site-footer__grid { grid-template-columns: 1fr; }
}

.site-footer__brand {
  margin-bottom: var(--s-4);
  display: inline-block;
  background: var(--c-warm-white);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
}

.site-footer__brand img {
  height: 72px;
  width: auto;
  display: block;
}
.site-footer__group h4 { color: var(--c-warm-white); margin-bottom: var(--s-3); font-size: var(--fs-md); }
.site-footer__group ul { display: grid; gap: var(--s-2); font-size: var(--fs-sm); }

.site-footer__legal {
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid rgba(255,253,245,0.1);
  font-size: var(--fs-xs);
  color: rgba(255,253,245,0.5);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
}

/* ------------------------------------------------------------------------
   10b. STORY DECK — vertical-slide modal (Apple Stories format)
   Used for character bios and non-video storybooks.
   ------------------------------------------------------------------------ */
.story-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(20, 14, 8, 0.94);
  display: none;
  opacity: 0;
  transition: opacity var(--t-base) var(--easing);
}

.story-modal[data-open="true"] {
  display: block;
  opacity: 1;
}

.story-modal__viewport {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.story-modal__close {
  position: fixed;
  top: env(safe-area-inset-top, 16px);
  right: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  background: rgba(255, 253, 245, 0.16);
  color: var(--c-warm-white);
  font-size: 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  transition: background var(--t-base) var(--easing);
}

.story-modal__close:hover { background: rgba(255, 253, 245, 0.28); }

.story-progress {
  position: fixed;
  top: env(safe-area-inset-top, 16px);
  left: 16px;
  right: 76px;
  z-index: 2;
  display: flex;
  gap: 4px;
}

.story-progress__bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 253, 245, 0.22);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.story-progress__bar.is-active::after,
.story-progress__bar.is-done::after {
  content: "";
  display: block;
  height: 100%;
  background: var(--c-warm-white);
  border-radius: var(--r-pill);
  transform-origin: left;
  animation: storyProgress var(--story-duration, 5s) linear forwards;
}

.story-progress__bar.is-done::after {
  width: 100%;
  animation: none;
}

@keyframes storyProgress {
  from { width: 0; }
  to   { width: 100%; }
}

.story-slide {
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  width: 100%;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(var(--s-7), 8vw, var(--s-10)) var(--s-5);
  isolation: isolate;
  color: var(--c-warm-white);
  overflow: hidden;
}

/* Slide background variants */
.story-slide--image {
  padding: 0;
}
.story-slide--image .story-slide__bg {
  position: absolute; inset: 0; z-index: -1;
}
.story-slide--image .story-slide__bg img {
  width: 100%; height: 100%; object-fit: cover;
}
.story-slide--image::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  /* Bottom-anchored scrim — strong dark band where text sits.
     Works on warm-white-bg images (portraits) AND scenic backgrounds. */
  background:
    linear-gradient(180deg,
      rgba(20,14,8,0)    0%,
      rgba(20,14,8,0)   30%,
      rgba(20,14,8,0.55) 55%,
      rgba(20,14,8,0.92) 100%);
}

/* Moody variant — used when text needs even more contrast over a busy image */
.story-slide--moody::after {
  background:
    linear-gradient(180deg,
      rgba(20,14,8,0.50) 0%,
      rgba(20,14,8,0.40) 40%,
      rgba(20,14,8,0.92) 100%);
}

/* Default content placement on image slides: bottom 30% of frame */
.story-slide--image .story-slide__content {
  align-self: end;
  margin-bottom: clamp(var(--s-7), 12vh, var(--s-10));
}

.story-slide--solid-yellow   { background: linear-gradient(180deg, #FFD966 0%, #FFB940 100%); color: var(--c-ink); }
.story-slide--solid-mint     { background: linear-gradient(180deg, #6BD4A8 0%, #3FB582 100%); color: var(--c-ink); }
.story-slide--solid-tangerine{ background: linear-gradient(180deg, #FF8B6F 0%, #FF5832 100%); }
.story-slide--solid-sky      { background: linear-gradient(180deg, #5BB8FF 0%, #2D7FFF 100%); }
.story-slide--solid-purple   { background: linear-gradient(180deg, #B57BFF 0%, #8A4DE6 100%); }
.story-slide--solid-ink      { background: linear-gradient(180deg, #2A2018 0%, #14100A 100%); }

.story-slide__content {
  max-width: 600px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.story-slide__eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: var(--s-3);
}

.story-slide__title {
  font-family: var(--font-display);
  font-size: clamp(var(--fs-3xl), 9vw, var(--fs-5xl));
  line-height: 1;
  letter-spacing: -0.02em;
  /* Explicit color — beats the global h2 { color: --c-ink } rule */
  color: var(--c-warm-white);
  text-shadow: 0 2px 24px rgba(20,14,8,0.7), 0 1px 2px rgba(20,14,8,0.5);
}

.story-slide__body {
  font-size: clamp(var(--fs-lg), 3vw, var(--fs-2xl));
  line-height: var(--lh-snug);
  margin-top: var(--s-5);
  font-weight: var(--fw-medium);
  max-width: 28ch;
  margin-inline: auto;
  color: var(--c-warm-white);
  text-shadow: 0 1px 16px rgba(20,14,8,0.7), 0 1px 2px rgba(20,14,8,0.5);
}

.story-slide__eyebrow {
  color: var(--c-warm-white);
  text-shadow: 0 1px 12px rgba(20,14,8,0.7);
}

.story-slide__caption {
  position: absolute;
  bottom: var(--s-7);
  left: 0; right: 0;
  text-align: center;
  font-size: var(--fs-sm);
  opacity: 0.7;
  z-index: 1;
}

.story-slide__cta {
  margin-top: var(--s-7);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-6);
  background: var(--c-warm-white);
  color: var(--c-ink);
  border-radius: var(--r-pill);
  font-weight: var(--fw-semibold);
}

/* Tap zones for advance/back (full-screen invisible buttons) */
.story-slide__tap {
  position: absolute;
  top: 0; bottom: 0;
  width: 30%;
  z-index: 3;
  background: transparent;
  cursor: pointer;
}
.story-slide__tap--prev { left: 0; }
.story-slide__tap--next { right: 0; }

/* Cast card becomes a button when stories are wired */
.cast-card--clickable {
  cursor: pointer;
  border: 0;
  background: var(--c-surface);
  text-align: left;
  font: inherit;
  width: 100%;
  display: block;
}
.cast-card--clickable:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 4px;
}

/* ------------------------------------------------------------------------
   10c. STORYBOOK — slide variant + card grid
   Same modal infrastructure as bios; smaller display type, prose body.
   ------------------------------------------------------------------------ */
.story-slide--storybook .story-slide__content {
  max-width: 540px;
}

/* Smaller, more readable display title for storybook pages */
.story-slide__title--story {
  font-size: clamp(var(--fs-2xl), 6vw, var(--fs-4xl));
  line-height: 1;
}

/* Prose body for story pages — bigger than normal body, reads as story text */
.story-slide__story {
  font-family: var(--font-body);
  font-size: clamp(var(--fs-lg), 3.4vw, var(--fs-2xl));
  line-height: 1.4;
  font-weight: var(--fw-medium);
  color: var(--c-warm-white);
  text-shadow: 0 1px 16px rgba(20,14,8,0.7), 0 1px 2px rgba(20,14,8,0.5);
  max-width: 22ch;
  margin-inline: auto;
}

.story-slide__story + .story-slide__story {
  margin-top: var(--s-4);
}

/* Storybook card — used on Storytime page to launch a storybook deck */
.storybook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-5);
}

.storybook-card {
  background: var(--c-surface);
  border: 0;
  text-align: left;
  font: inherit;
  width: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  cursor: pointer;
  transition:
    transform var(--t-base) var(--easing-bounce),
    box-shadow var(--t-base) var(--easing);
  display: block;
  position: relative;
}

.storybook-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-lg);
}

.storybook-card:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 4px;
}

.storybook-card__cover {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  position: relative;
}

.storybook-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--easing);
}

.storybook-card:hover .storybook-card__cover img {
  transform: scale(1.04);
}

.storybook-card__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,14,8,0) 50%, rgba(20,14,8,0.55) 100%);
  pointer-events: none;
}

.storybook-card__overlay {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  padding: var(--s-5);
  color: var(--c-warm-white);
}

.storybook-card__label {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-yellow);
  margin-bottom: var(--s-2);
  text-shadow: 0 1px 8px rgba(20,14,8,0.6);
}

.storybook-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  line-height: 1;
  text-shadow: 0 2px 16px rgba(20,14,8,0.6);
}

.storybook-card__body {
  padding: var(--s-4) var(--s-5) var(--s-5);
}

.storybook-card__desc {
  color: var(--c-ink-muted);
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
}

.storybook-card__cta {
  display: inline-block;
  margin-top: var(--s-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-tangerine);
}

/* ------------------------------------------------------------------------
   11. UTILITIES
   ------------------------------------------------------------------------ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-balance { text-wrap: balance; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
