/* VowelPlay — Landing Page (mobile-first)
   ---------------------------------------------------------------------------
   Default styles target mobile (<640px). Tablet adds at ≥640px,
   desktop at ≥1024px. Most fluid sizes use clamp() so interior elements
   scale smoothly across the spectrum without stepwise jumps.
   --------------------------------------------------------------------------- */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--vp-bg);
  color: var(--vp-fg);
  font-family: var(--vp-font-rounded);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body { overflow-x: hidden; }

/* ---------------------------------------------------------------------------
   Selection policy
   ---------------------------------------------------------------------------
   Default to non-selectable so the page feels app-like — tiles, illustrations,
   eyebrow labels, headlines and decorative chrome don't drag-highlight when a
   user taps or swipes. The blue tap-flash is suppressed for the same reason.

   On desktop (≥1024px) we re-enable text selection on the readable copy —
   subheadings (.vp-feature__eyebrow), section headlines (h2/h3), the hero
   lede and the feature/final-CTA paragraphs — so anyone who wants to copy
   real prose still can. On mobile, nothing is selectable: the long-press
   selection menu is the source of the frustration the user reported.
   --------------------------------------------------------------------------- */
html, body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 1024px) {
  .vp-feature__eyebrow,
  .vp-feature__copy,
  .vp-feature h2,
  .vp-feature h3,
  .vp-hero__lede,
  .vp-final-cta h2,
  .vp-final-cta p {
    -webkit-user-select: text;
    user-select: text;
  }
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.vp-section {
  width: 100%;
  padding: 40px 20px;
  position: relative;
}

.vp-container {
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

/* ---------- Hero ---------- */
.vp-hero {
  padding: 32px 20px 40px;
  position: relative;
}

.vp-hero__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}

.vp-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--vp-brand-blue-wash);
  color: var(--vp-brand-blue-deepest);
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
  text-decoration: none;
  transition: background .15s linear, transform .2s var(--vp-ease-tile);
}
a.vp-hero__eyebrow:hover {
  background: #DCE6FE;
  transform: translateY(-1px);
}
.vp-hero__eyebrow .dot {
  width: 8px; height: 8px;
  background: var(--vp-brand-blue);
  border-radius: 999px;
  display: inline-block;
}
.vp-hero__eyebrow .pill {
  background: #fff;
  color: var(--vp-brand-blue-deep);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.vp-hero h1 {
  font-size: clamp(40px, 9vw, 88px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  color: var(--vp-fg);
}

.vp-hero h1 .vp-hero__accent {
  background: linear-gradient(180deg, var(--vp-brand-blue) 0%, var(--vp-brand-blue-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.vp-hero__lede {
  font-size: clamp(16px, 4vw, 20px);
  line-height: 1.45;
  color: var(--vp-text-secondary);
  max-width: 480px;
  margin: 0 0 28px;
  font-weight: 500;
}

.vp-hero__ctas {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.vp-appstore {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #0F172A;
  color: #fff;
  padding: 12px 22px;
  border-radius: 14px;
  transition: transform .25s var(--vp-ease-tile);
  box-shadow: 0 6px 18px rgba(15,23,42,0.18);
}
.vp-appstore:hover { transform: translateY(-2px) scale(1.02); }

.vp-appstore svg { width: 28px; height: 28px; }
.vp-appstore__small { font-size: 11px; opacity: .8; line-height: 1; margin-bottom: 3px; }
.vp-appstore__big { font-size: 19px; font-weight: 800; line-height: 1; letter-spacing: -0.01em; }

.vp-hero__meta {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--vp-text-secondary);
  font-size: 14px;
  font-weight: 600;
}

.vp-hero__meta-stars { color: #FBBF24; letter-spacing: 1px; }

.vp-hero__phone-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1400px;
  z-index: 2;
  /* No negative margin on mobile — the stacked layout would collide. */
  margin-bottom: 0;
}

/* Scroll-indicator is desktop-only — see the (min-width: 1024px) block
   for its actual styling. Hide elsewhere. */
.vp-hero__scroll { display: none; }

/* ---------- Feature sections ---------- */
.vp-feature {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
}

.vp-feature--split {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
/* `.is-flipped` order classes only affect grid/horizontal flex layouts.
   In column flex they're harmless — text always renders before illustration. */

.vp-feature__text { max-width: 520px; width: 100%; }

.vp-feature__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: auto;
  width: 100%;
}

.vp-feature__eyebrow {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--vp-brand-blue);
  margin-bottom: 16px;
}

.vp-feature__copy {
  font-size: clamp(16px, 3.4vw, 18px);
  line-height: 1.5;
  color: var(--vp-text-secondary);
  font-weight: 500;
  max-width: 480px;
  margin: 20px 0 0;
}

.vp-feature__hint {
  font-size: 13px;
  color: var(--vp-text-tertiary);
  margin-top: 14px;
  font-weight: 600;
}

/* ---------- Tile word component ---------- */
.tile-word {
  display: flex;
  gap: clamp(4px, 1.5vw, 10px);
  align-items: center;
  /* Perspective so the JS-driven scroll-spin reads as a 3D flip rather
     than a flat vertical squish. */
  perspective: 800px;
}

.tile-word--lg { gap: clamp(4px, 1.5vw, 14px); }

.word-tile {
  width: clamp(44px, 11vw, 78px);
  height: clamp(44px, 11vw, 78px);
  border-radius: var(--vp-radius-tile);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--vp-font-rounded);
  font-weight: 900;
  font-size: clamp(22px, 5.5vw, 38px);
  line-height: 1;
  background: var(--vp-brand-blue);
  color: #fff;
  box-shadow: var(--vp-shadow-tile);
  position: relative;
  transition: background .25s var(--vp-ease-smooth), color .25s var(--vp-ease-smooth);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  user-select: none;
}

.word-tile--lg {
  width: clamp(48px, 12vw, 96px);
  height: clamp(48px, 12vw, 96px);
  font-size: clamp(24px, 6vw, 46px);
  border-radius: clamp(10px, 2vw, 16px);
}

.word-tile--slot {
  background: #fff;
  color: var(--vp-amber-deep);
  border: 3px dashed var(--vp-brand-yellow);
  box-shadow: none;
  cursor: pointer;
  padding: 0;
}

.word-tile--slot:hover {
  transform: translateY(-3px) rotate(-2deg);
  background: var(--vp-amber-fill-soft);
}

.word-tile--slot::before {
  content: "?";
  font-size: clamp(22px, 5vw, 36px);
  color: var(--vp-brand-yellow);
  font-weight: 900;
  opacity: 0.65;
  transition: opacity .2s linear;
}
.word-tile--slot:hover::before { opacity: 1; }

.word-tile--filled {
  background: var(--vp-success-fill);
  color: var(--vp-success-ink);
  border: 3px solid var(--vp-success-green);
  animation: tileFlip 0.6s var(--vp-ease-flip);
}
/* Scroll-mode tiles inherit the green visual but DO NOT run a separate
   celebration animation — the green is revealed during the settle's
   back-face moment and rolls into view already green, so an additional
   rotateY animation would only fight the inline rotateX transition. */
[data-tile-word][data-mechanic="scroll"] .word-tile--filled {
  animation: none;
}

@keyframes tileFlip {
  0%   { transform: rotateY(0deg) scale(1); }
  50%  { transform: rotateY(90deg) scale(1.08); }
  100% { transform: rotateY(0deg) scale(1); }
}

.tile-word:hover .word-tile:not(.word-tile--slot):not(.word-tile--filled):not(.word-tile--scramble) {
  animation: tileWiggle 0.6s ease-in-out;
}

@keyframes tileWiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-3deg) translateY(-2px); }
  75% { transform: rotate(3deg) translateY(-2px); }
}

.word-tile--scramble {
  background: var(--vp-brand-blue-wash);
  color: var(--vp-brand-blue-deep);
  border: 3px solid var(--vp-brand-blue-light);
  font-variant-numeric: tabular-nums;
}

/* ---------- Big CTA ---------- */
.vp-final-cta {
  text-align: center;
  padding: 64px 20px;
  background: var(--vp-brand-blue);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.vp-final-cta h2 {
  font-size: clamp(32px, 5.5vw, 64px);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  line-height: 1;
}

.vp-final-cta p {
  font-size: clamp(16px, 3.6vw, 19px);
  font-weight: 500;
  opacity: 0.85;
  margin: 0 0 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.vp-final-cta .vp-appstore {
  background: #fff;
  color: #0F172A;
}
.vp-final-cta .vp-appstore:hover { background: #fff; }

/* ---------- Footer ---------- */
.vp-footer {
  background: #0F172A;
  color: #fff;
  padding: 36px 20px 28px;
}

.vp-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.vp-footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 800;
}
.vp-footer__brand img { width: 36px; height: 36px; border-radius: 8px; }

.vp-footer__credit {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 500;
}

.vp-footer__social {
  display: flex;
  gap: 10px;
}

.vp-footer__social a {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  transition: background .15s linear, transform .2s var(--vp-ease-tile);
}
.vp-footer__social a:hover { background: rgba(255,255,255,0.18); transform: translateY(-2px); }
.vp-footer__social svg { width: 18px; height: 18px; fill: #fff; }

/* ---------- Sticky mobile App Store CTA ---------- */
.vp-sticky-cta {
  display: none;
}

@media (max-width: 639px) {
  .vp-sticky-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    background: #0F172A;
    color: #fff;
    padding: 14px 20px;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.30);
    font-weight: 800;
    font-size: 15px;
    z-index: 100;
    opacity: 0;
    transform: translateY(120%);
    transition: opacity .25s ease, transform .3s var(--vp-ease-tile);
    pointer-events: none;
  }
  .vp-sticky-cta.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .vp-sticky-cta svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }
  /* Avoid the sticky CTA covering the footer's last lines. */
  body.has-sticky-cta {
    padding-bottom: 80px;
  }
}

/* ---------- Mobile + tablet centering ----------
   In single-column layouts (default and tablet) we centre everything —
   eyebrow, headline, lede, CTA, feature text, tile words. Desktop's
   two-column hero/feature flips back to left-aligned in the 1024+ block. */
.vp-hero__inner > div:first-child,
.vp-feature__text {
  text-align: center;
}
.vp-hero__lede,
.vp-feature__copy {
  margin-left: auto;
  margin-right: auto;
}
.vp-hero__ctas,
.vp-feature__eyebrow,
.tile-word {
  justify-content: center;
}

/* ---------- Mobile-only CTA scale tweak ---------- */
@media (max-width: 639px) {
  .vp-appstore {
    padding: 10px 18px;
    gap: 10px;
  }
  .vp-appstore svg { width: 24px; height: 24px; }
  .vp-appstore__small { font-size: 10px; }
  .vp-appstore__big { font-size: 17px; }
}

/* ---------- Tablet (≥640px) ---------- */
@media (min-width: 640px) {
  .vp-section { padding: 64px 24px; }

  .vp-hero { padding: 56px 24px 72px; }
  .vp-hero__inner { gap: 40px; }
  .vp-hero__eyebrow { margin-bottom: 22px; }
  .vp-hero h1 { margin-bottom: 22px; }
  .vp-hero__lede { margin-bottom: 30px; }

  .vp-feature--split { gap: 40px; }

  .vp-final-cta { padding: 80px 24px; }
}

/* ---------- Desktop (≥1024px) ---------- */
@media (min-width: 1024px) {
  .vp-section { padding: 96px 24px; }

  /* Hero takes the full viewport so the content has its own moment, then
     the user scrolls down to the feature sections. The .vp-hero__inner
     gets vertically centered inside that 100vh box. */
  .vp-hero {
    padding: 56px 24px 110px;
    min-height: 100vh;
    display: flex;
    align-items: center;
  }
  .vp-hero__inner {
    grid-template-columns: 1.1fr 1fr;
    gap: 48px;
    width: 100%;
  }
  .vp-hero__phone-wrap {
    /* Restore the desktop phone-shadow overhang trick. */
    margin-bottom: -80px;
  }
  .vp-hero h1 { margin-bottom: 24px; }

  /* Scroll-indicator chevron — desktop only, anchored to the hero's
     bottom-center, gentle bounce to invite continuation. */
  .vp-hero__scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--vp-text-secondary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color .15s linear;
    animation: scrollBob 2s ease-in-out infinite;
  }
  .vp-hero__scroll:hover { color: var(--vp-brand-blue); }
  .vp-hero__scroll-chevron { width: 18px; height: 18px; }
  @keyframes scrollBob {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, 5px); }
  }

  /* On desktop, the hero/feature text columns return to left-aligned. */
  .vp-hero__inner > div:first-child,
  .vp-feature__text {
    text-align: left;
  }
  .vp-hero__lede,
  .vp-feature__copy {
    margin-left: 0;
    margin-right: 0;
  }
  .vp-hero__ctas,
  .vp-feature__eyebrow,
  .tile-word {
    justify-content: flex-start;
  }

  .vp-feature--split {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 80px;
  }
  /* On desktop, `.is-flipped` swaps the columns. */
  .vp-feature--split.is-flipped .order-1 { order: 1; }
  .vp-feature--split.is-flipped .order-2 { order: 2; }
  .vp-feature__visual { min-height: 380px; }

  .vp-final-cta { padding: 120px 24px; }

  .vp-footer { padding: 48px 24px 36px; }
}

/* ---------- Reduce motion for users who request it ---------- */
@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;
  }
  .float-tile,
  .illus-brain__tile {
    animation: none !important;
  }
}
