/**
 * TopPair Landing — Midnight Clubhouse
 * =====================================
 * Standalone stylesheet. The colours, radii and shadows below are COPIED from
 * frontend/src/assets/design-tokens.css so this page can never reach into the
 * app codebase. If the app's palette ever changes, update the block below by
 * hand — that is the deliberate trade-off for keeping the mobile app untouched.
 */

:root {
  /* Surfaces */
  --bg:        #191611;
  --surface:   #2c2825;
  --surface-2: #363129;
  --border:    #453e36;

  /* Accents */
  --primary:   #74c044;
  --gold:      #e6b34a;
  --info:      #56a6d8;
  --lantern:   #f0a35e;

  /* Text */
  --text:      #f2ead9;
  --text-dim:  #a89c8a;

  /* Type */
  --font: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Radii */
  --r-md:   16px;
  --r-lg:   20px;
  --r-pill: 999px;

  /* Depth */
  --edge:        0 4px 0 rgba(0, 0, 0, .32);
  --lantern-edge: inset 0 1px 0 rgba(240, 163, 94, .09);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(130% 55% at 50% -8%, rgba(240, 163, 94, .10), transparent 55%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ------------------------------------------------------ cinematic hero ---
 * The phone tilts from -16deg to +16deg as you scroll through a tall section
 * whose stage stays pinned. Three beats (headline + screenshot) swap along the
 * way. Ported from the older mockup on the `claude/website` branch
 * (frontend/public/site/index.html) — same maths, but the phone now holds the
 * real screenshots instead of hand-built fake UI.
 */

.d-sticky-wrap {
  position: relative;
  height: 340vh;
}

.d-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 70% at 50% 10%, rgba(240, 163, 94, .16), transparent 55%),
    var(--bg);
}

/* Beats fly in and out along the scroll direction. No direction tracking
 * needed: a beat parks BELOW the stage while its turn is still ahead and ABOVE
 * once its turn has passed. Scrolling down therefore lifts the old line out the
 * top while the new one rises from the bottom; scrolling up reverses both,
 * because the same rule now sorts them the other way round. */
.d-beat {
  position: absolute;
  left: 50%;
  top: 9%;
  text-align: center;
  z-index: 2;
  font-size: clamp(1.9rem, 6vw, 4.2rem);
  font-weight: 900;
  line-height: 1.04;
  width: min(90vw, 900px);
  margin: 0;
  opacity: 0;
  transform: translate(-50%, 0);
  transition:
    opacity .4s ease,
    transform .55s cubic-bezier(.2, .7, .3, 1);
  pointer-events: none;
}

.d-beat.active {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Its turn has passed — parked above the stage. */
.d-beat.above {
  opacity: 0;
  transform: translate(-50%, -80px);
}

/* Its turn has not come yet — waiting below the stage. */
.d-beat.below {
  opacity: 0;
  transform: translate(-50%, 80px);
}

.d-phone-wrap {
  perspective: 1600px;
  z-index: 2;
  margin-top: 6vh;
}

.phone {
  position: relative;
  aspect-ratio: 924 / 2000;
  height: min(520px, 54vh);
  border-radius: 34px;
  background: #161009;
  border: 6px solid #0e0a06;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
  overflow: hidden;
  flex-shrink: 0;
}

/* Recreates the Dynamic Island — the screenshots have the gap for it. */
.phone::before {
  content: '';
  position: absolute;
  top: 1.2%;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  aspect-ratio: 126 / 37;
  border-radius: var(--r-pill);
  background: #0e0a06;
  z-index: 2;
}

.d-phone {
  transition: transform .05s linear;
}

.d-screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .45s ease;
}

.d-screen.active {
  opacity: 1;
}

.scroll-hint {
  position: absolute;
  bottom: 104px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: opacity .4s ease;
}

.scroll-hint.hide {
  opacity: 0;
}

.scroll-hint i {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg);
  animation: bounceDown 1.6s ease-in-out infinite;
}

@keyframes bounceDown {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50%      { transform: rotate(45deg) translate(4px, 4px); }
}

.d-pill {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.d-pill img {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: block;
}

.d-progress {
  display: flex;
  gap: 5px;
}

.d-progress i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
}

.d-progress i.active {
  background: var(--gold);
}

/* No motion wanted: collapse the tall scroll stage to a single static frame. */
@media (prefers-reduced-motion: reduce) {
  .d-sticky-wrap {
    height: auto;
  }

  .d-sticky {
    position: static;
    height: auto;
    flex-direction: column;
    padding: 56px 20px 40px;
  }

  .d-beat {
    position: static;
    transform: none;
    transition: none;
    margin-bottom: 24px;
  }

  .d-beat:not(.active) {
    display: none;
  }

  .d-phone-wrap {
    margin-top: 0;
  }

  .phone {
    height: min(520px, 70vh);
  }

  .d-screen {
    transition: none;
  }

  .scroll-hint {
    display: none;
  }

  .d-pill {
    position: static;
    transform: none;
    margin-top: 28px;
  }
}

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

.hero {
  padding: 48px 0 8px;
  text-align: center;
}

.logo {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  box-shadow: var(--edge);
  display: block;
  margin: 0 auto 20px;
}

.hero h1 {
  font-size: 39px;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
}

.hero .tagline {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 14px;
}

.hero .lead {
  font-size: 16px;
  color: var(--text-dim);
  margin: 0 auto;
  max-width: 30rem;
}

/* --------------------------------------------------------------- store --- */

.stores {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  padding: 28px 0 4px;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 280px;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--lantern-edge);
  /* Deliberately not a link: the apps are not in the stores yet. */
  cursor: default;
  opacity: .62;
}

.store-badge svg {
  width: 26px;
  height: 26px;
  flex: none;
  fill: var(--text-dim);
}

.store-badge .store-lines {
  text-align: left;
  line-height: 1.25;
}

.store-badge .store-soon {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
}

.store-badge .store-name {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.stores-note {
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  margin: 6px 0 0;
}

/* ------------------------------------------------------------- screens --- */

.screens {
  padding: 40px 0 8px;
}

/* Mobile: a swipeable rail that snaps card by card. */
.rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 20px 20px;
  margin: 0 -20px;
  scrollbar-width: none;
}

.rail::-webkit-scrollbar {
  display: none;
}

.shot {
  flex: 0 0 68%;
  max-width: 260px;
  scroll-snap-align: center;
  margin: 0;
  text-align: center;
}

.shot img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--edge);
}

.shot figcaption {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
  margin-top: 12px;
  padding: 0 4px;
}

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

.features {
  padding: 24px 0 8px;
  display: grid;
  gap: 12px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--lantern-edge);
  padding: 16px 18px;
}

.feature h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 2px;
  color: var(--text);
}

.feature p {
  margin: 0;
  font-size: 15px;
  color: var(--text-dim);
}

/* ------------------------------------------------------------ 404 page --- */

.notfound {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}

.notfound h1 {
  font-size: 25px;
  font-weight: 900;
  margin: 12px 0 4px;
}

.notfound p {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
}

.notfound a {
  color: var(--info);
  font-weight: 800;
}

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

.foot {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  text-align: center;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-bottom: 16px;
}

.foot a {
  color: var(--info);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.foot a:hover {
  text-decoration: underline;
}

.foot .copy {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
}

/* ------------------------------------------------------ wider screens --- */

@media (min-width: 720px) {
  .hero {
    padding-top: 72px;
  }

  .hero h1 {
    font-size: 52px;
  }

  .stores {
    flex-direction: row;
    justify-content: center;
  }

  /* No rail on desktop — everything fits side by side. */
  .rail {
    overflow: visible;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 4px 0 20px;
  }

  .shot {
    flex: 0 0 172px;
  }

  .features {
    grid-template-columns: 1fr 1fr;
  }
}
