/* ════════════════════════════════════════════════════════════════════════
   Home hero animation: the algorithm's feed drifts past in the background,
   then a rec from a friend lands on it and knocks it out of the way.
   Only applies with JS on (the `js` class is set in <head>); without it the
   page stays the centered teaser from styles.css.
   ════════════════════════════════════════════════════════════════════════ */
.home-layout { display: contents; }
.recstage { display: none; }

.js body.home { display: block; place-items: normal; min-height: 100svh; overflow-x: clip; }
.js .waitlist__row input { min-width: 0; }

.js .home-layout {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center; gap: clamp(24px, 4vw, 72px);
  min-height: 100svh;
  /* Full width with padding (not max-width) so a card flying out is only clipped at the screen edge. */
  padding: 0 max(clamp(32px, 5vw, 72px), calc((100% - 1176px) / 2));
  overflow-x: clip;
}
.js .home-hero { max-width: 640px; padding: 48px 0 24px; text-align: left; }
.js .home-hero::before { display: none; }
.js .home-hero h1 { font-size: clamp(38px, 4.3vw, 62px); }
.js .home-lead { margin-left: 0; }
.js .waitlist { margin-left: 0; }
.js .coming { align-items: flex-start; }
.js .platforms { justify-content: flex-start; }
.js .home-hero .foot { justify-content: flex-start; padding: 30px 0 10px; }
.js .home-hero .legal-links { justify-content: flex-start; }

/* Text rises in once on load. `backwards` keeps it visible if animation is off. */
.js .home-hero > * { animation: hero-rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.js .home-hero > :nth-child(2) { animation-delay: 0.06s; }
.js .home-hero > :nth-child(3) { animation-delay: 0.12s; }
.js .home-hero > :nth-child(4) { animation-delay: 0.2s; }
.js .home-hero > :nth-child(5) { animation-delay: 0.28s; }
.js .home-hero > :nth-child(n + 6) { animation-delay: 0.36s; }
@keyframes hero-rise { from { opacity: 0; transform: translateY(18px); } }

/* ─── The feed ─────────────────────────────────────────────────────────── */
.feedwall {
  --tile-w: 156px;
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  display: none; justify-content: center; gap: 14px;
  opacity: 0; transition: opacity 1.4s ease;
}
.js .feedwall { display: flex; }
.feedwall.is-on { opacity: 1; }
.feedwall::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(27, 25, 22, 0.75) 0%, transparent 18%, transparent 82%, rgba(27, 25, 22, 0.8) 100%),
    linear-gradient(90deg, #1b1916 0%, rgba(27, 25, 22, 0.97) 36%, rgba(27, 25, 22, 0.34) 58%, rgba(27, 25, 22, 0.16) 100%);
}
.feedcol {
  flex: 0 0 var(--tile-w); align-self: flex-start;
  animation: feed-up var(--dur, 60s) linear infinite;
  will-change: transform;
}
.feedcol--down { animation-name: feed-down; }
.feedwall.is-paused .feedcol { animation-play-state: paused; }
@keyframes feed-up { to { transform: translate3d(0, -50%, 0); } }
@keyframes feed-down { from { transform: translate3d(0, -50%, 0); } to { transform: translate3d(0, 0, 0); } }

/* margin (not gap) so half the column is exactly one full cycle */
.ft {
  display: block; margin-bottom: 14px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.ft__art { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 7px; background: var(--art, #2a2620); overflow: hidden; }
.ft__match {
  position: absolute; left: 6px; bottom: 6px; padding: 2px 6px; border-radius: 5px;
  font-size: 9px; font-weight: 700; color: var(--soft); background: rgba(27, 25, 22, 0.78);
}
.ft__tag {
  display: block; margin-top: 8px; font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; color: var(--faint);
}
.ft__bar { display: block; height: 6px; width: 72%; margin-top: 6px; border-radius: 3px; background: var(--border); }

/* ─── The rec that lands ───────────────────────────────────────────────── */
.js .recstage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; height: min(600px, 86svh); }
.recstage__ring {
  grid-area: 1 / 1; width: 340px; height: 340px; border-radius: 50%;
  border: 2px solid var(--aqua); opacity: 0; pointer-events: none;
}
/* A copy of the app's RecCard (recom-frontend/src/components/RecCard.tsx) in
   its unread state. Sizes are the app's, times --u so it can scale up on desktop. */
.rc {
  --u: clamp(1px, 0.086vw, 1.3px);
  grid-area: 1 / 1; position: relative;
  display: flex; flex-direction: column; gap: calc(var(--u) * 12);
  width: min(calc(var(--u) * 358), 100%); padding: calc(var(--u) * 14);
  background: var(--surface); border: 1px solid #245f55; border-radius: calc(var(--u) * 14);
  box-shadow: 0 calc(var(--u) * 26) calc(var(--u) * 64) rgba(0, 0, 0, 0.62), 0 0 calc(var(--u) * 40) rgba(46, 211, 183, 0.14);
  transform: rotate(var(--tilt, -2deg));
}
.rc svg { display: block; }
.rc__head { display: flex; align-items: center; gap: calc(var(--u) * 9); }
.rc__av {
  flex: none; display: grid; place-items: center;
  width: calc(var(--u) * 28); height: calc(var(--u) * 28); border-radius: 50%;
  font-size: calc(var(--u) * 11.2); font-weight: 700; line-height: 1; color: #f5f1e6; background: var(--av);
}
.rc__who {
  flex: 1; min-width: 0; font-size: calc(var(--u) * 13); line-height: 1.3; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rc__who b { font-weight: 700; color: var(--cream); }
.rc__new {
  flex: none; padding: calc(var(--u) * 2) calc(var(--u) * 7); border-radius: 999px;
  font-size: calc(var(--u) * 9); font-weight: 700; line-height: 1.3; letter-spacing: 0.067em;
  text-transform: uppercase; color: var(--charcoal); background: var(--aqua);
}
.rc__time { flex: none; font-size: calc(var(--u) * 11); font-weight: 600; color: var(--faint); }

.rc__body { display: flex; gap: calc(var(--u) * 13); }
.rc__art { flex: none; width: calc(var(--u) * 62); }
.rc__art svg { width: 100%; height: auto; border-radius: calc(var(--u) * 8); }
.rc__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: calc(var(--u) * 6); }
.rc__titleline { display: flex; align-items: baseline; gap: calc(var(--u) * 6); }
.rc__title {
  flex-shrink: 1; min-width: 0; font-family: var(--font-display); font-weight: 700;
  font-size: calc(var(--u) * 14); line-height: 1.25; color: var(--cream);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rc__year { flex: none; font-family: var(--font-display); font-weight: 700; font-size: calc(var(--u) * 12); color: var(--faint); }
.rc__meta {
  display: flex; align-items: center; gap: calc(var(--u) * 5);
  font-size: calc(var(--u) * 10); font-weight: 600; line-height: 1.3;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint);
}
.rc__meta svg { width: calc(var(--u) * 11); height: calc(var(--u) * 11); }
.rc__sub {
  font-size: calc(var(--u) * 12); line-height: 1.3; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rc__quote {
  margin: 0; font-style: italic; font-size: calc(var(--u) * 13); line-height: calc(var(--u) * 18); color: var(--soft);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.rc__word { display: inline-block; animation: word-in 0.34s ease backwards; animation-delay: calc(0.42s + var(--i) * 0.045s); }
@keyframes word-in { from { opacity: 0; transform: translateY(6px); } }
.rc__media {
  display: flex; align-items: center; gap: calc(var(--u) * 5);
  font-size: calc(var(--u) * 12); font-weight: 600; line-height: 1.3; color: var(--soft);
}
.rc__media svg { width: calc(var(--u) * 13); height: calc(var(--u) * 13); color: var(--aqua); }
.rc__mark {
  align-self: flex-start; display: flex; align-items: center; gap: calc(var(--u) * 5);
  margin-top: calc(var(--u) * 2); padding: calc(var(--u) * 5) calc(var(--u) * 12);
  border: 1px solid #245f55; border-radius: 999px;
  font-size: calc(var(--u) * 12); font-weight: 600; line-height: 1.3; color: var(--aqua);
}
.rc__mark svg { width: calc(var(--u) * 11); height: calc(var(--u) * 11); }

/* ─── Phones and small tablets: the stage sits on top, text underneath ─── */
@media (max-width: 919px) {
  .js .home-layout { display: flex; flex-direction: column; gap: 0; min-height: 0; padding: 0; }
  .js .recstage { order: 0; align-self: stretch; height: clamp(326px, 42svh, 400px); padding-top: 62px; }
  .js .home-hero { order: 1; position: static; width: 100%; margin: 0 auto; padding: 14px 24px 8px; max-width: 600px; text-align: center; }
  .js .home-hero h1 { font-size: clamp(30px, 8vw, 48px); }
  .js .home-lead, .js .waitlist { margin-left: auto; margin-right: auto; }
  .js .coming { align-items: center; }
  .js .platforms { justify-content: center; }
  .js .home-hero .foot, .js .home-hero .legal-links { justify-content: center; }
  .js .wordmark { position: absolute; top: 24px; left: 0; right: 0; z-index: 3; width: fit-content; margin: 0 auto; }

  .feedwall { --tile-w: 124px; position: absolute; inset: 0 0 auto; height: clamp(366px, 48svh, 450px); gap: 10px; }
  .feedwall::after {
    background: linear-gradient(180deg, rgba(27, 25, 22, 0.86) 0%, rgba(27, 25, 22, 0.24) 22%, rgba(27, 25, 22, 0.24) 66%, #1b1916 100%);
  }
  .ft { margin-bottom: 10px; padding: 6px; }
  .rc { --u: 1px; width: min(358px, calc(100% - 32px)); }
  .recstage__ring { width: 260px; height: 260px; }
}

@media (max-width: 359px) {
  .rc { --u: 0.88px; width: calc(100% - 24px); }
}
