/* ============ Maldita Salsa — brand styles ============ */
@font-face {
  font-family: "Anton";
  src: url("fonts/Anton.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("fonts/Cinzel.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Great Vibes";
  src: url("fonts/GreatVibes.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --black: #0b0603;
  --coal: #17100a;
  --coal-2: #1f150c;
  --gold: #d9a441;
  --gold-2: #f3cd7a;
  --gold-dim: rgba(217, 164, 65, 0.28);
  --red: #e8442e;
  --flame: #ff5a26;
  --cream: #f7ead2;
  --muted: #bfae90;
  --radius: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(232, 68, 46, 0.16), transparent 60%),
    radial-gradient(90% 50% at 50% 115%, rgba(217, 164, 65, 0.10), transparent 60%),
    var(--black);
  color: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

img { display: block; max-width: 100%; }
a { color: inherit; }

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============ Hero ============ */
.hero {
  text-align: center;
  padding: 34px 0 8px;
}

.hero-logo {
  width: 104px;
  height: 104px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 2px solid var(--gold-dim);
  box-shadow: 0 0 0 4px rgba(217, 164, 65, 0.08), 0 10px 34px rgba(0, 0, 0, 0.6);
}

.hero-eyebrow {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.brand {
  font-family: "Anton", sans-serif;
  font-size: clamp(2.9rem, 14.5vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.brand-a {
  background: linear-gradient(180deg, #ffe9ad 0%, var(--gold-2) 34%, var(--gold) 62%, #9a6b1e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.brand-b {
  background: linear-gradient(180deg, #ffb199 0%, var(--flame) 45%, var(--red) 78%, #a11f10 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-tag {
  margin-top: 12px;
  font-size: 1.02rem;
  color: var(--cream);
}

.hero-visual {
  margin: 24px auto 22px;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid var(--gold-dim);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 44px rgba(232, 68, 46, 0.12);
  perspective: 900px;
  background: var(--coal);
  aspect-ratio: 1 / 1;
}

.hero-visual > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.05);
  transition: transform 0.45s ease;
  will-change: transform;
}

/* The global `img { display: block }` reset (author origin) beats the UA's
   [hidden] rule, so heroImg.hidden = true in app.js used to change nothing:
   the fallback photo kept the figure's box and the unhidden .spin-ui was
   stacked below it, clipped away by overflow: hidden. Restore hidden. */
.hero-visual > img[hidden] { display: none; }

.spin-ui {
  position: relative;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.spin-ui:active { cursor: grabbing; }

.spin-ui img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.spin-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(11, 6, 3, 0.72);
  border: 1px solid var(--gold-dim);
  color: var(--gold-2);
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.spin-hint.gone { opacity: 0; }

/* .spin-hint sets display:inline-flex (author origin), which beats the UA's
   [hidden] rule — same trap as the hero img in round 1. Restore hidden. */
.spin-hint[hidden] { display: none; }

.pour-hint { bottom: 60px; }

/* ============ Open-and-pour stage (tap the bottle) ============
   Layers are full-canvas slices of frame-00 (body / band / cap) stacked in
   registration inside .pour-tilt; the stream is an SVG in figure coords.
   Beat classes are added/removed by app.js: band-off, cap-twist, cap-off,
   tilted, pouring. Removing every class settles back to the sealed bottle. */
.pour-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pour-stage[hidden] { display: none; }

.pour-tilt {
  position: absolute;
  inset: 0;
  transform-origin: 50% 52%;
  transition: transform 0.8s cubic-bezier(0.55, 0.06, 0.35, 1);
  will-change: transform;
}

.pour-stage.tilted .pour-tilt { transform: rotate(117deg); }

.pour-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The band is two half-canvas copies of the same slice, clipped at the
   bottle's front-center: on band-off the ring SNAPS at the front and the
   two ends swing down and away — a torn collar falling open. (First cut
   slid the whole strip sideways with a clip eating it: at mid-beat the
   remnant read as a blurry tab sticking out of the shoulder, not a peel.) */
.pour-band {
  transform-origin: 50% 31.5%;
  transition: transform 0.7s cubic-bezier(0.5, 0, 0.8, 0.4), opacity 0.6s ease-in;
}

.pour-band-l { clip-path: inset(0 50% 0 0); }
.pour-band-r { clip-path: inset(0 0 0 50%); }

.pour-stage.band-off .pour-band-l { transform: translate(-5%, 7%) rotate(-17deg); opacity: 0; }
.pour-stage.band-off .pour-band-r { transform: translate(5%, 7%) rotate(17deg); opacity: 0; }

.pour-cap {
  transform-origin: 50% 12.5%;
  transition: transform 0.45s ease-in-out, opacity 0.35s ease;
}

.pour-stage.cap-twist .pour-cap { transform: translateY(-1.2%) rotate(-13deg); }

/* Listed after cap-twist on purpose: same specificity, so cap-off wins
   while both classes are present. */
.pour-stage.cap-off .pour-cap {
  transform: translate(17%, -14%) rotate(24deg);
  opacity: 0;
  transition-duration: 0.6s, 0.5s;
  transition-delay: 0s, 0.08s;
}

.pour-stream-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pour-stream {
  transform-box: view-box;
  transform-origin: 812px 640px;
  transform: scaleY(0);
  transition: transform 0.5s ease-in;
}

.pour-stage.pouring .pour-stream { transform: scaleY(1); }

.pour-pool, .pour-pool-shine {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  opacity: 0;
  transition: transform 0.6s ease-out 0.15s, opacity 0.4s ease 0.15s;
}

.pour-stage.pouring .pour-pool,
.pour-stage.pouring .pour-pool-shine { transform: scale(1); opacity: 1; }

.pour-drop { opacity: 0; }

.pour-stage.pouring .pour-drop-a { animation: pourDrop 0.9s ease-in 0.05s infinite; }
.pour-stage.pouring .pour-drop-b { animation: pourDrop 0.9s ease-in 0.45s infinite; }

@keyframes pourDrop {
  0% { transform: translateY(0); opacity: 0; }
  18% { opacity: 0.9; }
  82% { opacity: 0.9; }
  100% { transform: translateY(232px); opacity: 0; }
}

/* ============ Buttons ============ */
.btn {
  display: inline-block;
  font-family: "Anton", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 1.02rem;
  text-decoration: none;
  text-align: center;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 15px 34px;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.btn:active { transform: scale(0.97); }

.btn-order {
  color: #fff;
  background: linear-gradient(135deg, var(--flame) 0%, var(--red) 58%, #b32413 100%);
  box-shadow: 0 12px 30px rgba(232, 68, 46, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-gold {
  color: #241503;
  background: linear-gradient(135deg, var(--gold-2) 0%, var(--gold) 60%, #a97a26 100%);
  box-shadow: 0 10px 26px rgba(217, 164, 65, 0.28);
}

.btn-block { display: block; width: 100%; }

/* ============ Sections ============ */
.section { padding: 40px 0 6px; }

.sec-title {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  color: var(--gold-2);
}

.sec-script {
  font-family: "Great Vibes", cursive;
  font-size: 1.9rem;
  text-align: center;
  color: var(--flame);
  margin-top: 2px;
}

/* ============ Product duo (two photos, side by side) ============ */
.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 22px;
}

.duo-item { text-align: center; }

.duo-img {
  width: 100%;
  /* height:auto is load-bearing, not decoration: the width/height attributes
     on these <img> tags otherwise win the cascade over aspect-ratio (live
     computed height measured = the attribute height, 1207/924, while computed
     aspect-ratio read 3/4) — the intended box never existed and object-fit:
     cover sliced a zoomed center strip out of each photo. */
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  object-position: center;
  background: var(--coal);
  border-radius: var(--radius);
  border: 1px solid var(--gold-dim);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.55);
}

.duo-name {
  margin-top: 13px;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--gold-2);
}

.duo-item .price { margin-top: 10px; }

.price {
  display: inline-block;
  margin-top: 13px;
  padding: 6px 13px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-2);
}

/* ============ Steps ============ */
.steps {
  list-style: none;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  background: var(--coal);
  border: 1px solid rgba(217, 164, 65, 0.18);
  border-radius: 16px;
  padding: 16px;
}

.step-num {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  color: var(--gold-2);
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 12px rgba(217, 164, 65, 0.15);
}

.step-title {
  font-family: "Cinzel", serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--cream);
}

.step-text {
  margin-top: 4px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ============ Footer ============ */
.footer {
  text-align: center;
  padding: 48px 0 18px;
}

.foot-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 50%;
  opacity: 0.95;
}

.foot-brand {
  font-family: "Cinzel", serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--cream);
}

.foot-ig { margin-top: 6px; }

.foot-ig a {
  color: var(--gold-2);
  text-decoration: none;
  font-size: 0.95rem;
}

.foot-credit {
  margin-top: 20px;
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.85;
}

/* ============ Sticky bar ============ */
.sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(11, 6, 3, 0.82);
  border-top: 1px solid rgba(217, 164, 65, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sticky-bar .btn { max-width: 560px; margin: 0 auto; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  z-index: 60;
  background: var(--coal-2);
  color: var(--gold-2);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 0.9rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============ Fallback sheet ============ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-backdrop[hidden] { display: none; }

.sheet {
  width: 100%;
  max-width: 560px;
  background: var(--coal);
  border-top: 1px solid var(--gold-dim);
  border-radius: 24px 24px 0 0;
  padding: 24px 22px calc(22px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-title {
  font-family: "Cinzel", serif;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gold-2);
  text-align: center;
}

.sheet-msg {
  border: 1.5px dashed var(--gold-dim);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--cream);
  -webkit-user-select: all;
  user-select: all;
}

.sheet-help {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.sheet-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.92rem;
  padding: 8px;
  cursor: pointer;
  font-family: inherit;
}

/* ============ Small screens / motion ============ */
@media (max-width: 380px) {
  .duo-name { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-visual > img { transition: none; transform: none; }
  .btn { transition: none; }
  /* The pour is never armed under reduced motion (app.js); kill its
     transitions too so nothing can drift if a class lands by accident. */
  .pour-tilt, .pour-band, .pour-cap, .pour-stream, .pour-pool, .pour-pool-shine { transition: none; }
  .pour-stage.pouring .pour-drop-a, .pour-stage.pouring .pour-drop-b { animation: none; }
}
