/* ─────────────────────────────────────────────────────────────────────────
   Crossfeed landing page. Builds on theme.css tokens.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Nav (solid, crisp — no glass/blur) ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav-links a:not(.btn) {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-dim);
  transition: color 0.15s ease;
}
.nav-links a:not(.btn):hover {
  color: var(--text);
}
.nav-cta {
  height: 38px;
  padding: 0 15px;
  font-size: 14px;
}

/* ── Hero ── */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(56px, 9vw, 128px) 0 clamp(48px, 7vw, 96px);
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Quiet fallback: a single faint violet whisper behind the feed; near-black elsewhere. */
  background: radial-gradient(46% 78% at 90% 42%, rgba(145, 70, 255, 0.06), transparent 60%);
}
/* The generated DARK backdrop image, kept subtle so the live feed stays the star. */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  background: var(--hero-img, none) right center / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%);
  mask-image: linear-gradient(90deg, transparent, #000 40%);
}
.hero-bg.has-image::after {
  opacity: 0.8;
}
/* Keep the left dark so headline text stays crisp. */
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--bg) 6%, transparent 52%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero-copy .eyebrow {
  margin-bottom: 18px;
}
.hero-title {
  font-size: clamp(44px, 7vw, 82px);
  letter-spacing: -0.035em;
  line-height: 0.98;
}
.hero-title .accent {
  color: var(--accent-hi);
}
.hero-sub {
  margin-top: 20px;
  max-width: 38ch;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--text-dim);
}
.hero-cta {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-trust {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.hero-trust li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-dim);
}
.hero-trust li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--kick);
}
.hero-trust li {
  font-family: var(--mono);
}

/* ── The overlay frame (used in hero + OBS section) ── */
.overlay-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.overlay-frame-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.015);
}
.overlay-frame-bar .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2b313b;
}
.overlay-frame-bar .dot:nth-child(1) {
  background: #ff5f57;
}
.overlay-frame-bar .dot:nth-child(2) {
  background: #febc2e;
}
.overlay-frame-bar .dot:nth-child(3) {
  background: #28c840;
}
.overlay-frame-label {
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--mono);
}
.live-tag {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #ff5d5d;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.live-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff3b3b;
  animation: livepulse 1.6s ease-in-out infinite;
}
@keyframes livepulse {
  50% {
    opacity: 0.35;
  }
}

/* ── The merged chat feed (mimics the real overlay) ── */
.feed {
  height: 430px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 9px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%, #000 100%);
  mask-image: linear-gradient(180deg, transparent, #000 14%, #000 100%);
}
.msg {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 15px;
  line-height: 1.4;
  text-shadow:
    -1px -1px 0 rgba(0, 0, 0, 0.9), 1px 1px 0 rgba(0, 0, 0, 0.9),
    0 2px 5px rgba(0, 0, 0, 0.6);
  animation: msgin 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes msgin {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
.msg .author {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.92em;
}
.msg .colon {
  opacity: 0.5;
  margin-left: -3px;
}
.msg .text {
  color: #f2f4f8;
  word-break: break-word;
}
.msg .badge {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
}
.msg .emote {
  height: 22px;
  vertical-align: -6px;
}
.msg .emoji {
  font-size: 17px;
}
.hero-feed-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
}

/* ── Sections ── */
.section {
  padding: clamp(64px, 9vw, 120px) 0;
}
.section-alt {
  background: var(--bg-1);
  border-block: 1px solid var(--line-soft);
}
/* When the quiet texture asset is fetched, lay it on at a whisper over bg-1. */
.section-alt.has-image {
  background-image:
    linear-gradient(0deg, rgba(15, 15, 19, 0.92), rgba(15, 15, 19, 0.92)),
    var(--texture-img);
  background-size: cover;
  background-position: center;
}
.section-title {
  margin-top: 14px;
  font-size: clamp(30px, 4.4vw, 50px);
  max-width: 20ch;
}
.section-lead {
  margin-top: 16px;
  max-width: 56ch;
  color: var(--text-dim);
  font-size: 17px;
}
.container.narrow {
  max-width: 820px;
}

/* ── Features ── */
.feature-grid {
  margin-top: 38px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.feature {
  position: relative;
  padding: 28px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-1);
  overflow: hidden;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease;
}
/* Platform-tinted accent line that lights up on hover. */
.feature::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.feature.tw::before {
  background: linear-gradient(90deg, var(--twitch), transparent 70%);
}
.feature.kk::before {
  background: linear-gradient(90deg, var(--kick), transparent 70%);
}
.feature.xx::before {
  background: linear-gradient(90deg, #fff, transparent 70%);
}
.feature:hover {
  transform: translateY(-3px);
  border-color: #313139;
}
.feature:hover::before {
  opacity: 0.9;
}
.feature .ficon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.feature .ficon svg {
  width: 22px;
  height: 22px;
}
/* Signal hairline only (no glow). */
.feature.tw .ficon {
  box-shadow: inset 0 0 0 1px rgba(145, 70, 255, 0.45);
}
.feature.kk .ficon {
  box-shadow: inset 0 0 0 1px rgba(83, 252, 24, 0.4);
}
.feature.xx .ficon {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}
.feature h3 {
  font-size: 20px;
}
.feature p {
  margin-top: 9px;
  color: var(--text-dim);
  font-size: 15px;
}

/* ── Steps ── */
.steps {
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-1);
  counter-increment: step;
}
.steps li::before {
  content: "0" counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--accent-hi);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.steps h3 {
  font-size: 17px;
}
.steps p {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 15px;
}
.steps code {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent-hi);
  background: var(--bg-3);
  border-radius: 6px;
  word-break: break-all;
}

/* ── OBS stream frame ── */
.stream-frame {
  position: relative;
  margin-top: 36px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.stream-scene {
  position: absolute;
  inset: 0;
  /* Quiet near-black fallback with a single faint violet whisper. */
  background:
    radial-gradient(50% 60% at 75% 35%, rgba(145, 70, 255, 0.07), transparent 60%),
    var(--bg);
}
/* When the generated atmospheric scene is fetched, show it under a neutral scrim. */
.stream-scene.has-image {
  background-image:
    linear-gradient(0deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.1)),
    var(--scene-img);
  background-size: cover;
  background-position: center;
}
.stream-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(80% 80% at 50% 50%, #000, transparent);
}
.stream-cam {
  position: absolute;
  left: 5%;
  bottom: 6%;
  width: 30%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, #1c2130, #0e1117);
  display: grid;
  place-items: center;
}
.stream-cam span {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  font-weight: 700;
}
.overlay-frame.floating {
  position: absolute;
  top: 5%;
  right: 4%;
  width: min(38%, 360px);
  background: rgba(9, 9, 12, 0.66);
  border-color: rgba(255, 255, 255, 0.1);
}
.overlay-frame.floating .feed {
  height: clamp(180px, 30vw, 320px);
}

/* ── FAQ ── */
.faq {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  overflow: hidden;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 650;
  font-size: 16.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  font-size: 22px;
  color: var(--text-faint);
  transition: transform 0.18s ease;
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}
.faq .answer {
  padding: 0 20px 18px;
  color: var(--text-dim);
  font-size: 15px;
}

/* ── Final CTA ── */
.cta-band {
  position: relative;
  text-align: center;
  overflow: hidden;
}
/* A short signal hairline instead of a glow fill. */
.cta-band::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}
.cta-inner .section-title {
  max-width: 24ch;
  margin: 0 auto;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 34px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 28px;
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  font-size: 14px;
  color: var(--text-dim);
}
.footer-links a:hover {
  color: var(--text);
}
.footer-note {
  flex-basis: 100%;
  color: var(--text-faint);
  font-size: 13px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-feed {
    order: -1;
  }
  .feed {
    height: 320px;
  }
  /* Use the vertical hero art (convergence up top), fade to base at the bottom. */
  .hero-bg::after {
    background-image: var(--hero-img-m, var(--hero-img, none));
    background-position: center top;
    -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent);
    mask-image: linear-gradient(180deg, #000 45%, transparent);
  }
  .hero-bg::before {
    background:
      linear-gradient(180deg, transparent 28%, var(--bg) 94%),
      radial-gradient(130% 80% at 50% 0%, transparent 52%, rgba(0, 0, 0, 0.45));
  }
  .feature-grid,
  .steps {
    grid-template-columns: 1fr;
  }
  .nav-links a:not(.btn) {
    display: none;
  }
}
@media (max-width: 560px) {
  .hero-cta .btn {
    width: 100%;
  }
  .overlay-frame.floating {
    width: 56%;
    top: 4%;
    right: 3%;
  }
  .stream-cam {
    width: 40%;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .msg {
    animation: none;
  }
  .live-tag::before {
    animation: none;
  }
}
