/*
 * nex-playground-alternative.html: the game first, then two choices on
 * phones, then the comparison. Loaded after landing.css and demo-loop.css.
 *
 * Phones (PostHog Nov 9-15): 72% of the page's sessions, a median 18 s on
 * the page and 19% average scroll, so the picture of the game, the buttons
 * and the comparison have to be on the first two screens.
 */

/* The still stands in for the demo video while that is off (the build strips
   the video figure, see build/demoVideos.ts). With the video on, it hides. */
[data-demo-loop] ~ .hero-still {
  display: none;
}

.hero-still {
  margin: 24px auto 0;
  max-width: 560px;
  width: 100%;
  min-width: 0;
  text-align: center;
}

.hero-still-frame {
  aspect-ratio: 960 / 600;
  border-radius: 18px;
  overflow: hidden;
  background: #1f2937;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.hero-still-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-still-caption {
  margin: 12px auto 0;
  max-width: 520px;
  font-size: 0.95rem;
  line-height: 1.45;
  opacity: 0.85;
}

.hero-still-caption strong {
  opacity: 1;
}

.article-hero .hero-still-play {
  margin: 14px 0 0;
}

/* Wide screens: picture beside its caption and Play button (as the video's
   .demo-loop--split), so Play is above the fold on a laptop. */
@media (min-width: 900px) {
  .hero-still {
    max-width: 880px;
    display: grid;
    grid-template-columns: minmax(0, 480px) minmax(0, 320px);
    column-gap: 32px;
    justify-content: center;
    align-items: center;
    text-align: left;
  }

  .hero-still-frame {
    grid-row: 1 / span 2;
  }

  .hero-still-caption {
    margin: 0;
    align-self: end;
    font-size: 1.05rem;
  }

  .article-hero .hero-still-play {
    align-self: start;
    justify-content: flex-start;
    margin: 20px 0 0;
  }
}

/* Phone choices: hidden on wider screens, which keep Play + the game chips. */
.nex-hero .hero-choices {
  display: none;
}

.nex-hero .hero-choice-send {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.55);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.nex-hero .hero-choice-send:hover,
.nex-hero .hero-choice-send:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 600px) {
  .nex-hero .subtitle {
    font-size: 1rem;
    line-height: 1.4;
  }

  .nex-hero .demo-loop,
  .nex-hero .hero-still {
    margin-top: 14px;
  }

  .hero-still-frame {
    border-radius: 14px;
  }

  .nex-hero .demo-loop-caption,
  .nex-hero .hero-still-caption {
    margin-top: 8px;
    font-size: 0.85rem;
  }

  /* The two choices replace the camera Play button and the game chips. */
  .nex-hero .demo-loop-play,
  .nex-hero .hero-still-play,
  .nex-hero .hero-games {
    display: none;
  }

  .nex-hero .hero-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0 0;
  }

  .nex-hero .hero-choices .btn {
    justify-content: center;
    width: 100%;
    min-height: 56px;
  }

  /* The send-to-computer card opens right under the buttons. */
  .nex-hero .hoppo-send-to-computer {
    width: 100%;
    margin: 12px 0 0;
  }
}

/* Comparison straight after the hero. */
.nex-compare {
  padding: 48px 0 16px;
}

.nex-compare .comparison-table-wrapper {
  margin-bottom: 24px;
}

.nex-compare .compare-more {
  display: none;
}

/* Shown by marketing.ts; .btn's display would otherwise beat [hidden]. */
.nex-compare .compare-more [hidden] {
  display: none;
}

/* How it works: its own dark band after the comparison. */
.article-hero.nex-steps {
  padding: 8px 0 40px;
}

.nex-steps .hero-steps {
  margin-top: 32px;
}

/* Phones: one card per row (no sideways scroll), first three rows until
   "See full comparison" (marketing.ts installCompareToggle). */
@media (max-width: 600px) {
  .nex-compare {
    padding: 28px 0 8px;
  }

  .nex-compare h2 {
    margin-top: 0;
  }

  .nex-compare .comparison-table-wrapper {
    margin: 0 0 12px;
    overflow: visible;
    box-shadow: none;
    border-radius: 0;
  }

  .nex-compare .comparison-table,
  .nex-compare .comparison-table tbody,
  .nex-compare .comparison-table tr,
  .nex-compare .comparison-table th,
  .nex-compare .comparison-table td {
    display: block;
  }

  .nex-compare .comparison-table {
    background: transparent;
  }

  .nex-compare .comparison-table thead {
    display: none;
  }

  .nex-compare .comparison-table tbody tr {
    margin: 0 0 12px;
    padding: 4px 0 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
  }

  .nex-compare .comparison-table tbody tr:hover {
    background: white;
  }

  .nex-compare .comparison-table tbody th {
    padding: 10px 14px 4px;
    border: 0;
    font-size: 1rem;
  }

  .nex-compare .comparison-table tbody td {
    padding: 3px 14px;
    border: 0;
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .nex-compare .comparison-table tbody td::before {
    content: attr(data-label) ': ';
    font-weight: 700;
    color: var(--text);
  }

  .nex-compare .comparison-table tbody td.hoppo::before {
    color: var(--primary);
  }

  .nex-compare .comparison-table-wrapper.is-compact tbody tr:nth-child(n + 4) {
    display: none;
  }

  .nex-compare .compare-more {
    display: block;
    margin: 0 0 8px;
    text-align: center;
  }

  .nex-compare .compare-more .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }

  .article-hero.nex-steps {
    padding: 4px 0 28px;
  }

  .nex-steps .hero-steps {
    margin-top: 24px;
  }
}

/* "Updated <date>" at the foot of the hero, below the phone choices so it
   never pushes them off the first screen. The page quotes prices, so the
   date they were last checked is shown (it matches the Article dateModified). */
.nex-hero .article-updated {
  margin: 12px auto 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}
