@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Dark geek palette — near-monochrome with one restrained cool accent */
  --bg: #09090b;
  --bg-2: #0c0c0f;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.20);
  --ink: #fafafa;
  --sub: #a1a1aa;
  --muted: #71717a;
  /* Accent kept as a single restrained indigo — no pink */
  --primary: #818cf8;
  --primary-d: #a5b4fc;
  --accent: #818cf8;
  --accent-2: #6366f1;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --accent-glow: rgba(129, 140, 248, 0.40);
  --glow: rgba(129, 140, 248, 0.45);
  --radius: 16px;
  --nav-h: 64px;
  --maxw: 1180px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* guard against any incidental horizontal scroll on small screens */
}

::selection { background: rgba(129, 140, 248, 0.35); color: #fff; }

/* Subtle scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ===== Ambient nebula / aurora background ===== */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(99,102,241,0.08), transparent 60%),
    linear-gradient(180deg, #09090b 0%, #0a0a0d 100%);
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.40;
  will-change: transform;
}
.blob-1 {
  width: 520px; height: 520px;
  top: -160px; left: 12%;
  background: radial-gradient(circle, rgba(129,140,248,0.45), transparent 70%);
  animation: float1 22s ease-in-out infinite;
}
.blob-2 {
  width: 460px; height: 460px;
  top: 60px; right: 8%;
  background: radial-gradient(circle, rgba(99,102,241,0.38), transparent 70%);
  animation: float2 26s ease-in-out infinite;
}
.blob-3 {
  width: 420px; height: 420px;
  bottom: -160px; left: 40%;
  background: radial-gradient(circle, rgba(168,85,247,0.22), transparent 70%);
  animation: float3 30s ease-in-out infinite;
}
.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 28%, black, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 28%, black, transparent 78%);
}
@keyframes float1 { 0%,100% { transform: translateY(0); } 50% { transform: translateY(46px); } }
@keyframes float2 { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(40px) translateX(-26px); } }
@keyframes float3 { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-40px) translateX(26px); } }

@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
}

/* ===== Top navigation bar (transparent floating) ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(9, 9, 11, 0.55);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.navbar:hover { border-bottom-color: var(--border); }
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-size: 19px; font-weight: 800; letter-spacing: -0.3px;
  text-decoration: none; color: #fff;
}
.nav-brand span {
  background: linear-gradient(120deg, #ffffff, var(--primary-d));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  font-size: 14px; font-weight: 600; color: var(--sub);
  text-decoration: none; padding: 8px 14px; border-radius: 10px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-link:hover { color: #fff; background: var(--surface-2); }
.nav-login {
  color: #fff;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.04);
}
.nav-login:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(129,140,248,0.3), 0 8px 24px var(--accent-glow);
  background: var(--surface-3);
}

/* ===== Hero: two-column on desktop ===== */
.hero {
  position: relative;
  z-index: 1;
  padding: calc(var(--nav-h) + 64px) 24px 40px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start; /* never vertically center the grid on top of a tall right panel */
}
.hero-grid {
  width: 100%;
  max-width: var(--maxw);
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  gap: 60px;
  align-items: flex-start;
}

/* ----- Left: product pitch ----- */
.hero-copy { max-width: 540px; align-self: flex-start; padding-top: 6px; }
.badge {
  display: inline-block;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.2px;
  color: var(--primary-d);
  background: var(--accent-soft);
  border: 1px solid rgba(129,140,248,0.35);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 22px;
}
.hero-title {
  font-size: clamp(40px, 5.4vw, 66px);
  font-weight: 800; margin: 0 0 18px; letter-spacing: -2px;
  line-height: 1.02;
  background: linear-gradient(180deg, #ffffff 0%, #c9c9d2 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub {
  color: var(--sub); font-size: clamp(15px, 1.4vw, 17.5px); line-height: 1.65;
  margin: 0; max-width: 470px;
}
.features {
  list-style: none; padding: 0; margin: 28px 0 0;
  display: flex; flex-direction: column; gap: 13px;
}
.features li {
  display: flex; align-items: center; gap: 11px;
  font-size: 15px; color: #d4d4d8; font-weight: 500;
}
.features .tick {
  flex: 0 0 auto;
  width: 21px; height: 21px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(129,140,248,0.10);
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px;
}
.meta-pill {
  font-size: 13px; font-weight: 600; color: var(--sub);
  background: var(--surface); border: 1px solid var(--border);
  padding: 7px 14px; border-radius: 999px;
}
.meta-pill::before { content: "✦ "; color: var(--accent); }

/* ----- Right: tool window (glassmorphism) ----- */
.showcase { width: 100%; display: flex; justify-content: center; }
.window {
  position: relative;
  width: 100%;
  max-width: 520px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--border-strong);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 40px 120px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.04);
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.window:hover {
  border-color: rgba(129,140,248,0.45);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 50px 140px rgba(0,0,0,0.7),
    0 0 60px rgba(129,140,248,0.16);
  transform: translateY(-2px);
}
.window-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.traffic { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.t-dot, .t-r { background: #ff5f57; }
.t-y { background: #febc2e; }
.t-g { background: #28c840; }
.window-title {
  margin-left: 10px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  letter-spacing: 0.2px;
}

.card { padding: 22px 22px 26px; background: transparent; }
/* Manage Subscription (shown to Pro users only) — subtle link-style button under the plan tag */
.manage-sub {
  display: inline-block; margin: 0 0 16px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--primary-d); font-size: 12.5px; font-weight: 700;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.manage-sub:hover { border-color: var(--accent); background: var(--surface-2); }
.manage-sub:disabled { opacity: 0.5; cursor: wait; }
.plan-tag {
  display: inline-block;
  font-size: 12px; font-weight: 600; color: var(--primary-d);
  background: var(--accent-soft);
  border: 1px solid rgba(129,140,248,0.35);
  padding: 6px 11px; border-radius: 999px;
  white-space: nowrap; margin-bottom: 18px;
}
.block { margin-bottom: 17px; }
.block-title { display: block; font-size: 13.5px; font-weight: 700; color: #e4e4e7; margin-bottom: 10px; letter-spacing: 0.1px; }
.muted { color: var(--muted); font-weight: 600; }
.hint { font-size: 12px; color: var(--muted); margin: 9px 0 0; line-height: 1.5; }
.credit-note { font-size: 11.5px; color: var(--muted); margin: 4px 0 0; line-height: 1.5; display: flex; align-items: center; gap: 6px; }
.credit-warn { font-size: 12.5px; color: #fbbf24; font-weight: 600; margin: 8px 0 0; line-height: 1.5; }
.credit-note::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #6366f1; flex: 0 0 auto; box-shadow: 0 0 8px rgba(99,102,241,0.6); }

/* Chips (dark icon capsules) */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sub);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.chip:hover {
  color: #fff;
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.chip.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent), 0 6px 18px var(--accent-glow);
}

/* Textarea */
.topic {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  background: rgba(0,0,0,0.4);
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.topic::placeholder { color: var(--muted); }
.topic:focus {
  outline: none;
  border-color: rgba(129,140,248,0.6);
  box-shadow: 0 0 0 3px rgba(129,140,248,0.15);
}
.topic-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.char-count { font-size: 12px; color: var(--muted); }
/* Turns red as the topic approaches the 300-character cap (maxlength truncates it). */
#topicCount.over { color: #f87171; font-weight: 700; }

/* Segmented */
.seg { display: flex; gap: 8px; }
.seg-btn {
  flex: 1; padding: 10px; border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface); font-weight: 700; font-size: 14px; color: var(--sub); cursor: pointer;
  transition: all 0.18s ease;
}
.seg-btn:hover { color: #fff; border-color: var(--border-strong); }
.seg-btn.active {
  color: #fff; border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}

/* Sliders */
.slider {
  width: 100%; height: 26px; accent-color: var(--accent);
  cursor: pointer;
}

/* Generate — solid white, glows on hover (no pink) */
.generate {
  width: 100%; height: 54px; border: 1px solid rgba(255,255,255,0.85); border-radius: 14px;
  background: #fafafa;
  color: #09090b; font-size: 16.5px; font-weight: 800; cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 10px 30px rgba(129,140,248,0.18);
  margin-top: 4px;
  transition: transform 0.15s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}
.generate:hover {
  transform: translateY(-1px);
  border-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.5), 0 14px 44px rgba(129,140,248,0.42);
}
.generate:active { transform: translateY(0); }
.generate:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.disclaimer { text-align: center; font-size: 11.5px; color: var(--muted); margin: 12px 0 0; line-height: 1.4; }

/* ===== Daily usage counter (synced with the Worker's KV quota) ===== */
/* Sits right above the Generate button: an at-a-glance "X/limit left today".
   Green when credits remain, red when depleted (0 left), with a direct Upgrade link. */
.usage-counter {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 13.5px; font-weight: 700; color: #e4e4e7;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 14px; margin-bottom: 14px;
}
.usage-counter .uc-tier {
  color: var(--primary-d); font-weight: 800; font-size: 12px;
  background: var(--accent-soft); border: 1px solid rgba(129,140,248,0.35);
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.usage-counter .uc-num { color: #34d399; font-size: 16px; font-weight: 900; min-width: 14px; text-align: center; }
.usage-counter .uc-limit { color: var(--muted); }
.usage-counter .uc-tail { color: var(--sub); font-weight: 600; }
.usage-counter .uc-upgrade { color: var(--primary-d); text-decoration: none; margin-left: 2px; font-weight: 800; }
.usage-counter .uc-upgrade:hover { text-decoration: underline; }
.usage-counter.depleted { border-color: rgba(248,113,113,0.5); background: rgba(248,113,113,0.08); }
.usage-counter.depleted .uc-num { color: #f87171; }
.usage-counter.depleted .uc-tier { color: #fca5a5; background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.45); }
.usage-counter.depleted .uc-tail { color: #fca5a5; }

/* Result */
.result { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.result-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 10px; color: #e4e4e7; }
.copy-btn {
  border: 1px solid var(--border); background: var(--surface); color: #fff;
  border-radius: 10px; padding: 6px 13px; font-weight: 700; font-size: 13px; cursor: pointer;
  transition: all 0.18s ease;
}
.copy-btn:hover { border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 1px rgba(129,140,248,0.25); }
.result-body { white-space: pre-wrap; line-height: 1.65; font-size: 14.5px; color: #d4d4d8; }
.result-body .pl-name { font-weight: 800; color: var(--primary-d); margin: 14px 0 4px; }
.result-body .pl-name:first-child { margin-top: 0; }
.result-body .tag-hl {
  display: inline-block;
  font-weight: 800;
  color: #c7d2fe;
  background: rgba(129, 140, 248, 0.16);
  border: 1px solid rgba(129, 140, 248, 0.5);
  border-radius: 6px;
  padding: 0 6px;
  margin: 1px 0;
}

/* Streaming text + blinking caret (fluid/typing effect) */
.result-body .stream-text { white-space: pre-wrap; line-height: 1.65; font-size: 14.5px; color: #d4d4d8; }
.stream-cursor {
  display: inline-block;
  width: 7px; height: 1.05em;
  background: var(--primary);
  margin-left: 2px;
  vertical-align: text-bottom;
  border-radius: 2px;
  animation: caret-blink 1s steps(1, end) infinite;
}
@keyframes caret-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .stream-cursor { animation: none; opacity: 0.6; }
}

/* Per-platform streaming block (multi-select generation) */
.result-body .pl-block { margin: 0 0 10px; }
.result-body .pl-block:last-child { margin-bottom: 0; }

/* Waiting skeleton: shown before the first token arrives so the panel never looks dead */
.gen-skeleton { padding: 2px 0; }
.gen-skeleton .sk-line {
  height: 12px;
  border-radius: 6px;
  margin: 8px 0;
  background: linear-gradient(90deg, rgba(129,140,248,0.10) 25%, rgba(129,140,248,0.22) 37%, rgba(129,140,248,0.10) 63%);
  background-size: 400% 100%;
  animation: sk-shimmer 1.4s ease infinite;
}
.gen-skeleton .sk-1 { width: 92%; }
.gen-skeleton .sk-2 { width: 84%; }
.gen-skeleton .sk-3 { width: 88%; }
@keyframes sk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.gen-skeleton .sk-status {
  display: flex; align-items: center; gap: 6px;
  margin: 12px 0 0; font-size: 13px; color: #a1a1aa; font-weight: 600;
}
.gen-skeleton .sk-dot {
  flex: none;
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(161,161,170,0.35);
  transition: background 0.3s ease;
}
.gen-skeleton .sk-dot.on { background: var(--primary); }
.gen-skeleton .sk-step { margin-left: 4px; }
/* Blinking caret after the status text => reads as "typing / actively generating". */
.gen-skeleton .sk-caret {
  display: inline-block;
  width: 7px; height: 1em;
  margin-left: 2px;
  background: var(--primary);
  vertical-align: -2px;
  animation: caret-blink 1s step-end infinite;
}
@media (prefers-reduced-motion: reduce) {
  .gen-skeleton .sk-line { animation: none; }
  .gen-skeleton .sk-caret { animation: none; opacity: 0.6; }
}

/* Limit note */
/* Limit-reached banner: a fixed, slide-up notification anchored near the bottom of the
   viewport — ABOVE the cookie consent bar so the two never collide. Detached from the card
   flow so showing it never shifts the layout (no abrupt jump). Centered + width-capped on
   desktop; full-width with safe-area clearance on mobile. */
.limit-note {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 90;
  width: min(520px, calc(100% - 28px));
  margin: 0;
  background: rgba(14, 14, 18, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(129, 140, 248, 0.5);
  border-radius: 16px;
  padding: 15px 18px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(129, 140, 248, 0.18);
  animation: limitPop 0.26s ease;
}
@keyframes limitPop {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .limit-note { animation: none; }
}
.limit-note p { margin: 0 0 12px; font-size: 14px; color: #e0e0ff; line-height: 1.5; }
.waitlist-cta {
  border: 1px solid var(--accent); background: var(--accent-soft); color: #fff; font-weight: 800;
  padding: 12px 20px; border-radius: 12px; cursor: pointer; font-size: 14px;
  box-shadow: 0 0 0 1px var(--accent);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.waitlist-cta:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--accent), 0 12px 30px var(--accent-glow); }

/* ===== Section eyebrow (H2 used to separate function blocks) ===== */
.section-h2 {
  font-size: 13px; font-weight: 700; color: var(--primary-d);
  letter-spacing: 0.6px; text-transform: uppercase;
  margin: 30px 0 14px;
}

/* ===== FAQ (GEO long-tail capture) ===== */
.faq { position: relative; z-index: 1; padding: 44px 24px 8px; }
.faq > h2 {
  font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -1px;
  color: #fff; text-align: center; margin: 0 0 28px;
}
.faq-list {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 760px; margin: 0 auto;
}
.faq-item {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 18px 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.faq-item:hover {
  border-color: rgba(129,140,248,0.4);
  box-shadow: 0 0 0 1px rgba(129,140,248,0.2);
}
.faq-item h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; color: #fafafa; }
.faq-item p { margin: 0; font-size: 14.5px; color: var(--sub); line-height: 1.65; }

/* ===== Footer ===== */
.footer {
  position: relative; z-index: 1;
  margin-top: 64px; padding: 30px 8px 40px; text-align: center;
  border-top: 1px solid var(--border);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 12px; }
.footer-links a { color: var(--sub); font-size: 13px; font-weight: 600; text-decoration: none; transition: color 0.15s ease; }
.footer-links a:hover { color: #fff; }
.footer-email { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.footer-email a { color: var(--primary-d); }
.footer-fine { font-size: 11px; color: var(--muted); margin: 0; line-height: 1.5; }

/* ===== Modal ===== */
/* Mobile-safe: modal area respects the iOS/Android browser bars and any soft keyboard;
   the card itself scrolls so tall content (pricing/limit) is never clipped off-screen. */
.modal {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; background: #0e0e12; border: 1px solid var(--border-strong); border-radius: 20px; padding: 26px 22px;
  width: 100%; max-width: 380px; box-shadow: 0 30px 80px rgba(0,0,0,0.7);
  max-height: calc(100dvh - 48px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
@supports not (height: 100dvh) {
  .modal-card { max-height: calc(100vh - 48px - env(safe-area-inset-bottom, 0px)); }
}
.modal-x { position: absolute; top: 14px; right: 16px; border: none; background: none; font-size: 18px; color: var(--muted); cursor: pointer; }
.modal-x:hover { color: #fff; }
.modal-card h2 { margin: 0 0 8px; font-size: 20px; color: #fff; }
.modal-sub { font-size: 13.5px; color: var(--sub); line-height: 1.55; margin: 0 0 16px; }
.email-input {
  width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  font-size: 15px; font-family: inherit; background: rgba(0,0,0,0.4); color: #fff;
}
.email-input::placeholder { color: var(--muted); }
.email-input:focus { outline: none; border-color: rgba(129,140,248,0.6); box-shadow: 0 0 0 3px rgba(129,140,248,0.15); }
.waitlist-submit {
  width: 100%; margin-top: 12px; border: 1px solid var(--accent); border-radius: 12px; padding: 13px;
  background: var(--accent-2); color: #fff;
  font-weight: 800; font-size: 15px; cursor: pointer;
  box-shadow: 0 0 0 1px var(--accent), 0 8px 22px var(--accent-glow);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.waitlist-submit:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--accent), 0 12px 30px var(--accent-glow); }
.waitlist-status { font-size: 13px; text-align: center; margin: 12px 0 0; min-height: 18px; }
.waitlist-status.ok { color: #34d399; font-weight: 700; }
.waitlist-status.err { color: var(--primary-d); font-weight: 600; }

/* ===== Turnstile widget ===== */
.turnstile-wrap { margin-top: 14px; display: flex; justify-content: center; }
.turnstile-wrap[hidden] { display: none; }

/* ===== Pricing modal (Creem fallback) ===== */
.pricing-card {
  max-width: 470px; text-align: center;
  background: #0e0e12; border: 1px solid var(--border-strong); border-radius: 20px;
}
.pricing-badge {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: #fff; background: linear-gradient(120deg, var(--accent-2), var(--accent));
  padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}
.pricing-card h2 { margin: 0 0 6px; font-size: 24px; color: #fff; }
.price { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin-bottom: 18px; }
.price-amt { font-size: 44px; font-weight: 900; color: #fff; letter-spacing: -1.5px; }
.price-per { font-size: 15px; color: var(--sub); font-weight: 600; }
.pricing-features { list-style: none; padding: 0; margin: 0 0 20px; text-align: left; display: flex; flex-direction: column; gap: 11px; }
.pricing-features li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: #d4d4d8; font-weight: 500; }
.pricing-features .tick {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff;
  background: var(--accent-soft); border: 1px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(129,140,248,0.10);
}
.get-pro {
  width: 100%; height: 52px; border: none; border-radius: 14px; cursor: pointer;
  font-size: 16px; font-weight: 800; color: #fff;
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 0 1px rgba(129,140,248,0.5), 0 12px 30px var(--accent-glow);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.get-pro:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(129,140,248,0.7), 0 16px 40px var(--accent-glow); }
.pricing-note { font-size: 14px; color: var(--primary-d); font-weight: 700; margin: 14px 0 0; }

/* ===== Pricing: two-plan cards ===== */
.pricing-cards { display: flex; gap: 14px; margin: 6px 0 14px; }
.price-card {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 16px; padding: 20px 14px 16px;
  background: rgba(255,255,255,0.02);
  position: relative;
}
.price-card.best {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 30px var(--accent-glow);
}
.price-card-tag {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 800; letter-spacing: 0.3px; color: #fff; white-space: nowrap;
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
  padding: 4px 12px; border-radius: 999px;
}
.price-card-name {
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--sub); margin-bottom: 8px;
}
.price-card .price { margin-bottom: 12px; }
.price-card .price-amt { font-size: 36px; }
.price-card .pricing-features { flex: 1 1 auto; gap: 9px; margin-bottom: 16px; }
.price-card .pricing-features li { font-size: 13px; }
.price-card .get-pro { margin-top: auto; height: 46px; font-size: 15px; }
.pricing-activate { margin: 12px 0 0; font-size: 13.5px; color: var(--sub); }
.pricing-activate a { color: var(--accent); text-decoration: none; font-weight: 700; }
.pricing-activate a:hover { text-decoration: underline; }
.pro-activate { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); text-align: left; }
.pro-activate-title { font-weight: 700; color: #fff; margin: 0 0 4px; font-size: 15px; }
.pro-activate-sub { font-size: 13px; color: var(--sub); margin: 0 0 12px; line-height: 1.5; }
.limit-recover-title { font-size: 14px; color: #e4e4e7; text-align: center; margin: 20px 0 10px; font-weight: 600; }
.pricing-secure { font-size: 12.5px; line-height: 1.6; color: var(--muted); text-align: center; margin: 18px 2px 0; padding-top: 14px; border-top: 1px solid var(--border); }

/* ===== Payment-success (welcome) modal ===== */
.welcome-card { text-align: center; }
.welcome-card .modal-sub { font-size: 15px; color: #e4e4e7; line-height: 1.6; }
.welcome-email { font-size: 12.5px; line-height: 1.55; color: var(--muted); margin: 0 0 18px; }
.welcome-upsell { font-size: 13px; color: var(--sub); margin: 0 0 18px; }
.welcome-upsell a { color: var(--primary-d); font-weight: 700; text-decoration: none; }
.welcome-upsell a:hover { text-decoration: underline; }
.welcome-card .get-pro { margin-top: 0; }
@media (max-width: 460px) {
  .pricing-cards { flex-direction: column; }
}

/* ===== Landing page (home) ===== */
.landing {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 24px) 20px 64px;
}
.landing-hero { text-align: center; max-width: 880px; }
.landing-title {
  font-size: clamp(40px, 8.2vw, 86px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  background: linear-gradient(180deg, #ffffff 0%, #c9c9d6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.landing-sub {
  font-size: clamp(15px, 2.3vw, 20px);
  line-height: 1.55;
  color: var(--sub);
  max-width: 600px;
  margin: 0 auto 38px;
}
.landing-cta {
  display: inline-block;
  padding: 16px 40px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 14px;
  box-shadow: 0 10px 30px var(--accent-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.landing-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 42px var(--accent-glow);
}
.landing-footer { position: relative; z-index: 1; }
.landing-footer .footer-links { justify-content: center; }

/* ===== Before & After (landing social proof) ===== */
.ba { position: relative; z-index: 1; max-width: 980px; margin: 8px auto 0; padding: 0 20px; text-align: center; }
.ba-title { font-size: 30px; font-weight: 800; letter-spacing: -0.6px; color: #fff; margin: 0 0 10px; }
.ba-sub { max-width: 660px; margin: 0 auto 28px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.ba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; text-align: left; }
.ba-card {
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.ba-before { opacity: 0.92; }
.ba-after { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent), 0 12px 34px var(--accent-glow); }
.ba-tag { align-self: flex-start; font-size: 11px; font-weight: 800; letter-spacing: 0.6px; color: var(--muted); border: 1px solid var(--border, rgba(255,255,255,0.12)); border-radius: 999px; padding: 4px 10px; }
.ba-tag-after { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.ba-platform { font-size: 13px; font-weight: 700; color: var(--primary-d); }
.ba-line { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink); }
/* General [Hook]/[Script] highlight so it works outside the result panel too */
.tag-hl {
  display: inline-block;
  font-weight: 800;
  color: #c7d2fe;
  background: rgba(129, 140, 248, 0.16);
  border: 1px solid rgba(129, 140, 248, 0.5);
  border-radius: 6px;
  padding: 0 6px;
  margin: 1px 0;
}
.ba-note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.ba-cta { display: inline-block; margin-top: 26px; color: var(--primary-d); font-weight: 700; text-decoration: none; font-size: 15px; }
.ba-cta:hover { color: #fff; }
@media (max-width: 720px) {
  .ba-grid { grid-template-columns: 1fr; }
  .ba-title { font-size: 24px; }
}

/* ===== Legal pages (dark) ===== */
.legal { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: calc(var(--nav-h) + 36px) 20px 60px; }
.legal h1 { font-size: 28px; margin: 8px 0 4px; color: #fff; letter-spacing: -0.5px; }
.legal .updated { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.legal h2 { font-size: 18px; margin: 26px 0 8px; color: var(--primary-d); }
.legal p, .legal li { color: #c4c4cc; line-height: 1.7; font-size: 14.5px; }
.legal a { color: var(--primary-d); }
.legal .back { display: inline-block; margin-top: 28px; color: var(--primary-d); font-weight: 700; text-decoration: none; }
.legal .back:hover { text-decoration: underline; }
.legal .email-line { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 12px 0; font-weight: 600; color: #e4e4e7; }

/* Prominent "we do not sell your data" statement */
.legal .notice-box {
  background: rgba(129, 140, 248, 0.08);
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 16px 0 8px;
}
.legal .notice-box strong { display: block; color: #fff; font-size: 15.5px; line-height: 1.5; }
.legal .notice-box p { margin: 6px 0 0; color: var(--sub); font-size: 14px; line-height: 1.6; }

/* ===== Cookie consent bar (site-wide) ===== */
.cookie-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 200; width: min(720px, calc(100% - 32px));
  display: flex; align-items: center; gap: 16px;
  background: rgba(14, 14, 18, 0.92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong); border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.cookie-text { margin: 0; font-size: 13px; line-height: 1.5; color: var(--sub); flex: 1; }
.cookie-text a { color: var(--primary-d); text-decoration: none; }
.cookie-text a:hover { text-decoration: underline; }
.cookie-accept {
  flex: 0 0 auto; border: 1px solid var(--accent); border-radius: 10px; padding: 10px 20px;
  background: var(--accent-2); color: #fff; font-weight: 800; font-size: 14px; cursor: pointer;
  box-shadow: 0 0 0 1px var(--accent), 0 8px 22px var(--accent-glow);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.cookie-accept:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--accent), 0 12px 30px var(--accent-glow); }
@media (max-width: 560px) {
  .cookie-bar { flex-direction: column; align-items: stretch; text-align: left; bottom: 12px; }
  .cookie-accept { width: 100%; }
  /* The wrapped cookie bar is taller on mobile — lift the limit banner clear of it. */
  .limit-note { bottom: 120px; width: calc(100% - 24px); padding: 13px 15px; }
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  /* Three infinite blurred gradients are the main GPU cost on phones/tablets.
     Keep the static background, drop the continuous compositing work. */
  .blob { animation: none; }
  .hero { padding: calc(var(--nav-h) + 44px) 18px 30px; }
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-copy { max-width: 100%; text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .features { display: inline-flex; text-align: left; }
  .hero-meta { justify-content: center; }
  .showcase { justify-content: stretch; }
  .window { max-width: 560px; }
}
@media (max-width: 480px) {
  .window-bar { padding: 11px 14px; }
  .card { padding: 18px 16px 22px; }
  .nav-brand { font-size: 17px; }
}
