/* ============================================================
   GG33 Life Path Flow — iOS-style multi-step funnel
   Uses theme tokens from styles.css (:root)
   ============================================================ */

.flow-body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Ambient background ---------- */
.flow-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.flow-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.22;
}
.flow-bg-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(240, 106, 24, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(7, 4, 3, 0.55) 0%, rgba(7, 4, 3, 0.82) 100%),
    var(--bg);
}
.flow-bg-orb {
  position: absolute;
  width: 60vw;
  height: 60vw;
  max-width: 520px;
  max-height: 520px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: orbFloat 14s ease-in-out infinite;
}
.flow-bg-orb-a { top: -12%; left: -18%; background: radial-gradient(circle, rgba(240, 106, 24, 0.5), transparent 70%); }
.flow-bg-orb-b { bottom: -16%; right: -20%; background: radial-gradient(circle, rgba(255, 138, 42, 0.32), transparent 70%); animation-delay: -7s; }
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6%, 8%) scale(1.12); }
}

/* ---------- Top bar ---------- */
.flow-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 2.4rem 1fr auto;
  align-items: center;
  gap: 0.9rem;
  padding: max(0.9rem, env(safe-area-inset-top)) 1.15rem 0.9rem;
  background: linear-gradient(180deg, rgba(7, 4, 3, 0.9) 0%, rgba(7, 4, 3, 0.55) 68%, rgba(7, 4, 3, 0) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
}
.flow-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 248, 235, 0.04);
  color: var(--ink);
  cursor: pointer;
  transition: background 180ms var(--ease);
}
.flow-back:hover { background: rgba(255, 248, 235, 0.1); }
.flow-progress {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 248, 235, 0.12);
  overflow: hidden;
}
.flow-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), var(--orange-2));
  transition: width 520ms var(--ease);
}
.flow-brand {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  text-decoration: none;
}
.flow-brand img {
  height: 1.6rem;
  width: auto;
  display: block;
}

/* ---------- Step shell ---------- */
.flow {
  position: relative;
  z-index: 10;
  min-height: 100svh;
}
.flow-step {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  /* flex-start + the inner's margin:auto centers short steps but lets tall
     steps (the reveal) start at the top and scroll fully — justify-content:center
     makes overflowing content unreachable above the fold */
  justify-content: flex-start;
  align-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 5.2rem 1.4rem calc(2rem + env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  transition: opacity 420ms var(--ease), visibility 0s linear 420ms;
}
.flow-step.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 460ms var(--ease);
}
/* Slide the INNER content (not the full-width fixed panel) so it never overflows the viewport. */
.flow-inner {
  width: 100%;
  max-width: 30rem;
  margin: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: stretch;
  text-align: left;
  transform: translateX(36px);
  transition: transform 520ms var(--ease);
}
.flow-step.from-left .flow-inner { transform: translateX(-36px); }
/* Active step always rests at 0, even while the from-left/from-right modifier lingers. */
.flow-step.is-active .flow-inner,
.flow-step.is-active.from-left .flow-inner,
.flow-step.is-active.from-right .flow-inner { transform: translateX(0); transition: transform 560ms var(--ease); }
.flow-inner-center {
  align-items: center;
  text-align: center;
}

/* ---------- Typography ---------- */
.flow-eyebrow,
.flow-step-kicker {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange-2);
  margin: 0;
}
.flow-step-kicker { color: var(--muted); }
.flow-h1 {
  font-family: var(--sans);
  font-size: clamp(2.2rem, 9vw, 2.9rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0.3rem 0 0;
}
.flow-h1-sm { font-size: clamp(1.9rem, 7.6vw, 2.4rem); }
.flow-q {
  font-family: var(--sans);
  font-size: clamp(1.55rem, 6.6vw, 2rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0.2rem 0 0.2rem;
}
.hl { color: var(--orange-2); }
.flow-sub {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--soft);
  margin: 0.4rem 0 0.4rem;
  max-width: 26rem;
}
.flow-inner-center .flow-sub { margin-inline: auto; }
.flow-hint {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 0.4rem;
}
.flow-fineprint {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0.4rem 0 0;
}

/* ---------- Inputs ---------- */
.flow-input {
  width: 100%;
  min-height: 3.6rem;
  padding: 0 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 248, 235, 0.05);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.1rem;
  font-weight: 500;
  outline: none;
  transition: border-color 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease);
}
.flow-input::placeholder { color: rgba(255, 248, 235, 0.34); }
.flow-input:focus {
  border-color: rgba(240, 106, 24, 0.7);
  background: rgba(255, 248, 235, 0.07);
  box-shadow: 0 0 0 4px rgba(240, 106, 24, 0.12);
}

/* ---------- DOB scroll-wheel picker (iOS style) ---------- */
.dob-labels {
  display: grid;
  grid-template-columns: 1.35fr 0.75fr 1fr;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.dob-labels span {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.dob-picker {
  position: relative;
  display: grid;
  grid-template-columns: 1.35fr 0.75fr 1fr;
  gap: 0.4rem;
  height: 230px;            /* 5 visible rows at 46px */
  margin: 0.4rem 0 0.6rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 248, 235, 0.035);
  overflow: hidden;
}
.dob-wheel {
  position: relative;
  z-index: 2;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  outline: none;
  /* top/bottom padding so first & last items can reach the centre band (230-46)/2 = 92 */
  padding: 92px 0;
  /* fade the rows away from the centre */
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 26%, #000 74%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 26%, #000 74%, transparent 100%);
  scroll-behavior: smooth;
}
.dob-wheel::-webkit-scrollbar { display: none; }
.dob-opt {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-family: var(--sans);
  font-size: 1.18rem;
  font-weight: 500;
  color: rgba(255, 248, 235, 0.4);
  white-space: nowrap;
  transition: color 160ms var(--ease), transform 160ms var(--ease), opacity 160ms var(--ease);
  cursor: pointer;
}
.dob-opt.is-sel {
  color: var(--ink);
  font-weight: 700;
  transform: scale(1.04);
}
/* centre selection band */
.dob-band {
  position: absolute;
  top: 50%;
  left: 0.5rem;
  right: 0.5rem;
  height: 46px;
  transform: translateY(-50%);
  border-top: 1px solid rgba(240, 106, 24, 0.62);
  border-bottom: 1px solid rgba(240, 106, 24, 0.62);
  background: linear-gradient(90deg, rgba(240, 106, 24, 0.13), rgba(255, 138, 42, 0.06));
  border-radius: 8px;
  pointer-events: none;
  z-index: 1;
}

/* ---------- Consent ---------- */
.flow-consent {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0.2rem 0 0.2rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
  cursor: pointer;
}
.flow-consent input {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.05rem;
  accent-color: var(--orange);
}

/* live field hint — tells the user exactly what the button is waiting on */
.flow-field-hint {
  margin: 0.15rem 0 0.3rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--orange-2);
}
.flow-field-hint[hidden] { display: none; }

/* ---------- Buttons ---------- */
.flow-cta {
  width: 100%;
  min-height: 3.6rem;
  margin-top: 0.6rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange-2), var(--orange));
  color: #160a04;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(240, 106, 24, 0.28);
  transition: transform 160ms var(--ease), box-shadow 180ms var(--ease), opacity 180ms var(--ease);
}
.flow-inner-center .flow-cta { max-width: 22rem; }
.flow-cta:hover { transform: translateY(-1px); box-shadow: 0 20px 48px rgba(240, 106, 24, 0.36); }
.flow-cta:active { transform: translateY(1px) scale(0.99); }
.flow-cta:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  background: rgba(255, 248, 235, 0.12);
  color: var(--muted);
}
.flow-skip {
  align-self: center;
  margin-top: 0.2rem;
  background: none;
  border: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.6rem;
}
.flow-skip:hover { color: var(--soft); }

/* ---------- Welcome glyph ---------- */
.welcome-glyph {
  position: relative;
  width: 8.5rem;
  height: 8.5rem;
  display: grid;
  place-items: center;
  margin-bottom: 0.4rem;
}
.welcome-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(240, 106, 24, 0.4);
  animation: ringPulse 3.4s var(--ease) infinite;
}
.welcome-ring-2 { inset: 1.1rem; border-color: rgba(255, 138, 42, 0.28); animation-delay: -1.7s; }
.welcome-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 3.4rem;
  font-weight: 600;
  color: var(--orange-2);
  text-shadow: 0 0 30px rgba(240, 106, 24, 0.5);
}
@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.07); opacity: 0.35; }
}

/* ---------- Calculating orb ---------- */
.calc-orb {
  position: relative;
  width: 10rem;
  height: 10rem;
  display: grid;
  place-items: center;
  margin-bottom: 1.4rem;
}
.calc-orb-core {
  position: absolute;
  inset: 2.2rem;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255, 138, 42, 0.9), rgba(240, 106, 24, 0.25) 70%);
  filter: blur(6px);
  animation: corePulse 1.6s ease-in-out infinite;
}
.calc-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(240, 106, 24, 0.5);
  border-top-color: var(--orange-2);
  animation: spin 1.1s linear infinite;
}
.calc-orb-ring-2 { inset: 1.4rem; border-color: rgba(255, 138, 42, 0.3); border-bottom-color: var(--orange-2); animation-duration: 1.7s; animation-direction: reverse; }
.calc-digit {
  position: relative;
  font-family: var(--mono);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 0 24px rgba(240, 106, 24, 0.6);
}
.calc-status {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--soft);
  margin: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes corePulse {
  0%, 100% { transform: scale(0.92); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 1; }
}

/* ---------- Reveal ---------- */
.flow-step-reveal .flow-inner { gap: 0.5rem; }
/* Reveal CTA docked at the bottom (matches the site's bottom dock buttons), so it
   stays put while the Life Path / sign / personal-year blocks scroll. */
.flow-step-reveal { padding-bottom: calc(7.5rem + env(safe-area-inset-bottom)); }
.reveal-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: flex;
  justify-content: center;
  padding: 1.4rem 1.4rem calc(0.95rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 32%, rgba(5, 3, 2, 0.82) 66%, rgba(5, 3, 2, 0));
  pointer-events: none;
}
.reveal-dock .flow-cta {
  pointer-events: auto;
  width: 100%;
  max-width: 22rem;
  margin-top: 0;
}
.reveal-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  animation: revealUp 700ms var(--ease) both;
}
.reveal-zodiac { animation-delay: 240ms; }
.reveal-kicker {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--orange-2);
  margin: 0;
}
.reveal-number {
  font-family: var(--sans);
  font-size: clamp(4.5rem, 22vw, 6.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-shadow: 0 0 50px rgba(240, 106, 24, 0.45);
  transition: text-shadow 400ms var(--ease);
}
.reveal-number.is-final { text-shadow: 0 0 70px rgba(240, 106, 24, 0.65); }
.reveal-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--orange-2);
  margin: 0;
}
.reveal-copy {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--soft);
  margin: 0.1rem 0 0;
  max-width: 22rem;
}
.reveal-lp-link {
  display: inline-block;
  margin: 0.7rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--orange-2);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 138, 44, 0.4);
}
.reveal-divider {
  width: 38%;
  height: 1px;
  margin: 1.1rem auto;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.reveal-zodiac-glyph {
  width: 12rem;
  height: 12rem;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  font-size: 0;
  /* screen blend drops the emblem's black background so only the glow shows */
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 30px rgba(240, 106, 24, 0.4));
  animation: glyphIn 800ms var(--ease) both;
  animation-delay: 320ms;
}
.reveal-zodiac-name {
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0.1rem 0 0;
}
@keyframes revealUp {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes glyphIn {
  from { opacity: 0; transform: scale(0.5) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

/* ---------- Next step cards ---------- */
.next-stack {
  width: 100%;
  max-width: 24rem;
  margin: 0.6rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.next-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.2rem 0.9rem;
  padding: 0.95rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 248, 235, 0.04);
  text-decoration: none;
  color: var(--ink);
  text-align: left;
  transition: border-color 180ms var(--ease), background 180ms var(--ease), transform 160ms var(--ease);
}
.next-card:hover { border-color: var(--line-strong); background: rgba(255, 248, 235, 0.07); transform: translateY(-1px); }
.next-card-primary {
  border-color: rgba(240, 106, 24, 0.5);
  background: linear-gradient(135deg, rgba(240, 106, 24, 0.16), rgba(255, 138, 42, 0.04));
}
.next-card-k {
  grid-column: 1;
  grid-row: 1 / span 2;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  writing-mode: horizontal-tb;
}
.next-card strong { grid-column: 2; font-size: 1.02rem; font-weight: 700; }
.next-card em { grid-column: 3; grid-row: 1 / span 2; font-style: normal; font-family: var(--mono); font-size: 0.8rem; color: var(--orange-2); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .flow-step, .flow-step.is-active { transition: opacity 180ms ease; }
  .flow-inner, .flow-step.is-active .flow-inner, .flow-step.from-left .flow-inner { transform: none; transition: none; }
  .flow-bg-orb, .welcome-ring, .calc-orb-core, .calc-orb-ring, .reveal-block, .reveal-zodiac-glyph { animation: none; }
}

/* press feedback on touch */
@media (hover: none) {
  .flow-cta:active:not(:disabled), .flow-skip:active, .next-card:active, .flow-back:active { transform: scale(0.97); transition: transform 80ms ease; }
}

/* ============================================================
   Desktop layer (min-width: 761px) — mobile rendering untouched.
   The funnel keeps its focused center-stage shape; it just gets
   desktop scale and chrome. (DOB wheel geometry is left alone:
   the JS measures it.)
   ============================================================ */
@media (min-width: 761px) {
  .flow-top {
    grid-template-columns: 2.6rem minmax(0, 28rem) auto;
    justify-content: center;
    gap: 1.4rem;
    padding: 1rem max(1.4rem, calc((100% - 77.5rem) / 2)) 1rem;
  }
  .flow-progress { align-self: center; }
  .flow-brand img { height: 1.85rem; }
  .flow-back { width: 2.6rem; height: 2.6rem; }

  .flow-step { padding-top: 6.4rem; }
  .flow-inner { max-width: 34rem; gap: 1rem; }
  .flow-h1 { font-size: clamp(2.9rem, 3.6vw, 3.5rem); }
  .flow-h1-sm { font-size: clamp(2.3rem, 2.8vw, 2.7rem); }
  .flow-q { font-size: clamp(1.9rem, 2.4vw, 2.3rem); }
  .flow-sub { font-size: 1.12rem; max-width: 30rem; }
  .flow-hint { font-size: 0.95rem; }
  .flow-fineprint { font-size: 0.7rem; }
}
