/* ============================================================
   Emilia está escribiendo — "Limpia" (editorial), refined.
   Clean base + playful borrowings: rainbow title, typewriter,
   faded hero illustration, subtle rainbow dividers.
   ============================================================ */

body { background: var(--paper); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

.rainbow-text {
  background: var(--rainbow);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ── Header ───────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.85); backdrop-filter: saturate(150%) blur(10px); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; padding-block: 12px; }
.brand img { display: block; width: clamp(74px, 16vw, 88px); }
.bar-right { display: flex; align-items: center; gap: clamp(14px, 3vw, 26px); }
.nav { display: flex; gap: clamp(12px, 3vw, 30px); }
.nav a { text-decoration: none; font-weight: 500; font-size: .98rem; color: var(--ink); padding: 6px 2px; position: relative; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); }
.rainbow-rule { height: 4px; background: var(--rainbow); }

/* Language toggle */
.lang { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.lang button { font-family: var(--font-body); font-weight: 700; font-size: .8rem; line-height: 1; cursor: pointer; background: transparent; color: var(--ink); border: none; padding: 7px 11px; transition: background .15s, color .15s; }
.lang button.is-active { background: var(--ink); color: #fff; }

/* ── Hero / Casa ──────────────────────────── */
.hero { position: relative; overflow: hidden; padding-block: clamp(56px, 12vw, 120px) clamp(40px, 9vw, 80px); }
.hero-bg {
  position: absolute; right: max(0px, calc((100vw - var(--container)) / 2)); top: 50%; transform: translateY(-50%);
  width: clamp(360px, 56vw, 720px); opacity: .14; filter: blur(1px);
  pointer-events: none; z-index: 0;
}
.hero-content { position: relative; z-index: 1; }
.hero-title { font-size: clamp(3rem, 9vw, 6rem); letter-spacing: -.01em; line-height: 1.02; margin-bottom: 18px; }
.hero-name { color: var(--ink); }
.typeline { font-family: var(--font-title); font-size: clamp(1.2rem, 3.4vw, 2rem); margin: 0 0 26px; min-height: 1.4em; white-space: nowrap; }
.tw { font-style: italic; }
.caret { font-weight: 300; color: var(--purple); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lead { font-size: clamp(1.12rem, 2.4vw, 1.45rem); max-width: 42ch; color: var(--ink); margin: 0 0 34px; }
.lead em { font-style: italic; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* ── Buttons ──────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-body); font-weight: 600; font-size: 1rem; text-decoration: none; padding: 14px 26px; border-radius: 999px; border: 2px solid var(--ink); transition: transform .18s ease, background .18s ease, color .18s ease; }
.btn-solid { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn:hover { transform: translateY(-2px); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-small { padding: 11px 18px; font-size: .92rem; border-width: 1.5px; }

/* ── Subtle rainbow divider between sections ── */
.divider {
  height: 3px; background: var(--rainbow); opacity: .4; border-radius: 3px;
  margin-block: clamp(10px, 3vw, 26px);
  -webkit-mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
          mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

/* ── Section blocks ───────────────────────── */
.block { padding-block: clamp(44px, 8vw, 84px); }
.block-head { margin-bottom: clamp(26px, 5vw, 44px); }
.tag { display: inline-block; font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-soft); background: #efece6; padding: 4px 11px; border-radius: 999px; margin-bottom: 14px; }
.block-head h2 { font-size: clamp(2rem, 5.4vw, 3.4rem); }
.block-intro { color: var(--ink-soft); font-size: 1.1rem; max-width: 48ch; margin: 14px 0 0; }
.muted { color: var(--ink-soft); }

/* ── Libro ────────────────────────────────── */
.libro-grid { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: clamp(28px, 5vw, 60px); align-items: stretch; }
.libro-cover { position: relative; align-self: start; margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.libro-cover img, .book-video { width: 100%; display: block; }
.video-toggle { position: absolute; left: 12px; bottom: 16px; z-index: 2; width: 44px; height: 44px; border: none; border-radius: 50%; cursor: pointer; color: #fff; background: rgba(27,27,38,.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; transition: background .15s ease, transform .15s ease; }
.video-toggle:hover { background: rgba(27,27,38,.85); transform: scale(1.06); }
.video-toggle .vt-play { margin-left: 2px; }
.video-toggle .vt-pause { display: none; }
.video-toggle.playing .vt-play { display: none; }
.video-toggle.playing .vt-pause { display: block; }
.video-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; background: rgba(27,27,38,.18); cursor: pointer; z-index: 2; touch-action: none; }
.video-progress:hover, .video-progress:focus-visible { height: 12px; }
.video-progress span { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: var(--rainbow); pointer-events: none; }
.libro-text { display: flex; flex-direction: column; }
.libro-text p { font-size: 1.08rem; margin: 0 0 18px; }

/* Store = money section. Pushed to the bottom so the column fills the video height. */
.tienda { margin-top: auto; padding-top: 30px; }
.tienda-heading { font-family: var(--font-title); font-size: clamp(1.9rem, 4.4vw, 2.6rem); margin: 0 0 18px; }
.store-group { margin-bottom: 16px; }
.store-group:last-child { margin-bottom: 0; }
.store-grouplabel { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--ink-soft); margin: 0 0 9px; }
.store-row { display: flex; flex-wrap: wrap; gap: 10px; }
.store { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); background: #fff; border: 1.5px solid var(--ink); border-radius: 999px; padding: 12px 22px; font-weight: 700; font-size: 1rem; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.store:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.store-ico { width: 1.15em; height: 1.15em; flex-shrink: 0; fill: currentColor; }
/* physical book = primary CTA → solid */
.store-group:first-of-type .store { background: var(--ink); color: #fff; }
.store-group:first-of-type .store:hover { background: #000; }

/* Desktop: the text column drives the height; the video fills its side as a matched rectangle. */
@media (min-width: 821px) {
  .libro-cover { align-self: stretch; }
  .book-video { height: 100%; object-fit: cover; }
}

/* ── Redes ────────────────────────────────── */
.redes-grid { display: grid; gap: 14px; grid-template-columns: repeat(5, 1fr); }
.red { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; background: var(--paper); transition: transform .2s ease, box-shadow .2s ease; }
.red:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.red-ico { width: 26px; height: 26px; fill: var(--ink); margin-bottom: 12px; }
.red h3 { font-size: 1.15rem; margin-bottom: 6px; }
.red p { margin: 0 0 14px; color: var(--ink-soft); font-size: .9rem; flex: 1; }
.red-cta { margin-top: auto; font-weight: 700; font-size: .9rem; color: var(--ink); text-decoration: none; }
.red-cta:hover { text-decoration: underline; }

/* ── Yo ───────────────────────────────────── */
.yo-grid { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: clamp(28px, 5vw, 56px); align-items: center; }
.yo-photo { position: relative; margin: 0; }
.yo-photo img:first-child { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); display: block; }
.yo-sticker { position: absolute; right: -16px; bottom: -16px; width: clamp(64px, 12vw, 90px); transform: rotate(8deg); }
.yo-text p { font-size: 1.08rem; margin: 0 0 18px; }

/* ── Footer / Contacto (simple, fixed layout: top · image · bottom) ── */
.site-footer { background: var(--ink); color: #fff; margin-top: clamp(36px, 7vw, 80px); }
.footer-inner { text-align: center; padding-block: clamp(48px, 8vw, 80px); }
.footer-cta { font-family: var(--font-title); font-size: clamp(1.9rem, 5vw, 2.8rem); margin: 0 0 20px; }
.footer-links { display: flex; justify-content: center; gap: 24px; margin: 0; flex-wrap: wrap; }
.footer-links a { display: inline-flex; align-items: center; gap: 7px; color: #fff; text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; padding-bottom: 2px; }
.footer-links a:hover { border-color: #fff; }
.foot-ico { width: 1.05em; height: 1.05em; flex-shrink: 0; fill: currentColor; }
.footer-art { display: block; margin: clamp(28px, 5vw, 44px) auto; width: clamp(80px, 14vw, 108px); height: auto; }
.footer-logo { margin: 0 auto 14px; filter: brightness(0) invert(1); transition: transform .2s ease; cursor: pointer; }
.footer-logo:hover { transform: scale(1.05); }
.footer-fine { color: rgba(255,255,255,.7); font-size: .85rem; margin: 0; }

/* ── Reveal ───────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Confetti canvas (footer logo easter egg) */
#confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 999; }

/* ── Responsive ───────────────────────────── */
@media (max-width: 820px) {
  .libro-grid, .yo-grid { grid-template-columns: 1fr; }
  .libro-cover { max-width: 320px; margin-inline: auto; }
  .yo-photo { max-width: 320px; }
  .redes-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-bg { opacity: .1; }
}
@media (max-width: 540px) {
  .site-header .bar { gap: 18px; }
  .brand img { width: 56px; }
  .bar-right { gap: 14px; }
  .nav { gap: 15px; font-size: .9rem; }
  .nav a { font-size: .9rem; }
  .lang button { padding: 6px 9px; font-size: .75rem; }
  .typeline { font-size: 1.15rem; }
  .hero-bg { width: 90vw; opacity: .08; }
}
