/* =====================================================================
   John E. Piedrahita · del anochecer al amanecer
   ===================================================================== */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("assets/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("assets/fonts/literata.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("assets/fonts/literata-italic.woff2") format("woff2");
  font-weight: 200 900; font-style: italic; font-display: swap;
}

:root {
  /* cielo */
  --night-0: #060a20;
  --night-1: #0c1234;
  --night-2: #171c4b;
  --dusk: #2c2558;
  --ember: #8e4536;
  --dawn: #d98c4c;
  --gold: #e8b562;
  --gold-hi: #f6d08a;
  --morning: #fbf2e2;
  --ground: #050818;

  /* texto */
  --ink: #0a0f2c;
  --ink-2: #3a2a2a;
  --text: #f4eee2;
  --text-2: #c8c3dc;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --serif: "Literata", Georgia, serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --pad-x: clamp(1rem, 5vw, 4.5rem);
  --section-y: clamp(5rem, 11vw, 9.5rem);
  --ground-h: clamp(4.5rem, 12vh, 8rem);

  color-scheme: dark;
  scrollbar-color: var(--gold) var(--night-1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--night-0);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
::selection { background: var(--gold-hi); color: var(--ink); }
img { display: block; max-width: 100%; height: auto; }
svg { width: 1.15em; height: 1.15em; flex: none; }
p { margin: 0 0 1em; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--display);
  font-stretch: 78%;
  margin: 0;
  text-wrap: balance;
  letter-spacing: -0.02em;
}
h2 em, h1 em { font-style: normal; color: var(--gold-hi); }
.display-m { font-size: clamp(2rem, 4.6vw, 3.9rem); line-height: 1.02; font-weight: 700; }
.display-l { font-size: clamp(2.4rem, 6.2vw, 5.6rem); line-height: 0.98; font-weight: 800; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--gold-hi); color: var(--ink); padding: .6rem 1rem; border-radius: 999px;
  font: 600 .95rem var(--display); text-decoration: none;
}
.skip:focus { top: 1rem; }

/* ---------- botones ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3.1rem; padding: .8rem 1.5rem;
  border-radius: 999px; border: 1.5px solid transparent;
  font: 650 1rem/1.1 var(--display); font-stretch: 92%; letter-spacing: .005em;
  text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-light { background: var(--gold-hi); color: var(--ink); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6); }
.btn-ghost { border-color: rgba(244, 238, 226, .45); color: var(--text); }
.btn-night { background: var(--ink); color: var(--morning); }
.btn[disabled] { cursor: progress; opacity: .75; }
@media (hover: hover) and (pointer: fine) {
  .btn-light:hover { background: #fde2ad; }
  .btn-ghost:hover { border-color: var(--gold-hi); color: var(--gold-hi); }
  .btn-night:hover { background: #1c2356; }
  .link-ig:hover { color: var(--gold-hi); }
}
.link-ig {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem;
  font: 600 1rem var(--display); font-stretch: 92%;
  text-decoration: underline; text-decoration-color: rgba(244, 238, 226, .35);
  transition: color 200ms ease;
}

/* ---------- cabecera ---------- */
.top {
  position: absolute; inset: 0 0 auto; z-index: 10;
  display: flex; align-items: center; gap: 2rem;
  padding: 1.1rem var(--pad-x);
}
.brand { font: 700 1.1rem var(--display); font-stretch: 85%; letter-spacing: .01em; text-decoration: none; margin-right: auto; }
.top-nav { display: flex; gap: 1.75rem; }
.top-nav a, .top-ig { font: 500 .95rem var(--display); text-decoration: none; color: var(--text-2); transition: color 200ms ease; }
.top-ig { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; }
@media (hover: hover) and (pointer: fine) { .top-nav a:hover, .top-ig:hover { color: var(--gold-hi); } }
@media (max-width: 760px) {
  .top-nav { display: none; }
  .top-ig span { display: none; }
  .top-ig svg { width: 1.4rem; height: 1.4rem; }
}

/* ---------- hero: noche y horizonte ---------- */
.hero {
  position: relative; isolation: isolate;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(16rem, .9fr);
  align-items: end;
  gap: 0 clamp(1.5rem, 4vw, 4rem);
  padding: 6rem var(--pad-x) var(--ground-h);
  background: linear-gradient(180deg, var(--night-0) 0%, var(--night-1) 62%, #1a1d4a calc(100% - var(--ground-h)), var(--ground) calc(100% - var(--ground-h)));
}
.hero-copy { align-self: center; padding-bottom: clamp(2rem, 6vh, 4rem); position: relative; z-index: 2; }
.brand span { font-weight: 500; font-stretch: 92%; color: var(--gold); margin-left: .4rem; }
.hero h1 { display: flex; flex-direction: column; gap: .9rem; }
.h1-fall { font-size: clamp(1.45rem, 2.7vw, 2.4rem); line-height: 1.12; font-weight: 500; color: var(--text-2); max-width: 26ch; }
.h1-rise { font-size: clamp(2.7rem, 5.6vw, 5.3rem); line-height: .95; font-weight: 800; color: var(--gold-hi); max-width: 13ch; }
.hero-lede { max-width: 54ch; margin-top: 1.6rem; color: var(--text); }
.hero-lede p:last-child { margin-bottom: 0; color: var(--text-2); }

.hero-portrait { margin: 0; position: relative; z-index: 2; justify-self: end; width: min(100%, 27rem); }
.hero-portrait img, .hero-portrait .ph {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 20%;
  border-radius: 2px 2px 0 0;
}

.horizon { position: absolute; inset: auto 0 var(--ground-h); height: 0; z-index: 1; pointer-events: none; }
.horizon-line { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, rgba(246,208,138,.15), var(--gold-hi) 55%, rgba(246,208,138,.35)); }
.horizon-glow {
  position: absolute; left: 0; right: 0; bottom: 0; height: 46vh;
  transform-origin: 50% 100%;
  background:
    radial-gradient(60% 100% at 72% 100%, rgba(246, 208, 138, .55), rgba(232, 181, 98, .12) 45%, transparent 75%),
    linear-gradient(0deg, rgba(232, 181, 98, .28), transparent 70%);
  opacity: .75;
  will-change: transform, opacity;
}
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .horizon-glow { animation: dawn linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
    @keyframes dawn { from { transform: scaleY(1); opacity: .75; } to { transform: scaleY(2.4); opacity: 1; } }
  }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 5.5rem; align-items: start; }
  .hero-copy { padding-bottom: 2.5rem; }
  .hero-portrait { justify-self: center; width: min(78%, 22rem); }
  .horizon-glow { height: 38vh; background: radial-gradient(70% 100% at 50% 100%, rgba(246,208,138,.55), rgba(232,181,98,.12) 45%, transparent 75%), linear-gradient(0deg, rgba(232,181,98,.25), transparent 70%); }
}

/* ---------- autor ---------- */
.author {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2.5rem clamp(1.5rem, 3vw, 3rem);
  padding: var(--section-y) var(--pad-x);
  background: linear-gradient(180deg, var(--ground) 0, var(--night-1) 18%, var(--night-2) 100%);
}
.author h2 { grid-column: 1 / span 7; }
.author-body { grid-column: 8 / -1; padding-top: .6rem; max-width: 62ch; color: var(--text-2); }
.author-lead { font-size: 1.25rem; line-height: 1.45; color: var(--text); }
.author-quote { grid-column: 3 / -1; margin: 2rem 0 0; }
.author-quote p {
  font: 800 clamp(2.2rem, 6vw, 5.2rem)/1 var(--display); font-stretch: 75%;
  letter-spacing: -0.025em; color: var(--gold-hi); margin: 0;
}
.author-quote p::before { content: "“"; }
.author-quote p::after { content: "”"; }
.author-quote footer { margin-top: 1rem; font: 500 1rem var(--display); color: var(--text-2); }
.author-quote footer::before { content: "— "; }
@media (max-width: 860px) {
  .author h2, .author-body, .author-quote { grid-column: 1 / -1; }
}

/* ---------- libros ---------- */
.books {
  overflow-x: clip;
  padding: var(--section-y) var(--pad-x);
  background: linear-gradient(180deg, var(--night-2) 0%, #221f52 45%, var(--dusk) 100%);
}
.books-head { max-width: 58rem; margin-bottom: clamp(3.5rem, 8vw, 6rem); }
.books-head p { margin-top: 1.5rem; max-width: 52ch; color: var(--text-2); font-size: 1.15rem; }
.book-list { display: grid; gap: clamp(5rem, 12vw, 9rem); }
.book {
  display: grid; grid-template-columns: minmax(13rem, 22rem) minmax(0, 40rem);
  gap: clamp(2rem, 6vw, 6rem); align-items: center; justify-content: center;
}
.book:nth-child(even) { grid-template-columns: minmax(0, 40rem) minmax(13rem, 22rem); }
.book:nth-child(even) .book-cover { order: 2; }
.book-cover { position: relative; isolation: isolate; }
.book-cover::before {
  content: ""; position: absolute; inset: -18% -30% -10%; z-index: -1;
  background: radial-gradient(closest-side, var(--light, rgba(246, 208, 138, .35)), transparent);
}
.book--fe { --light: rgba(232, 181, 98, .38); }
.book--voz { --light: rgba(235, 120, 60, .42); }
.book--camino { --light: rgba(150, 200, 255, .30); }
.book-cover img, .book-cover .ph {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7), 0 8px 18px -6px rgba(0, 0, 0, .5);
}
.book-cover img { height: auto; }  /* la proporción real llega desde main.js (size), sin recortes */
.book h3 { font-size: clamp(2rem, 4.2vw, 3.4rem); line-height: 1; font-weight: 800; }
.book-sub { margin-top: .9rem; font-style: italic; color: var(--text-2); }
.book-hook { margin-top: 1.4rem; font: 600 clamp(1.25rem, 2vw, 1.55rem)/1.3 var(--display); font-stretch: 90%; color: var(--gold-hi); }
.book-text > p:not(.book-hook):not(.book-sub):not(.book-price):not(.book-en):not(.book-date) { color: var(--text-2); max-width: 62ch; }
.book-price, .book-en { margin: 1rem 0 0; font-size: .95rem; color: var(--text-2); }
.book-price + .book-en { margin-top: .35rem; }
.book-en a { color: var(--text); }
.book-date { margin: 1.75rem 0 0; font: 700 1.2rem var(--display); color: var(--gold-hi); }
.book-date + .actions { margin-top: 1rem; }
.kindle-note { margin: clamp(4rem, 9vw, 6rem) auto 0; max-width: 40rem; text-align: center; color: var(--text-2); font-size: .95rem; }
@media (max-width: 760px) {
  .book, .book:nth-child(even) { grid-template-columns: 1fr; gap: 2.25rem; }
  .book:nth-child(even) .book-cover { order: 0; }
  .book-cover { width: min(68%, 17rem); }
}

/* ---------- comunidad: hacia el alba ---------- */
.community {
  padding: var(--section-y) var(--pad-x);
  background: linear-gradient(180deg, var(--dusk) 0%, #5a3352 40%, #7f4140 78%, var(--ember) 100%);
}
.community h2 { max-width: 20ch; }
.phrases { list-style: none; margin: clamp(3rem, 7vw, 5rem) 0; padding: 0; display: grid; gap: clamp(1.75rem, 4vw, 3rem); }
.phrases li {
  font: 700 clamp(1.7rem, 4.4vw, 3.6rem)/1.05 var(--display); font-stretch: 76%;
  letter-spacing: -0.02em; color: var(--gold-hi); max-width: 22ch; text-wrap: balance;
}
.phrases li::before { content: "“"; }
.phrases li::after { content: "”"; }
.phrases li:nth-child(2) { margin-left: clamp(0rem, 12vw, 14rem); }
.phrases li:nth-child(3) { margin-left: clamp(0rem, 24vw, 28rem); }
.community-body { max-width: 60ch; margin-left: auto; }
.community-body p { color: #f1e6de; }
@media (max-width: 760px) { .phrases li:nth-child(n) { margin-left: 0; } .community-body { margin-left: 0; } }

/* ---------- propósito: primera luz ---------- */
.purpose {
  --focus: var(--ink);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 30rem); gap: clamp(2.5rem, 6vw, 6rem); align-items: start;
  padding: calc(var(--section-y) + 2rem) var(--pad-x) var(--section-y);
  background: linear-gradient(180deg, var(--ember) 0, var(--dawn) 9rem, #eab067 70%, #f1c27c 100%);
  color: var(--ink);
}
.purpose :focus-visible, .close :focus-visible, .foot :focus-visible { outline-color: var(--ink); }
.purpose-copy p { max-width: 54ch; color: var(--ink-2); }
.purpose-copy h2 { margin-bottom: 1.75rem; }
.signup { background: rgba(251, 242, 226, .5); border-radius: 18px; padding: clamp(1.5rem, 3vw, 2.25rem); box-shadow: 0 24px 50px -30px rgba(90, 40, 20, .55); }
.signup-intro { font: 600 1.15rem/1.35 var(--display); font-stretch: 92%; margin-bottom: 1.5rem; }
.field { margin-bottom: 1.15rem; }
.field label { display: block; font: 600 .9rem var(--display); margin-bottom: .4rem; }
.field input {
  width: 100%; min-height: 3rem; padding: .7rem .9rem;
  border: 1.5px solid rgba(10, 15, 44, .35); border-radius: 10px;
  background: rgba(255, 255, 255, .7); color: var(--ink);
  font: 400 1.05rem var(--serif); caret-color: var(--ember);
  transition: border-color 200ms ease, background-color 200ms ease;
}
.field input:focus { outline: none; border-color: var(--ink); background: #fff; box-shadow: 0 0 0 3px rgba(10, 15, 44, .18); }
.field input[aria-invalid="true"], .check input[aria-invalid="true"] { border-color: #8f1d1d; }
.check { display: flex; gap: .7rem; align-items: flex-start; margin: 1.25rem 0 .5rem; font-size: .95rem; }
.check input { width: 1.25rem; height: 1.25rem; margin: .2rem 0 0; accent-color: var(--ink); flex: none; }
.err { color: #7a1414; font: 600 .88rem/1.35 var(--display); margin: .4rem 0 0; }
.signup .btn { width: 100%; margin-top: 1.25rem; }
.signup-done { margin: 1rem 0 0; font-weight: 500; }
.signup-done:empty { display: none; }
.signup.is-done .field, .signup.is-done .check, .signup.is-done .btn, .signup.is-done .err { display: none; }
@media (max-width: 860px) { .purpose { grid-template-columns: 1fr; } }

/* ---------- cierre: mañana ---------- */
.close {
  padding: var(--section-y) var(--pad-x) calc(var(--section-y) * 1.1);
  background: linear-gradient(180deg, #f1c27c 0%, #f7dcae 45%, var(--morning) 100%);
  color: var(--ink);
}
.close h2 { max-width: 16ch; }
.still { list-style: none; margin: clamp(2.5rem, 6vw, 4rem) 0 2rem; padding: 0; display: grid; gap: .4rem; }
.still li { font: 600 clamp(1.4rem, 3vw, 2.3rem)/1.2 var(--display); font-stretch: 85%; }
.close-last { max-width: 46ch; font-size: 1.2rem; color: var(--ink-2); }
.close .link-ig { text-decoration-color: rgba(10, 15, 44, .35); }
@media (hover: hover) and (pointer: fine) { .close .link-ig:hover { color: var(--ember); } }

/* ---------- pie ---------- */
.foot {
  display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 2rem 3rem; align-items: start;
  padding: 3.5rem var(--pad-x) 6rem;
  background: var(--morning); color: var(--ink);
  border-top: 1px solid rgba(10, 15, 44, .12);
}
.foot-name { font: 800 1.6rem var(--display); font-stretch: 80%; margin-bottom: .3rem; }
.foot-brand p:last-child { color: var(--ink-2); font-size: .95rem; }
.foot-nav { display: grid; gap: .35rem; font: 500 .98rem var(--display); }
.foot-nav a, .foot-legal a { text-decoration: none; }
.foot-nav a { min-height: 2rem; display: inline-flex; align-items: center; }
@media (hover: hover) and (pointer: fine) { .foot a:hover { color: var(--ember); } }
.foot-social { display: flex; gap: .5rem; }
.foot-social a { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 50%; border: 1.5px solid rgba(10, 15, 44, .25); transition: border-color 200ms ease, color 200ms ease; }
.foot-legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; font-size: .88rem; color: var(--ink-2); padding-top: 1.5rem; border-top: 1px solid rgba(10, 15, 44, .1); }
.foot-legal p { margin: 0; }
@media (max-width: 760px) { .foot { grid-template-columns: 1fr; } }

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 20;
  display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%;
  background: #25d366; color: #06301a;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .55);
  transition: transform 160ms var(--ease-out);
}
.wa-float svg { width: 1.7rem; height: 1.7rem; }
.wa-float:active { transform: scale(0.94); }

/* =====================================================================
   MOVIMIENTO · un solo lenguaje: las cosas "se encienden" como al amanecer.
   Todo arranca visible; sin JS o con "reducir movimiento" la página queda quieta.
   ===================================================================== */
:root {
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-reveal: cubic-bezier(0.33, 1, 0.68, 1);  /* más pareja: el movimiento se alcanza a ver */
  --phrase-dim: #d4b0ad;   /* frase aún sin leer (contraste ≥ 3.4:1) */
  --still-dim: #7a5c44;    /* línea de cierre aún sin leer (≥ 3.7:1) */
}
.h1-rise .w { display: inline-block; }

/* 1 · Amanecer al cargar: horizonte, brillo, y el titular que se escribe */
@media (prefers-reduced-motion: no-preference) {
  .horizon-line { transform-origin: 0 50%; animation: draw-line 2200ms var(--ease-reveal) 200ms both; }
  .horizon { animation: rise-light 2600ms ease-out 400ms both; }
  .h1-fall { animation: fade-in 1200ms var(--ease-reveal) 300ms both; }
  .h1-rise .w { animation: write-word 1100ms var(--ease-reveal) calc(900ms + var(--i) * 190ms) both; }
  .hero-lede { animation: fade-up 1100ms var(--ease-reveal) 2000ms both; }
  .hero .actions { animation: fade-up 1100ms var(--ease-reveal) 2250ms both; }
  .hero-portrait { animation: portrait-light 2400ms var(--ease-reveal) 700ms both; }

  @keyframes draw-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes rise-light { from { opacity: 0; } to { opacity: 1; } }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes fade-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
  @keyframes write-word {
    from { opacity: 0; filter: blur(10px); transform: translateY(0.35em); }
    to { opacity: 1; filter: blur(0); transform: none; }
  }
  @keyframes portrait-light {
    from { opacity: 0; filter: brightness(.4); transform: scale(.96); }
    to { opacity: 1; filter: brightness(1); transform: none; }
  }
}
/* Con "reducir movimiento": nada se desplaza, solo una aparición suave. */
@media (prefers-reduced-motion: reduce) {
  .hero-copy, .hero-portrait { animation: calm-in 900ms ease-out both; }
  @keyframes calm-in { from { opacity: 0; } to { opacity: 1; } }
}

/* 2 · Las portadas se encienden al entrar en pantalla */
.motion .book-cover::before { opacity: 0; transition: opacity 2400ms ease-out 300ms; }
.motion .book-cover img, .motion .book-cover .ph {
  filter: brightness(.35) saturate(.6);
  transform: translateY(36px);
  transition: filter 1800ms ease-out, transform 1800ms var(--ease-reveal);
}
.motion .book.is-lit .book-cover::before { opacity: 1; }
.motion .book.is-lit .book-cover img, .motion .book.is-lit .book-cover .ph { filter: none; transform: none; }

/* 3 · Las frases se iluminan cuando llegan al centro de la pantalla */
.motion .phrases li {
  color: var(--phrase-dim);
  transform: translateY(22px);
  transition: color 1400ms ease, transform 1400ms var(--ease-reveal);
}
.motion .phrases li.is-lit { color: var(--gold-hi); transform: none; }

/* 4 · El cierre: "Todavía hay…" línea por línea */
.motion .still li {
  color: var(--still-dim);
  transform: translateY(22px);
  transition: color 1200ms ease, transform 1200ms var(--ease-reveal);
}
.motion .still li:nth-child(2) { transition-delay: 350ms; }
.motion .still li:nth-child(3) { transition-delay: 700ms; }
.motion .still.is-lit li { color: var(--ink); transform: none; }

/* 5 · WhatsApp entra después del inicio y se aparta en el pie de página */
.wa-float { transition: transform 600ms var(--ease-reveal), opacity 600ms var(--ease-reveal); }
.wa-float[data-hidden] {
  opacity: 0; pointer-events: none;
  transform: translateY(calc(100% + 1.5rem)) scale(.9);
  transition-duration: 350ms;
}
@media (prefers-reduced-motion: reduce) { .wa-float[data-hidden] { transform: none; } }

/* 6 · Formulario vivo */
.btn > span { display: inline-block; transition: filter 350ms ease, opacity 350ms ease; }
.btn > span.is-swapping { filter: blur(2px); opacity: .5; }
.err { transition: opacity 400ms ease-out, transform 400ms var(--ease-reveal); }
.signup .field, .signup .check { transition: opacity 500ms ease, filter 500ms ease; }
.signup .btn { transition: transform 160ms var(--ease-out), background-color 200ms ease, opacity 500ms ease, filter 500ms ease; }
.signup.is-leaving .field, .signup.is-leaving .check, .signup.is-leaving .btn { opacity: 0; filter: blur(4px); }
.signup-done { transition: opacity 900ms ease-out, transform 900ms var(--ease-reveal); }
@starting-style {
  .err { opacity: 0; transform: translateY(-8px); }
  .signup-done { opacity: 0; transform: translateY(14px); }
}

/* 7 · La flecha de los botones se adelanta (solo con mouse) */
.btn svg, .link-ig svg { transition: transform 300ms var(--ease-reveal); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover svg:has(use[href="#i-arrow"]) { transform: translate(4px, -4px); }
  .btn:hover svg:has(use[href="#i-down"]) { transform: translateY(4px); }
  .link-ig:hover svg { transform: scale(1.15); }
}

/* =====================================================================
   CIELO · capa fija. Solo se activa con JS (clase .has-sky); sin JS cada
   sección conserva su propio fondo y todo se lee igual.
   ===================================================================== */
.sky { display: none; }
.has-sky .sky {
  display: block; position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, #050818 0%, #0b1236 55%, #18194a 100%);
}
.sky-layer { position: absolute; inset: 0; opacity: 0; will-change: opacity; }
.sky-deep    { background: linear-gradient(180deg, #0b1038 0%, #1b1d55 55%, #302a68 100%); }
.sky-ember   { background: linear-gradient(180deg, #231f55 0%, #4f2f5c 42%, #7d3f4d 78%, #8e4536 100%); }
.sky-dawn    { background: linear-gradient(180deg, #c9714a 0%, #e09456 35%, #eab067 70%, #f1c27c 100%); }
.sky-morning { background: linear-gradient(180deg, #f3cd92 0%, #f8e1b8 45%, #fbf2e2 100%); }
.sky-stars { position: absolute; inset: 0; width: 100%; height: 100%; will-change: opacity; }

.moon, .sun { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
.moon { width: clamp(62px, 9vw, 140px); aspect-ratio: 1; }
.sun  { width: clamp(110px, 15vw, 230px); aspect-ratio: 1; opacity: 0; }
.moon-disc, .sun-disc, .moon-halo, .sun-halo { position: absolute; border-radius: 50%; }
.moon-disc {
  inset: 0;
  background:
    radial-gradient(circle at 62% 38%, rgba(150, 146, 130, .35) 0 9%, transparent 10%),
    radial-gradient(circle at 38% 64%, rgba(150, 146, 130, .28) 0 13%, transparent 14%),
    radial-gradient(circle at 70% 70%, rgba(150, 146, 130, .22) 0 6%, transparent 7%),
    radial-gradient(circle at 34% 30%, #fffaf0 0%, #e9e3d1 55%, #c9c2ad 100%);
}
.moon-halo { inset: -120%; background: radial-gradient(closest-side, rgba(200, 210, 255, .22), rgba(200, 210, 255, .06) 55%, transparent); }
.sun-disc { inset: 0; background: radial-gradient(circle, #fffbea 0%, #ffe9a8 45%, #ffcf6e 80%, #f7b552 100%); }
.sun-halo { inset: -140%; background: radial-gradient(closest-side, rgba(255, 220, 150, .6), rgba(255, 200, 120, .2) 45%, transparent); }

.moon-disc, .moon-halo, .sun-disc, .sun-halo { transition: opacity 700ms ease; }
.moon.is-veiled .moon-disc { opacity: .2; }
.moon.is-veiled .moon-halo { opacity: .35; }
.sun.is-veiled .sun-disc { opacity: .18; }
.sun.is-veiled .sun-halo { opacity: .4; }

.has-sky .hero, .has-sky .author, .has-sky .books, .has-sky .community,
.has-sky .purpose, .has-sky .close, .has-sky .foot { background: transparent; }
.has-sky .foot { border-top-color: rgba(10, 15, 44, .15); }

/* ---------- espacios reservados (mientras llegan las imágenes) ---------- */
.ph {
  display: flex; flex-direction: column; justify-content: flex-end; gap: .25rem;
  padding: 1.25rem; text-align: left;
  background: linear-gradient(160deg, #262a5e, #12163d);
  outline: 1px dashed rgba(246, 208, 138, .45); outline-offset: -10px;
}
.ph span { font: 800 1.35rem/1.05 var(--display); font-stretch: 80%; color: var(--gold-hi); }
.ph small { font: 500 .8rem var(--display); color: var(--text-2); }
.hero-portrait .ph { background: linear-gradient(170deg, #e9e6df, #c9c6bf); }
.hero-portrait .ph span { color: var(--ink); }
.hero-portrait .ph small { color: #4a4a55; }
