/* =========================================================================
   Watchly — watchlyparty.com
   Shared theme. Dark is default; [data-theme="light"] overrides the palette.
   ========================================================================= */

:root,
[data-theme="dark"] {
  --bg: #07070C;
  --bg-elevated: #0E0E16;
  --surface: #13131D;
  --surface-light: #1C1C28;
  --border: #2A2A38;
  --primary: #FF3D6E;
  --primary-soft: #FF6B95;
  --secondary: #8B5CF6;
  --accent: #22D3EE;
  --text: #F5F5FA;
  --text-secondary: #A0A0B2;
  --text-tertiary: #6B6B7E;
  --grad: linear-gradient(135deg, #FF3D6E 0%, #8B5CF6 100%);
  --glow-1: rgba(255, 61, 110, 0.18);
  --glow-2: rgba(139, 92, 246, 0.10);
  --nav-bg: rgba(7, 7, 12, 0.72);
  --shadow-primary: rgba(255, 61, 110, 0.35);
  --shadow-card: rgba(0, 0, 0, 0.45);
}

[data-theme="light"] {
  --bg: #FFFFFF;
  --bg-elevated: #F7F7FB;
  --surface: #FFFFFF;
  --surface-light: #F2F2F7;
  --border: #E5E5EE;
  --primary: #E11D54;
  --primary-soft: #FF3D6E;
  --secondary: #7C3AED;
  --accent: #0891B2;
  --text: #16161E;
  --text-secondary: #55556A;
  --text-tertiary: #8A8A9E;
  --grad: linear-gradient(135deg, #E11D54 0%, #7C3AED 100%);
  --glow-1: rgba(255, 61, 110, 0.12);
  --glow-2: rgba(139, 92, 246, 0.08);
  --nav-bg: rgba(255, 255, 255, 0.78);
  --shadow-primary: rgba(225, 29, 84, 0.22);
  --shadow-card: rgba(20, 20, 40, 0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* glow background */
body::before {
  content: "";
  position: fixed;
  top: -20%; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 900px;
  background: radial-gradient(circle, var(--glow-1) 0%, var(--glow-2) 35%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Nav ---------- */
nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.nav-links { display: flex; gap: 26px; font-size: 15px; color: var(--text-secondary); font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-cta {
  background: var(--grad); color: #fff; padding: 9px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600; box-shadow: 0 8px 22px var(--shadow-primary);
}
.nav-cta:hover { transform: translateY(-1px); }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 17px;
  display: grid; place-items: center; transition: background 0.2s ease, transform 0.15s ease;
}
.theme-toggle:hover { background: var(--surface-light); transform: translateY(-1px); }
@media (max-width: 720px) { .nav-links { display: none; } }

/* ---------- Hero ---------- */
header.hero { position: relative; z-index: 1; padding: 88px 0 70px; text-align: center; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text-secondary);
  margin-bottom: 26px;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 12px var(--primary); }
h1 { font-size: clamp(36px, 6.5vw, 64px); font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 20px; }
h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.lead { font-size: clamp(16px, 2.4vw, 20px); color: var(--text-secondary); max-width: 620px; margin: 0 auto 34px; }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 22px; color: var(--text-tertiary); font-size: 14px; }

/* official-style app store badges (kept in brand colors across both themes) */
.store-badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.store-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: #000; color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px; padding: 9px 15px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.store-badge:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4); }
.store-badge .sb-glyph { display: flex; }
.store-badge .sb-glyph svg { width: 26px; height: 26px; display: block; }
.store-badge .sb-text { display: flex; flex-direction: column; line-height: 1.08; text-align: left; }
.store-badge .sb-text small { font-size: 10px; font-weight: 500; letter-spacing: 0.02em; opacity: 0.88; }
.store-badge .sb-text strong { font-size: 16px; font-weight: 600; }
[data-theme="light"] .store-badge { border-color: rgba(0, 0, 0, 0.12); }
.store-badge.disabled { opacity: 0.55; cursor: default; }
.store-badge.disabled:hover { transform: none; box-shadow: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 28px; border-radius: 14px; font-weight: 600; font-size: 16px; cursor: pointer;
  border: none; transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px var(--shadow-primary); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 38px var(--shadow-primary); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-light); transform: translateY(-2px); }

/* ---------- Sections ---------- */
section { position: relative; z-index: 1; padding: 64px 0; }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }
.section-title p { color: var(--text-secondary); font-size: 17px; max-width: 560px; margin: 0 auto; }

/* features grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 30px 26px; transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--primary); transform: translateY(-4px); }
.card .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; margin-bottom: 18px; background: rgba(255, 61, 110, 0.12); }
.card:nth-child(3n+2) .ico { background: rgba(139, 92, 246, 0.14); }
.card:nth-child(3n) .ico { background: rgba(34, 211, 238, 0.12); }
.card h3 { font-size: 19px; font-weight: 600; margin-bottom: 8px; }
.card p { color: var(--text-secondary); font-size: 15px; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }
.step {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 32px 26px 28px;
}
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 18px; margin-bottom: 16px;
  box-shadow: 0 8px 22px var(--shadow-primary);
}
.step h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.step p { color: var(--text-secondary); font-size: 15px; }

/* platforms */
.platforms-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 880px; margin: 0 auto; }
@media (max-width: 760px) { .platforms-grid { grid-template-columns: 1fr; max-width: 420px; } }
.platform-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; padding: 30px 26px; text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.platform-card:hover { transform: translateY(-4px); border-color: var(--primary); }
.platform-card.detected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 14px 40px var(--shadow-primary); }
.platform-card .pico { font-size: 40px; margin-bottom: 14px; }
.platform-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.platform-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; min-height: 40px; }
.platform-card .btn { width: 100%; }
.platform-card .detected-tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  padding: 5px 14px; border-radius: 999px; white-space: nowrap; box-shadow: 0 8px 20px var(--shadow-primary);
}
.detected-banner {
  max-width: 600px; margin: 0 auto 36px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 20px; color: var(--text-secondary); font-size: 15px;
}
.detected-banner strong { color: var(--text); }

/* pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; max-width: 760px; margin: 0 auto; }
@media (max-width: 720px) { .pricing-grid { grid-template-columns: 1fr; max-width: 420px; } }
.price-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; padding: 32px 28px; transition: transform 0.2s ease;
}
.price-card:hover { transform: translateY(-4px); }
.price-card.featured { border-color: var(--primary); background: linear-gradient(160deg, rgba(255, 61, 110, 0.12), rgba(139, 92, 246, 0.08)); }
.price-card .tag {
  position: absolute; top: -12px; right: 22px; background: var(--grad); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; padding: 5px 12px; border-radius: 999px;
  box-shadow: 0 8px 20px var(--shadow-primary);
}
.price-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.price-card .amount { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; }
.price-card .amount span { font-size: 16px; font-weight: 500; color: var(--text-secondary); }
.price-card .save { color: #34D399; font-size: 13px; font-weight: 600; margin-top: 4px; min-height: 18px; }
.price-card ul { list-style: none; margin: 22px 0 0; padding: 0; }
.price-card li { color: var(--text-secondary); font-size: 14px; margin-bottom: 10px; padding-left: 26px; position: relative; }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
.trial-note { text-align: center; color: var(--text-secondary); font-size: 15px; margin-top: 28px; }
.trial-note strong { color: var(--text); }
.renew-terms { max-width: 760px; margin: 18px auto 0; color: var(--text-tertiary); font-size: 12px; line-height: 1.6; text-align: center; }

/* compare table */
.compare-wrap { max-width: 760px; margin: 0 auto; overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.compare-table th, .compare-table td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--border); font-size: 15px; }
.compare-table thead th { background: var(--surface-light); font-weight: 700; }
.compare-table thead th:nth-child(2) { color: var(--primary); }
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table td:not(:first-child) { text-align: center; }
.yes { color: #34D399; font-weight: 700; }
.no { color: var(--text-tertiary); }
.partial { color: #F59E0B; font-weight: 600; }

/* faq */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: 16px; margin-bottom: 14px; background: var(--surface); overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 20px 24px; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--primary); font-size: 24px; font-weight: 400; transition: transform 0.2s ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-a { padding: 0 24px 20px; color: var(--text-secondary); font-size: 15px; }

/* cta band */
.cta-band { text-align: center; }
.cta-band .inner {
  max-width: 720px; margin: 0 auto; background: linear-gradient(160deg, rgba(255, 61, 110, 0.12), rgba(139, 92, 246, 0.08));
  border: 1px solid var(--border); border-radius: 24px; padding: 52px 32px;
}
.cta-band h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 700; margin-bottom: 12px; }
.cta-band p { color: var(--text-secondary); margin-bottom: 26px; font-size: 17px; }

/* support */
.support-card { max-width: 640px; margin: 0 auto; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 48px 32px; }
.support-card h2 { font-size: 30px; font-weight: 700; margin-bottom: 12px; }
.support-card p { color: var(--text-secondary); margin-bottom: 26px; }
.email-pill { display: inline-flex; align-items: center; gap: 10px; background: var(--grad); color: #fff; padding: 14px 26px; border-radius: 14px; font-weight: 600; font-size: 16px; box-shadow: 0 10px 30px var(--shadow-primary); transition: transform 0.15s ease; }
.email-pill:hover { transform: translateY(-2px); }

/* legal / breadcrumb */
.breadcrumb { position: relative; z-index: 1; padding: 24px 0 0; font-size: 13px; color: var(--text-tertiary); }
.breadcrumb a:hover { color: var(--text); }
.legal-block { max-width: 760px; margin: 0 auto; padding: 40px 0 56px; position: relative; z-index: 1; }
.legal-block h1 { font-size: clamp(30px, 5vw, 40px); margin-bottom: 8px; text-align: left; }
.legal-block .updated { color: var(--text-tertiary); font-size: 14px; margin-bottom: 24px; }
.legal-block h3 { font-size: 18px; font-weight: 600; margin: 26px 0 8px; }
.legal-block p, .legal-block li { color: var(--text-secondary); font-size: 15px; margin-bottom: 10px; }
.legal-block ul { padding-left: 22px; }
.legal-block a { color: var(--primary-soft); }
.legal-block a:hover { text-decoration: underline; }

/* footer */
footer { position: relative; z-index: 1; border-top: 1px solid var(--border); padding: 52px 0 36px; margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; margin-bottom: 36px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; margin-bottom: 12px; }
.foot-brand img { width: 30px; height: 30px; border-radius: 9px; }
.foot-about { color: var(--text-secondary); font-size: 14px; max-width: 280px; }
.foot-col h4 { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.foot-col a { display: block; color: var(--text-secondary); font-size: 14px; margin-bottom: 10px; }
.foot-col a:hover { color: var(--text); }
.copyright { border-top: 1px solid var(--border); padding-top: 24px; text-align: center; color: var(--text-tertiary); font-size: 13px; }

/* =========================================================================
   Motion layer — entrance + scroll reveals.
   Pure CSS + a tiny inline IntersectionObserver. Everything is gated on
   `html.js` (set in theme.js before first paint), so no-JS visitors and
   crawlers get the fully-visible static page: zero CLS, zero FOUC, no content
   ever hidden behind JS. Honors prefers-reduced-motion.
   ========================================================================= */
@keyframes wl-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes wl-pulse { 0%, 100% { box-shadow: 0 0 9px var(--primary); } 50% { box-shadow: 0 0 18px var(--primary); } }
@keyframes wl-drift { 0%, 100% { transform: translateX(-50%) translateY(0) scale(1); } 50% { transform: translateX(-50%) translateY(28px) scale(1.06); } }
@keyframes wl-shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* Hero: staggered fade-up on load (one-shot). LCP-safe — short, small delays. */
.js header.hero > .wrap > * { opacity: 0; animation: wl-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.js header.hero .badge { animation-delay: 0.04s; }
.js header.hero h1 { animation-delay: 0.12s; }
.js header.hero .lead { animation-delay: 0.2s; }
.js header.hero .cta-row, .js header.hero .store-badges { animation-delay: 0.3s; }
.js header.hero .hero-note { animation-delay: 0.4s; }

/* Living accents — small areas, slow, compositor-friendly */
.js .badge .dot { animation: wl-pulse 2.4s ease-in-out infinite; }
.js body::before { animation: wl-drift 16s ease-in-out infinite; }
.js h1 .grad { background-size: 220% 220%; animation: wl-shimmer 9s ease-in-out infinite; }

/* Scroll reveals — `.reveal` is emitted on section content by build.js. The
   `--d` index produces a subtle per-item stagger within a grid/row. */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); transition-delay: calc(var(--d, 0) * 70ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* Smoother hover lift + a touch more depth on the existing card hovers */
.card, .step, .platform-card, .price-card { transition: border-color 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease; }
.card:hover, .platform-card:hover { box-shadow: 0 18px 44px var(--shadow-card); }

/* Hero typewriter — first word ships in HTML; the caret blinks via CSS. */
.typed { color: var(--primary-soft); font-weight: 600; white-space: nowrap; }
.js .typed { border-right: 2px solid var(--primary); margin-right: 1px; animation: wl-caret 0.9s step-end infinite; }
@keyframes wl-caret { 0%, 100% { border-color: var(--primary); } 50% { border-color: transparent; } }

/* Platform cards: flex column so every card is equal height with its store
   badge pinned to the bottom (no emoji icons). */
.platform-card { display: flex; flex-direction: column; align-items: center; }
.platform-card h3 { margin-top: 2px; }
.platform-card p { margin-bottom: 22px; }
.platform-card .store-badge { margin-top: auto; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js header.hero > .wrap > * { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; }
  .js .badge .dot,
  .js body::before,
  .js h1 .grad,
  .js .typed { animation: none !important; }
  .js .typed { border-color: transparent !important; }
  html { scroll-behavior: auto; }
}
