/* ============================================================
   DE AFUERA HACIA ADENTRO — Clara S. Pollach
   Paleta de la portada: luz dorada · agua turquesa · hoja · loto
   ============================================================ */

:root {
  --arena: #FAF5EC;
  --arena-2: #F2E8D6;
  --papel: #FFFCF6;
  --agua: #0E3B3B;
  --agua-2: #0A2C2C;
  --agua-3: #1B5653;
  --turquesa: #7FB7B0;
  --sol: #C8963E;
  --sol-2: #A9782A;
  --sol-luz: #F2C46D;
  --loto: #E9A7A0;
  --hoja: #3E6B4A;
  --ink: #23302C;
  --ink-soft: #55625C;
  --linea: rgba(35, 48, 44, 0.12);
  --linea-luz: rgba(250, 245, 236, 0.16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 1140px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--body); font-size: 1.0625rem; line-height: 1.7; color: var(--ink); background: var(--arena); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--sol-luz); color: var(--agua-2); }

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.14; }
h1 em, h2 em, h3 em { font-style: italic; font-weight: 400; color: var(--sol-2); }
strong { font-weight: 600; }

.kicker { font-size: 0.78rem; letter-spacing: 0.24em; text-transform: uppercase; font-weight: 600; color: var(--sol-2); margin-bottom: 1.1rem; }
.kicker-light { color: var(--sol-luz); }

/* ---------- Botones ---------- */
.btn { display: inline-block; padding: 1rem 2rem; font-family: var(--body); font-size: 1rem; font-weight: 600; letter-spacing: 0.02em; text-decoration: none; text-align: center; border-radius: 999px; border: 1px solid transparent; transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.3s, color 0.3s; }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--turquesa); outline-offset: 3px; }
.btn-gold { background: linear-gradient(135deg, var(--sol-luz), var(--sol)); color: var(--agua-2); }
.btn-gold:hover { box-shadow: 0 14px 32px rgba(200, 150, 62, 0.35); }
.btn-ghost { border-color: rgba(250, 245, 236, 0.55); color: var(--arena); }
.btn-ghost:hover { background: rgba(250, 245, 236, 0.12); }
.btn-block { display: block; width: 100%; }
.text-link { color: var(--agua-3); font-weight: 600; text-decoration-color: var(--sol); text-underline-offset: 4px; }

/* ---------- Nav ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem clamp(1rem, 4vw, 2.5rem); padding-top: calc(0.8rem + env(safe-area-inset-top, 0px)); transition: background 0.35s, box-shadow 0.35s; }
.nav.is-scrolled { background: rgba(14, 59, 59, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }
.nav-brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; color: var(--arena); }
.nav-brand img { width: 38px; height: 38px; border-radius: 50%; }
.nav-brand span { font-family: var(--display); font-size: 1.1rem; }
.nav-brand em { color: var(--sol-luz); }
.nav-cta { padding: 0.6rem 1.3rem; font-size: 0.92rem; }

/* ---------- Sol ---------- */
.sun { position: absolute; width: 60vmax; height: 60vmax; top: -22vmax; right: -14vmax; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(242, 196, 109, 0.55) 0%, rgba(242, 196, 109, 0.18) 35%, rgba(242, 196, 109, 0) 65%);
  animation: breathe 9s ease-in-out infinite alternate; }
.sun-low { top: auto; bottom: -34vmax; right: auto; left: 50%; translate: -50% 0; }
@keyframes breathe { from { opacity: 0.75; scale: 1; } to { opacity: 1; scale: 1.06; } }

/* ---------- 1. Hero ---------- */
.hero { position: relative; overflow: hidden; color: var(--arena);
  padding: calc(7.5rem + env(safe-area-inset-top, 0px)) clamp(1.25rem, 5vw, 2.5rem) clamp(4rem, 9vw, 6rem);
  background:
    radial-gradient(ellipse 70% 50% at 10% 100%, rgba(127, 183, 176, 0.25), transparent 65%),
    linear-gradient(170deg, var(--agua-2) 0%, var(--agua) 50%, var(--agua-3) 100%);
}
.hero-grid { position: relative; z-index: 1; max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.hero .kicker { color: var(--sol-luz); }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); margin-bottom: 1.5rem; }
.hero h1 em { color: var(--sol-luz); }
.hero-sub { font-size: clamp(1.08rem, 2vw, 1.25rem); color: rgba(250, 245, 236, 0.84); margin-bottom: 2.2rem; max-width: 580px; }
.hero-sub strong { color: var(--arena); font-weight: 500; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero-meta { margin-top: 1.6rem; font-size: 0.9rem; color: rgba(250, 245, 236, 0.62); }

.hero-book { position: relative; display: flex; justify-content: center; perspective: 1400px; }
.book { position: relative; z-index: 1; width: min(330px, 76vw); border-radius: 4px 10px 10px 4px; transform: rotateY(-14deg) rotateX(3deg); transform-style: preserve-3d; transition: transform 0.6s var(--ease); box-shadow: -18px 30px 60px rgba(0, 0, 0, 0.45); animation: float 7s ease-in-out infinite; }
.book img { border-radius: 4px 10px 10px 4px; }
.book::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 14px; border-radius: 4px 0 0 4px; background: linear-gradient(90deg, rgba(0,0,0,0.35), rgba(255,255,255,0.14) 60%, transparent); z-index: 2; }
.book::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, rgba(255,255,255,0.2), transparent 35%); z-index: 2; pointer-events: none; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.book-glow { position: absolute; width: 70%; height: 30%; bottom: -6%; left: 15%; background: radial-gradient(ellipse, rgba(242, 196, 109, 0.4), transparent 70%); filter: blur(18px); }

/* ---------- Secciones ---------- */
.section { position: relative; padding: clamp(4.5rem, 10vw, 7.5rem) clamp(1.25rem, 5vw, 2.5rem); }
.section-head { max-width: 820px; margin: 0 auto clamp(2.5rem, 6vw, 3.5rem); text-align: center; }
.section-head h2, .narrow h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); color: var(--agua); }
.narrow { max-width: 760px; margin: 0 auto; text-align: center; }
.narrow h2 { margin-bottom: 1.6rem; }
.narrow > p { color: var(--ink-soft); font-size: 1.12rem; margin-bottom: 1rem; }
.num { font-family: var(--display); font-style: italic; font-size: 1.3rem; color: var(--sol-2); display: block; margin-bottom: 0.4rem; }

/* ---------- 2. Origen ---------- */
.origin { background: var(--arena); }

/* ---------- 3. Pregunta ---------- */
.question { background: linear-gradient(135deg, var(--sol-luz), var(--sol)); color: var(--agua-2); padding: clamp(4rem, 9vw, 6rem) clamp(1.25rem, 5vw, 2.5rem); text-align: center; }
.question blockquote { max-width: 900px; margin: 0 auto; }
.question p { font-family: var(--display); font-style: italic; font-size: clamp(1.7rem, 4.2vw, 2.7rem); line-height: 1.3; margin-bottom: 1.2rem; }
.question cite { font-style: normal; font-size: 0.85rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 600; }

/* ---------- 4. Índice ---------- */
.index { background: var(--papel); }
.chapters { list-style: none; max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 0 3rem; }
.chapters li { display: grid; grid-template-columns: 3.4rem 1fr; align-items: baseline; padding: 1.25rem 0; border-bottom: 1px solid var(--linea); }
.chapters span { font-family: var(--display); font-style: italic; font-size: 1.5rem; color: var(--sol-2); }
.chapters h3 { font-size: 1.22rem; color: var(--agua); font-weight: 500; }
.index-note { text-align: center; color: var(--ink-soft); margin-top: 2rem; font-size: 0.98rem; }

/* ---------- 5. Territorios ---------- */
.places { background: var(--agua); color: var(--arena); overflow: hidden; }
.places-grid { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 4.5rem); align-items: center; }
.places h2 { font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom: 1.2rem; }
.places h2 em { color: var(--sol-luz); }
.places-text > p { color: rgba(250, 245, 236, 0.8); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.8rem; }
.chips li { padding: 0.7rem 1.25rem; border-radius: 999px; border: 1px solid rgba(242, 196, 109, 0.45); background: rgba(250, 245, 236, 0.06); font-family: var(--display); font-size: 1.15rem; color: var(--arena); transition: background 0.3s, transform 0.4s var(--ease); }
.chips li:hover { background: rgba(242, 196, 109, 0.18); transform: translateY(-3px); }

/* ---------- 6. Para quién ---------- */
.who { background: var(--arena); }
.who-grid { max-width: 960px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.who-card { background: var(--papel); border: 1px solid var(--linea); border-radius: 18px; padding: 2.2rem 2rem; border-top: 3px solid var(--loto); }
.who-card:nth-child(2) { border-top-color: var(--turquesa); }
.who-card h3 { font-size: 1.6rem; color: var(--agua); margin-bottom: 0.7rem; }
.who-card p { color: var(--ink-soft); }

/* ---------- 7. Autora ---------- */
.author { background: var(--arena-2); }
.author-grid { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.author-photo img { border-radius: 16px 200px 16px 16px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; box-shadow: 0 30px 60px rgba(14, 59, 59, 0.2); }
.author-text h2 { font-size: clamp(2.3rem, 4.8vw, 3.3rem); color: var(--agua); margin-bottom: 1.1rem; }
.author-text > p { color: var(--ink-soft); margin-bottom: 1rem; }
.author-points { list-style: none; margin-top: 1.4rem; border-top: 1px solid var(--linea); }
.author-points li { padding: 0.75rem 0 0.75rem 1.6rem; border-bottom: 1px solid var(--linea); position: relative; }
.author-points li::before { content: "❋"; position: absolute; left: 0; color: var(--sol); }

/* ---------- 8. Compra ---------- */
.buy { background: linear-gradient(180deg, var(--arena-2), var(--arena)); }
.buy-card { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: 0.8fr 1.2fr; background: var(--papel); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 70px rgba(14, 59, 59, 0.16); }
.buy-cover { background: radial-gradient(circle at 60% 30%, rgba(242,196,109,0.35), transparent 55%), linear-gradient(170deg, var(--agua-3), var(--agua-2)); display: flex; align-items: center; justify-content: center; padding: clamp(2rem, 5vw, 3rem); }
.buy-cover img { width: min(250px, 70%); border-radius: 4px 8px 8px 4px; box-shadow: -12px 22px 44px rgba(0, 0, 0, 0.45); transform: rotate(-3deg); }
.buy-info { padding: clamp(2rem, 4.5vw, 3rem); }
.buy-info h2 { font-size: clamp(2rem, 4vw, 2.7rem); color: var(--agua); }
.buy-sub { font-family: var(--display); font-style: italic; color: var(--ink-soft); font-size: 1.12rem; margin: 0.3rem 0 1.4rem; }
.check-list { list-style: none; margin-bottom: 1.8rem; }
.check-list li { position: relative; padding: 0.4rem 0 0.4rem 1.9rem; }
.check-list li::before { content: ""; position: absolute; left: 0; top: 0.8rem; width: 1rem; height: 0.55rem; border-left: 2px solid var(--sol); border-bottom: 2px solid var(--sol); transform: rotate(-45deg); }
.buy-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.4rem 1rem; margin-bottom: 1.2rem; }
.price { font-family: var(--display); font-size: clamp(2.6rem, 6vw, 3.3rem); font-weight: 600; color: var(--agua); line-height: 1; }
.price-note { color: var(--ink-soft); font-size: 0.95rem; }
.buy-safe { text-align: center; margin-top: 0.9rem; font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- 9. Seguir ---------- */
.next { background: var(--papel); }
.next-grid { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.next-card { display: block; text-decoration: none; background: var(--arena); border: 1px solid var(--linea); border-radius: 18px; padding: 2rem 1.75rem; transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.next-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(14, 59, 59, 0.12); }
.next-card h3 { font-size: 1.4rem; color: var(--agua); margin-bottom: 0.5rem; }
.next-card p { color: var(--ink-soft); margin-bottom: 1rem; }
.next-link { font-weight: 600; color: var(--agua-3); }

/* ---------- 10. FAQ ---------- */
.faq { background: var(--papel); padding-top: 0; }
.faq-list { max-width: 800px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--linea); }
.faq summary { list-style: none; cursor: pointer; position: relative; padding: 1.3rem 2.5rem 1.3rem 0; font-family: var(--display); font-size: 1.3rem; color: var(--agua); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.3rem; top: 1.05rem; font-size: 1.7rem; color: var(--sol); transition: transform 0.3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 1.4rem; color: var(--ink-soft); }

/* ---------- 11. Cierre ---------- */
.final { overflow: hidden; text-align: center; color: var(--arena); background: linear-gradient(180deg, var(--agua-3), var(--agua-2)); }
.final-inner { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; }
.final h2 { font-size: clamp(2rem, 4.6vw, 3.1rem); margin-bottom: 2rem; }
.final h2 em { color: var(--sol-luz); }

/* ---------- Footer ---------- */
.footer { background: var(--agua-2); color: rgba(250, 245, 236, 0.75); text-align: center; padding: 3.5rem 1.5rem calc(5.5rem + env(safe-area-inset-bottom, 0px)); font-size: 0.95rem; }
.footer img { width: 104px; margin: 0 auto 1.2rem; }
.footer p { margin-bottom: 0.5rem; }
.footer a { color: var(--sol-luz); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-small { font-size: 0.82rem; color: rgba(250, 245, 236, 0.5); margin-top: 1rem; }

/* ---------- WhatsApp ---------- */
.wa-float { position: fixed; right: 1.1rem; bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px)); z-index: 60; width: 56px; height: 56px; border-radius: 50%; background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25); transition: transform 0.3s var(--ease); }
.wa-float:hover { transform: scale(1.07); }

/* ---------- Reveal defensivo ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); animation: reveal-fallback 0.6s ease 6s forwards; }
@keyframes reveal-fallback { to { opacity: 1; transform: none; } }
.js .reveal.is-in { opacity: 1; transform: none; animation: none; }
.js.reveal-all .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-ctas { justify-content: center; }
  .hero-book { order: -1; }
  .book { width: min(240px, 60vw); }
  .places-grid, .author-grid, .buy-card { grid-template-columns: 1fr; }
  .author-photo { max-width: 380px; margin: 0 auto; }
}
@media (max-width: 680px) {
  .nav-brand span { font-size: 0.98rem; }
  .hero { padding-top: calc(6.5rem + env(safe-area-inset-top, 0px)); }
  .hero-ctas .btn { width: 100%; }
  .chapters, .who-grid, .next-grid { grid-template-columns: 1fr; }
}
