/*
 * Game-rotating first screen: a full-bleed game stage with an overlay-styled
 * chat panel on top (desktop: docked left; phones and narrow windows: game band
 * on top, panel overlapping its bottom edge). Rotation: assets/hero-rotator.js.
 * Accent tokens per slide: --k (border, button), --k-text (accent text on the
 * dark panel), --k-ink (button label). Spec: docs/superpowers/specs/2026-11-18-landing-v3-design.md
 */

section.ghero.ghero {
  --k: #D97757; --k-text: #e8906f; --k-ink: #1a0d08;
  --ov-bg: #0d0e18f2; --ov-muted: #8a8a9a; --ov-text: #e4e4e8;
  --ov-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', Consolas, monospace;
  position: relative; display: flex; align-items: center;
  min-height: max(560px, calc(100vh - 110px));
  padding: 48px 4.5%; overflow: hidden; background: #0a0a12;
}

/* ===== Stage ===== */
.ghero-stage { position: absolute; inset: 0; z-index: 0; }
.ghero-stage::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, #0a0a12d0 0%, #0a0a1260 45%, #0a0a1220 100%);
}
.ghero-slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1s ease; }
.ghero-slide.is-on { opacity: 1; }
.ghero-slide img, .ghero-slide video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* A clip sits on top of its own still (the still stays as the poster and the no-JS fallback). */
.ghero-slide video { position: absolute; inset: 0; }

.ghero-chip {
  position: absolute; right: 22px; bottom: 18px; z-index: 2; display: flex; align-items: center; gap: 6px;
  font-family: var(--ov-mono); font-size: 11px; color: #fff;
  background: #0a0a12d0; border: 1px solid #ffffff22; padding: 5px 10px; border-radius: 20px;
}
.ghero-live { width: 7px; height: 7px; border-radius: 50%; background: #e04848; animation: ghero-pulse 1.4s infinite; }
.ghero-live[hidden] { display: none; }
.ghero-mockup { color: #0a0a12; background: #e4e4e8; border-radius: 4px; padding: 0 5px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.ghero-dots { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 2; display: flex; gap: 6px; }
.ghero-dots span { width: 22px; height: 3px; border-radius: 2px; background: #ffffff40; transition: background 0.4s; }
.ghero-dots span.on { background: var(--k); }
@keyframes ghero-pulse { 50% { opacity: 0.3; } }

/* ===== Overlay-styled panel ===== */
.ov-panel {
  position: relative; z-index: 3; width: 44%; max-width: 560px;
  background: var(--ov-bg); border: 1px solid var(--k); border-radius: 10px;
  box-shadow: 0 10px 40px #000a, 0 0 0 1px #0006;
  font-family: var(--ov-mono); color: var(--ov-text); transition: border-color 0.8s;
}
.ov-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #ffffff12; font-size: 11px; color: var(--ov-muted); }
.ov-brand { color: var(--k-text); letter-spacing: 0.06em; font-weight: 600; transition: color 0.8s; }
.ov-state { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ov-state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #e8b341; }
.ov-tabs { display: flex; gap: 4px; padding: 6px 10px 0; font-size: 11px; color: var(--ov-muted); }
.ov-tabs span { padding: 4px 8px; }
.ov-tabs span.on { color: var(--ov-text); border-bottom: 2px solid var(--k); }
.ov-msg { padding: 16px 18px 6px; }
.ov-who { font-size: 11px; color: var(--ov-muted); margin-bottom: 8px; }
.ghero .ov-msg h1 {
  font-family: var(--ov-mono); font-weight: 600; font-size: clamp(28px, 3vw, 38px); line-height: 1.1;
  letter-spacing: -0.01em; color: #fff; margin: 0 0 12px;
}
.ghero .ov-msg h1 em { font-style: normal; color: var(--k-text); transition: color 0.8s; }
.ov-sub { font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.5; color: #c4c4cf; margin: 0; }

.ov-perm { margin: 14px 16px 16px; border: 1px solid var(--k); border-radius: 8px; padding: 12px 14px; background: #ffffff06; transition: border-color 0.8s; }
.ov-perm-label { font-size: 11px; letter-spacing: 0.1em; color: var(--k-text); margin-bottom: 6px; transition: color 0.8s; }
.ov-perm-q { font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif; font-size: 14px; color: var(--ov-text); margin: 0 0 12px; }
.ghero .ov-perm .cta-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.ghero .ov-perm .btn-primary {
  background: var(--k); border-color: var(--k); color: var(--k-ink) !important;
  padding: 11px 16px; font-size: 13px; transition: background 0.8s, border-color 0.8s;
}
.ghero .ov-perm .btn-primary:hover { background: var(--k); filter: brightness(1.1); box-shadow: none; }
.ghero .ov-perm .btn-ghost { padding: 10px 14px; font-size: 12px; }
.ov-safe { font-size: 12px; color: #9fd8a8; margin: 10px 0 0; }
.ov-safe::before { content: '\2713  '; }
.ov-input { display: flex; justify-content: space-between; margin: 0 16px 14px; border: 1px solid #ffffff14; border-radius: 6px; padding: 8px 10px; font-size: 11px; color: var(--ov-muted); }

/* Desktop shows the PC prompt; touch phones show the send-to-PC prompt. */
.ghero .phone-only, .ghero .hero-phone-cta { display: none; }
@media (hover: none) and (pointer: coarse) {
  .ghero .pc-only { display: none; }
  .ghero span.phone-only { display: inline; }
  .ghero .ov-perm .hero-phone-cta { display: block; width: 100%; text-align: center; }
  .ghero .ov-perm .btn-primary[data-track="download_hero"] { display: none; }
}

/* ===== Phones and narrow windows: game band on top, panel overlapping it ===== */
@media (max-width: 860px), (hover: none) and (pointer: coarse) {
  section.ghero.ghero { display: block; min-height: 0; padding: 0 0 24px; }
  .ghero-stage { position: relative; height: 44vh; height: 44svh; min-height: 200px; }
  .ghero-stage::after { background: linear-gradient(#0a0a1240, #0a0a1210 50%, #0a0a12e0); }
  .ghero-chip { left: 12px; right: auto; bottom: calc(8svh + 10px); font-size: 10px; padding: 3px 8px; }
  .ghero-dots { left: auto; right: 12px; transform: none; bottom: calc(8svh + 16px); gap: 3px; }
  .ghero-dots span { width: 10px; }
  .ov-panel { width: auto; max-width: 640px; margin: -8svh 10px 0; }
  .ov-msg { padding: 12px 14px 4px; }
  .ghero .ov-msg h1 { font-size: 24px; }
  .ov-sub { font-size: 14px; }
  .ov-perm { margin: 10px 12px 12px; }
}
@media (max-width: 400px) {
  .ov-tabs, .ov-input { display: none; }
  .ghero .ov-msg h1 { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .ghero-slide, .ov-panel, .ov-perm, .ov-brand, .ghero .ov-msg h1 em, .ghero .ov-perm .btn-primary { transition: none; }
  .ghero-live { animation: none; }
}
