/* ==========================================================================
   Alivey — landing page styles
   Palette: violet #8B5CF6 -> pink #EC4899 (brand gradient), ink #2B2438,
   cream #FAF7FF, muted plum #6E6580, blush card #FFF1F7.
   Type: Fredoka (display) + Nunito (body/UI).
   ========================================================================== */

:root {
  --violet: #8B5CF6;
  --violet-soft: #C7B4EB;
  --pink: #EC4899;
  --ink: #2B2438;
  --ink-soft: #372d49;
  --cream: #FAF7FF;
  --muted: #6E6580;
  --card-pink: #FFF1F7;
  --hairline: #F0ECFA;
  --success: #FAF7FF;
  --error: #FFB4A8;
  --gradient-brand: linear-gradient(115deg, var(--violet) 0%, var(--pink) 100%);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: 'Fredoka', sans-serif;
  letter-spacing: -0.02em;
  margin: 0;
}

p { line-height: 1.5; letter-spacing: -0.01em; }

a { color: inherit; }

::placeholder { color: #6E6580; opacity: 0.7; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 30px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
  will-change: transform;
}

.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(139, 92, 246, 0.45); }
.btn-primary:active { transform: translateY(0) scale(0.97); box-shadow: 0 6px 16px rgba(139, 92, 246, 0.32); }

.btn-dark {
  background: var(--ink);
  color: var(--cream);
}
.btn-dark:hover { transform: translateY(-2px); background: var(--ink-soft); box-shadow: 0 10px 24px rgba(43, 36, 56, 0.35); }
.btn-dark:active { transform: translateY(0) scale(0.97); }

.btn-sm { min-height: 40px; padding: 10px 22px; font-size: 14px; }

/* ---------- header ---------- */

.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 30;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 44px; height: 44px;
  border-radius: 12px;
  object-fit: cover;
  flex: 0 0 auto;
  filter: brightness(1.18) saturate(0.85);
}

.brand-name {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  display: flex;
  white-space: nowrap;
}
.brand-name span { display: inline-block; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--violet-soft);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(43,36,56,0.6) 0%, rgba(43,36,56,0.2) 55%, rgba(43,36,56,0) 78%);
}

.sparkles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.sparkle {
  position: absolute;
  top: 0;
  opacity: 0;
  animation-name: fallSparkleRight;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.sparkle-l { animation-name: fallSparkleLeft; }

@keyframes fallSparkleRight {
  0% { transform: translate(0px, -60px) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translate(120px, 760px) rotate(200deg); opacity: 0; }
}
@keyframes fallSparkleLeft {
  0% { transform: translate(0px, -60px) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translate(-120px, 760px) rotate(-200deg); opacity: 0; }
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 128px 24px clamp(88px, 22vw, 300px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(43,36,56,0.45);
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: var(--cream);
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.hero h1 {
  font-weight: 700;
  font-size: clamp(2.3rem, 5vw + 1rem, 4rem);
  line-height: 1.06;
  color: var(--cream);
  margin: 0 0 20px;
  max-width: 620px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.35);
}

.framed-word { position: relative; display: inline-block; }
.corner { position: absolute; width: 16px; height: 16px; border: 0 solid var(--cream); }
.corner-tl { top: -8px; left: -10px; border-top-width: 3px; border-left-width: 3px; border-radius: 6px 0 0 0; }
.corner-tr { top: -8px; right: -10px; border-top-width: 3px; border-right-width: 3px; border-radius: 0 6px 0 0; }
.corner-bl { bottom: -8px; left: -10px; border-bottom-width: 3px; border-left-width: 3px; border-radius: 0 0 0 6px; }
.corner-br { bottom: -8px; right: -10px; border-bottom-width: 3px; border-right-width: 3px; border-radius: 0 0 6px 0; }

.hero-sub {
  font-size: clamp(1rem, 0.4vw + 0.95rem, 1.19rem);
  color: #F0ECFA;
  max-width: 480px;
  margin: 0 0 36px;
  text-shadow: 0 1px 14px rgba(0,0,0,0.3);
}

.cta-row { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.cta-row-center { justify-content: center; }

.waitlist-form { display: flex; flex-direction: column; gap: 8px; min-width: 260px; }
.waitlist-input-row { display: flex; gap: 10px; flex-wrap: wrap; }

.waitlist-input-row input[type="email"] {
  flex: 1 1 220px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  font-size: 16px;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  color: var(--ink);
  outline: none;
}

.form-status {
  min-height: 20px;
  margin: 2px 4px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--success);
  text-shadow: 0 1px 10px rgba(0,0,0,0.3);
}
.form-status[data-state="error"] { color: var(--error); }

/* ---------- shared section chrome ---------- */

.how-it-works, .features, .closing-cta {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 9vw, 100px) 24px;
}

.section-bg { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: 0; }
.section-inner { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; }

.kicker {
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 14px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.how-it-works h2, .features h2, .closing-cta h2 {
  font-weight: 700;
  font-size: clamp(1.75rem, 3.2vw + 1rem, 2.75rem);
  color: #fff;
  text-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

/* ---------- how it works ---------- */

.how-header {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.how-text { flex: 0 1 390px; min-width: 260px; }
.how-phone { flex: 1 1 240px; display: flex; justify-content: flex-start; }

.phone-frame {
  width: 240px;
  height: 490px;
  background: var(--ink);
  border-radius: 44px;
  padding: 12px;
  box-shadow: 0 30px 60px rgba(43,36,56,0.25);
  animation: floaty 6s ease-in-out infinite;
}
.phone-screen {
  width: 100%; height: 100%;
  background: var(--violet-soft);
  border-radius: 34px;
  overflow: hidden;
  position: relative;
}
.phone-screen video { width: 100%; height: 100%; object-fit: cover; }

@keyframes floaty {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-14px); }
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.step-card {
  background: var(--card-pink);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(43,36,56,0.12);
  transition: transform .25s ease, box-shadow .25s ease;
}
.step-card:hover { transform: translateY(-6px); box-shadow: 0 26px 60px rgba(43,36,56,0.18); }
.step-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.step-body { padding: 26px 24px; }
.step-num {
  font-weight: 800;
  font-size: 13px;
  color: var(--violet);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.step-body h3 { font-weight: 600; font-size: 23px; color: var(--ink); margin: 0 0 10px; }
.step-body p { font-size: 16px; color: var(--muted); margin: 0; }

/* ---------- features ---------- */

.features-header { text-align: center; margin-bottom: 56px; }
.features-header p {
  font-size: 18px; color: #fff; margin: 14px 0 0;
  text-shadow: 0 1px 12px rgba(0,0,0,0.25);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.feature-card {
  background: var(--card-pink);
  border-radius: 28px;
  padding: 32px;
  display: flex;
  gap: 24px;
  align-items: center;
  transition: transform .25s ease, box-shadow .25s ease;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}
.feature-card:hover { transform: translateY(-6px); box-shadow: 0 22px 48px rgba(43,36,56,0.14); }

.feature-icon {
  flex: 0 0 auto;
  width: 110px; height: 110px;
  border-radius: 24px;
  background-size: 145%;
  background-position: center;
  background-repeat: no-repeat;
}

.feature-card h3 { font-weight: 600; font-size: 24px; color: var(--ink); margin: 0 0 8px; }
.feature-card p { font-size: 16px; color: var(--muted); margin: 0; }

/* ---------- closing CTA ---------- */

.closing-cta { background: var(--ink); text-align: center; }
.closing-overlay { position: absolute; inset: 0; z-index: 0; background: rgba(43,36,56,0.55); }
.closing-inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.closing-cta p:not(.form-status) {
  font-size: 18px; color: #c9c2d6; margin: 18px 0 34px;
}

/* ---------- footer ---------- */

.site-footer { background: #fff; padding: 40px 24px; border-top: 1px solid var(--hairline); }
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.footer-logo { width: 40px; height: 40px; border-radius: 11px; filter: brightness(1.18) saturate(0.85); }
.footer-inner p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- scroll reveal + load animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
}
.reveal.in-view { opacity: 1; transform: none; }

.steps-grid .step-card:nth-child(2) { transition-delay: .1s; }
.steps-grid .step-card:nth-child(3) { transition-delay: .2s; }
.features-grid .feature-card:nth-child(2) { transition-delay: .08s; }
.features-grid .feature-card:nth-child(3) { transition-delay: .16s; }
.features-grid .feature-card:nth-child(4) { transition-delay: .24s; }

.reveal-load {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s ease, transform .8s ease;
  transition-delay: calc(var(--i, 0) * 0.12s + 0.05s);
}
.reveal-load.in-view { opacity: 1; transform: none; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .steps-grid { grid-template-columns: 1fr; }
  .how-phone { justify-content: center; }
  .how-header { text-align: center; justify-content: center; }
}

@media (max-width: 700px) {
  .features-grid { grid-template-columns: 1fr; }
  .hero-inner { padding-top: 120px; }
}

@media (max-width: 480px) {
  .feature-card { padding: 24px; gap: 18px; }
  .feature-icon { width: 84px; height: 84px; border-radius: 18px; }
  .brand-name { font-size: 22px; }
  .btn { padding: 13px 22px; font-size: 15px; }
  .phone-frame { width: 200px; height: 410px; }
}

/* ---------- reduced motion: complete fallback ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-load {
    opacity: 1 !important;
    transform: none !important;
  }
  .sparkle, .phone-frame {
    animation: none !important;
    opacity: 0 !important;
  }
  .phone-frame { opacity: 1 !important; }
}
