@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --p: #7C3AED;
  --pk: #EC4899;
  --bg: #0B0914;
  --text: #F0EBF8;
  --muted: #8B7FA8;
  --grad: linear-gradient(135deg, var(--p), var(--pk));
  --sb: env(safe-area-inset-bottom, 0px);
  --st: env(safe-area-inset-top, 0px);
}

html, body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

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

.orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.o1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(124,58,237,.18) 0%, transparent 70%);
  top: -300px; left: 50%; transform: translateX(-50%);
}
.o2 {
  width: 450px; height: 450px;
  background: radial-gradient(circle, rgba(236,72,153,.13) 0%, transparent 70%);
  bottom: -150px; right: -80px;
}
.o3 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(124,58,237,.08) 0%, transparent 70%);
  bottom: 50px; left: -80px;
}

/* ── HERO ── */
.hero {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  padding-top: calc(24px + var(--st));
  padding-bottom: calc(20px + var(--sb));
  gap: 26px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── AVATAR ── */
.av-scene {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
  height: 280px;
}

.av-glow {
  position: absolute;
  width: 340px; height: 340px;
  border-radius: 50%;
  bottom: -30px; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(124,58,237,.32) 0%, rgba(236,72,153,.14) 48%, transparent 70%);
  animation: glow-pulse 4.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes glow-pulse {
  0%,100% { transform: translateX(-50%) scale(1); opacity: .7; }
  50% { transform: translateX(-50%) scale(1.15); opacity: 1; }
}

/* Floating outer wrapper */
.av-wrap {
  position: relative;
  width: 200px; height: 280px;
  animation: float 5.5s ease-in-out infinite;
  z-index: 2;
}
@keyframes float {
  0%,100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Ring anchor — stays as a circle behind the figure */
.av-rings {
  position: absolute;
  width: 160px; height: 160px;
  border-radius: 50%;
  left: 50%; top: 50px;
  transform: translateX(-50%);
  pointer-events: none;
}

.ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.r1 {
  inset: -14px;
  background: conic-gradient(from 0deg, #7C3AED, #EC4899, rgba(124,58,237,.12), #7C3AED);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  animation: spin 5s linear infinite;
}
.r2 {
  inset: -28px;
  background: conic-gradient(from 180deg, rgba(236,72,153,.5), rgba(124,58,237,.2), transparent, rgba(236,72,153,.5));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  animation: spin 10s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Cutout image frame — full figure, no circle clip */
.av-frame {
  position: absolute;
  width: 190px;
  height: 275px;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  overflow: visible;
  border-radius: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 3;
  transform-origin: center bottom;
  will-change: transform;
}

.av-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  border-radius: 0;
  filter:
    drop-shadow(0 0 28px rgba(124,58,237,.55))
    drop-shadow(0 12px 48px rgba(0,0,0,.6))
    drop-shadow(-2px 0 18px rgba(236,72,153,.2));
}
.av-letter {
  width: 160px; height: 160px;
  border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 4.5rem; font-weight: 800; color: #fff;
  align-self: center;
}

/* Dynamic light overlay — controlled by JS mouse/gyro */
.av-light {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: 0;
  background: radial-gradient(circle at 45% 30%, rgba(255,255,255,.16) 0%, rgba(255,255,255,.04) 38%, transparent 62%);
  mix-blend-mode: screen;
  transition: background .08s ease-out;
}

/* Sweeping shine */
.av-shine {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(118deg, transparent 30%, rgba(255,255,255,.11) 50%, transparent 70%);
  background-size: 300% 100%;
  background-position: -100% 0;
  animation: shine-sweep 9s ease-in-out infinite 1.5s;
}
@keyframes shine-sweep {
  0%   { background-position: -100% 0; opacity: 0; }
  15%  { opacity: 1; }
  65%  { background-position: 250% 0; opacity: .7; }
  80%  { opacity: 0; }
  100% { background-position: 250% 0; opacity: 0; }
}

.av-status {
  position: absolute;
  bottom: -4px; left: 50%;
  transform: translateX(-50%);
  background: rgba(11,9,20,.92);
  border: 1px solid rgba(34,197,94,.28);
  border-radius: 99px;
  padding: 4px 12px;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap;
  z-index: 6;
  backdrop-filter: blur(10px);
}
.sdot {
  width: 7px; height: 7px;
  background: #22C55E;
  border-radius: 50%;
  animation: blink-dot 2.2s ease-in-out infinite;
}
@keyframes blink-dot {
  0%,100% { opacity: 1; box-shadow: 0 0 6px #22C55E; }
  50% { opacity: .4; box-shadow: none; }
}
.stxt { font-size: .65rem; color: #86efac; font-weight: 500; letter-spacing: .02em; }

/* Floating sparkles */
.fl {
  position: absolute;
  pointer-events: none;
  z-index: 7;
  font-size: 14px;
}
.f1 { top: 10px; right: -10px; color: #EC4899; animation: sparkle 2.3s ease-in-out infinite; }
.f2 { bottom: 40px; left: -18px; color: #7C3AED; font-size: 17px; animation: sparkle 3s ease-in-out infinite .5s; }
.f3 { top: 50px; left: -10px; color: rgba(236,72,153,.6); font-size: 10px; animation: sparkle 2.8s ease-in-out infinite 1.1s; }
@keyframes sparkle {
  0%,100% { opacity: 0; transform: translateY(0) scale(.5) rotate(0deg); }
  50% { opacity: 1; transform: translateY(-9px) scale(1) rotate(15deg); }
}

/* ── CONTENT ── */
.content {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.phase { width: 100%; }

/* Phase 1 — Hook */
.hook {
  font-size: 1.22rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.75;
  min-height: 4.4rem;
  white-space: pre-line;
  letter-spacing: -.01em;
}

/* Typing cursor */
.hook::after,
.layla-sub::after,
.question::after {
  content: '|';
  display: inline;
  color: var(--pk);
  animation: blink-cur .75s step-end infinite;
  font-weight: 300;
  margin-left: 1px;
}
.hook.done::after,
.layla-sub.done::after,
.question.done::after { display: none; }
@keyframes blink-cur {
  0%,100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Phase 2 — Identity */
.layla-name {
  font-size: 3.8rem;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.04em;
  line-height: 1;
  margin-bottom: 10px;
}
.layla-sub {
  font-size: .97rem;
  color: var(--muted);
  line-height: 1.65;
  min-height: 3.2rem;
}

/* Phase 3 — Question */
.gline {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124,58,237,.5), rgba(236,72,153,.5), transparent);
  margin: 18px 0 14px;
}
.asks-lbl {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #B794F4;
  margin-bottom: 9px;
}
.question {
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.45;
  min-height: 3.7rem;
  color: var(--text);
  margin-bottom: 20px;
}

/* Input */
.input-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.input-wrap {
  display: flex; gap: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(124,58,237,.32);
  border-radius: 16px;
  padding: 11px 13px;
  transition: border-color .2s, box-shadow .2s;
}
.input-wrap:focus-within {
  border-color: var(--p);
  box-shadow: 0 0 0 3px rgba(124,58,237,.14), 0 0 24px rgba(124,58,237,.09);
}
.input-wrap textarea {
  flex: 1;
  background: none; border: none; outline: none;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: .97rem;
  resize: none;
  max-height: 96px; min-height: 24px;
  line-height: 1.5;
  user-select: text;
  -webkit-user-select: text;
}
.input-wrap textarea::placeholder { color: var(--muted); }

.go-btn {
  background: var(--grad);
  border: none; border-radius: 10px;
  width: 44px; height: 44px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity .15s, transform .15s;
  align-self: flex-end;
  box-shadow: 0 4px 16px rgba(124,58,237,.35);
}
.go-btn:hover { opacity: .88; transform: scale(1.06); }
.go-btn:active { transform: scale(.94); }
.go-btn:disabled { opacity: .22; cursor: not-allowed; transform: none; box-shadow: none; }

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px;
}
.free-tag { font-size: .71rem; color: #86efac; font-weight: 500; }
.lock-tag { font-size: .71rem; color: var(--muted); }

/* Social proof */
.sp-row {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 18px;
  font-size: .74rem;
  color: var(--muted);
  transition: opacity .6s;
}
.sp-live {
  width: 6px; height: 6px;
  background: #22C55E;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px #22C55E;
}

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .hero { gap: 12px; padding: 16px; padding-top: calc(16px + var(--st)); padding-bottom: calc(14px + var(--sb)); }
  .av-scene { height: 230px; }
  .av-wrap { width: 160px; height: 230px; }
  .av-glow { width: 280px; height: 280px; }
  .av-rings { width: 130px; height: 130px; top: 36px; }
  .r1 { inset: -11px; }
  .r2 { inset: -22px; }
  .av-frame { width: 152px; height: 225px; }
  .layla-name { font-size: 3.2rem; }
  .hook { font-size: 1.08rem; min-height: 3.8rem; }
  .question { font-size: 1.12rem; min-height: 3.2rem; }
}

@media (max-height: 680px) {
  .hero { gap: 8px; }
  .av-scene { height: 180px; }
  .av-wrap { width: 126px; height: 180px; }
  .av-glow { width: 220px; height: 220px; }
  .av-rings { width: 104px; height: 104px; top: 28px; }
  .r1 { inset: -9px; } .r2 { inset: -18px; }
  .av-frame { width: 120px; height: 175px; }
  .layla-name { font-size: 2.6rem; }
  .hook { font-size: .94rem; min-height: 2.8rem; }
  .question { font-size: .98rem; min-height: 2.6rem; margin-bottom: 12px; }
  .gline { margin: 10px 0 8px; }
  .sp-row { margin-top: 10px; }
}
