:root {
  --bg: #0f0722;
  --bg-deep: #070311;
  --violet: #2d1b4e;
  --violet-glow: rgba(168, 120, 255, 0.18);
  --gold: #c9a227;
  --gold-soft: #e6c35a;
  --gold-glow: rgba(230, 195, 90, 0.25);
  --text: #f3ebe0;
  --text-dim: #b8a8cc;
  --card-back: #1a0f2e;
  --radius: 14px;
}

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

html, body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* STAGE LIGHTING — radial beam from top + ambient violet wash */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% -5%, var(--violet-glow) 0%, transparent 60%),
    radial-gradient(ellipse 40% 80% at 50% 0%, rgba(200, 180, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at top, #2a1548 0%, var(--bg-deep) 70%);
  z-index: 0;
  pointer-events: none;
}

/* BACKGROUND FANNED DECK TEASER — subtle decorative, behind content */
body::after {
  content: "";
  position: fixed;
  top: 40%;
  left: 50%;
  width: 1200px;
  height: 600px;
  transform: translate(-50%, -50%);
  background-image:
    radial-gradient(circle at 20% 50%, var(--gold-glow) 0%, transparent 25%),
    radial-gradient(circle at 80% 50%, var(--gold-glow) 0%, transparent 25%);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
  filter: blur(20px);
}

#particles-js {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
}

.brand {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--gold-soft);
  text-transform: uppercase;
}
.brand span { color: var(--text-dim); margin: 0 0.25em; font-weight: 300; }

.sound-btn {
  background: transparent;
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.sound-btn:hover { border-color: var(--gold); }
.sound-btn img { width: 18px; height: 18px; filter: invert(80%) sepia(25%) saturate(400%) hue-rotate(10deg); }

.stage {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem 4rem;
}

.step { display: none; }
.step[data-active="true"] { display: block; animation: fade-in 0.5s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ORNATE SIGIL — small decorative SVG at top of question step */
.sigil {
  display: block;
  margin: 1rem auto 0.5rem;
  width: 52px;
  height: 52px;
  color: var(--gold-soft);
  opacity: 0.85;
}

/* MOON PHASES — strip of crescent phases in gold */
.moon-phases {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin: 1.5rem 0 2rem;
  opacity: 0.75;
}
.moon-phase {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--gold-soft);
  position: relative;
  overflow: hidden;
}
.moon-phase::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold-soft);
}
.moon-phase.p0::after { transform: translateX(-100%); }   /* new */
.moon-phase.p1::after { clip-path: inset(0 60% 0 0); }
.moon-phase.p2 { background: var(--gold-soft); }
.moon-phase.p2::after { display: none; }
.moon-phase.p3::after { clip-path: inset(0 0 0 60%); }
.moon-phase.p4::after { transform: translateX(100%); }
.moon-phase.p2 { box-shadow: 0 0 12px var(--gold-glow); }

.headline {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.75rem, 8vw, 5rem);
  font-weight: 400;
  text-align: center;
  color: var(--text);
  margin: 1rem 0 0.5rem;
  letter-spacing: -0.01em;
  line-height: 1.05;
  font-style: italic;
}
.headline em {
  color: var(--gold-soft);
  font-style: normal;
}
.headline.small {
  font-size: clamp(1.6rem, 3.8vw, 2.4rem);
  font-style: normal;
  color: var(--gold-soft);
}
.deck-meta {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: -0.5rem 0 1rem;
  opacity: 0.7;
}

.lede {
  text-align: center;
  max-width: 540px;
  margin: 0 auto 1rem;
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 1rem;
}
.trust-line {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0 0 1.5rem;
  letter-spacing: 0.03em;
}
.trust-line strong { color: var(--gold-soft); font-weight: 500; }

/* QUESTION INPUT — pill with inner glow + star icon */
.question-box {
  max-width: 620px;
  margin: 0 auto 2rem;
  position: relative;
}
#questionInput {
  width: 100%;
  background: rgba(12, 6, 26, 0.55);
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: 100px;
  padding: 1.25rem 1.5rem 1.25rem 3.5rem;
  color: var(--text);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.3rem;
  font-style: italic;
  resize: none;
  backdrop-filter: blur(8px);
  transition: border-color 0.25s, box-shadow 0.25s;
  min-height: 64px;
  text-align: center;
}
#questionInput:focus {
  outline: none;
  border-color: var(--gold-soft);
  box-shadow: 0 0 24px rgba(230, 195, 90, 0.15), inset 0 0 16px rgba(230, 195, 90, 0.05);
}
#questionInput::placeholder { color: var(--text-dim); opacity: 0.6; }
.question-box::before {
  content: "";
  position: absolute;
  left: 1.25rem;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  background: var(--gold-soft);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M12 2 14 10 22 12 14 14 12 22 10 14 2 12 10 10Z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M12 2 14 10 22 12 14 14 12 22 10 14 2 12 10 10Z'/></svg>") center/contain no-repeat;
  opacity: 0.8;
}
.char-count {
  position: absolute;
  bottom: -1.4rem;
  right: 1rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  opacity: 0.6;
}

.cta {
  display: inline-block;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.05rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  padding: 1rem 3rem;
  border-radius: 100px;
  border: 1px solid var(--gold);
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  font-weight: 500;
}
.cta.primary {
  background: transparent;
  color: var(--text);
  position: relative;
}
.cta.primary::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 100px;
  background: radial-gradient(circle at 50% 50%, var(--gold-glow) 0%, transparent 60%);
  opacity: 0.6;
  transition: opacity 0.25s;
}
.cta.primary:hover { border-color: var(--gold-soft); color: var(--gold-soft); }
.cta.primary:hover::before { opacity: 1; }

.cta.solid {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-soft) 100%);
  color: var(--bg-deep);
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(201, 162, 39, 0.25);
}
.cta.solid:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(201, 162, 39, 0.4); }

.cta.ghost {
  background: transparent;
  color: var(--gold-soft);
}
.cta.ghost:hover { background: rgba(201, 162, 39, 0.1); }
.step { text-align: center; }

.disclaimer {
  margin-top: 2rem;
  color: var(--text-dim);
  font-size: 0.78rem;
  opacity: 0.55;
  letter-spacing: 0.02em;
}

/* SPREAD */
.spread {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  max-width: 760px;
  margin: 2rem auto 3rem;
}
.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.slot-label {
  font-family: "Cormorant Garamond", serif;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  min-height: 2.4em;
  line-height: 1.2;
  font-style: italic;
  letter-spacing: 0.03em;
}
.slot-card {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--radius);
  border: 1px dashed rgba(201, 162, 39, 0.25);
  background: rgba(10, 5, 22, 0.4);
  position: relative;
}
.slot.filled .slot-card {
  border-style: solid;
  border-color: rgba(201, 162, 39, 0.4);
  box-shadow: 0 0 24px rgba(230, 195, 90, 0.12);
}

/* DECK — arc fan */
.deck {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 260px;
  margin: 1rem auto 1rem;
  perspective: 1600px;
  perspective-origin: 50% 100%;
  overflow: visible;
}
.deck-inner {
  position: absolute;
  inset: 0;
}
.deck-card {
  --base-rot: calc((var(--i) - 10.5) * 3.2deg);
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 100px;
  aspect-ratio: 2/3;
  margin-left: -50px;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transform-origin: 50% 320px;
  transform: rotate(var(--base-rot));
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.4s;
  animation: deal-in 0.9s cubic-bezier(0.23, 1, 0.32, 1) both;
  animation-delay: calc(var(--i) * 0.04s);
  will-change: transform;
}
@keyframes deal-in {
  from {
    opacity: 0;
    transform: rotate(0deg) translateY(200px) scale(0.5);
  }
}
.deck-card:hover:not(.picked):not(.flying) {
  transform: rotate(var(--base-rot)) translateY(-55px);
  z-index: 20;
}
.deck-card:hover:not(.picked) .deck-card-back {
  box-shadow: inset 0 0 16px rgba(230, 195, 90, 0.35), 0 12px 30px rgba(0, 0, 0, 0.7);
  border-color: var(--gold-soft);
}
.deck-card.flying {
  transform-origin: center !important;
  transform: translate(var(--fly-dx), var(--fly-dy)) scale(var(--fly-scale)) rotate(0deg) !important;
  transition: transform 0.85s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s 0.7s !important;
  z-index: 50;
  pointer-events: none;
}
.deck-card.flying.fade { opacity: 0; }
.deck-card.picked {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

/* ORNATE CARD BACK — original geometric pattern, not copied */
.deck-card-back {
  width: 100%; height: 100%;
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 50%, rgba(230, 195, 90, 0.12) 0%, transparent 50%),
    linear-gradient(135deg, #1a0f2e 0%, #2d1b4e 100%);
  border: 1px solid rgba(201, 162, 39, 0.45);
  box-shadow: inset 0 0 10px rgba(201, 162, 39, 0.08), 0 2px 6px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}
.deck-card-back::before,
.deck-card-back::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 4px;
  pointer-events: none;
}
.deck-card-back::after {
  inset: 50% 50% 50% 50%;
  width: 12px;
  height: 12px;
  margin: -6px;
  border: none;
  background: radial-gradient(circle, var(--gold-soft) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0.7;
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.3; transform: scale(1.3); } }

/* CARD FLIP */
.flip {
  width: 100%;
  height: 100%;
  perspective: 1000px;
}
.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-back, .flip-front {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
}
.flip-back {
  background:
    radial-gradient(circle at 50% 50%, rgba(230, 195, 90, 0.12) 0%, transparent 50%),
    linear-gradient(135deg, #1a0f2e 0%, #2d1b4e 100%);
  border: 1px solid rgba(201, 162, 39, 0.45);
}
.flip-front {
  background-size: cover;
  background-position: center;
  transform: rotateY(180deg);
  border: 1px solid rgba(201, 162, 39, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.flip.reversed .flip-front { transform: rotateY(180deg) rotate(180deg); }

/* LOADING "Su lectura está casi lista..." */
.loading-note {
  text-align: center;
  color: var(--gold-soft);
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.1rem;
  margin: 1rem 0;
  opacity: 0;
  transition: opacity 0.4s;
}
.loading-note.visible { opacity: 1; }
.loading-note::after {
  content: "";
  display: inline-block;
  margin-left: 4px;
  animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; }
}

/* REVEAL */
.your-question {
  text-align: center;
  color: var(--text);
  font-style: italic;
  margin-bottom: 2.5rem;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-weight: 400;
}
.reveal-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 820px;
  margin: 0 auto 3rem;
}
.reveal-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1.5rem;
  background: linear-gradient(135deg, rgba(45, 27, 78, 0.4) 0%, rgba(20, 10, 35, 0.6) 100%);
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: left;
  backdrop-filter: blur(6px);
}
.reveal-card { aspect-ratio: 2/3; }
.reveal-position {
  font-family: "Cormorant Garamond", serif;
  font-size: 0.78rem;
  color: var(--gold-soft);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.reveal-text h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 0.6rem;
  font-weight: 500;
}
.orient {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.05em;
}
.reveal-meaning { color: var(--text); margin-bottom: 0.6rem; line-height: 1.6; font-size: 0.98rem; }
.reveal-advice { color: var(--text-dim); font-size: 0.92rem; line-height: 1.55; margin-bottom: 0.6rem; }
.reveal-ai {
  color: var(--gold-soft);
  font-size: 0.95rem;
  line-height: 1.6;
  border-top: 1px dashed rgba(201, 162, 39, 0.2);
  padding-top: 0.6rem;
  margin-top: 0.6rem;
}

/* UPSELL */
.upsell {
  max-width: 560px;
  margin: 3rem auto 2rem;
  padding: 2.5rem 1.75rem;
  background: linear-gradient(135deg, rgba(45, 27, 78, 0.6) 0%, rgba(26, 15, 46, 0.85) 100%);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 0 60px rgba(201, 162, 39, 0.12);
  position: relative;
}
.upsell::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gold-soft), transparent, var(--gold-soft));
  z-index: -1;
  opacity: 0.3;
}
.upsell h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.8rem;
  color: var(--gold-soft);
  margin-bottom: 0.85rem;
  font-weight: 500;
}
.upsell p { color: var(--text-dim); line-height: 1.55; margin-bottom: 1.5rem; }
.upsell-note { font-size: 0.78rem; opacity: 0.55; margin-top: 1rem; margin-bottom: 0 !important; }

/* TIP CAROUSEL — bottom-right floating card */
.tip-carousel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: 320px;
  background: rgba(12, 6, 26, 0.85);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  backdrop-filter: blur(10px);
  z-index: 3;
  font-size: 0.83rem;
  transition: transform 0.3s;
}
.tip-carousel h4 {
  font-family: "Cormorant Garamond", serif;
  color: var(--gold-soft);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}
.tip-carousel p {
  color: var(--text-dim);
  line-height: 1.45;
  margin-bottom: 0.6rem;
}
.tip-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-dim);
}
.tip-next {
  background: none;
  border: none;
  color: var(--gold-soft);
  cursor: pointer;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-family: inherit;
  padding: 0;
}
.tip-next:hover { color: var(--text); }

.site-footer {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  color: var(--text-dim);
  font-size: 0.78rem;
  opacity: 0.5;
  position: relative;
  z-index: 1;
}

/* MOBILE */
@media (max-width: 680px) {
  .spread { grid-template-columns: repeat(5, 1fr); gap: 0.35rem; max-width: 100%; }
  .slot-label { font-size: 0.6rem; min-height: 2.8em; letter-spacing: 0; }
  .reveal-row { grid-template-columns: 90px 1fr; gap: 1rem; padding: 1rem; }
  .reveal-text h3 { font-size: 1.2rem; }
  .headline { font-size: clamp(2.25rem, 10vw, 3rem); }
  #questionInput { font-size: 1.05rem; padding-left: 3rem; }
  .tip-carousel { display: none; }
  .deck {
    height: 200px;
    margin: 0.5rem auto 0.5rem;
  }
  .deck-card {
    --base-rot: calc((var(--i) - 10.5) * 2.4deg);
    width: 68px;
    margin-left: -34px;
    bottom: 12px;
    transform-origin: 50% 240px;
  }
  .deck-card:hover:not(.picked):not(.flying) {
    transform: rotate(var(--base-rot)) translateY(-30px);
  }
  @keyframes deal-in {
    from { opacity: 0; transform: rotate(0deg) translateY(140px) scale(0.6); }
  }
}
@media (max-width: 420px) {
  .slot-label { font-size: 0.55rem; }
  .reveal-row { grid-template-columns: 1fr; }
  .reveal-card { max-width: 130px; margin: 0 auto; }
  .deck-card {
    --base-rot: calc((var(--i) - 10.5) * 2.0deg);
    width: 58px;
    margin-left: -29px;
    transform-origin: 50% 210px;
  }
  .deck { height: 180px; }
  .deck-meta { font-size: 0.65rem; letter-spacing: 0.1em; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  body::before, body::after { animation: none; }
}
