/* =========================================================
   Todo se movía a mi alrededor — landing del cuento
   Sistema de diseño tomado del libro (Teacher Luy, Canva):
   navy índigo + azul del cuento + amarillo sol + crema + pasteles
   ========================================================= */

:root {
  --navy: #19285e;          /* títulos display */
  --indigo: #2f3b94;        /* azul del cuerpo del cuento */
  --ink: #2a3251;           /* texto principal sobre crema */
  --muted: #5b6382;         /* texto secundario */

  --yellow: #f3b100;        /* amarillo acento */
  --yellow-bright: #ffcf3a; /* amarillo sol */
  --coral: #ef5d72;         /* corazones */

  --cream: #fbf4e6;         /* fondo página */
  --cream-deep: #f6ecd6;    /* bandas */
  --card: #ffffff;

  --pink: #fbd6e2;
  --green: #d8efcf;
  --blue: #d6e8fb;
  --yellow-soft: #fdf1bd;

  --sky-1: #bfe3fb;         /* degradado cielo (hero / bandas) */
  --sky-2: #eaf6ff;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 18px 40px -18px rgba(25, 40, 94, .35);
  --shadow-soft: 0 10px 28px -14px rgba(25, 40, 94, .28);
  --maxw: 1120px;

  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;

  color-scheme: light;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  font-size: clamp(16px, 1.05vw + 14px, 19px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--indigo); }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.08;
  margin: 0 0 .4em;
  letter-spacing: -.01em;
}

p { margin: 0 0 1rem; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 40px);
}

.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--indigo);
  margin: 0 0 .9rem;
  display: inline-flex;
  align-items: center;
  gap: .5ch;
}

.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;
}

/* ---------- botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6ch;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  text-decoration: none;
  padding: .85em 1.5em;
  border-radius: 999px;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  line-height: 1.1;
}
.btn:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; }

.btn-primary {
  background: var(--yellow);
  color: var(--navy);
  box-shadow: 0 10px 0 -2px #d49a00, var(--shadow-soft);
}
.btn-primary:hover { transform: translateY(-2px); background: var(--yellow-bright); box-shadow: 0 12px 0 -2px #d49a00, var(--shadow); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 5px 0 -2px #d49a00; }

.btn-ghost {
  background: transparent;
  color: var(--indigo);
  border-color: color-mix(in srgb, var(--indigo) 35%, transparent);
}
.btn-ghost:hover { background: #fff; transform: translateY(-2px); border-color: var(--indigo); }

.btn-sm { font-size: .92rem; padding: .6em 1.1em; box-shadow: 0 6px 0 -2px #d49a00; }

/* ---------- barra superior ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in srgb, var(--navy) 10%, transparent);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .7rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy);
  text-decoration: none;
}
.brand .sparkle { color: var(--yellow); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(120% 90% at 85% -10%, var(--sky-2), transparent 55%),
    linear-gradient(180deg, #fff9ee 0%, var(--cream) 60%);
  padding-top: clamp(2.2rem, 5vw, 4rem);
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.hero h1 {
  font-weight: 700;
  font-size: clamp(2.3rem, 5.2vw, 4rem);
  margin-bottom: .2em;
}
.hero .underline-swash { margin: -.15em 0 .6em; width: min(360px, 80%); color: var(--yellow); }
.hero .subtitle {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--indigo);
  font-size: clamp(1.15rem, 1.6vw, 1.5rem);
  line-height: 1.25;
  margin-bottom: 1.1rem;
}
.hero .byline { font-weight: 700; color: var(--navy); margin-bottom: 1.6rem; }
.hero .byline span { color: var(--muted); font-weight: 600; }

.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.meta-note { margin-top: 1rem; font-size: .92rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: .5ch; }

/* portada tipo libro */
.cover-stage { position: relative; display: grid; place-items: center; }
.book {
  position: relative;
  border-radius: 10px 16px 16px 10px;
  box-shadow:
    -6px 0 0 0 rgba(25,40,94,.12),
    var(--shadow);
  transform: rotate(2deg);
  transition: transform .4s ease;
  max-width: 520px;
  width: 100%;
  border: 6px solid #fff;
  overflow: hidden;
}
.book::before { /* lomo */
  content: ""; position: absolute; inset: 0 auto 0 0; width: 10px;
  background: linear-gradient(90deg, rgba(0,0,0,.14), transparent);
}
.cover-stage:hover .book { transform: rotate(0deg) translateY(-4px); }

.deco-sparkle { position: absolute; color: var(--yellow); pointer-events: none; }
.deco-sparkle.s1 { top: 4%; right: 2%; width: 56px; animation: float 5s ease-in-out infinite; }
.deco-sparkle.s2 { bottom: 8%; left: -2%; width: 40px; animation: float 6s ease-in-out infinite .6s; }
.deco-sparkle.s3 { top: 46%; right: -3%; width: 30px; animation: float 7s ease-in-out infinite 1.2s; }

@keyframes float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-10px) rotate(8deg); } }

/* ---------- secciones ---------- */
section[id] { scroll-margin-top: 76px; }
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto clamp(1.8rem, 4vw, 3rem); }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 600; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* sinopsis */
.synopsis { background: linear-gradient(180deg, var(--sky-2), #fff 70%); }
.synopsis-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.6rem, 4vw, 3.2rem);
  max-width: 860px;
  margin-inline: auto;
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--navy) 7%, transparent);
}
.synopsis-card .lead-q {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.2;
  margin-bottom: 1.3rem;
}
.synopsis-card p { color: var(--ink); }
.pill-key {
  display: inline-block;
  background: var(--pink);
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.1rem, 2.1vw, 1.55rem);
  padding: .55em 1.1em;
  border-radius: 999px;
  margin: 1.2rem 0 1.3rem;
  box-shadow: var(--shadow-soft);
}
.synopsis-card .closing { color: var(--muted); font-size: .98rem; margin-bottom: 0; }

/* galería */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(.8rem, 2vw, 1.4rem);
}
.frame {
  margin: 0;
  background: #fff;
  padding: 10px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  transform: rotate(var(--r, 0deg));
  transition: transform .2s ease, box-shadow .2s ease;
  cursor: zoom-in;
  border: 0;
  width: 100%;
  font: inherit;
}
.frame img { border-radius: 8px; aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.frame:hover, .frame:focus-visible { transform: rotate(0) translateY(-4px) scale(1.02); box-shadow: var(--shadow); outline: none; }
.frame:focus-visible { box-shadow: 0 0 0 3px var(--indigo), var(--shadow); }
.gallery .frame:nth-child(3n+1) { --r: -1.4deg; }
.gallery .frame:nth-child(3n+2) { --r: .8deg; }
.gallery .frame:nth-child(3n) { --r: 1.6deg; }
.gallery-note { text-align: center; margin-top: 1.6rem; color: var(--muted); font-weight: 600; }

/* guía para familias */
.families { background: linear-gradient(180deg, #fff, var(--cream-deep)); }
.families-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.families-copy h2 { font-size: clamp(1.7rem, 3.3vw, 2.5rem); font-weight: 600; }
.families-copy .intro { color: var(--ink); }
.families-copy .after { font-family: var(--font-display); font-weight: 600; color: var(--indigo); margin: 1.4rem 0 1rem; font-size: 1.1rem; }

.q-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-bottom: 1.4rem; }
.q-card {
  display: flex; gap: .8ch; align-items: flex-start;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  color: var(--navy);
  font-size: .98rem;
  line-height: 1.35;
}
.q-card .ico { flex: 0 0 auto; width: 30px; height: 30px; }
.q-card.c1 { background: var(--pink); }
.q-card.c2 { background: var(--green); }
.q-card.c3 { background: var(--blue); }
.q-card.c4 { background: var(--yellow-soft); }
.families-copy .guidance { color: var(--ink); font-size: .98rem; }

.families-media { position: relative; }
.families-media .frame { cursor: zoom-in; transform: rotate(-1.2deg); max-width: 520px; margin-inline: auto; }

/* banda descarga */
.download-band {
  background:
    radial-gradient(90% 120% at 50% -20%, var(--sky-1), transparent 60%),
    linear-gradient(180deg, var(--sky-2), #fff);
  text-align: center;
  position: relative;
}
.download-band h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 700; }
.download-band p { color: var(--ink); max-width: 560px; margin-inline: auto; }
.download-band .btn-primary { font-size: 1.15rem; margin-top: 1rem; }
.download-band .fineprint { margin-top: 1rem; color: var(--muted); font-size: .9rem; font-weight: 600; }

/* sobre la autora */
.about { text-align: center; }
.about .about-inner { max-width: 640px; margin-inline: auto; }
.about .luy {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--indigo);
  display: inline-flex; align-items: center; gap: .5ch;
  margin-bottom: .6rem;
}
.about p { color: var(--ink); }
.about .follow { margin-top: 1.6rem; margin-bottom: 0; }
.btn.ig:hover { color: var(--coral); border-color: var(--coral); }

/* footer */
footer {
  background: var(--navy);
  color: #e8ecf8;
  text-align: center;
  padding-block: clamp(2rem, 5vw, 3rem);
}
footer .f-title { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: #fff; margin-bottom: .3rem; }
footer p { margin: .25rem 0; color: #c3cbe6; font-size: .92rem; }
footer .heart { color: var(--coral); }
footer a { color: var(--yellow-bright); font-weight: 700; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16, 24, 56, .88);
  display: none;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  cursor: zoom-out;
}
.lightbox.open { display: grid; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 12px; border: 6px solid #fff; box-shadow: var(--shadow); }
.lightbox .lb-close {
  position: absolute; top: 18px; right: 20px;
  width: 46px; height: 46px; border-radius: 999px;
  border: 0; background: #fff; color: var(--navy);
  font-size: 1.5rem; cursor: pointer; line-height: 1;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700;
}
.lightbox .lb-close:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero .underline-swash { margin-inline: auto; }
  .cta-row { justify-content: center; }
  .meta-note { justify-content: center; }
  .cover-stage { order: -1; margin-bottom: 1rem; }
  .book { max-width: 340px; transform: rotate(0); }
  .families-grid { grid-template-columns: 1fr; }
  .families-media .frame { transform: rotate(0); max-width: 460px; }
  .q-cards { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr 1fr; }
  .topbar .brand span.full { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .book { transform: none; }
}
