/* Puertitas — identidad inspirada en el retablo ayacuchano */
:root {
  --anil: #1f2a6b;
  --anil-hondo: #141c4d;
  --fucsia: #c62835;
  --maiz: #f2b630;
  --hoja: #2e8b57;
  --papel: #fffbf3;
  --tinta: #1a1530;
  --madera: #8a4b2a;

  --f: "Bricolage Grotesque", system-ui, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.333rem;
  --step-2: 1.777rem;
  --step-3: 2.369rem;
  --step-4: clamp(2.6rem, 6vw, 4.2rem);
  --r-door: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--tinta);
  background: var(--papel);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--maiz); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- barra superior ---------- */
.topbar {
  background: var(--fucsia);
  color: #fff;
  text-align: center;
  font-size: var(--step--1);
  padding: .45rem 1rem;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 1.1rem;
}
.logo {
  font-weight: 800; font-size: var(--step-1); letter-spacing: -.02em;
  text-decoration: none; display: flex; align-items: center; gap: .5rem;
}
.logo-mark {
  width: 28px; height: 32px; border-radius: 14px 14px 4px 4px;
  background:
    linear-gradient(90deg, transparent 47%, var(--maiz) 47% 53%, transparent 53%),
    var(--fucsia);
  border: 3px solid var(--anil);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 700;
  border: 0; cursor: pointer; text-decoration: none;
  border-radius: 999px; padding: .9rem 1.6rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-main { background: var(--fucsia); color: #fff; box-shadow: 0 4px 0 #8c1622; }
.btn-main:hover { box-shadow: 0 6px 0 #8c1622; transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--anil); border: 2px solid var(--anil); padding: .55rem 1.1rem; }
.btn-light { background: var(--maiz); color: var(--tinta); box-shadow: 0 4px 0 #b9850f; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1fr 1.05fr; gap: 3rem; align-items: center;
  padding-block: 2.5rem 5rem;
}
.hero h1 {
  font-size: var(--step-4); line-height: 1.02; letter-spacing: -.035em;
  font-weight: 800; margin: 0 0 1.25rem;
  font-variation-settings: "wdth" 85;
}
.hero p.lead { font-size: var(--step-1); max-width: 30ch; margin: 0 0 2rem; color: #3a3355; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1.5rem; font-size: var(--step--1); color: #4b4566; }
.hero-meta span::before { content: "✿ "; color: var(--hoja); }

/* ---------- el retablo ---------- */
.retablo {
  position: relative;
  background: var(--anil);
  border-radius: 140px 140px 18px 18px;
  padding: 5.4rem 1.1rem 1.1rem;
  border: 10px solid var(--madera);
  box-shadow: inset 0 0 0 4px var(--maiz), 0 30px 60px -25px rgba(31,42,107,.55);
}
.retablo-title {
  position: absolute; top: 1.4rem; left: 0; right: 0; text-align: center;
  color: var(--papel); font-weight: 700; font-size: var(--step-1); letter-spacing: -.01em;
}
.retablo-title small { display: block; font-weight: 400; font-size: var(--step--1); opacity: .8; }
.retablo-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 64px;
  gap: 8px;
}
.door {
  --c: var(--fucsia);
  position: relative; perspective: 600px;
  border: 0; padding: 0; background: var(--anil-hondo);
  border-radius: var(--r-door); cursor: pointer; font: inherit;
}
.door.big { grid-column: span 2; grid-row: span 2; }
.door.wide { grid-column: span 2; }
.door.tall { grid-row: span 2; }
.door-face {
  position: absolute; inset: 0; border-radius: var(--r-door);
  background:
    radial-gradient(circle at 78% 26%, rgba(255,255,255,.35) 0 4px, transparent 5px),
    radial-gradient(circle at 70% 34%, rgba(255,255,255,.25) 0 3px, transparent 4px),
    var(--c);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.18);
  transform-origin: left center;
  transition: transform .7s cubic-bezier(.2,.8,.2,1);
  display: flex; align-items: flex-end; padding: .4rem .55rem;
  color: #fff; font-weight: 800; font-size: 1.15rem; line-height: 1;
  backface-visibility: hidden;
}
.door.big .door-face { font-size: 3rem; align-items: center; justify-content: center; }
.door[data-tone="maiz"] { --c: var(--maiz); }
.door[data-tone="maiz"] .door-face { color: var(--tinta); }
.door[data-tone="hoja"] { --c: var(--hoja); }
.door[data-tone="papel"] { --c: #f6e7cf; }
.door[data-tone="papel"] .door-face { color: var(--anil); }
.door[data-tone="anil"] { --c: #3a49a8; }
.door-inside {
  position: absolute; inset: 0; border-radius: var(--r-door);
  display: grid; place-items: center; font-size: 1.4rem;
  background: var(--papel);
}
.door.open .door-face { transform: rotateY(-105deg); }
.door.locked .door-face::after {
  content: ""; position: absolute; right: .45rem; top: .45rem;
  width: 10px; height: 8px; border-radius: 2px; background: rgba(0,0,0,.28);
  box-shadow: 0 -5px 0 -1px transparent;
}
.door.today .door-face { box-shadow: inset 0 0 0 3px var(--papel); animation: llamar 2.4s ease-in-out infinite; }
@keyframes llamar { 50% { transform: rotateY(-12deg); } }
.door.locked { cursor: not-allowed; }
.retablo-note { color: var(--papel); text-align: center; font-size: var(--step--1); margin: .9rem 0 0; opacity: .85; }

/* ---------- modal del contenido ---------- */
.sheet {
  border: 0; padding: 0; border-radius: 20px; width: min(420px, 92vw);
  background: var(--papel); color: var(--tinta);
  box-shadow: 0 30px 80px rgba(20,28,77,.45);
}
.sheet::backdrop { background: rgba(20,28,77,.6); }
.sheet-head { background: var(--anil); color: var(--papel); padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; }
.sheet-head b { font-size: var(--step-1); }
.sheet-close { background: none; border: 0; color: inherit; font: inherit; font-size: 1.5rem; cursor: pointer; line-height: 1; }
.sheet-body { padding: 1.5rem 1.25rem 1.75rem; }
.sheet-body h3 { margin: 0 0 .5rem; font-size: var(--step-2); line-height: 1.1; letter-spacing: -.02em; }
.sheet-body p { margin: 0 0 1rem; }
.polaroid { background: #fff; padding: .6rem .6rem 2.2rem; box-shadow: 0 8px 24px rgba(0,0,0,.15); transform: rotate(-2deg); position: relative; margin-bottom: 1rem; }
.polaroid .pic { aspect-ratio: 4/3; border-radius: 2px; background: linear-gradient(160deg, #f2b630, #c62835 60%, #1f2a6b); }
.polaroid span { position: absolute; bottom: .55rem; left: 0; right: 0; text-align: center; font-weight: 600; }
.voice { display: flex; align-items: center; gap: .75rem; background: #fff; border-radius: 999px; padding: .5rem .9rem .5rem .5rem; box-shadow: 0 2px 0 rgba(0,0,0,.06); }
.voice button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--fucsia); color: #fff; cursor: pointer; font-size: 1rem; }
.wave { flex: 1; height: 26px; background: repeating-linear-gradient(90deg, var(--anil) 0 3px, transparent 3px 7px); mask: linear-gradient(90deg, #000 0 0); opacity: .7; clip-path: polygon(0 40%,5% 20%,10% 60%,15% 10%,20% 50%,25% 30%,30% 70%,35% 20%,40% 55%,45% 5%,50% 45%,55% 25%,60% 65%,65% 15%,70% 50%,75% 35%,80% 60%,85% 20%,90% 45%,95% 30%,100% 50%,100% 100%,0 100%); }
.vale { border: 3px dashed var(--fucsia); border-radius: 14px; padding: 1rem; text-align: center; font-weight: 700; font-size: var(--step-1); }

/* ---------- secciones ---------- */
section { padding-block: 5rem; }
.sec-title { font-size: var(--step-3); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; margin: 0 0 1rem; max-width: 22ch; }
.sec-lead { max-width: 52ch; color: #3a3355; margin: 0 0 3rem; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; counter-reset: paso; }
.steps li { counter-increment: paso; border-top: 4px solid var(--anil); padding-top: 1rem; }
.steps li::before { content: counter(paso); display: block; font-weight: 800; font-size: var(--step-3); color: var(--fucsia); line-height: 1; margin-bottom: .5rem; }
.steps h3 { margin: 0 0 .35rem; font-size: var(--step-1); line-height: 1.2; }
.steps p { margin: 0; color: #4b4566; }

.lejos { background: var(--anil); color: var(--papel); }
.lejos .sec-lead { color: #d7dbf5; }
.ciudades { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.ciudades li { border: 2px solid rgba(255,251,243,.35); border-radius: 999px; padding: .4rem 1rem; font-size: var(--step--1); }
.ciudades li b { color: var(--maiz); }

.que-va { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem 2.5rem; margin: 0; padding: 0; list-style: none; }
.que-va li { padding-left: 2.2rem; position: relative; }
.que-va li i { position: absolute; left: 0; top: .1rem; font-style: normal; font-size: 1.3rem; }
.que-va b { display: block; font-size: var(--step-1); }
.que-va span { color: #4b4566; }

.precio { background: var(--maiz); }
.precio-box { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.monto { font-size: clamp(4rem, 12vw, 8rem); font-weight: 800; line-height: .9; letter-spacing: -.05em; margin: 0; }
.monto small { font-size: .3em; letter-spacing: 0; font-weight: 700; vertical-align: top; margin-right: .2rem; }
.precio ul { list-style: none; margin: 0 0 2rem; padding: 0; }
.precio li { padding: .55rem 0; border-bottom: 1px solid rgba(26,21,48,.15); }
.precio li::before { content: "✓  "; font-weight: 800; color: var(--anil); }
.pagos { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; font-size: var(--step--1); }
.pagos span { background: var(--papel); border-radius: 6px; padding: .25rem .6rem; font-weight: 700; }

.faq details { border-bottom: 1px solid #e5dccb; padding: 1.1rem 0; max-width: 70ch; }
.faq summary { cursor: pointer; font-weight: 700; font-size: var(--step-1); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::after { content: "+"; color: var(--fucsia); font-size: 1.5rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: .75rem 0 0; color: #4b4566; }

.cierre { text-align: center; background: var(--fucsia); color: #fff; }
.cierre .sec-title { margin-inline: auto; }
footer { padding: 2rem 0; font-size: var(--step--1); color: #6b6585; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

.sticky-cta { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 1rem; }
  .steps { grid-template-columns: 1fr 1fr; }
  .que-va { grid-template-columns: 1fr 1fr; }
  .precio-box { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 560px) {
  .retablo { border-radius: 90px 90px 14px 14px; padding: 4.8rem .6rem .7rem; border-width: 7px; }
  .retablo-grid { grid-auto-rows: 48px; gap: 6px; }
  .door-face { font-size: .95rem; padding: .3rem .4rem; }
  .door.big .door-face { font-size: 2.2rem; }
  .steps, .que-va { grid-template-columns: 1fr; }
  section { padding-block: 3.5rem; }
  .nav .btn-ghost { display: none; }
  .sticky-cta { display: flex; position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 5; }
  body { padding-bottom: 5rem; }
}
/* Movimiento reducido: se quitan los bucles automáticos y el confeti (clase puesta por app.js);
   lo que responde a un toque sigue animado. */
.calm { scroll-behavior: auto; }
.calm .mini-retablo, .calm .door.today .door-face, .calm .mini-grid span.today { animation: none !important; }
