/* ═══════════════════════════════════════
   TOKENS
   ═══════════════════════════════════════ */
:root {
  --bg-cream: #FDFAF5;
  --bg-white: #FFFFFF;
  --bg-warm: #F5F1EB;
  --bg-warm-dark: #EDE7DD;

  --border-light: #E8E2D9;
  --border-medium: #D4CCC0;

  --text-primary: #2D2A26;
  --text-secondary: #6B6560;
  --text-muted: #9E9790;

  --plum: #7B5EA7;
  --plum-light: #9B7EC8;
  --plum-dark: #5E4585;
  --plum-soft: rgba(123,94,167,0.08);
  --plum-medium: rgba(123,94,167,0.14);

  --coral: #E8734A;
  --coral-soft: rgba(232,115,74,0.10);
  --teal: #3AAFA9;
  --teal-soft: rgba(58,175,169,0.10);
  --gold: #D4A843;
  --gold-soft: rgba(212,168,67,0.10);

  --board-light: #F0DEB4;
  --board-dark: #B88B5A;
  --board-highlight: rgba(232,115,74,0.45);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 100px;

  --shadow-sm: 0 2px 8px rgba(45,42,38,0.06);
  --shadow-md: 0 4px 20px rgba(45,42,38,0.08);
  --shadow-lg: 0 8px 40px rgba(45,42,38,0.10);
  --shadow-xl: 0 16px 60px rgba(45,42,38,0.12);
}

/* ═══════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-cream);
  color: var(--text-primary);
  font-family: 'Nunito', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }

/* ═══════════════════════════════════════
   NAV
   ═══════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(253,250,245,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.scrolled { border-bottom-color: var(--border-light); }
.nav-logo {
  font-family: 'Fraunces', serif;
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.nav-logo .piece { font-size: 1.1em; margin: 0 0.05em; }
.nav-logo .bestie { color: var(--coral); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.nav-link:hover { color: var(--plum); }
.nav-cta-sm {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--plum);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.nav-cta-sm:hover { background: var(--plum-light); transform: translateY(-1px); }

/* ═══════════════════════════════════════
   HERO
   ═══════════════════════════════════════ */
.hero {
  padding: 8rem 2rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  min-height: 90vh;
}
.hero-text {
  max-width: 480px;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--plum);
  background: var(--plum-soft);
  border: 1px solid var(--plum-medium);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1.5rem;
}
.hero-tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.hero h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}
.hero h1 .highlight {
  color: var(--plum);
  position: relative;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 2rem;
  max-width: 420px;
}

/* ═══════════════════════════════════════
   CTA INPUT
   ═══════════════════════════════════════ */
.cta-box {
  display: flex;
  align-items: stretch;
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  max-width: 440px;
}
.cta-box:focus-within {
  border-color: var(--plum);
  box-shadow: 0 0 0 4px var(--plum-soft), var(--shadow-md);
}
.cta-input {
  flex: 1;
  padding: 0.85rem 1rem;
  border: none;
  outline: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
}
.cta-input::placeholder { color: var(--text-muted); }
.cta-btn {
  padding: 0.85rem 1.5rem;
  background: var(--plum);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.cta-btn:hover { background: var(--plum-dark); }
.cta-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.65rem;
}
.cta-hint a {
  color: var(--plum);
  text-decoration: underline;
  text-decoration-color: var(--plum-medium);
  text-underline-offset: 2px;
}

/* ═══════════════════════════════════════
   HERO MOCKUP
   ═══════════════════════════════════════ */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.mockup-wrapper {
  position: relative;
  width: 100%;
  max-width: 460px;
}
/* Phone frame */
.phone-frame {
  background: #1a1a1a;
  border-radius: 28px;
  padding: 10px;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0,0,0,0.1);
  position: relative;
}
.phone-screen {
  background: #2b2926;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}
/* The chess game */
.mock-game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: #1e1c1a;
}
.mock-player {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mock-avatar {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: #444;
}
.mock-name {
  font-size: 0.65rem;
  font-weight: 600;
  color: #ccc;
  font-family: 'Nunito', sans-serif;
}
.mock-rating {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.55rem;
  color: #888;
  margin-left: 0.3rem;
}
.mock-clock {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  color: #fff;
  background: #333;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}
/* Chessboard in mockup */
.mock-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1;
  width: 100%;
}
.sq {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: min(3.5vw, 22px);
  line-height: 1;
  user-select: none;
  position: relative;
}
.sq-l { background: var(--board-light); }
.sq-d { background: var(--board-dark); }
.sq-hl::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 3px;
  background: var(--board-highlight);
  pointer-events: none;
}
.mock-game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: #1e1c1a;
}

/* PiP prediction window */
.pip-window {
  position: absolute;
  bottom: 15%;
  left: -6%;
  width: 54%;
  background: var(--bg-cream);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-light);
  overflow: hidden;
  z-index: 10;
  animation: pip-float 4s ease-in-out infinite;
}
@keyframes pip-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.pip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
}
.pip-logo {
  font-family: 'Fraunces', serif;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-primary);
}
.pip-logo .b { color: var(--coral); }
.pip-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.45rem;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.pip-status-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--teal);
}
.pip-body {
  padding: 0.5rem 0.6rem;
}
.pip-pred {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 0.35rem;
}
.pip-pred:last-child { margin-bottom: 0; }
.pip-pred-board {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}
.psq {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6px;
  line-height: 1;
}
.psq-l { background: var(--board-light); }
.psq-d { background: var(--board-dark); }
.pip-pred-info {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}
.pip-pred-title {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}
.pip-pred-conf {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.42rem;
  color: var(--text-muted);
}
.pip-pred-tag {
  font-size: 0.4rem;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-pill);
  margin-left: auto;
  flex-shrink: 0;
}
.tag-plum { background: var(--plum-soft); color: var(--plum); }
.tag-coral { background: var(--coral-soft); color: var(--coral); }
.tag-teal { background: var(--teal-soft); color: var(--teal); }

/* Decorative blobs behind mockup */
.blob-1, .blob-2 {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}
.blob-1 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--plum-soft) 0%, transparent 70%);
  top: -10%; right: -15%;
}
.blob-2 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, var(--coral-soft) 0%, transparent 70%);
  bottom: -5%; left: -10%;
}

/* ═══════════════════════════════════════
   SOCIAL PROOF BAR
   ═══════════════════════════════════════ */
.proof-bar {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem 2rem 3.5rem;
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.proof-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.proof-icon {
  font-size: 1rem;
}

/* ═══════════════════════════════════════
   DIVIDER
   ═══════════════════════════════════════ */
.section-divider {
  max-width: 800px;
  margin: 0 auto;
  height: 1px;
  background: var(--border-light);
}

/* ═══════════════════════════════════════
   HOW IT WORKS
   ═══════════════════════════════════════ */
.how-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 5rem 2rem;
}
.section-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--plum);
  margin-bottom: 0.5rem;
}
.section-heading {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  margin-bottom: 0.6rem;
  line-height: 1.2;
}
.section-sub {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 3rem;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.step-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.step-card:hover {
  border-color: var(--plum-medium);
  box-shadow: var(--shadow-md);
}
.step-num {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--plum-medium);
  line-height: 1;
  margin-bottom: 0.75rem;
}
.step-card:nth-child(2) .step-num { color: var(--coral-soft); }
.step-card:nth-child(3) .step-num { color: var(--teal-soft); }
.step-title {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.step-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.step-icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════════
   FEATURES (alternating)
   ═══════════════════════════════════════ */
.features-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
  margin-bottom: 4rem;
}
.feature-row:last-child { margin-bottom: 0; }
.feature-row.reverse .feature-text { order: 2; }
.feature-row.reverse .feature-visual { order: 1; }
.feature-text {
  max-width: 400px;
}
.feature-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
  display: inline-block;
  margin-bottom: 0.75rem;
}
.feature-title {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.25;
}
.feature-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
}
/* Feature visual panels */
.feature-panel {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}
/* Prediction cards showcase */
.feat-predictions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.feat-pred-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-cream);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
}
.feat-pred-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}
.feat-pred-info {
  flex: 1;
}
.feat-pred-name {
  font-weight: 700;
  font-size: 0.88rem;
}
.feat-pred-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.feat-pred-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}
/* Scoreboard visual */
.feat-score {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.feat-score-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.feat-score-label {
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 120px;
}
.feat-score-bar {
  flex: 1;
  height: 12px;
  background: var(--bg-warm);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.feat-score-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.6s ease;
}
.feat-score-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}
/* Speed visual */
.feat-speed {
  text-align: center;
}
.feat-speed-num {
  font-family: 'Fraunces', serif;
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--plum);
  line-height: 1;
}
.feat-speed-unit {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 600;
}
.feat-speed-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  line-height: 1.6;
}

/* ═══════════════════════════════════════
   DEMO SECTION
   ═══════════════════════════════════════ */
.demo-section {
  background: var(--bg-warm);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.demo-inner {
  max-width: 700px;
  margin: 0 auto;
  padding: 4rem 2rem;
  text-align: center;
}
.demo-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}
.demo-heading {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.demo-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 460px;
  margin: 0 auto 1.5rem;
}
.demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  background: var(--bg-white);
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.demo-btn:hover {
  border-color: var(--plum);
  box-shadow: 0 0 0 4px var(--plum-soft);
  transform: translateY(-1px);
}
.demo-btn .play-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--plum);
  display: flex;
  align-items: center;
  justify-content: center;
}
.demo-btn .play-circle svg {
  fill: #fff;
  width: 10px;
  height: 10px;
  margin-left: 1px;
}

/* ═══════════════════════════════════════
   BOTTOM CTA
   ═══════════════════════════════════════ */
.bottom-cta {
  max-width: 620px;
  margin: 0 auto;
  padding: 5rem 2rem 6rem;
  text-align: center;
}
.bottom-cta .section-heading {
  margin-bottom: 0.5rem;
}
.bottom-cta .section-sub {
  margin: 0 auto 2rem;
}
.bottom-cta .cta-box {
  margin: 0 auto;
  max-width: 460px;
}
.bottom-cta .cta-hint {
  text-align: center;
}

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border-light);
  padding: 2.5rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-brand {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1rem;
}
.footer-brand .bestie { color: var(--coral); }
.footer-links {
  display: flex;
  gap: 1.5rem;
}
.footer-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-link:hover { color: var(--plum); }

/* ═══════════════════════════════════════
   ANIMATIONS (scroll reveal)
   ═══════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger children */
.stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.stagger > .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger > .reveal:nth-child(3) { transition-delay: 0.2s; }

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 7rem;
    min-height: auto;
    gap: 2.5rem;
  }
  .hero-text {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .hero-sub { max-width: 100%; }
  .cta-box { max-width: 100%; }
  .hero-visual { order: -1; }
  .mockup-wrapper { max-width: 320px; }
  .pip-window { width: 58%; left: -4%; bottom: 12%; }
  .steps {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .feature-row, .feature-row.reverse {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .feature-row .feature-text,
  .feature-row.reverse .feature-text { order: 1; }
  .feature-row .feature-visual,
  .feature-row.reverse .feature-visual { order: 2; }
  .proof-bar { gap: 1.25rem; }
  .nav-links { display: none; }
  .footer {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .cta-box { flex-direction: column; }
  .cta-btn { padding: 0.85rem; }
  .pip-window { width: 62%; }
}
