/* ===========================================================================
   Evie & Theo — whimsical, colorful storybook builder
   =========================================================================== */

:root {
  --pink: #ff7eb6;
  --purple: #a48cf0;
  --blue: #6cc7ff;
  --teal: #5fe3c0;
  --yellow: #ffd86b;
  --orange: #ff9f6b;
  --ink: #3a2d5c;
  --ink-soft: #6b5b8f;
  --card: #ffffff;
  --cream: #fff9f0;
  --shadow: 0 12px 30px rgba(92, 60, 140, 0.18);
  --radius: 22px;
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --font-book: "Lora", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(160deg, #c8efff 0%, #e6dcff 38%, #ffe6f3 70%, #fff3dd 100%);
  background-size: 100% 220%;
  background-attachment: fixed;
  overflow-x: hidden;
  animation: sky-shift 28s ease-in-out infinite alternate;
}

@keyframes sky-shift {
  0% { background-position: 50% 0%; }
  100% { background-position: 50% 100%; }
}

/* ---- floating background ------------------------------------------------- */
.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Gentle pastel bubbles that drift up the screen — soft and dreamy rather than
   busy. Each bubble is a translucent orb (white highlight + a pastel tint) that
   rises slowly with a slight sway, fading in and out. Negative animation-delays
   mean the screen is already populated on load instead of starting empty. */
.bubble {
  position: absolute;
  bottom: -18vh;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 32% 28%,
    rgba(255, 255, 255, 0.95),
    var(--tint, rgba(255, 255, 255, 0.4)) 45%,
    rgba(255, 255, 255, 0) 72%
  );
  opacity: 0;
  animation: rise linear infinite;
  will-change: transform, opacity;
}
@keyframes rise {
  0%   { transform: translate3d(0, 0, 0) scale(0.55); opacity: 0; }
  12%  { opacity: 0.5; }
  50%  { transform: translate3d(20px, -64vh, 0) scale(1); }
  88%  { opacity: 0.5; }
  100% { transform: translate3d(-14px, -128vh, 0) scale(1.12); opacity: 0; }
}

/* per bubble: column, size, pastel tint, speed, and a staggered (negative) delay */
.b1  { left: 6%;  width: 64px;  height: 64px;  --tint: rgba(255, 126, 182, 0.45); animation-duration: 24s; animation-delay: -2s; }
.b2  { left: 16%; width: 96px;  height: 96px;  --tint: rgba(164, 140, 240, 0.42); animation-duration: 31s; animation-delay: -14s; }
.b3  { left: 27%; width: 48px;  height: 48px;  --tint: rgba(108, 199, 255, 0.45); animation-duration: 19s; animation-delay: -7s; }
.b4  { left: 38%; width: 112px; height: 112px; --tint: rgba(95, 227, 192, 0.38);  animation-duration: 34s; animation-delay: -20s; }
.b5  { left: 49%; width: 58px;  height: 58px;  --tint: rgba(255, 216, 107, 0.45); animation-duration: 22s; animation-delay: -5s; }
.b6  { left: 60%; width: 82px;  height: 82px;  --tint: rgba(255, 126, 182, 0.4);  animation-duration: 28s; animation-delay: -17s; }
.b7  { left: 70%; width: 44px;  height: 44px;  --tint: rgba(108, 199, 255, 0.5);  animation-duration: 18s; animation-delay: -10s; }
.b8  { left: 80%; width: 100px; height: 100px; --tint: rgba(164, 140, 240, 0.4);  animation-duration: 33s; animation-delay: -3s; }
.b9  { left: 89%; width: 56px;  height: 56px;  --tint: rgba(95, 227, 192, 0.45);  animation-duration: 21s; animation-delay: -13s; }
.b10 { left: 33%; width: 70px;  height: 70px;  --tint: rgba(255, 216, 107, 0.4);  animation-duration: 26s; animation-delay: -22s; }
.b11 { left: 54%; width: 90px;  height: 90px;  --tint: rgba(108, 199, 255, 0.38); animation-duration: 30s; animation-delay: -9s; }
.b12 { left: 74%; width: 52px;  height: 52px;  --tint: rgba(255, 126, 182, 0.48); animation-duration: 20s; animation-delay: -16s; }

/* ---- layout -------------------------------------------------------------- */
main {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 18px 60px;
}

.site-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 38px 18px 10px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 4.6rem);
  margin: 0;
  line-height: 1;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--blue), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 4px 0 rgba(255, 255, 255, 0.45);
}
.logo .amp {
  -webkit-text-fill-color: var(--yellow);
  color: var(--yellow);
}
.tagline {
  font-family: var(--font-display);
  font-size: clamp(1rem, 3.6vw, 1.4rem);
  color: var(--ink-soft);
  margin: 8px 0 0;
}
.tagline em {
  color: var(--pink);
  font-style: normal;
  font-weight: 600;
}

.intro {
  text-align: center;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 6px auto 26px;
  max-width: 560px;
}

/* ---- cards / fieldsets ---------------------------------------------------- */
.card {
  background: var(--card);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 24px;
  margin: 0 0 22px;
}
.card legend {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--ink);
  padding: 6px 16px;
  background: var(--cream);
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(164, 140, 240, 0.25);
}
.hint {
  margin: 2px 0 14px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1.4fr 0.7fr 1fr;
}
.grid.two {
  grid-template-columns: 1fr 1fr;
}
.grid.main-grid {
  grid-template-columns: 1.6fr 0.8fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field:last-child {
  margin-bottom: 0;
}
.field > span,
.field-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.field-label {
  display: block;
  margin: 4px 0 10px;
}

input[type="text"],
input[type="number"],
textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: #fbfaff;
  border: 2.5px solid #ece7fb;
  border-radius: 14px;
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
textarea {
  resize: vertical;
  line-height: 1.5;
}
input::placeholder,
textarea::placeholder {
  color: #b7afca;
  font-weight: 500;
  font-style: italic;
  opacity: 1;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(164, 140, 240, 0.22);
}

/* ---- character rows ------------------------------------------------------ */
.character-row {
  display: grid;
  grid-template-columns: 1fr 1.7fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  animation: pop 0.18s ease-out;
}
.character-row .field {
  margin-bottom: 0;
}
.remove-btn {
  font-size: 1.2rem;
  line-height: 1;
  background: #fff0f5;
  border: 2.5px solid #ffd4e5;
  color: var(--pink);
  border-radius: 12px;
  height: 48px;
  width: 48px;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s;
}
.remove-btn:hover {
  background: #ffe0ec;
  transform: scale(1.06);
}

@keyframes pop {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---- flavor chips -------------------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  cursor: pointer;
}
.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.chip span {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1rem;
  padding: 10px 16px;
  border-radius: 999px;
  background: #f4f0ff;
  border: 2.5px solid #e7e0fb;
  color: var(--ink-soft);
  transition: transform 0.08s, background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover span {
  transform: translateY(-2px);
}
.chip input:checked + span {
  background: linear-gradient(90deg, var(--pink), var(--purple));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 14px rgba(164, 140, 240, 0.4);
}
.chip input:focus-visible + span {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

/* ---- art-style picker ---------------------------------------------------- */
.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.style-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px;
  border-radius: 16px;
  border: 2.5px solid #e7e0fb;
  background: #f4f0ff;
  transition: transform 0.08s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.style-card:hover {
  transform: translateY(-2px);
}
/* visually hide the radio dot but keep it focusable for keyboard users */
.style-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.style-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  background: #ece4ff;
}
.style-card span {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  text-align: center;
  color: var(--ink-soft);
  line-height: 1.2;
  transition: color 0.15s;
}
.style-card:has(input:checked) {
  background: linear-gradient(150deg, #fff4fa, #f3ecff);
  border-color: var(--purple);
  box-shadow: 0 6px 16px rgba(164, 140, 240, 0.35);
}
.style-card:has(input:checked) span {
  color: var(--ink);
  font-weight: 700;
}
.style-card:has(input:focus-visible) {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

/* ---- buttons ------------------------------------------------------------- */
.create-btn {
  display: block;
  width: 100%;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 18px 24px;
  cursor: pointer;
  background: linear-gradient(90deg, var(--orange), var(--pink), var(--purple));
  background-size: 200% auto;
  box-shadow: 0 10px 24px rgba(255, 126, 182, 0.45);
  transition: transform 0.1s, box-shadow 0.15s, background-position 0.4s;
}
.create-btn:hover {
  background-position: right center;
  transform: translateY(-2px) scale(1.01);
}
.create-btn:active {
  transform: translateY(0) scale(0.99);
}
.create-btn:disabled {
  filter: grayscale(0.4) opacity(0.7);
  cursor: wait;
}
.create-btn.small {
  font-size: 1.15rem;
  padding: 12px 28px;
  width: auto;
}

.ghost-btn {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--purple);
  background: #fff;
  border: 2.5px dashed #d9cffb;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.15s, transform 0.08s;
}
.ghost-btn:hover {
  background: #f6f1ff;
  transform: translateY(-1px);
}
.ghost-btn.big {
  font-size: 1.15rem;
  padding: 14px 24px;
  border-style: solid;
}

/* ---- consent checkbox (sits above the human-check) ----------------------- */
.consent {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin: 6px 0 18px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-soft);
}
.consent input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  accent-color: var(--purple);
  cursor: pointer;
}

.turnstile-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 18px;
  min-height: 65px;
}

.form-error {
  background: #fff0f4;
  color: #c23d6b;
  border: 2px solid #ffd0df;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  margin: 0 0 16px;
  text-align: center;
}

/* ---- loading ------------------------------------------------------------- */
.loading {
  text-align: center;
  padding: 70px 20px;
}
.cauldron {
  font-size: 4.5rem;
  display: inline-block;
  animation: stir 1.4s ease-in-out infinite;
}
@keyframes stir {
  0%, 100% { transform: rotate(-12deg) scale(1); }
  50% { transform: rotate(12deg) scale(1.12); }
}
.loading-msg {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--ink);
  margin: 18px 0 12px;
  min-height: 1.6em;
}
.dots {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--purple);
  animation: jump 1s ease-in-out infinite;
}
.dots span:nth-child(2) { background: var(--pink); animation-delay: 0.15s; }
.dots span:nth-child(3) { background: var(--teal); animation-delay: 0.3s; }
@keyframes jump {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-12px); opacity: 1; }
}

/* ---- storybook ----------------------------------------------------------- */
.storybook {
  animation: fadein 0.5s ease;
}
@keyframes fadein {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.book {
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px clamp(24px, 6vw, 56px) 48px;
  position: relative;
  border: 1px solid #f0e6d6;
}
.book::before {
  /* a soft "spine" down the left edge */
  content: "";
  position: absolute;
  left: 14px;
  top: 24px;
  bottom: 24px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--pink), var(--purple), var(--blue));
  opacity: 0.5;
}
.story-title {
  font-family: var(--font-book);
  font-weight: 600;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  text-align: center;
  color: var(--ink);
  margin: 0 0 28px;
  line-height: 1.2;
}
.story-body {
  font-family: var(--font-book);
  font-size: clamp(1.12rem, 2.6vw, 1.3rem);
  line-height: 1.85;
  color: #2f2647;
}

/* ---- illustrated scenes -------------------------------------------------- */
.scene {
  margin: 0 0 38px;
}
.scene:last-child {
  margin-bottom: 0;
}
.scene-illus {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  box-shadow: 0 8px 20px rgba(92, 60, 140, 0.15);
  background: linear-gradient(120deg, #f3ecff, #ffe9f3, #e9f6ff);
  background-size: 200% 200%;
  animation: shimmer 2.4s ease-in-out infinite;
}
.scene-illus.ready {
  animation: none;
  background: #fff;
}
.illus-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  color: var(--ink-soft);
  font-size: 1rem;
}
.illus-emoji {
  font-size: 2.4rem;
  animation: stir 1.4s ease-in-out infinite;
}
.scene-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: fadein 0.5s ease;
}
@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.scene-text p {
  margin: 0 0 1.1em;
}
.scene-text p:last-child {
  margin-bottom: 0;
}
.scene:first-child .scene-text p:first-child::first-letter {
  font-size: 3.2em;
  font-weight: 600;
  float: left;
  line-height: 0.8;
  padding: 6px 10px 2px 0;
  color: var(--pink);
}

.book-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 26px 0 0;
}

/* ---- modal --------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(58, 45, 92, 0.45);
  backdrop-filter: blur(3px);
  padding: 20px;
  animation: fadein 0.2s ease;
}
.modal-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  max-width: 420px;
  text-align: center;
  animation: pop 0.25s ease-out;
}
.modal-emoji {
  font-size: 3rem;
}
.modal-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 8px 0 10px;
  color: var(--ink);
}
.modal-card p {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 1.08rem;
  margin: 0 0 22px;
}

/* ---- feedback ------------------------------------------------------------ */
.feedback {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px auto 0;
  padding: 14px 22px;
  max-width: 460px;
  background: #fff;
  border: 2.5px dashed #e7e0fb;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(92, 60, 140, 0.1);
}
.feedback > span {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--ink-soft);
}
.feedback button {
  font-size: 1.5rem;
  line-height: 1;
  background: #f4f0ff;
  border: 2.5px solid #e7e0fb;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
}
.feedback button:hover {
  transform: translateY(-2px) scale(1.08);
  background: #ece4ff;
}
.feedback button:active {
  transform: scale(0.96);
}
.feedback button.selected {
  background: linear-gradient(90deg, var(--pink), var(--purple));
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(164, 140, 240, 0.4);
}
.feedback button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

/* Thumbs-down comment form: turn the pill row into a tidy stacked card so the
   prompt, textarea, and a real "Send feedback" button each get their own line. */
.feedback.feedback-form {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  border-style: solid;
  border-radius: 22px;
  padding: 18px 22px;
}
.feedback-prompt {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink-soft);
  text-align: center;
}
.feedback-comment {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  border: 2px solid #e7e0fb;
  border-radius: 14px;
  padding: 10px 14px;
  resize: vertical;
}
.feedback-comment:focus-visible {
  outline: none;
  border-color: var(--purple);
}
/* A proper solid pill button (overrides the round thumbs-button styling above). */
.feedback button.feedback-send {
  align-self: center;
  width: auto;
  height: auto;
  border: none;
  border-radius: 999px;
  padding: 12px 30px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(90deg, var(--orange), var(--pink), var(--purple));
  background-size: 200% auto;
  box-shadow: 0 8px 18px rgba(255, 126, 182, 0.4);
  transition: transform 0.1s, background-position 0.4s, box-shadow 0.15s;
}
.feedback button.feedback-send:hover {
  transform: translateY(-2px) scale(1.03);
  background-position: right center;
}
.feedback button.feedback-send:active {
  transform: translateY(0) scale(0.99);
}

/* ---- standalone content pages (about / contact) -------------------------- */
.page {
  position: relative;
  z-index: 1;
}
.page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 5vw, 2.3rem);
  text-align: center;
  color: var(--ink);
  margin: 6px auto 22px;
  line-height: 1.25;
}
.prose p {
  font-size: 1.08rem;
  line-height: 1.75;
  color: #463a64;
  margin: 0 0 1em;
}
.prose p:last-child {
  margin-bottom: 0;
}
.prose-head {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--ink);
  margin: 0 0 14px;
}
.steps {
  margin: 0;
  padding-left: 1.2em;
  color: #463a64;
}
.steps li {
  font-size: 1.06rem;
  line-height: 1.7;
  margin-bottom: 10px;
}
.steps li:last-child {
  margin-bottom: 0;
}

/* ---- tip jar ------------------------------------------------------------- */
.tip-jar {
  text-align: center;
  background: linear-gradient(150deg, #fff9f0, #fff);
}
.tip-jar-emoji {
  font-size: 3rem;
  animation: bob 6s ease-in-out infinite;
}
.tip-jar .prose-head {
  margin-top: 4px;
}
.tip-jar p {
  font-size: 1.06rem;
  line-height: 1.72;
  color: #463a64;
  margin: 0 auto 1em;
  max-width: 520px;
}
.tip-soft {
  color: var(--ink-soft) !important;
  font-weight: 600;
}
.tip-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}
.tip-btn {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
  text-decoration: none;
  color: #fff;
  padding: 12px 26px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), var(--pink), var(--purple));
  background-size: 200% auto;
  box-shadow: 0 8px 18px rgba(255, 126, 182, 0.4);
  transition: transform 0.1s, box-shadow 0.15s, background-position 0.4s;
}
.tip-btn:hover {
  background-position: right center;
  transform: translateY(-2px) scale(1.03);
}
.tip-btn:active {
  transform: translateY(0) scale(0.98);
}
.tip-btn:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.back-link {
  text-align: center;
  margin: 26px 0 0;
}
.back-link a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--purple);
  text-decoration: none;
  border-bottom: 2px dashed #d9cffb;
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}
.back-link a:hover {
  color: var(--pink);
  border-color: var(--pink);
}

/* ---- logo as link (sub-pages) ------------------------------------------- */
.logo-link {
  text-decoration: none;
  display: inline-block;
}

/* ---- contact form -------------------------------------------------------- */
.optional {
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.required-mark {
  font-weight: 700;
  color: var(--pink);
  font-size: 0.85rem;
}
input[type="email"] {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: #fbfaff;
  border: 2.5px solid #ece7fb;
  border-radius: 14px;
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="email"]:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(164, 140, 240, 0.22);
}
.contact-status {
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  margin: 0 0 16px;
  text-align: center;
}
.contact-status.ok {
  background: #eafaf3;
  color: #1f8f6b;
  border: 2px solid #bdeddc;
}
.contact-status.err {
  background: #fff0f4;
  color: #c23d6b;
  border: 2px solid #ffd0df;
}

/* ---- footer -------------------------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 10px 18px 40px;
  font-size: 0.92rem;
}
.footer-links {
  margin-top: 8px;
  font-family: var(--font-display);
}
.footer-links a {
  color: var(--purple);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.footer-links a:hover {
  color: var(--pink);
  text-decoration: underline;
}
.footer-links .dot {
  margin: 0 10px;
  color: #c9bef0;
}

[hidden] {
  display: none !important;
}

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 560px) {
  .grid,
  .grid.two {
    grid-template-columns: 1fr;
  }
  .character-row {
    grid-template-columns: 1fr 1fr;
  }
  .character-row .remove-btn {
    grid-column: 2;
    justify-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .bubble,
  .cauldron,
  .dots span,
  .scene-illus,
  .illus-emoji {
    animation: none !important;
  }
}

/* ---- print: just the storybook ------------------------------------------- */
@media print {
  body {
    background: #fff;
  }
  .sky,
  .site-header,
  .site-footer,
  .builder,
  .loading,
  .book-actions,
  .feedback,
  .modal {
    display: none !important;
  }
  main {
    max-width: none;
    padding: 0;
  }
  .book {
    box-shadow: none;
    border: none;
    background: #fff;
    padding: 0;
  }
  .book::before {
    display: none;
  }
  /* don't print empty/loading illustration boxes; keep scenes intact */
  .scene-illus:not(.ready) {
    display: none;
  }
  .scene-illus {
    animation: none;
    box-shadow: none;
    border: none;
    break-inside: avoid;
  }
  .scene {
    break-inside: avoid;
  }
}

/* ---- landing hero (shown first; CTA unfurls the form) -------------------- */
.hero {
  text-align: center;
  animation: pop 0.3s ease-out;
}
.hero-lede {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.6vw, 1.6rem);
  font-weight: 500;
  color: var(--ink-soft);
  max-width: 620px;
  margin: 6px auto 22px;
  line-height: 1.4;
}
.hero-lede em {
  color: var(--pink);
  font-style: normal;
  font-weight: 700;
}

/* sample "open book" spread */
.hero-spread {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0 auto 26px;
  max-width: 720px;
}
.spread-page {
  margin: 0;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 12px;
  width: min(320px, 86vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease;
}
.spread-cover {
  transform: rotate(-1.2deg);
}
.spread-page:not(.spread-cover) {
  transform: rotate(1.2deg);
}
.spread-page:hover {
  transform: translateY(-4px) rotate(0deg);
}
.spread-page img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}
.spread-title {
  font-family: var(--font-book);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
  text-align: center;
}
.spread-text {
  font-family: var(--font-book);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
  text-align: left;
}

.hero-cta {
  display: inline-block;
  width: auto;
  margin: 4px auto 10px;
  padding: 16px 42px;
}
.hero-trust {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0 0 30px;
}

/* art-style strip */
.hero-styles {
  margin: 0 auto;
  max-width: 720px;
}
.hero-styles-label {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.hero-styles-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.hero-styles-strip img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(92, 60, 140, 0.16);
}
@media (max-width: 560px) {
  .hero-styles-strip img { width: 50px; height: 50px; }
}

/* the form gently unfurls when revealed by the hero CTA */
.builder {
  animation: unfurl 0.4s ease-out;
}
@keyframes unfurl {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
