:root {
  --trigo: #F2B544;
  --tostado: #D9822B;
  --corteza: #7A4A1E;
  --miga: #FFF4DE;
  --carbon: #2B1E14;
  --tinta-suave: #5d4632;
  --linea: rgba(122, 74, 30, 0.16);
  --velo: rgba(255, 244, 222, 0.86);
  --radio: 24px;
  --font-marca: 'Fredoka', ui-rounded, system-ui, sans-serif;
  --font-texto: 'Inter', system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--miga);
  color: var(--carbon);
  font: 400 17px/1.55 var(--font-texto);
  overflow-x: hidden;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--tostado); outline-offset: 3px; border-radius: 8px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--corteza); color: #fff; padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 16px; }

/* --- capa fija -------------------------------------------------------------------- */
#mundo, .poster { position: fixed; inset: 0; width: 100%; height: 100%; }
#mundo { z-index: 0; opacity: 0; transition: opacity 0.9s ease; }
body.ready #mundo { opacity: 1; }
.poster { z-index: 0; display: grid; place-items: center; background: radial-gradient(120% 80% at 70% 40%, #fff9ec 0%, var(--miga) 55%, #f6e3bd 100%); transition: opacity 0.9s ease; }
.poster svg { width: min(34vw, 260px); margin-left: 34vw; filter: drop-shadow(0 30px 40px rgba(122, 74, 30, 0.22)); }
body.ready .poster { opacity: 0; pointer-events: none; }
body.scrolled .scroll-hint { opacity: 0; }
body.no-webgl .poster { opacity: 1; }

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  background: linear-gradient(to bottom, rgba(255, 244, 222, 0.92), rgba(255, 244, 222, 0));
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { width: 36px; height: 36px; }
.brand span { font: 600 26px/1 var(--font-marca); color: var(--corteza); letter-spacing: -0.5px; }
.topnav { display: flex; align-items: center; gap: 18px; font-weight: 500; font-size: 15px; }
.topnav a:not(.btn) { text-decoration: none; color: var(--tinta-suave); }
.topnav a:not(.btn):hover { color: var(--corteza); }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 21; }
.progress span { display: block; height: 100%; width: 100%; background: var(--tostado); transform-origin: 0 50%; transform: scaleX(0); }

/* --- capítulos ------------------------------------------------------------------- */
main { position: relative; z-index: 2; }
.chapter {
  position: relative;
  min-height: 130vh;
  display: flex; align-items: center;
  padding: 96px var(--gutter);
}
.chapter--hero { min-height: 100vh; }
.chapter--final { min-height: 100vh; align-items: flex-end; padding-bottom: 48px; }
.side-right { justify-content: flex-end; }
.side-center { justify-content: center; align-items: flex-start; padding-top: 84px; }

.card {
  max-width: 480px;
  padding: 30px 32px;
  border-radius: var(--radio);
  background: var(--velo);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px -30px rgba(122, 74, 30, 0.35);
}
.card--hero { max-width: 560px; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; }
.card--center { text-align: center; max-width: 620px; padding: 22px 28px; position: sticky; top: 84px; }
.card--center h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.card--forms { max-width: 860px; }
.forms { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.forms .locales { margin-top: 0; padding-top: 0; border-top: 0; padding-left: 28px; border-left: 1px dashed var(--linea); }
.forms .locales h3 { margin-top: 4px; }
.card--forms .form { gap: 10px; margin-top: 12px; }
.card--forms .notice { margin: 14px 0 0; }

.eyebrow { margin: 0 0 10px; font: 600 13px/1.2 var(--font-texto); letter-spacing: 0.12em; text-transform: uppercase; color: var(--tostado); }
h1, h2, h3 { font-family: var(--font-marca); font-weight: 600; letter-spacing: -0.02em; margin: 0 0 14px; line-height: 1.04; }
h1 { font-size: clamp(2.7rem, 6.2vw, 5.2rem); font-weight: 700; }
h1 em { font-style: normal; color: var(--corteza); background: linear-gradient(transparent 70%, rgba(242, 181, 68, 0.55) 70%); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: 1.45rem; margin-top: 30px; }
p { margin: 0 0 12px; }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--tinta-suave); max-width: 470px; }
.small { font-size: 15px; color: var(--tinta-suave); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--corteza); color: #fff; font: 600 16px/1 var(--font-texto); text-decoration: none; cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-1px); background: #5f3815; }
.btn--small { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn--ghost { background: transparent; color: var(--corteza); box-shadow: inset 0 0 0 2px var(--corteza); }
.btn--ghost:hover { background: rgba(122, 74, 30, 0.08); }
.btn--dark { background: var(--carbon); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.scroll-hint { transition: opacity 0.4s ease; position: absolute; bottom: 28px; left: var(--gutter); margin: 0; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tinta-suave); }
.scroll-hint::after { content: ""; display: block; width: 1px; height: 34px; margin: 10px 0 0 4px; background: var(--corteza); animation: hint 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes hint { 0%, 100% { transform: scaleY(0.3); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }

.questions { list-style: none; padding: 0; margin: 4px 0 16px; display: grid; gap: 8px; }
.questions li { justify-self: start; padding: 9px 16px; border-radius: 18px 18px 18px 4px; background: #fff; box-shadow: 0 6px 18px -10px rgba(43, 30, 20, 0.4); font-weight: 500; }
.questions li:nth-child(2) { margin-left: 22px; }
.questions li:nth-child(3) { margin-left: 8px; }

.seals { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.seal { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--linea); background: rgba(255, 255, 255, 0.55); transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease; cursor: default; }
.seal svg { width: 44px; height: 44px; flex: none; }
.seal strong { display: block; font: 600 17px/1.2 var(--font-marca); }
.seal span { font-size: 14.5px; color: var(--tinta-suave); }
.seal.is-hot { background: #fff; border-color: var(--trigo); transform: translateX(4px); }

/* --- formularios ----------------------------------------------------------------- */
.form { display: grid; gap: 12px; margin-top: 16px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--tinta-suave); }
.form input { min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--linea); background: #fff; font: 400 16px var(--font-texto); color: var(--carbon); }
.form input:focus { outline: none; border-color: var(--tostado); box-shadow: 0 0 0 3px rgba(242, 181, 68, 0.35); }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form__msg { min-height: 1.4em; margin: 0; font-size: 14.5px; }
.form__msg.ok { color: #3d6b2b; font-weight: 600; }
.form__msg.err { color: #a2361d; }
.locales { margin-top: 10px; padding-top: 6px; border-top: 1px dashed var(--linea); }
.notice { margin-top: 18px; font-size: 12.5px; color: var(--tinta-suave); }

.footer { position: relative; z-index: 2; padding: 36px var(--gutter) 44px; background: var(--carbon); color: #f3e6cf; font-size: 14px; }
.footer p { max-width: 760px; }
.footer a { color: var(--trigo); }

/* --- revelado -------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2, .7, .2, 1); }
.is-in .reveal { opacity: 1; transform: none; }
.is-in .reveal:nth-child(2) { transition-delay: 0.08s; }
.is-in .reveal:nth-child(3) { transition-delay: 0.16s; }
.is-in .reveal:nth-child(4) { transition-delay: 0.24s; }
.is-in .reveal:nth-child(5) { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint::after { animation: none; }
  #mundo, .poster { transition: none; }
}

/* --- mobile ---------------------------------------------------------------------- */
@media (max-width: 759px), (max-aspect-ratio: 4/5) {
  body { font-size: 16px; }
  .topnav a:not(.btn) { display: none; }
  .chapter { align-items: flex-end; justify-content: stretch; min-height: 120vh; padding: 88px 16px 7vh; }
  .chapter--hero { min-height: 100svh; }
  .side-center { align-items: flex-start; padding-top: 12vh; }
  .card { max-width: none; width: 100%; padding: 22px 20px; }
  .card--hero { padding: 22px 4px 8px; }
  .poster svg { width: 46vw; margin: 0 0 30vh; }
  .scroll-hint { display: none; }
  .chapter--final { align-items: flex-start; }
  .forms { grid-template-columns: 1fr; gap: 8px; }
  .forms .locales { padding-left: 0; border-left: 0; padding-top: 6px; border-top: 1px dashed var(--linea); }
  .card--center { top: 72px; }
}
