/* Pabilo Tibio — hoja de estilos
   Idea: la página cambia de "día" a "luz de vela". Al encender la vela de la portada,
   todo pasa a una paleta nocturna y el cursor se vuelve la llama.
   Letras: Sofia Sans Extra Condensed (títulos, altas y finas como una vela) + Newsreader (texto). */

:root {
  --ink: #2a1d33;
  --bruma: #e9e5f0;
  --cera: #f6f3f8;
  --salvia: #b8c7ad;
  --ciruela: #4a2650;
  --ambar: #f2c98b;
  --flame: #ffb347;
  --flame-deep: #e8912d;
  --paper: #fbf8f3;

  --display: "Sofia Sans Extra Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Newsreader", Georgia, "Times New Roman", serif;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --board: linear-gradient(#cbbba8, #9d8975);
  --focus: var(--ink);
}

html[data-room="night"] {
  --board: linear-gradient(#4a3a3f, #2c2127);
  --focus: var(--flame);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.1875rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  color: var(--ink);
  background: var(--bruma);
}

svg { max-width: 100%; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

[hidden] { display: none !important; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .6rem 1rem;
  background: var(--flame); color: var(--ink); font-weight: 700; text-decoration: none; border-radius: 3px;
}
.skip:focus { top: 1rem; }

.wrap { width: 100%; max-width: 78rem; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Bandas (cambian con la luz) ---------- */
.band { padding-block: clamp(3.5rem, 9vw, 7rem); transition: background-color .9s ease, color .9s ease; }
.band--hero    { background: var(--bruma);   color: var(--ink); }
.band--shelf   { background: var(--cera);    color: var(--ink); }
.band--care    { background: var(--salvia);  color: var(--ink); }
.band--gift    { background: var(--ciruela); color: #f6eef4; --focus: var(--flame); }
.band--contact { background: var(--ambar);   color: var(--ink); }

html[data-room="night"] .band--hero    { background: #19111f; color: #f2e8dc; }
html[data-room="night"] .band--shelf   { background: #221829; color: #f2e8dc; }
html[data-room="night"] .band--care    { background: #1c2a21; color: #eaf0e4; }
html[data-room="night"] .band--gift    { background: #2d1733; color: #f6eef4; }
html[data-room="night"] .band--contact { background: #33231a; color: #f6e6d2; }

.h2, .h3 { font-family: var(--display); margin: 0; }
.h2 { font-weight: 700; font-size: clamp(2.8rem, 6.4vw, 5.4rem); line-height: .88; max-width: 15ch; text-wrap: balance; }
.h3 { font-weight: 700; font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: .95; }
.band__sub { max-width: 52ch; margin: 1.1rem 0 0; }

/* ---------- Botones ---------- */
.btn {
  font: 600 1.05rem/1 var(--body); letter-spacing: .01em;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1rem 1.6rem; border: 2px solid currentColor; border-radius: 3px;
  background: none; color: inherit; cursor: pointer; text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn--small { padding: .7rem 1.15rem; font-size: 1rem; }
.btn--flame { background: var(--flame); border-color: var(--flame); color: var(--ink); }
.btn--flame:hover { background: #ffc66e; border-color: #ffc66e; }
.btn--line:hover, .btn--line-ink:hover { background: rgba(127, 127, 127, .2); }
.btn--plain { border-color: transparent; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Navegación ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem 2rem; padding-block: 1.4rem; }
.logo { font: 800 1.9rem/1 var(--display); text-decoration: none; letter-spacing: .01em; }
.nav__links { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; list-style: none; margin: 0 auto 0 1rem; padding: 0; }
.nav__links a { text-decoration: none; font-weight: 500; padding-block: .25rem; border-bottom: 2px solid transparent; }
.nav__links a:hover { border-bottom-color: currentColor; }

.toggle {
  display: inline-flex; align-items: center; gap: .6rem; padding: .55rem 1.05rem;
  font: 600 1rem/1 var(--body); color: inherit; background: none; border: 2px solid currentColor; border-radius: 999px; cursor: pointer;
}
.toggle__dot { width: .85rem; height: .85rem; border-radius: 50%; border: 2px solid currentColor; transition: background-color .3s ease, box-shadow .3s ease; }
.toggle[aria-pressed="true"] .toggle__dot { background: var(--flame); border-color: var(--flame); box-shadow: 0 0 10px 2px rgba(255, 179, 71, .8); }

/* ---------- Portada ---------- */
.hero { padding-block: 0 clamp(2.5rem, 6vw, 4.5rem); overflow: hidden; --stage-h: clamp(24rem, 60vh, 36rem); --cw: calc(var(--stage-h) * .62); }

.hero__stage { position: relative; min-height: var(--stage-h); display: flex; align-items: flex-end; margin-top: 1rem; }
.hero__title {
  margin: 0; width: 100%; display: grid; grid-template-columns: 1fr var(--cw) 1fr; align-items: end;
  font-family: var(--display); font-size: clamp(4rem, 13.5vw, 14rem); line-height: .78; letter-spacing: .005em;
}
.t1 { justify-self: end; font-weight: 900; padding-right: .06em; }
.t2 { justify-self: start; font-weight: 200; padding-left: .06em; }

.hero__candle { position: absolute; left: 50%; bottom: 0; height: 100%; transform: translateX(-50%); pointer-events: none; }
.hero__candle svg { height: 100%; width: auto; display: block; overflow: visible; }

.hero__foot { display: grid; justify-items: center; text-align: center; gap: 1.4rem; margin-top: 2.25rem; }
.lede { margin: 0; font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.35; font-style: italic; max-width: 30ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .85rem; justify-content: center; }
.hint { margin: 0; max-width: 44ch; }

@media (max-width: 719px) {
  .hero__stage { display: block; min-height: 0; }
  .hero__title { display: block; text-align: center; font-size: clamp(4.5rem, 26vw, 9rem); line-height: .82; }
  .hero__title span { display: block; padding: 0; }
  .hero__candle { position: static; transform: none; height: 22rem; margin: 1.5rem auto 0; display: flex; justify-content: center; }
}

/* ---------- Estantería ---------- */
.moments { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin-top: 2.25rem; }
.moments button {
  font: 600 1.7rem/1 var(--display); color: inherit; background: none; border: 0; padding: .25rem 0 .35rem;
  border-bottom: 3px solid transparent; cursor: pointer;
}
.moments button:hover { border-bottom-color: rgba(127, 127, 127, .6); }
.moments button[aria-pressed="true"] { border-bottom-color: currentColor; }
.moments__line { margin: 1rem 0 0; min-height: 1.65em; }

.shelf {
  --gap: clamp(1rem, 3vw, 2.5rem);
  display: flex; align-items: flex-end; gap: var(--gap); overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity; padding: 3.5rem var(--gutter) 1.5rem; margin-top: .5rem;
}
.shelf > :first-child { margin-left: auto; }
.shelf > :last-child { margin-right: auto; }

.candle {
  flex: 0 0 auto; width: clamp(8.25rem, 13vw, 11rem); scroll-snap-align: center;
  display: grid; justify-items: center; gap: .6rem; padding: 0; border: 0; background: none; color: inherit; cursor: pointer;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .35s ease, filter .35s ease;
}
.candle svg { width: 100%; height: auto; display: block; overflow: visible; }
.candle:hover { transform: translateY(-5px); }
.candle[aria-pressed="true"] { transform: translateY(-12px); }
.candle.is-dim { opacity: .3; filter: saturate(.3); }
.plank { display: block; height: 1rem; width: calc(100% + var(--gap)); margin-top: -.6rem; background: var(--board); border-radius: 2px; }
.candle__name { font: 600 1.55rem/1 var(--display); padding-bottom: .15rem; border-bottom: 3px solid transparent; }
.candle[aria-pressed="true"] .candle__name { border-bottom-color: currentColor; }

.sheet { margin-top: 2.5rem; padding-top: 2rem; border-top: 3px solid currentColor; display: grid; gap: 2rem; }
.sheet__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1.25rem 2rem; }
.sheet__desc { margin: .75rem 0 0; max-width: 54ch; }
.sheet__body { display: grid; gap: 2.5rem 4rem; }
@media (min-width: 900px) { .sheet__body { grid-template-columns: 1.05fr .95fr; } }

.pyramid { display: grid; gap: .55rem; align-content: start; }
.layer { margin-inline: auto; width: 100%; padding: .9rem 1.15rem 1rem; background: rgba(127, 127, 127, .14); border-top: 6px solid var(--wax, var(--flame-deep)); }
.layer--top { width: 74%; }
.layer--heart { width: 87%; }
.layer h4 { margin: 0; font: 700 1.45rem/1 var(--display); }
.layer p { margin: .3rem 0 0; }
@media (max-width: 560px) { .layer--top, .layer--heart { width: 100%; } }

.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 0 0 1.75rem; }
.specs dt { font-weight: 600; }
.specs dd { margin: 0; font: 700 2rem/1.05 var(--display); }
.calc { margin-bottom: 1.75rem; }
.calc label { display: block; font-weight: 600; margin-bottom: .4rem; }
.calc input { width: 100%; accent-color: var(--flame-deep); }
.calc p { margin: .5rem 0 0; font-size: 1.05rem; }
.buy { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }

.stepper { display: inline-flex; align-items: center; border: 2px solid currentColor; border-radius: 3px; }
.stepper button { width: 2.6rem; height: 2.9rem; background: none; border: 0; color: inherit; font: 600 1.4rem/1 var(--body); cursor: pointer; }
.stepper button:hover { background: rgba(127, 127, 127, .2); }
.stepper output { min-width: 2.4rem; text-align: center; font-weight: 700; }

/* ---------- Llamas ---------- */
.candle-svg .flame { opacity: 0; transition: opacity .5s ease; }
.candle-svg.is-lit .flame { opacity: 1; }
.candle-svg .f, .candle-svg .core, .candle-svg .halo { transform-box: fill-box; transform-origin: 50% 100%; }
.candle-svg.is-lit .f { animation: flicker 2.6s ease-in-out infinite; }
.candle-svg.is-lit .core { animation: flicker 2.1s ease-in-out infinite reverse; }
.candle-svg.is-lit .halo { transform-origin: 50% 50%; animation: breathe 3.2s ease-in-out infinite; }
@keyframes flicker {
  0%, 100% { transform: scale(1, 1) rotate(-1deg); }
  20% { transform: scale(.95, 1.06) rotate(1.8deg); }
  45% { transform: scale(1.04, .96) rotate(-2.2deg); }
  70% { transform: scale(.97, 1.04) rotate(1.2deg); }
}
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.92); opacity: .82; } }

/* Luz que sigue al cursor cuando la vela está encendida */
.glow {
  position: fixed; inset: 0; z-index: 35; pointer-events: none; opacity: 0; mix-blend-mode: screen;
  transition: opacity .9s ease;
  background: radial-gradient(circle 30rem at var(--gx, 50%) var(--gy, 40%), rgba(255, 170, 70, .3), rgba(255, 140, 40, .1) 45%, rgba(255, 140, 40, 0) 72%);
}
html[data-room="night"] .glow { opacity: 1; }

/* ---------- Cómo encenderlas ---------- */
.band--care .h2 { margin-bottom: 1rem; max-width: 18ch; }
.rail { list-style: none; margin: 2.5rem 0 0; padding: 0 0 0 .6rem; }
.rail li { position: relative; display: grid; gap: .5rem 3rem; padding: 1.4rem 0 1.6rem 2.2rem; border-left: 3px solid currentColor; }
.rail li::before {
  content: ""; position: absolute; left: -.65rem; top: 1.9rem; width: 1.1rem; height: 1.1rem;
  border-radius: 50%; background: var(--flame); border: 3px solid currentColor;
}
.rail__time { margin: 0; font: 800 clamp(1.9rem, 3.6vw, 2.8rem)/.95 var(--display); }
.rail p { margin: 0; max-width: 46ch; }
@media (min-width: 800px) { .rail li { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: baseline; } }

/* ---------- Para regalar ---------- */
.gift { display: grid; gap: 3rem; align-items: center; }
.gift__form { display: grid; gap: 1rem; max-width: 34rem; }
.gift__form .h2 { margin-bottom: .25rem; }
.gift__form > p { margin: 0 0 .5rem; }
.field { display: grid; gap: .3rem; }
.field label { font-weight: 600; }
.field input, .field select {
  font: 500 1.05rem/1.3 var(--body); color: var(--ink); background: var(--paper);
  border: 2px solid var(--paper); border-radius: 3px; padding: .75rem .9rem; width: 100%;
}
.gift__form .btn { justify-self: start; margin-top: .5rem; }
.gift__status { min-height: 1.65em; margin: 0; font-weight: 600; }
.gift__preview { display: grid; place-items: center; padding: 2rem 1rem 1rem; }
.gift__preview svg { height: clamp(18rem, 44vh, 28rem); width: auto; overflow: visible; }
@media (min-width: 900px) { .gift { grid-template-columns: 1fr 1fr; gap: 5rem; } }

/* ---------- Contacto ---------- */
.contact { display: grid; gap: 3rem; }
.contact .h2 { margin-bottom: 1.25rem; }
.contact__text { max-width: 50ch; margin: 0 0 1.75rem; }
.details { margin: 0; display: grid; gap: 1.5rem; align-content: start; }
.details dt { font: 700 1.7rem/1 var(--display); margin-bottom: .3rem; }
.details dd { margin: 0; }
.details a { text-underline-offset: 3px; font-weight: 600; }
@media (min-width: 900px) { .contact { grid-template-columns: 1.1fr .9fr; gap: 5rem; } }

/* ---------- Pie ---------- */
.footer { background: var(--ink); color: #f2e8dc; padding-block: 2rem; --focus: var(--flame); transition: background-color .9s ease; }
html[data-room="night"] .footer { background: #120b17; }
.footer__row { display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; align-items: baseline; }
.footer p { margin: 0; }
.footer__brand { font: 800 1.8rem/1 var(--display); color: var(--flame); }

/* ---------- Barra de pedido ---------- */
.orderbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .85rem var(--gutter); background: var(--ink); color: #f2e8dc; --focus: var(--flame);
  border-top: 3px solid var(--flame);
}
.orderbar p { margin: 0; font-weight: 600; }
body.has-order .footer { padding-bottom: 5.5rem; }

/* ---------- Ticket ---------- */
.ticket { border: 0; padding: 0; background: transparent; width: min(30rem, 92vw); max-height: 92vh; color: var(--ink); --focus: var(--ink); }
.ticket::backdrop { background: rgba(25, 17, 31, .65); }
.ticket__inner {
  background: var(--paper); padding: 1.75rem 1.75rem 3rem;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 18px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 18px 100%;
}
.ticket__title { margin: 0 0 1rem; font: 800 2.6rem/.9 var(--display); }
.ticket__list { list-style: none; margin: 0; padding: 0; }
.ticket__list li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 2px dotted var(--ink); }
.ticket__list .stepper button { width: 2.2rem; height: 2.4rem; }
.ticket__list strong { display: block; }
.ticket__note { margin: 1rem 0 0; padding: .8rem 1rem; background: rgba(42, 29, 51, .08); }
.ticket__total { display: flex; justify-content: space-between; align-items: baseline; margin: 1.25rem 0; font: 700 1.9rem/1 var(--display); }
.ticket__total strong { font-size: 2.6rem; }
.ticket__actions { display: grid; gap: .6rem; }
.ticket__actions .btn--flame { width: 100%; }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
