/* WatchList site. Matches docs/DESIGN.md: dark cinema base, one red accent, glass controls over a busy-but-dimmed backdrop.
   No external fonts/images/scripts; no inline styles anywhere (strict CSP). Mobile-first. */

:root {
  color-scheme: dark light;
  --bg: #0f0f0f;
  --bg-elevated: #1a1a1a;
  --text: #ffffff;
  --text-2: #a0a0a0;
  --text-3: #7c7c80;
  --accent: #e50914;
  --accent-pressed: #c1121f;
  --success: #30d158;
  --glass-fill: rgba(30, 30, 33, 0.58);
  --glass-fill-thin: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-highlight: rgba(255, 255, 255, 0.2);
  --shadow-float: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 6px 22px rgba(229, 9, 20, 0.4);
  --scrim: rgba(15, 15, 15, 0.72);
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-pill: 999px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f2f7;
    --bg-elevated: #ffffff;
    --text: #0f0f10;
    --text-2: #5f5f66;
    --text-3: #8e8e93;
    --glass-fill: rgba(255, 255, 255, 0.66);
    --glass-fill-thin: rgba(255, 255, 255, 0.5);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.9);
    --shadow-float: 0 8px 28px rgba(0, 0, 0, 0.14);
    --scrim: rgba(242, 242, 247, 0.72);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; }
h1 { font-size: clamp(34px, 8vw, 56px); font-weight: 800; }
h2 { font-size: clamp(24px, 5vw, 32px); font-weight: 700; }
h3 { font-size: 20px; font-weight: 600; }
p { margin: 0 0 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.small { font-size: 13px; color: var(--text-3); }
.hidden { display: none !important; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* Ambient background: dimmed colour orbs + a tilted poster-tile wall, all CSS. */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.backdrop::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(40% 35% at 20% 15%, rgba(229, 9, 20, 0.34), transparent 70%),
    radial-gradient(35% 30% at 85% 25%, rgba(100, 120, 255, 0.22), transparent 70%),
    radial-gradient(45% 40% at 60% 95%, rgba(255, 170, 60, 0.18), transparent 70%);
  filter: blur(20px);
}
.wall {
  position: absolute;
  inset: -10% -20%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  transform: rotate(-8deg);
  opacity: 0.5;
}
.wall i { aspect-ratio: 2 / 3; border-radius: 8px; background: linear-gradient(160deg, hsl(var(--h) 60% 38%), hsl(calc(var(--h) + 40) 55% 18%)); }
.wall i:nth-child(7n + 1) { --h: 355; }
.wall i:nth-child(7n + 2) { --h: 215; }
.wall i:nth-child(7n + 3) { --h: 30; }
.wall i:nth-child(7n + 4) { --h: 280; }
.wall i:nth-child(7n + 5) { --h: 160; }
.wall i:nth-child(7n + 6) { --h: 330; }
.wall i:nth-child(7n) { --h: 50; }
.backdrop::after { content: ""; position: absolute; inset: 0; background: var(--scrim); }

.container { width: min(100% - 40px, 960px); margin-inline: auto; }
.page { padding-block: 24px 56px; }

/* Header */
.brand { display: flex; align-items: center; gap: 12px; padding-block: 8px; color: var(--text); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: var(--shadow-float); }

/* Glass */
.glass {
  position: relative;
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-float);
}
.glass.thin { background: var(--glass-fill-thin); }
.card { padding: 22px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 26px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font: 600 17px/1 var(--font);
  letter-spacing: -0.01em;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0) 70%), var(--accent);
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { background-color: var(--accent-pressed); }
.btn-secondary {
  color: var(--text);
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
  border-color: var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-float);
}
.btn-small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn.is-pending { opacity: 0.6; }
.btn .ico { width: 22px; height: 22px; flex: none; fill: currentColor; }
.btn-stack { display: grid; gap: 12px; }
.pending-note { display: block; }
.btn-note { display: block; margin-top: 6px; text-align: center; font-size: 13px; color: var(--text-3); }

/* Hero */
.hero { padding-block: 40px 28px; text-align: center; }
.hero .app-icon { width: 96px; height: 96px; margin: 0 auto 24px; border-radius: 22px; box-shadow: var(--shadow-float); }
.hero p.lead { max-width: 34ch; margin: 16px auto 28px; font-size: 20px; color: var(--text-2); }
.hero .cta { display: grid; gap: 12px; max-width: 420px; margin-inline: auto; }
.badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(229, 9, 20, 0.14);
}
.hero .desktop-only { max-width: 420px; margin: 24px auto 0; }
.hero .desktop-only .btn { margin-top: 4px; }
.recommended-tag { display: none; font-size: 12px; font-weight: 700; opacity: 0.9; }
html[data-platform="ios"] .btn-ios .recommended-tag,
html[data-platform="android"] .btn-android .recommended-tag { display: inline; }

/* Platform emphasis: the matching button stays red, the other becomes glass; matching steps card goes first. */
html[data-platform="ios"] .btn-android,
html[data-platform="android"] .btn-ios { background: var(--glass-fill); color: var(--text); border-color: var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-float); }
.desktop-only { display: none; }
html[data-platform="desktop"] .desktop-only { display: block; }

/* Sections */
.section { margin-top: 48px; }
.section > h2 { margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.features { grid-template-columns: 1fr; }
.feature h3 { margin-bottom: 6px; }
.feature p { margin: 0; color: var(--text-2); font-size: 16px; }
.platforms { grid-template-columns: 1fr; }
html[data-platform="android"] .platforms .steps-android { order: -1; }
html[data-platform="ios"] .platforms .steps-ios { border-color: rgba(229, 9, 20, 0.6); }
html[data-platform="android"] .platforms .steps-android { border-color: rgba(229, 9, 20, 0.6); }

ol.steps { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: step; display: grid; gap: 14px; }
ol.steps li { position: relative; padding-left: 44px; counter-increment: step; color: var(--text-2); font-size: 16px; }
ol.steps li strong { color: var(--text); font-weight: 600; }
ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(229, 9, 20, 0.16);
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
}

/* Join / party */
.invite { text-align: center; padding-top: 24px; }
.code {
  display: inline-block;
  margin: 8px 0 20px;
  padding: 14px 24px;
  border-radius: var(--r-md);
  font: 800 clamp(34px, 10vw, 52px)/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.22em;
  padding-left: calc(24px + 0.22em);
}
.status { min-height: 24px; margin: 12px 0 0; font-size: 15px; color: var(--text-2); }
.invite .btn-stack { max-width: 420px; margin: 20px auto 0; }
.divider { margin: 28px auto 8px; max-width: 420px; display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--glass-border); }

/* Prose pages */
.prose { max-width: 720px; }
.prose h1 { font-size: clamp(32px, 7vw, 44px); margin-bottom: 8px; }
.prose h2 { font-size: 22px; margin: 32px 0 10px; }
.prose p, .prose li { color: var(--text-2); font-size: 16px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); }
.prose ul { padding-left: 20px; margin: 0 0 12px; }
.prose .glass { margin-top: 20px; padding: 18px 20px; }
.prose .glass p:last-child { margin-bottom: 0; }

footer { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--glass-border); display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--text-3); font-size: 14px; }
footer a { color: var(--text-2); }

@media (min-width: 720px) {
  .features { grid-template-columns: repeat(3, 1fr); }
  .platforms { grid-template-columns: 1fr 1fr; }
  .hero .cta { max-width: none; grid-template-columns: 1fr 1fr; }
  .wall { grid-template-columns: repeat(12, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:active { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .glass, .btn-secondary { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg-elevated); }
}

/* Invite pages: spacing fixes */
.invite p.lead { max-width: 34ch; margin: 14px auto 24px; font-size: 19px; }
.invite .btn-stack .btn-stack { margin: 0; max-width: none; }
.invite .small { margin-top: 20px; }
.invite .btn-small { margin-top: 12px; }
