/* ————————————————————————————————————————
   Evie's Stories — storefront design system
   Night-nursery palette, storybook type.
   ———————————————————————————————————————— */

:root {
  --midnight: #262345;
  --deep: #161430;
  --horizon: #35305f;
  --paper: #fbf4e7;
  --paper-shade: #f1e6d2;
  --ink: #33304f;
  --ink-soft: #5d5878;
  --lilac: #a9a3cf;
  --amber: #f2b25c;
  --amber-deep: #d98f3b;
  --glow: #ffd9a0;
  --moon: #ffe9c4;
  --red: #e2574c;

  --font-display: "Young Serif", "Iowan Old Style", Georgia, serif;
  --font-hand: "Caveat", cursive;
  --font-body: "Nunito", -apple-system, "Segoe UI", sans-serif;

  --radius: 18px;
  --shadow-page: 0 1px 2px rgba(38, 35, 69, 0.08), 0 12px 32px rgba(38, 35, 69, 0.14);

  /* Theme-switchable (defaults = The Giant Is Sleeping, night) */
  --hero-ink: var(--paper);
  --hero-muted: var(--lilac);
  --highlight: var(--glow);
  --label-soft: var(--lilac);
  --field-bg: rgba(251, 244, 231, 0.08);
  --field-border: rgba(169, 163, 207, 0.4);
  --field-focus-bg: rgba(251, 244, 231, 0.12);
}

/* Little Fluffy — sunny pond morning */
body[data-theme="fluffy"] {
  --deep: #1d4956;
  --midnight: #256170;
  --lilac: #abdbe2;
  --hero-ink: #16404f;
  --hero-muted: #33707f;
  --highlight: #d9701e;
  --label-soft: #6fa7b2;
  --field-bg: rgba(22, 64, 79, 0.06);
  --field-border: rgba(22, 64, 79, 0.35);
  --field-focus-bg: rgba(255, 255, 255, 0.55);
}

/* Story-scoped content: only the active book's copy is shown */
body[data-theme="giant"] [data-story="fluffy"] { display: none !important; }
body[data-theme="fluffy"] [data-story="giant"] { display: none !important; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

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

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ——— Type roles ——— */

.whisper {
  font-style: italic;
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  text-transform: lowercase;
  color: var(--lilac);
  margin: 0 0 1rem;
}

.band-paper .whisper { color: var(--ink-soft); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.15; margin: 0; }

h1 { font-size: clamp(2.1rem, 4.5vw, 3.3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }

.hand { font-family: var(--font-hand); }

/* ——— Buttons ——— */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-amber {
  background: linear-gradient(180deg, var(--glow), var(--amber));
  color: var(--deep);
  box-shadow: 0 4px 18px rgba(242, 178, 92, 0.45);
}

.btn-amber:hover { box-shadow: 0 6px 24px rgba(242, 178, 92, 0.65); transform: translateY(-1px); }

.btn-quiet {
  background: transparent;
  color: var(--paper);
  border-color: rgba(251, 244, 231, 0.4);
}

.btn-quiet:hover { border-color: var(--paper); }

.band-paper .btn-quiet { color: var(--ink); border-color: rgba(51, 48, 79, 0.35); }
.band-paper .btn-quiet:hover { border-color: var(--ink); }

/* ——— Header ——— */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(22, 20, 48, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(169, 163, 207, 0.15);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.logo .moon-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--moon), var(--amber));
  box-shadow: 0 0 12px rgba(255, 217, 160, 0.7);
}

.site-nav { display: flex; align-items: center; gap: 1.6rem; }

.site-nav a {
  color: var(--lilac);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}

.site-nav a:hover { color: var(--paper); }

.site-nav .btn { padding: 0.55rem 1.2rem; font-size: 0.9rem; color: #000; }

/* ——— Hero: the scene that swaps per book ——— */

.hero {
  position: relative;
  overflow: hidden;
  background: #100e26;
  color: var(--hero-ink);
  transition: color 0.5s ease;
}

.hero .whisper { color: var(--hero-muted); transition: color 0.5s ease; }

.sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.sky-night { background: linear-gradient(180deg, #100e26 0%, #161430 35%, #35305f 100%); }

.sky-day {
  background: linear-gradient(180deg, #7cc0e6 0%, #b3e0f2 55%, #eef7de 100%);
  opacity: 0;
}

body[data-theme="fluffy"] .sky-night { opacity: 0; }
body[data-theme="fluffy"] .sky-day { opacity: 1; }

.stars, .stars-2 {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-repeat: repeat;
  background-size: 480px 480px;
  transition: opacity 0.8s ease;
}

body[data-theme="fluffy"] .stars,
body[data-theme="fluffy"] .stars-2 { animation: none; opacity: 0; }

.stars {
  background-image:
    radial-gradient(1.6px 1.6px at 40px 60px, var(--moon) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 190px 120px, var(--lilac) 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 320px 40px, var(--moon) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 420px 200px, var(--paper) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 120px 300px, var(--paper) 50%, transparent 51%);
  animation: twinkle 5s ease-in-out infinite alternate;
}

.stars-2 {
  background-image:
    radial-gradient(1.2px 1.2px at 90px 210px, var(--lilac) 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 260px 260px, var(--moon) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 380px 340px, var(--paper) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 40px 420px, var(--moon) 50%, transparent 51%);
  animation: twinkle 7s ease-in-out infinite alternate-reverse;
}

@keyframes twinkle {
  from { opacity: 0.35; }
  to { opacity: 0.9; }
}

.moon {
  position: absolute;
  top: 72px;
  right: 12%;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fff6e3, var(--moon) 60%, #f0cf94);
  box-shadow: 0 0 60px 24px rgba(255, 217, 160, 0.28);
  animation: moonbreathe 6s ease-in-out infinite;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

body[data-theme="fluffy"] .moon { animation: none; opacity: 0; }

.sun {
  position: absolute;
  top: 60px;
  right: 13%;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff3c4, #ffd97a 55%, #f5b04c);
  box-shadow: 0 0 70px 30px rgba(255, 214, 110, 0.45);
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

body[data-theme="fluffy"] .sun { opacity: 1; }

@keyframes moonbreathe {
  0%, 100% { box-shadow: 0 0 60px 24px rgba(255, 217, 160, 0.22); }
  50% { box-shadow: 0 0 80px 34px rgba(255, 217, 160, 0.38); }
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 3rem;
  align-items: center;
  padding-top: 5rem;
  padding-bottom: 11rem;
}

.hero-copy p.lede {
  color: var(--hero-muted);
  font-size: 1.15rem;
  max-width: 46ch;
  margin: 1.2rem 0 2rem;
  transition: color 0.5s ease;
}

.hero-copy .highlight { color: var(--highlight); transition: color 0.5s ease; }

/* Story switcher — the little bookshelf at the top of the hero */

.story-switch {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 2.2rem;
}

.story-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--hero-ink);
  background: transparent;
  border: 1.5px solid var(--field-border);
  border-radius: 999px;
  padding: 0.45rem 1.1rem 0.45rem 0.55rem;
  cursor: pointer;
  transition: color 0.5s ease, border-color 0.5s ease, background 0.3s ease, transform 0.15s ease;
}

.story-tab:hover { transform: translateY(-1px); }

.story-tab .story-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.25);
}

.dot-giant {
  background:
    radial-gradient(circle at 34% 30%, #ffe9c4 0 19%, transparent 20%),
    linear-gradient(180deg, #161430, #35305f);
}

.dot-fluffy {
  background:
    radial-gradient(circle at 34% 30%, #fff0b8 0 19%, transparent 20%),
    linear-gradient(180deg, #7cc0e6, #bfe6c8);
}

.story-tab.active {
  background: linear-gradient(180deg, var(--glow), var(--amber));
  color: #3a2a10;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(242, 178, 92, 0.45);
}

/* Name fields in the hero */

.name-fields { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 1.4rem; }

.name-field { flex: 1 1 180px; }

.name-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hero-muted);
  margin-bottom: 0.4rem;
  transition: color 0.5s ease;
}

.name-field input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--hero-ink);
  background: var(--field-bg);
  border: 1.5px solid var(--field-border);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.5s ease;
}

.name-field input::placeholder { color: var(--hero-muted); opacity: 0.7; font-weight: 600; }

.name-field input:focus {
  outline: none;
  border-color: var(--amber);
  background: var(--field-focus-bg);
  box-shadow: 0 0 0 3px rgba(242, 178, 92, 0.25);
}

.hero-note { font-size: 0.85rem; color: var(--hero-muted); margin-top: 0.9rem; transition: color 0.5s ease; }

/* The live book cover */

.book-wrap { display: flex; justify-content: center; perspective: 1100px; }

.book-cover {
  width: min(320px, 78vw);
  aspect-ratio: 5 / 6.4;
  background: linear-gradient(160deg, var(--paper) 0%, var(--paper-shade) 100%);
  border-radius: 6px 14px 14px 6px;
  box-shadow:
    -14px 0 0 -6px #d84a40,
    -20px 0 0 -8px #b03a32,
    0 30px 60px rgba(0, 0, 0, 0.45);
  transform: rotateY(-9deg) rotateZ(-1.5deg);
  transition: transform 0.4s ease;
  padding: 1.6rem 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--ink);
}

.book-wrap:hover .book-cover { transform: rotateY(-3deg) rotateZ(0deg); }

.book-cover .cover-frame {
  border: 2px solid rgba(51, 48, 79, 0.25);
  border-radius: 8px;
  padding: 1.4rem 1rem;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.book-wrap.flipping .book-cover { transform: rotateY(-90deg) rotateZ(-1.5deg); }

.book-cover .cover-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.book-cover .cover-title .t-fluffy { font-size: 1.2rem; }

.book-cover .cover-art { width: 76%; margin: 0.4rem 0; }

.book-cover .cover-for {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.book-cover .cover-names {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1.1;
  color: var(--amber-deep);
  min-height: 2.2rem;
}

/* Horizon scenes pinned to hero bottom — one per book, crossfaded */

.scene {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

body[data-theme="fluffy"] .castle-scene { opacity: 0; }
body[data-theme="giant"] .pond-scene { opacity: 0; }

/* ——— Bands ——— */

.band-paper { background: var(--paper); color: var(--ink); padding: 5rem 0; }

.band-paper.shaded { background: var(--paper-shade); }

.band-night {
  background: var(--midnight);
  color: var(--paper);
  padding: 5rem 0;
  transition: background-color 0.6s ease;
}

.band-head { max-width: 620px; margin-bottom: 2.8rem; }

.band-head p { color: var(--ink-soft); margin: 0.8rem 0 0; }

.band-night .band-head p { color: var(--lilac); }

/* ——— Peek inside: book pages ——— */

.spread {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.6rem;
}

.page {
  background: #fffdf7;
  border-radius: var(--radius);
  box-shadow: var(--shadow-page);
  padding: 2rem 1.8rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  position: relative;
}

.page::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(51, 48, 79, 0.08);
  border-radius: calc(var(--radius) - 8px);
  pointer-events: none;
}

.page-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--label-soft);
}

.page-art { margin: 0.2rem auto; width: 64%; }

.page-text { margin: 0; line-height: 1.65; }

.page-text .name { font-weight: 800; color: var(--amber-deep); }

.page-action {
  margin-top: auto;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* The loud page — typography acts out the story */

.page.loud { justify-content: center; text-align: center; background: #fffaf0; }

.page.loud .boo {
  font-family: var(--font-display);
  color: var(--red);
  line-height: 1;
  margin: 0.2rem 0;
}

.boo-1 { font-size: 1.8rem; }
.boo-2 { font-size: 2.4rem; }
.boo-3 { font-size: clamp(2.2rem, 8vw, 3rem); letter-spacing: -0.01em; }

.page.loud .boo-note { font-style: italic; font-size: 0.85rem; color: var(--ink-soft); margin: 0; }

/* Little Fluffy's joyful page — WHEE down the castle slide */

.page.loud .whee {
  font-family: var(--font-display);
  color: var(--amber-deep);
  line-height: 1;
  margin: 0.2rem 0;
}

.whee-1 { font-size: 1.5rem; }
.whee-2 { font-size: 1.9rem; }
.whee-3 { font-size: clamp(1.8rem, 5vw, 2.3rem); }

.peek-note { text-align: center; color: var(--ink-soft); font-size: 0.9rem; margin-top: 2rem; }

/* ——— Signature page section ——— */

.signature-card {
  background: #fffdf7;
  border-radius: var(--radius);
  box-shadow: var(--shadow-page);
  max-width: 560px;
  margin: 0 auto;
  padding: 2.6rem 2.4rem;
  text-align: center;
}

.signature-card .sig-heading { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 2rem; }

.sig-line { margin: 1.8rem auto 0; max-width: 340px; }

.sig-line .sig-name {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: 2.1rem;
  color: var(--ink);
  border-bottom: 2px solid rgba(51, 48, 79, 0.35);
  padding: 0 1.4rem 0.2rem;
  display: inline-block;
  min-width: 200px;
  transform: rotate(-1.2deg);
}

.sig-line .sig-role {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ——— How it works ——— */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  counter-reset: step;
}

.step { counter-increment: step; }

.step::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: rgba(242, 178, 92, 0.15);
  border: 1.5px solid var(--amber);
  color: var(--glow);
  font-weight: 800;
  margin-bottom: 0.9rem;
}

.step h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }

.step p { margin: 0; color: var(--lilac); font-size: 0.95rem; }

/* ——— Pricing ——— */

.prices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.6rem;
  align-items: stretch;
}

.price-card {
  background: #fffdf7;
  border-radius: var(--radius);
  box-shadow: var(--shadow-page);
  padding: 2.2rem 1.8rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  position: relative;
}

.price-card h3 { font-size: 1.2rem; }

.price-card .amount { font-family: var(--font-display); font-size: 2.4rem; color: var(--ink); }

.price-card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; flex-grow: 1; }

.price-card .btn { margin-top: 1rem; align-self: center; }

.price-card.featured { border: 2px solid var(--amber); }

.price-card .ribbon {
  position: absolute;
  top: -0.85rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
}

/* ——— Ask the Story Helper ——— */

.chat-cta { text-align: center; position: relative; overflow: hidden; }

/* a faint scatter of stars behind the invitation */
.chat-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 8% 30%, var(--moon) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 22% 70%, var(--lilac) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 78% 24%, var(--paper) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 90% 62%, var(--moon) 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 64% 82%, var(--lilac) 50%, transparent 51%);
  opacity: 0.5;
}

.chat-cta .container { position: relative; }

.chat-cta .band-head { margin: 0 auto 0; }

.chat-cta .chat-cta-lede {
  color: var(--lilac);
  max-width: 46ch;
  margin: 1rem auto 2rem;
}

.btn-big { font-size: 1.1rem; padding: 1rem 2.2rem; }

.chat-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.chat-chip {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--paper);
  background: rgba(251, 244, 231, 0.06);
  border: 1.5px solid rgba(169, 163, 207, 0.4);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.chat-chip:hover {
  border-color: var(--amber);
  background: rgba(242, 178, 92, 0.12);
  transform: translateY(-1px);
}

/* ——— Footer ——— */

.site-footer {
  background: var(--deep);
  color: var(--lilac);
  padding: 2.6rem 0;
  font-size: 0.9rem;
  transition: background-color 0.6s ease;
  padding-bottom: 150px;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer .hand { font-size: 1.3rem; color: var(--paper); }

/* ——— Responsive ——— */

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding-top: 3.5rem;
    padding-bottom: 9rem;
    gap: 2.5rem;
  }
  .moon { top: 40px; right: 8%; width: 64px; height: 64px; }
  .site-nav a.nav-link { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stars, .stars-2, .moon { animation: none; }
  .book-cover, .btn, .sky, .scene, .sun, .moon, .stars, .stars-2 { transition: none; }
}
