/* Homepage only. Layout after the Novawell template; colors, type and wordmark
   from the GameNightly web app (tokens live in styles.css). */

.home {
  --h-size: clamp(40px, 12vw, 200px);
  --line: rgba(140, 82, 255, 0.12);
  overflow-x: clip;
}

.home-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.home h1, .home h2, .home h3, .home-brand, .cta, .btn-pill, .core-num, .app-title, .app-btn, .chat-cmd {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-variation-settings: "wdth" 125;
  font-weight: 800;
}

/* ---------- header ---------- */
.home-header {
  position: fixed; inset: 0 0 auto; z-index: 20;
  padding: 14px 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.home-header .home-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; text-transform: uppercase; font-size: 18px; letter-spacing: -0.01em; }
.home-brand img { width: 32px; height: 32px; }

.cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 18px; border-radius: 999px;
  background: var(--orange); color: var(--ink);
  text-decoration: none; text-transform: uppercase; font-size: 12px; letter-spacing: 0.02em;
  transition: background 0.2s;
}
.cta:hover { background: var(--yellow); color: var(--ink); }
.cta-arrow {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--ink); color: var(--yellow); font-size: 16px;
  transition: transform 0.25s;
}
.cta:hover .cta-arrow { transform: rotate(45deg); }

/* ---------- hero ---------- */
.hero {
  --p: 0;
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(110px, 18vh, 170px) 16px 72px;
  text-align: center;
}
.hero-lines {
  position: absolute; inset: 0; z-index: -2;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 12 - 1px), var(--line) calc(100% / 12 - 1px) calc(100% / 12));
  mask-image: linear-gradient(180deg, transparent, #000 15%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 15%, #000 70%, transparent);
}
.hero-glow {
  position: absolute; z-index: -1;
  left: 50%; top: 42%; width: min(1100px, 140vw); height: 620px;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side, rgba(255, 172, 51, 0.28), transparent 70%),
    radial-gradient(closest-side, rgba(140, 82, 255, 0.55), transparent);
  filter: blur(30px);
}

.hero-title {
  margin: 0; position: relative; z-index: 1;
  font-size: var(--h-size); line-height: 0.95; letter-spacing: -0.03em;
  text-transform: uppercase; white-space: nowrap;
}
.hero-title span { color: var(--orange); }

/* The phone starts over the headline and drops back as you scroll. */
.phone-stage {
  position: relative; z-index: 2;
  height: clamp(440px, 62vh, 560px);
  margin-top: calc(var(--h-size) * -0.62);
  overflow: hidden;
  mask-image: linear-gradient(180deg, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
}
.phone {
  position: relative; margin: 0 auto;
  width: 290px; height: 590px; padding: 12px;
  border-radius: 46px;
  background: linear-gradient(160deg, #3a3550, #121019 40%, #26223a);
  box-shadow: 0 0 0 2px #4b4566, 0 40px 80px rgba(0, 0, 0, 0.6), 0 0 120px rgba(140, 82, 255, 0.35);
}
.hero .phone { transform: translateY(calc(var(--p) * 150px)); will-change: transform; }
.phone-notch { position: absolute; left: 50%; top: 22px; width: 92px; height: 26px; transform: translateX(-50%); border-radius: 20px; background: #000; z-index: 1; }
.phone-screen {
  height: 100%; border-radius: 36px; overflow: hidden;
  padding: 54px 18px 18px; text-align: left;
  background: linear-gradient(180deg, #000 0%, #0c0055 70%, #1800ad 100%);
}
.app-top { display: flex; align-items: center; justify-content: space-between; }
.app-kicker { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.app-avatars { display: flex; }
.app-avatars i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #0c0055; margin-left: -7px; background: var(--purple); }
.app-avatars i:nth-child(2) { background: var(--orange); }
.app-avatars i:nth-child(3) { background: var(--yellow); }
.app-avatars i:nth-child(4) { background: #c67fb0; }
.app-avatars i:nth-child(5) { background: #5b8cff; }
.app-title { margin: 10px 0 0; font-size: 20px; line-height: 1.1; text-transform: uppercase; }
.app-sub { margin: 4px 0 14px; font-size: 12px; color: var(--muted); }
.app-heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; padding: 12px; border-radius: 14px; background: rgba(12, 5, 64, 0.9); border: 1px solid var(--border); }
.app-heat span { aspect-ratio: 1; border-radius: 5px; background: var(--c); }
.app-label { margin: 14px 0 8px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.app-times { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.app-times li { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 12px; background: rgba(21, 12, 92, 0.9); border: 1px solid var(--border); font-size: 13px; }
.app-times b { color: var(--yellow); margin-right: 4px; }
.app-times em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); }
.app-times li.best { border-color: var(--yellow); }
.app-times li.best em { background: var(--yellow); color: var(--ink); padding: 2px 8px; border-radius: 999px; }
.app-btn { display: block; margin-top: 12px; padding: 11px; border-radius: 999px; background: var(--orange); color: var(--ink); text-align: center; text-transform: uppercase; font-size: 12px; }

.hero-copy { position: relative; z-index: 3; max-width: 560px; margin: -24px auto 0; }
.hero-copy > p:first-child { margin: 0; font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); }
.hero-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.btn-pill {
  display: inline-block; padding: 14px 26px; border-radius: 999px;
  text-decoration: none; text-transform: uppercase; font-size: 13px; letter-spacing: 0.02em;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-solid { background: var(--orange); color: var(--ink); }
.btn-solid:hover { background: var(--yellow); color: var(--ink); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); background: rgba(12, 5, 64, 0.5); }
.btn-ghost:hover { border-color: var(--purple); color: var(--text); background: rgba(140, 82, 255, 0.15); }
.hero-note { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.hero-platforms { display: flex; justify-content: center; gap: 18px; margin-top: 12px; color: var(--text); }
.hero-platforms svg { width: 22px; height: 22px; }

/* ---------- horizontal scroll: core features ---------- */
/* Desktop with motion: the stage pins while the page scrolls, and scroll
   progress (--cp, 0 to 1) slides the card track sideways. Otherwise the
   cards simply stack. */
.core { padding-top: 48px; scroll-margin-top: 40px; }
.core-head { text-align: center; }
.core-title { color: var(--text); margin: 0 auto; max-width: 760px; text-transform: uppercase; font-size: clamp(28px, 4.6vw, 52px); line-height: 1.05; letter-spacing: -0.02em; }
.core-title span { color: var(--orange); }
.core-sub { margin: 16px auto 40px; max-width: 540px; color: var(--muted); font-size: 17px; }

.core-pin { --cp: 0; --n: 4; }
.core-phone { display: none; }
.core-track { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.core-progress { display: none; }

.core-card {
  padding: 26px 24px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(21, 12, 92, 0.85), rgba(12, 5, 64, 0.85));
  border: 1px solid var(--border);
}
.core-num {
  display: inline-grid; place-items: center; width: 40px; height: 28px; border-radius: 8px;
  background: rgba(140, 82, 255, 0.2); border: 1px solid var(--purple); color: var(--text);
  font-size: 12px; font-weight: 700;
}
.core-card h3 { margin: 16px 0 10px; font-size: clamp(22px, 2.6vw, 32px); text-transform: uppercase; letter-spacing: -0.01em; line-height: 1.1; }
.core-card > p { margin: 0 0 16px; color: var(--muted); font-size: 16px; max-width: 520px; }
.core-card code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; color: var(--yellow); }
.core-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.core-card ul li { position: relative; padding-left: 22px; font-size: 15px; }
.core-card ul li::before {
  content: ""; position: absolute; left: 0; top: 0.42em; width: 10px; height: 10px; background: var(--orange);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
}
.core-actions { margin-top: 24px; }

@media (min-width: 900px) {
  .js-motion .core-pin { height: calc(var(--n) * 90vh); }
  .js-motion .core-stage {
    position: sticky; top: 0; height: 100vh;
    display: grid; grid-template-columns: 340px 1fr; gap: 56px; align-items: center;
  }
  .js-motion .core-phone { display: block; position: relative; }
  .js-motion .core-phone::before {
    content: ""; position: absolute; inset: 10% -20%; z-index: -1;
    background: radial-gradient(closest-side, rgba(140, 82, 255, 0.45), transparent); filter: blur(20px);
  }

  .js-motion .core-cards { position: relative; overflow: hidden; padding-top: 32px; }
  .js-motion .core-progress { display: block; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--border); border-radius: 2px; }
  .js-motion .core-progress span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--purple), var(--orange)); transform-origin: left; transform: scaleX(calc(0.25 + var(--cp) * 0.75)); }

  .js-motion .core-track { display: flex; gap: 0; transform: translateX(calc(var(--cp) * (var(--n) - 1) * -100%)); will-change: transform; }
  .js-motion .core-card {
    flex: 0 0 100%; padding: 8px 48px 8px 0; border: 0; background: none;
    opacity: 0.25; transform: perspective(1200px) rotateY(-12deg) scale(0.92); transform-origin: left center;
    transition: opacity 0.45s, transform 0.45s;
  }
  .js-motion .core-card.is-active { opacity: 1; transform: none; }
}

/* Phone screens: the active one slides up over the last. */
.phone-sm { width: 300px; height: 610px; margin: 0 auto; }
.core-screens { position: relative; }
.core-screen {
  position: absolute; inset: 0; padding: 54px 18px 18px;
  display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, #000 0%, #0c0055 70%, #1800ad 100%);
  transform: translateY(100%); transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.core-screen.is-active, .core-screen.is-past { transform: none; }
.core-screen[data-i="0"] { transform: none; }
.core-screen .app-title { margin: 0 0 4px; }
.core-screen .app-label, .core-screen .app-sub { margin: 4px 0 0; }
.core-screen .app-btn { margin-top: auto; }
.core-screen .mini-field { display: block; }
.core-screen .mini-invite, .core-screen .mini-grid { max-width: none; }
.accent { color: var(--orange); }
.screen-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.screen-dates { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.screen-dates i { aspect-ratio: 1; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); }
.screen-dates i.on { background: var(--purple); border-color: #a87bff; }
.screen-linked { align-self: flex-start; padding: 4px 12px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: 11px; font-weight: 700; }
.screen-grid { grid-template-columns: repeat(5, 1fr); }
.screen-guests { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.screen-guests li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(21, 12, 92, 0.9); border: 1px solid var(--border); font-size: 13px; }
.screen-guests i { width: 20px; height: 20px; border-radius: 50%; background: var(--c); }
.screen-guests em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); }

/* ---------- product cards ---------- */
.features { padding-top: 64px; padding-bottom: 96px; }
.features-title { color: var(--text); margin: 0 auto; max-width: 820px; text-align: center; text-transform: uppercase; font-size: clamp(28px, 4.6vw, 52px); line-height: 1.05; letter-spacing: -0.02em; }
.features-title span { color: var(--orange); }
.features-sub { margin: 16px auto 44px; max-width: 520px; text-align: center; color: var(--muted); font-size: 17px; }

.product-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 760px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }

.product {
  padding: 14px 14px 22px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(21, 12, 92, 0.85), rgba(12, 5, 64, 0.85));
  border: 1px solid var(--border);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.product:hover { transform: translateY(-4px); border-color: var(--orange); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 40px rgba(255, 172, 51, 0.12); }
.product h3 { margin: 20px 8px 6px; font-size: 17px; text-transform: uppercase; letter-spacing: 0; }
.product p { margin: 0 8px; color: var(--muted); font-size: 15px; }
.product code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; color: var(--yellow); }

.product-art {
  position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden;
  display: grid; place-items: center; padding: 22px;
  background:
    radial-gradient(70% 60% at 50% 110%, rgba(140, 82, 255, 0.5), transparent),
    repeating-linear-gradient(90deg, transparent 0 39px, var(--line) 39px 40px),
    #07022e;
}
.product:hover .product-art { background:
    radial-gradient(70% 60% at 50% 110%, rgba(255, 172, 51, 0.4), transparent),
    repeating-linear-gradient(90deg, transparent 0 39px, var(--line) 39px 40px),
    #07022e; }
.art-tag { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: 11px; font-weight: 700; white-space: nowrap; }

/* Start */
.art-or { justify-self: center; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.art-start .chat-cmd { justify-self: center; }
.art-start .mini-link { display: block; }
.chat { width: 100%; max-width: 270px; display: grid; gap: 10px; text-align: left; }
.chat-cmd { margin: 0; justify-self: end; padding: 8px 14px; border-radius: 14px 14px 4px 14px; background: var(--purple); font-size: 14px; }

.mini-field { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; text-align: left; }
.mini-link { margin-top: 6px; padding: 10px 12px; border-radius: 999px; background: var(--orange); color: var(--ink); font-weight: 700; font-size: 12px; text-align: center; }

/* Calendar */
.mini-cal { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: 100%; max-width: 240px; margin-bottom: 18px; }
.mini-cal span { height: 30px; border-radius: 6px; background: rgba(140, 82, 255, 0.35); border: 1px solid rgba(140, 82, 255, 0.5); }
.mini-cal span.busy { background: repeating-linear-gradient(135deg, #2a2550 0 4px, #1b1740 4px 8px); border-color: #2f2a5a; }

/* Availability grid (phone screen) */
.mini-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: 100%; max-width: 250px; }
.mini-grid span { aspect-ratio: 1; border-radius: 6px; background: var(--cell, #1f166e); border: 1px solid var(--border); }
.mini-grid span.on { background: var(--purple); border-color: #a87bff; box-shadow: 0 0 12px rgba(140, 82, 255, 0.5); }

/* Ranked */
.mini-rank { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 250px; display: grid; gap: 12px; }
.mini-rank li { display: flex; align-items: center; gap: 10px; }
.mini-rank span { flex: 1; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); position: relative; overflow: hidden; }
.mini-rank span::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit; background: var(--c); }
.mini-rank b { width: 16px; color: var(--muted); font-size: 14px; }
.mini-rank .rank-lock { justify-content: center; margin-top: 4px; padding: 9px; border-radius: 999px; background: var(--orange); color: var(--ink); font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: 12px; text-transform: uppercase; }

/* Invite (phone screen) */
.mini-invite { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 270px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--yellow); text-align: left; }
.invite-day { display: grid; place-items: center; flex: none; width: 48px; height: 52px; border-radius: 10px; background: var(--orange); color: var(--ink); font-weight: 800; font-size: 20px; line-height: 1; }
.invite-day small { font-size: 10px; text-transform: uppercase; }
.invite-body { flex: 1; display: grid; font-size: 12px; color: var(--muted); }
.invite-body b { color: var(--text); font-size: 13px; }

/* ---------- footer ---------- */
.home-footer { border-top: 1px solid var(--border); padding: 22px 0 30px; color: var(--muted); font-size: 14px; }
.home-footer .home-wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.home-footer a { color: var(--muted); }
.home-footer a:hover { color: var(--text); }

/* ---------- small screens / motion ---------- */
@media (max-width: 520px) {
  .home-brand span { font-size: 15px; }
  .cta { padding-left: 14px; font-size: 11px; }
  .cta-arrow { width: 30px; height: 30px; }
  .phone { width: 260px; height: 530px; }
  .phone-stage { margin-top: 20px; }
}
@media (max-width: 380px) {
  .cta { font-size: 0; gap: 0; padding: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .phone, .product, .cta-arrow { transition: none; transform: none; }
}
