*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #030306;
  --surface: rgba(255,255,255,0.03);
  --surface-hover: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.06);
  --text: #e0e0ec;
  --text-dim: #6b6b80;
  --accent: #38bdf8;
  --accent2: #818cf8;
  --accent3: #c084fc;
  --glow: rgba(56,189,248,0.15);
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: #020204;
  color: var(--text);
  font-family: 'DM Sans', -apple-system, sans-serif;
  overflow-x: hidden;
  line-height: 1.6;
}
body::-webkit-scrollbar { width: 6px; }
body::-webkit-scrollbar-track { background: var(--bg); }
body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

img { display: block; max-width: 100%; }

/* Grain */
.grain { display: none; }

/* ---- NAV ---- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.25rem 3rem; display: flex; align-items: center; justify-content: space-between;
  transition: background 0.5s, backdrop-filter 0.5s;
}
nav.scrolled {
  background: rgba(3,3,6,0.85); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.logo {
  font-family: 'Silkscreen', cursive; font-size: 1.3rem; font-weight: 700;
  color: #fff; letter-spacing: 0.02em; z-index: 2; text-transform: lowercase;
}
.logo span {
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; gap: 2.5rem; list-style: none; z-index: 2; position: relative; }
.nav-links a {
  color: var(--text-dim); text-decoration: none; font-size: 0.875rem; font-weight: 500;
  transition: color 0.3s; position: relative; padding: 0.25rem 0;
}
.nav-links a:hover { color: #fff; }
.nav-links a.active { color: #fff; }
.nav-limelight {
  position: absolute; top: -8px; height: 3px; width: 30px;
  border-radius: 2px; background: #fff;
  box-shadow: 0 4px 12px rgba(255,255,255,0.5), 0 8px 24px rgba(255,255,255,0.2);
  transition: left 0.35s cubic-bezier(0.4, 0, 0.15, 1), width 0.35s cubic-bezier(0.4, 0, 0.15, 1);
  pointer-events: none;
}
.nav-limelight::after {
  content: ''; position: absolute; left: -15%; top: 3px;
  width: 130%; height: 40px;
  clip-path: polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%);
  background: linear-gradient(to bottom, rgba(255,255,255,0.2), transparent);
  pointer-events: none;
}
.nav-actions { display: flex; gap: 0.75rem; z-index: 2; }

.btn-ghost {
  padding: 0.55rem 1.25rem; border: 1px solid rgba(255,255,255,0.1); border-radius: 10px;
  background: rgba(255,255,255,0.03); color: var(--text); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all 0.3s; font-family: inherit; backdrop-filter: blur(10px);
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.06); }

.btn-primary {
  padding: 0.55rem 1.5rem; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: all 0.3s; font-family: inherit; position: relative; overflow: hidden;
}
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  filter: blur(15px); opacity: 0.4; z-index: -1; transition: opacity 0.3s;
}
.btn-primary:hover::after { opacity: 0.6; }

/* ---- HERO ---- */
.hero {
  position: relative; height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; overflow: hidden;
  z-index: 1;
}

/* Hero background — cinematic video */
.hero-bg {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
}
.hero-bg video,
.hero-bg img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-bg video.active,
.hero-bg img.active { opacity: 1; }
.hero-bg::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(to bottom, rgba(3,3,6,0.3) 0%, rgba(3,3,6,0.15) 30%, rgba(3,3,6,0.15) 50%, rgba(3,3,6,0.5) 80%, var(--bg) 100%),
    radial-gradient(ellipse at center top, transparent 30%, rgba(3,3,6,0.4) 100%);
}

/* Subtle aurora accent — refined, not overdone */
.aurora { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.aurora-blob {
  position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0;
  animation: auroraFade 2.5s ease-out forwards;
}
.aurora-blob:nth-child(1) {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(56,189,248,0.1), transparent 70%);
  top: -10%; right: 10%; animation: auroraMove1 30s ease-in-out infinite, auroraFade 2.5s ease-out forwards;
}
.aurora-blob:nth-child(2) {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(129,140,248,0.08), transparent 70%);
  bottom: 10%; left: 5%; animation: auroraMove2 35s ease-in-out infinite, auroraFade 2.5s 0.5s ease-out forwards;
}
.aurora-blob:nth-child(3) {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(192,132,252,0.06), transparent 70%);
  top: 50%; left: 50%; animation: auroraMove3 25s ease-in-out infinite, auroraFade 2.5s 1s ease-out forwards;
}

@keyframes auroraFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes auroraMove1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-40px,30px) scale(1.05); } }
@keyframes auroraMove2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px,-30px); } }
@keyframes auroraMove3 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-50px,30px); } }

#heroCanvas { position: absolute; inset: 0; z-index: 1; pointer-events: none; }

/* Ghostwriter — bottom liquid glass prompt */
.ghostwriter {
  position: absolute; bottom: 80px; left: 0; right: 0;
  margin: 0 auto; z-index: 25; width: calc(100% - 4rem); max-width: 520px;
  opacity: 0; animation: fadeUp 1.2s 0.4s ease-out forwards;
}
.ghostwriter-box {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 0.85rem 1.3rem;
  display: flex; align-items: center; gap: 0.6rem;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(255,255,255,0.04);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.ghostwriter-box:hover {
  border-color: rgba(56,189,248,0.4);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.3),
    0 0 20px rgba(56,189,248,0.15),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(255,255,255,0.04);
}
.ghostwriter-prompt {
  font-family: 'JetBrains Mono', monospace; font-size: 0.85rem;
  color: var(--accent); font-weight: 500; flex-shrink: 0; opacity: 0.7;
}
.ghostwriter-text {
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem;
  color: rgba(255,255,255,0.75); font-weight: 300; line-height: 1.6;
  min-height: 1.3em; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ghostwriter-cursor {
  display: inline-block; width: 1.5px; height: 1em; background: rgba(255,255,255,0.5);
  margin-left: 1px; vertical-align: text-bottom;
  animation: cursorBlink 0.8s step-end infinite;
}
@keyframes cursorBlink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.ghostwriter-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: transparent; border: none; outline: none;
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem;
  color: rgba(255,255,255,0.9); font-weight: 300; letter-spacing: -0.01em;
  padding: 0.85rem 1.3rem 0.85rem 2.4rem;
  opacity: 0; cursor: pointer; caret-color: var(--accent);
}
.ghostwriter-input:focus, .ghostwriter-input.active {
  opacity: 1; cursor: text;
}
.ghostwriter-box { position: relative; }

@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.scroll-hint {
  position: absolute; bottom: 2.5rem; left: 2.5rem; transform: none;
  z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem;
  opacity: 0; animation: fadeUp 1s 1.5s ease-out forwards;
}
.scroll-hint span {
  font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 0.15em; font-weight: 500;
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse { 0%,100% { opacity: 0.3; transform: scaleY(0.5); } 50% { opacity: 1; transform: scaleY(1); } }

/* ---- DEMO ---- */
.demo-section { position: relative; padding: 8rem 3rem; overflow: hidden; background: transparent; z-index: 1; }
.demo-container { max-width: 900px; margin: 0 auto; }
.demo-header { text-align: center; margin-bottom: 4rem; }
.section-label {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 1rem;
}
.section-h2 {
  font-family: 'DM Sans', sans-serif; font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 700; letter-spacing: -0.04em; line-height: 1.1;
}

.prompt-container {
  background: rgba(3,3,6,0.88); border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden; backdrop-filter: blur(20px); position: relative;
}
.prompt-container::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent); opacity: 0.5;
}
.prompt-top {
  display: flex; align-items: center; gap: 0.5rem; padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.pdot { width: 8px; height: 8px; border-radius: 50%; }
.pdot.r { background: #ff5f57; } .pdot.y { background: #ffbd2e; } .pdot.g { background: #28ca41; }
.prompt-title { flex: 1; text-align: center; font-size: 0.75rem; color: var(--text-dim); font-weight: 500; }

.prompt-body { padding: 1.5rem; }
.prompt-input-row {
  display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.25rem;
  border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,0.02);
  transition: border-color 0.3s;
}
.prompt-input-row:focus-within { border-color: rgba(56,189,248,0.3); }
.prompt-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(56,189,248,0.15), rgba(129,140,248,0.15));
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.prompt-input-row input {
  flex: 1; background: none; border: none; color: var(--text);
  font-size: 0.95rem; font-family: inherit; outline: none;
}
.prompt-input-row input::placeholder { color: var(--text-dim); }
.prompt-generate {
  padding: 0.6rem 1.5rem; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  font-family: inherit; white-space: nowrap; transition: transform 0.2s;
}
.prompt-generate:hover:not(:disabled) { transform: scale(1.03); }
.prompt-generate:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.prompt-generate.loading {
  position: relative; color: transparent;
}
.prompt-generate.loading::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gen-status {
  margin-top: 0.75rem; font-size: 0.8rem; color: var(--text-dim);
  min-height: 1.2em; transition: opacity 0.3s;
}
.gen-status.error { color: #f87171; }
.gen-status.success { color: #34d399; }

/* ── RENDERING QUEUE EXPERIENCE (free users) ── */
.render-experience {
  display: none; margin: 1.25rem 0; border-radius: 16px;
  background: rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.05);
  overflow: hidden; animation: renderFadeIn 0.5s ease-out;
  backdrop-filter: blur(20px);
}
@keyframes renderFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Progress section */
.render-progress {
  padding: 1.25rem 1.5rem 1rem;
  display: flex; align-items: center; gap: 1rem;
}
.render-orbit {
  position: relative; width: 36px; height: 36px; flex-shrink: 0;
}
.render-orbit-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent); border-right-color: var(--accent2);
  animation: orbitSpin 1.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  filter: drop-shadow(0 0 6px rgba(56,189,248,0.3));
}
.render-orbit-dot {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 12px rgba(56,189,248,0.5);
  animation: orbitPulse 2s ease-in-out infinite;
}
@keyframes orbitSpin { to { transform: rotate(360deg); } }
@keyframes orbitPulse {
  0%, 100% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
  50% { transform: translate(-50%,-50%) scale(0.7); opacity: 0.5; }
}
.render-progress-info { flex: 1; min-width: 0; }
.render-progress-text {
  font-size: 0.82rem; font-weight: 500; color: var(--text);
  background: linear-gradient(110deg, var(--text-dim) 0%, var(--text) 40%, var(--text-dim) 60%);
  background-size: 200% 100%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmerText 2.5s linear infinite;
}
@keyframes shimmerText {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.render-elapsed {
  font-size: 0.7rem; color: var(--text-dim); margin-top: 2px;
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.render-bar-track {
  height: 2px; background: rgba(255,255,255,0.04);
  border-radius: 1px; overflow: hidden;
}
.render-bar-fill {
  height: 100%; border-radius: 1px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
  background-size: 200% 100%;
  animation: barShimmer 2s linear infinite;
  transition: width 0.5s ease-out;
}
@keyframes barShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Sponsored ad section */
.render-ad-section {
  padding: 0 1.25rem;
}
.render-ad-label {
  display: flex; align-items: center; gap: 0.5rem;
  padding-bottom: 0.5rem;
}
.render-ad-label span {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.2); font-weight: 600;
}
.render-ad-label::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05), transparent);
}
.render-ad-card {
  border-radius: 10px; overflow: hidden;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  min-height: 250px;
  transition: opacity 0.4s ease;
}

/* Upgrade CTA section */
.render-upgrade {
  padding: 1rem 1.25rem 1.25rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
  animation: upgradeSlideUp 0.6s ease-out 0.3s both;
}
@keyframes upgradeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.render-upgrade-card {
  padding: 1rem 1.1rem; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  cursor: pointer; transition: all 0.3s ease;
  position: relative; overflow: hidden;
}
.render-upgrade-card:hover {
  border-color: rgba(56,189,248,0.2);
  background: rgba(56,189,248,0.03);
  transform: translateY(-1px);
}
.render-upgrade-card.featured {
  border-color: rgba(56,189,248,0.15);
  background: linear-gradient(135deg, rgba(56,189,248,0.04), rgba(129,140,248,0.04));
}
.render-upgrade-card.featured::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(56,189,248,0.05), transparent);
  pointer-events: none;
}
.render-upgrade-card.featured:hover {
  border-color: rgba(56,189,248,0.3);
  box-shadow: 0 4px 20px rgba(56,189,248,0.08);
}
.upgrade-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.5rem;
}
.upgrade-card-name {
  font-size: 0.75rem; font-weight: 600; color: var(--text);
  letter-spacing: 0.01em;
}
.upgrade-card-badge {
  font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 4px; font-weight: 700;
  background: linear-gradient(135deg, rgba(56,189,248,0.15), rgba(129,140,248,0.15));
  color: var(--accent); border: 1px solid rgba(56,189,248,0.2);
}
.upgrade-card-price {
  font-size: 1.4rem; font-weight: 700; color: var(--text);
  letter-spacing: -0.02em; line-height: 1;
}
.upgrade-card-price span {
  font-size: 0.65rem; font-weight: 400; color: var(--text-dim);
}
.upgrade-card-features {
  list-style: none; margin-top: 0.6rem; padding: 0;
}
.upgrade-card-features li {
  font-size: 0.68rem; color: var(--text-dim); padding: 2px 0;
  display: flex; align-items: center; gap: 0.4rem;
}
.upgrade-card-features li::before {
  content: ''; width: 3px; height: 3px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0; opacity: 0.6;
}
.upgrade-card-btn {
  display: block; width: 100%; margin-top: 0.75rem;
  padding: 0.45rem 0; border-radius: 8px; border: none;
  font-size: 0.7rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.25s ease;
  letter-spacing: 0.01em;
}
.upgrade-card-btn.outline {
  background: transparent; color: var(--accent);
  border: 1px solid rgba(56,189,248,0.25);
}
.upgrade-card-btn.outline:hover {
  background: rgba(56,189,248,0.06);
  border-color: rgba(56,189,248,0.4);
}
.upgrade-card-btn.fill {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: none;
  box-shadow: 0 2px 12px rgba(56,189,248,0.2);
}
.upgrade-card-btn.fill:hover {
  box-shadow: 0 4px 16px rgba(56,189,248,0.3);
  transform: translateY(-1px);
}

/* Divider between sections */
.render-divider {
  height: 1px; margin: 0 1.25rem;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
}

/* Mobile: stack upgrade cards */
@media (max-width: 480px) {
  .render-upgrade { grid-template-columns: 1fr; }
  .render-progress { padding: 1rem; }
  .render-ad-section { padding: 0 1rem; }
  .render-upgrade { padding: 0.75rem 1rem 1rem; }
}

.gen-result-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.85); border-radius: 14px; opacity: 0;
  transition: opacity 0.5s; pointer-events: none;
}
.gen-result-overlay.visible { opacity: 1; pointer-events: auto; }
.gen-result-overlay img, .gen-result-overlay video {
  max-width: 100%; max-height: 100%; border-radius: 10px; object-fit: contain;
}
.gen-result-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  border-radius: 50%; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.gen-result-actions {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  width: max-content; max-width: calc(100% - 24px);
}
.gen-result-action-row {
  display: flex; gap: 0.5rem;
}
.gen-result-action-row button {
  padding: 0.5rem 1.2rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.6); color: #fff; font-size: 0.8rem; cursor: pointer;
  font-family: inherit; transition: background 0.2s, border-color 0.2s;
}
.gen-result-action-row button:hover { background: rgba(255,255,255,0.1); }

/* HD Upgrade button */
#genUpgradeHDBtn {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4) !important;
  border: 1px solid rgba(14,165,233,0.4) !important;
  color: #fff; font-weight: 600; letter-spacing: 0.02em;
  box-shadow: 0 0 16px rgba(6,182,212,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
  animation: hdBtnAppear 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
#genUpgradeHDBtn:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 24px rgba(6,182,212,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  background: linear-gradient(135deg, #38bdf8, #22d3ee) !important;
}
#genUpgradeHDBtn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}
#genUpgradeHDBtn:disabled {
  opacity: 0.6; cursor: wait;
  background: linear-gradient(135deg, #475569, #64748b) !important;
  border-color: rgba(100,116,139,0.4) !important;
  box-shadow: none;
  animation: hdPulse 1.8s ease-in-out infinite;
}
@keyframes hdBtnAppear {
  from { opacity: 0; transform: translateY(6px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes hdPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.85; }
}

/* Share bar */
.share-bar {
  display: flex; gap: 0.4rem; align-items: center;
  background: rgba(3,3,6,0.75); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 10px;
  padding: 0.35rem 0.5rem;
}
.share-bar-label {
  font-size: 0.65rem; color: rgba(255,255,255,0.35); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em; padding: 0 0.25rem;
  white-space: nowrap;
}
.share-btn {
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.65rem; border-radius: 7px; border: 1px solid transparent;
  background: transparent; color: rgba(255,255,255,0.6); font-size: 0.75rem;
  font-weight: 500; cursor: pointer; font-family: inherit;
  transition: background 0.2s, color 0.2s, border-color 0.2s; white-space: nowrap;
}
.share-btn svg { flex-shrink: 0; }
.share-btn:hover {
  background: rgba(56,189,248,0.1); border-color: rgba(56,189,248,0.25);
  color: var(--accent);
}
.share-btn.copied {
  color: #34d399; border-color: rgba(52,211,153,0.3); background: rgba(52,211,153,0.08);
}
.share-divider {
  width: 1px; height: 18px; background: rgba(255,255,255,0.08); flex-shrink: 0;
}

.mode-row { display: flex; gap: 0.5rem; margin-top: 1rem; }
.mode-chip {
  padding: 0.45rem 1rem; border-radius: 10px; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: all 0.3s; font-family: inherit;
}
.mode-chip.active {
  background: rgba(56,189,248,0.1); border-color: rgba(56,189,248,0.3); color: var(--accent);
}
.mode-chip:hover:not(.active) { border-color: rgba(255,255,255,0.15); color: var(--text); }
.res-chip { padding: 0.3rem 0.7rem; font-size: 0.72rem; }
.ar-chip { padding: 0.3rem 0.7rem; font-size: 0.72rem; display: inline-flex; align-items: center; gap: 5px; }
.ar-icon { display: inline-block; border: 1.5px solid currentColor; border-radius: 2px; }

/* Credit cost indicator */
.credit-cost-display {
  display: inline-block; margin-left: 1rem; font-size: 0.8rem; color: var(--text-dim);
  padding: 0.3rem 0.75rem; border-radius: 8px; background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); vertical-align: middle; transition: color 0.3s;
}
.credit-cost-display.free { color: #22c55e; }

/* History button + panel */
.history-btn {
  padding: 0.45rem 1rem; border-radius: 10px; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: all 0.3s; font-family: inherit; margin-left: auto;
}
.history-btn:hover { border-color: rgba(255,255,255,0.15); color: var(--text); }
.history-btn.active { background: rgba(129,140,248,0.1); border-color: rgba(129,140,248,0.3); color: var(--accent2); }

.history-panel {
  display: none; margin-top: 1rem; padding: 1rem; border-radius: 14px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.02);
  max-height: 300px; overflow-y: auto;
}
.history-panel.open { display: block; }
.history-panel::-webkit-scrollbar { width: 4px; }
.history-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.history-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.75rem;
}
.history-item {
  aspect-ratio: 1; border-radius: 10px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); transition: border-color 0.3s; position: relative;
}
.history-item:hover { border-color: rgba(56,189,248,0.4); }
.history-item img, .history-item video {
  width: 100%; height: 100%; object-fit: cover;
}
.history-item .history-type {
  position: absolute; top: 4px; right: 4px; padding: 2px 6px; border-radius: 4px;
  font-size: 0.6rem; font-weight: 600; text-transform: uppercase;
  background: rgba(0,0,0,0.7); color: var(--accent); backdrop-filter: blur(4px);
}
.history-item .history-prompt {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 4px 6px;
  font-size: 0.6rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.8));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-empty { text-align: center; color: var(--text-dim); font-size: 0.85rem; padding: 2rem; }

/* Chat interface */
.chat-container {
  display: none; flex-direction: column; height: 340px; border-radius: 14px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.02); overflow: hidden;
}
.chat-container.active { display: flex; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.chat-msg {
  max-width: 85%; padding: 0.75rem 1rem; border-radius: 14px; font-size: 0.9rem;
  line-height: 1.6; word-wrap: break-word;
}
.chat-msg.user {
  align-self: flex-end; background: rgba(56,189,248,0.15); border: 1px solid rgba(56,189,248,0.2);
  color: var(--text);
}
.chat-msg.assistant {
  align-self: flex-start; background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: var(--text);
}
.chat-msg.assistant .typing-dots::after {
  content: '...'; animation: dotPulse 1.5s infinite;
}
@keyframes dotPulse { 0%,20% { content: '.'; } 40% { content: '..'; } 60%,100% { content: '...'; } }

/* Upscale drop zone */
.upscale-zone {
  display: none; height: 340px; border-radius: 14px; border: 2px dashed var(--border);
  background: rgba(255,255,255,0.02); flex-direction: column; align-items: center;
  justify-content: center; gap: 1rem; transition: border-color 0.3s, background 0.3s; cursor: pointer;
}
.upscale-zone.active { display: flex; }
.upscale-zone.dragover { border-color: var(--accent); background: rgba(56,189,248,0.05); }
.upscale-zone svg { opacity: 0.4; }
.upscale-zone .upscale-label { color: var(--text-dim); font-size: 0.9rem; }
.upscale-zone .upscale-sublabel { color: var(--text-dim); font-size: 0.75rem; opacity: 0.6; }
.upscale-zone .upscale-preview-img {
  max-width: 90%; max-height: 280px; border-radius: 10px; object-fit: contain; display: none;
}
.upscale-file-input { display: none; }

/* Generated image preview */
.gen-preview {
  margin-top: 1.5rem; height: 340px; border-radius: 14px; overflow: hidden; position: relative;
}
.gen-preview img {
  width: 100%; height: 100%; object-fit: cover;
  animation: previewFade 12s ease-in-out infinite;
}
@keyframes previewFade { 0%,30% { opacity: 1; } 33%,63% { opacity: 0; } 66%,100% { opacity: 1; } }
.gen-preview-stack { position: relative; width: 100%; height: 100%; }
.gen-preview-stack img,
.gen-preview-stack video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.5s ease; border-radius: 10px;
}
.gen-preview-stack img.active,
.gen-preview-stack video.active { opacity: 1; }

/* ---- CAPABILITIES ---- */
.capabilities { padding: 8rem 3rem; max-width: 1200px; margin: 0 auto; }
.cap-header { text-align: center; margin-bottom: 4rem; }
.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

.cap-card {
  position: relative; border-radius: 20px; overflow: hidden; cursor: pointer;
  transition: transform 0.5s ease; aspect-ratio: 3/4;
}
.cap-card:hover { transform: translateY(-8px); }
.cap-card img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
}
.cap-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(3,3,6,0.95) 0%, rgba(3,3,6,0.4) 40%, transparent 100%);
  z-index: 1;
}
.cap-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 2rem; z-index: 2; }
.cap-tag {
  display: inline-block; padding: 0.3rem 0.75rem; border-radius: 6px;
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; margin-bottom: 0.75rem;
}
.cap-tag.cyan { background: rgba(56,189,248,0.2); color: var(--accent); }
.cap-tag.purple { background: rgba(192,132,252,0.2); color: var(--accent3); }
.cap-tag.green { background: rgba(34,197,94,0.2); color: #22c55e; }

.cap-content h3 {
  font-family: 'DM Sans', sans-serif; font-size: 1.75rem; font-weight: 700;
  letter-spacing: -0.03em; margin-bottom: 0.5rem;
}
.cap-content p { font-size: 0.9rem; color: var(--text-dim); line-height: 1.6; }
.cap-stats {
  display: flex; gap: 1.5rem; margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.cap-stat-val { font-family: 'DM Sans', sans-serif; font-size: 1.1rem; font-weight: 700; color: #fff; }
.cap-stat-label { font-size: 0.7rem; color: var(--text-dim); }

/* ---- GALLERY ---- */
.gallery-section { padding: 6rem 0; overflow: hidden; background: rgba(3,3,6,0.9); position: relative; z-index: 1; }
.gallery-header { text-align: center; padding: 0 3rem; margin-bottom: 3rem; }
.gallery-scroll {
  display: flex; gap: 1rem; animation: gallerySlide 60s linear infinite; width: max-content;
}
.gallery-scroll.reverse { animation-direction: reverse; margin-top: 1rem; }
.gallery-item {
  width: 380px; height: 220px; border-radius: 16px; overflow: hidden; flex-shrink: 0;
  position: relative;
}
.gallery-item img, .gallery-item video {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-item:hover img, .gallery-item:hover video { transform: scale(1.05); }
@keyframes gallerySlide { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ---- STATS ---- */
.stats-bar { padding: 4rem 3rem; max-width: 1000px; margin: 0 auto; background: transparent; position: relative; z-index: 1; }
.stats-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 2.5rem 3rem; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); backdrop-filter: blur(10px);
}
.stat-block { text-align: center; }
.stat-num {
  font-family: 'DM Sans', sans-serif; font-size: 2.5rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.25rem; }
.stat-divider { width: 1px; height: 50px; background: var(--border); }

/* ---- PRICING ---- */
.pricing-section { padding: 8rem 3rem; max-width: 1200px; margin: 0 auto; text-align: center; background: transparent; position: relative; z-index: 1; }
.pricing-sub { color: var(--text-dim); font-size: 1rem; margin-bottom: 2rem; }

/* Toggle */
.billing-toggle {
  display: inline-flex; gap: 0; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); padding: 4px; margin-bottom: 3rem;
}
.billing-btn {
  padding: 0.6rem 1.5rem; border: none; border-radius: 9px; background: transparent;
  color: var(--text-dim); font-size: 0.85rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.3s; display: flex; align-items: center; gap: 0.5rem;
}
.billing-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
}
.billing-badge {
  padding: 0.15rem 0.5rem; border-radius: 6px; font-size: 0.65rem; font-weight: 700;
  background: rgba(34,197,94,0.2); color: #22c55e;
}

.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }

.price-card {
  border: 1px solid var(--border); border-radius: 20px; padding: 2rem 1.5rem;
  text-align: left; background: rgba(3,3,6,0.85); backdrop-filter: blur(16px);
  transition: all 0.3s; position: relative;
  display: flex; flex-direction: column;
}
.price-card:hover { border-color: rgba(255,255,255,0.1); }
.price-card.featured { border-color: rgba(56,189,248,0.3); background: linear-gradient(155deg, rgba(3,3,6,0.9), rgba(56,189,248,0.06), rgba(3,3,6,0.85)); backdrop-filter: blur(20px); }
.price-card.featured::before {
  content: 'Most Popular'; position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  padding: 0.25rem 1rem; border-radius: 100px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  font-size: 0.7rem; font-weight: 700; color: #fff; white-space: nowrap;
}
.price-tier { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 0.25rem; }
.price-tagline { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 1rem; }
.price-amount { font-family: 'DM Sans', sans-serif; font-size: 3rem; font-weight: 700; letter-spacing: -0.04em; color: #fff; }
.price-amount span { font-size: 1rem; color: var(--text-dim); font-weight: 400; }
.price-annual-note { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.25rem; min-height: 1.1em; }
.credit-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin: 1rem 0; padding: 0.6rem 1rem; border-radius: 12px;
  background: rgba(56,189,248,0.06); border: 1px solid rgba(56,189,248,0.1);
}
.credit-badge strong {
  font-family: 'DM Sans', sans-serif; font-size: 1.2rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.credit-badge span { font-size: 0.75rem; color: var(--text-dim); }
.price-card ul { list-style: none; margin-bottom: 1.5rem; flex: 1; }
.price-card li { padding: 0.35rem 0; font-size: 0.8rem; color: var(--text-dim); display: flex; align-items: center; gap: 0.6rem; }
.price-check {
  width: 16px; height: 16px; border-radius: 50%; background: rgba(56,189,248,0.1);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--accent); font-size: 0.6rem;
}
.price-btn {
  width: 100%; padding: 0.75rem; border-radius: 12px; font-size: 0.9rem;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.3s;
}
.price-btn.outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.price-btn.outline:hover { border-color: rgba(255,255,255,0.2); background: var(--surface-hover); }
.price-btn.fill { background: linear-gradient(135deg, var(--accent), var(--accent2)); border: none; color: #fff; }

/* Credits table */
.credits-accordion { max-width: 900px; margin: 3rem auto 0; text-align: left; }
.credits-toggle {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 1rem; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--text); font-size: 0.9rem; font-weight: 500;
  cursor: pointer; font-family: inherit; transition: all 0.3s;
}
.credits-toggle:hover { border-color: rgba(255,255,255,0.15); }
.credits-toggle .arrow { transition: transform 0.3s; font-size: 0.7rem; }
.credits-toggle.open .arrow { transform: rotate(180deg); }
.credits-panel {
  max-height: 0; overflow: hidden; transition: max-height 0.4s ease;
  border: 1px solid transparent; border-radius: 0 0 14px 14px; margin-top: -1px;
}
.credits-panel.open { max-height: 800px; border-color: var(--border); border-top: none; }
.credits-panel-inner { padding: 1.5rem; }
.credits-panel h4 {
  font-family: 'DM Sans', sans-serif; font-size: 1.1rem; font-weight: 700;
  margin-bottom: 1rem; text-align: center;
}
.credits-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 1.5rem;
}
.credit-row {
  display: flex; justify-content: space-between; padding: 0.5rem 0.75rem; border-radius: 8px;
  background: rgba(255,255,255,0.02); font-size: 0.85rem;
}
.credit-row span:first-child { color: var(--text-dim); }
.credit-row span:last-child { color: var(--accent); font-weight: 600; }
.credit-example {
  padding: 1rem 1.5rem; border-radius: 12px; background: rgba(56,189,248,0.04);
  border: 1px solid rgba(56,189,248,0.08);
}
.credit-example h5 { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text); }
.credit-example-grid { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.credit-example-grid span { font-size: 0.85rem; color: var(--text-dim); }

/* FAQ */
.faq-section { max-width: 800px; margin: 4rem auto 0; text-align: left; }
.faq-section h3 {
  font-family: 'DM Sans', sans-serif; font-size: 1.5rem; font-weight: 700;
  text-align: center; margin-bottom: 2rem;
}
.faq-item {
  border-bottom: 1px solid var(--border); padding: 1.25rem 0;
}
.faq-item h4 { font-size: 0.95rem; font-weight: 600; color: #fff; margin-bottom: 0.5rem; }
.faq-item p { font-size: 0.85rem; color: var(--text-dim); line-height: 1.7; }

/* ---- AUTH MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center;
  overflow-y: auto; padding: 2rem 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #0c0c14; border: 1px solid var(--border); border-radius: 24px;
  padding: 2.5rem 2rem; width: 100%; max-width: 420px; position: relative;
  max-height: 90vh; overflow-y: auto; margin: auto;
}
.modal-close {
  position: sticky; top: 0; float: right; background: none; border: none;
  color: var(--text-dim); font-size: 1.5rem; cursor: pointer; line-height: 1;
  z-index: 10; margin: -0.5rem -0.5rem 0 0;
}
.modal-logo {
  width: 48px; height: 48px; border-radius: 12px; margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Sans', sans-serif; font-size: 1.5rem; font-weight: 700; color: #fff;
}
.modal-box h2 {
  font-family: 'DM Sans', sans-serif; font-size: 1.5rem; font-weight: 700;
  text-align: center; margin-bottom: 0.25rem;
}
.modal-subtitle { text-align: center; color: var(--text-dim); font-size: 0.9rem; margin-bottom: 1.5rem; }
.modal-field { margin-bottom: 1rem; }
.modal-field label { display: block; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.4rem; }
.modal-field input {
  width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 10px;
  background: rgba(255,255,255,0.03); color: var(--text); font-size: 0.9rem;
  font-family: inherit; outline: none; box-sizing: border-box; transition: border-color 0.3s;
}
.modal-field input:focus { border-color: rgba(56,189,248,0.4); }
.modal-submit {
  width: 100%; padding: 0.85rem; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--accent3));
  background-size: 200% 200%; color: #fff; font-size: 1rem; font-weight: 600;
  cursor: pointer; font-family: inherit; margin-top: 0.5rem; transition: opacity 0.3s;
}
.modal-submit:disabled { opacity: 0.5; cursor: wait; }
.modal-error {
  padding: 0.6rem; border-radius: 8px; background: rgba(255,69,58,0.1);
  color: #ff453a; font-size: 0.8rem; margin-bottom: 1rem; display: none; text-align: center;
}
.modal-error.show { display: block; }
.modal-success {
  padding: 0.6rem; border-radius: 8px; background: rgba(34,197,94,0.1);
  color: #22c55e; font-size: 0.8rem; margin-bottom: 1rem; display: none; text-align: center;
}
.modal-success.show { display: block; }
.modal-switch { text-align: center; margin-top: 1.25rem; font-size: 0.85rem; color: var(--text-dim); }
.modal-switch button {
  background: none; border: none; color: var(--accent); font-size: 0.85rem;
  cursor: pointer; font-family: inherit; text-decoration: underline;
}
.social-login-btns { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }
.social-btn {
  width: 100%; padding: 0.7rem 1rem; border: 1px solid var(--border); border-radius: 10px;
  background: rgba(255,255,255,0.03); color: var(--text); font-size: 0.9rem;
  font-family: inherit; cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 0.6rem; transition: background 0.2s, border-color 0.2s;
}
.social-btn:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.15); }
.social-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.social-divider {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem;
  color: var(--text-dim); font-size: 0.8rem;
}
.social-divider::before, .social-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.social-more-btns {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; justify-content: center;
}
.social-icon-btn {
  width: 48px; height: 48px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03); cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: all 0.25s; position: relative;
}
.social-icon-btn:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.18); transform: translateY(-2px); }
.social-icon-btn svg { width: 20px; height: 20px; }
.social-icon-btn .social-icon-tooltip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: rgba(20,20,30,0.95); color: #fff; font-size: 0.68rem; padding: 3px 8px;
  border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 0.2s; font-family: inherit; border: 1px solid rgba(255,255,255,0.1);
}
.social-icon-btn:hover .social-icon-tooltip { opacity: 1; }
/* User menu when logged in */
.user-menu { display: flex; align-items: center; gap: 0.75rem; }
.user-credits {
  display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.75rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.8rem; color: var(--accent); font-weight: 600;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #fff; cursor: pointer;
}

/* ---- FINAL CTA ---- */
.final-cta { padding: 8rem 3rem; text-align: center; position: relative; overflow: hidden; }
.final-cta::before {
  content: ''; position: absolute; top: 50%; left: 50%; width: 800px; height: 800px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(56,189,248,0.08), transparent 70%); pointer-events: none;
}
.final-cta h2 {
  font-family: 'DM Sans', sans-serif; font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700; letter-spacing: -0.04em; margin-bottom: 1rem; position: relative;
}
.final-cta p { color: var(--text-dim); font-size: 1.1rem; margin-bottom: 2rem; position: relative; }

/* ---- FOOTER ---- */
footer {
  border-top: 1px solid var(--border); padding: 3rem;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(3,3,6,0.92); backdrop-filter: blur(16px);
  position: relative; z-index: 1;
}
footer .copy { font-size: 0.8rem; color: var(--text-dim); }
footer .footer-links { display: flex; gap: 1.5rem; list-style: none; }
footer .footer-links a { font-size: 0.8rem; color: var(--text-dim); text-decoration: none; transition: color 0.3s; }
footer .footer-links a:hover { color: #fff; }

/* ---- SCROLL REVEAL ---- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---- RESPONSIVE ---- */

/* Tablet */
@media (max-width: 1100px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .cap-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
/* Hamburger menu */
.hamburger { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 0.5rem; z-index: 100; }
.hamburger svg { width: 24px; height: 24px; }
.mobile-menu {
  display: none; position: fixed; inset: 0; z-index: 9998; background: rgba(12,12,20,0.97);
  backdrop-filter: blur(12px); flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { color: var(--text); text-decoration: none; font-size: 1.2rem; font-family: inherit; opacity: 0.8; transition: opacity 0.2s; }
.mobile-menu a:hover { opacity: 1; }
.mobile-menu-close { position: absolute; top: 1rem; right: 1.25rem; background: none; border: none; color: var(--text); font-size: 2rem; cursor: pointer; }
@media (max-width: 768px) {
  /* Nav */
  nav { padding: 1rem 1.25rem; }
  .nav-links { display: none; }
  .hamburger { display: block; }
  .nav-actions { gap: 0.5rem; }
  .btn-ghost, .btn-primary { padding: 0.5rem 1rem; font-size: 0.8rem; }

  /* Hero */
  .hero { min-height: 100svh; }
  .aurora-blob:nth-child(1) { width: 300px; height: 300px; }
  .aurora-blob:nth-child(2) { width: 250px; height: 250px; }
  .aurora-blob:nth-child(3) { width: 200px; height: 200px; }
  .scroll-hint { bottom: 1.5rem; }
  .ghostwriter { width: 94%; max-width: 480px; }
  .ghostwriter-box { padding: 0.75rem 1rem; border-radius: 16px; }
  .ghostwriter-text { font-size: 0.7rem; }
  .ghostwriter-scene { font-size: 0.55rem; }

  /* Demo / Prompt */
  .demo-section { padding: 4rem 1.25rem; }
  .demo-header { margin-bottom: 2.5rem; }
  .section-h2 { font-size: clamp(1.6rem, 6vw, 2.5rem); }
  .prompt-body { padding: 1rem; }
  .prompt-input-row {
    flex-direction: column; gap: 0.75rem; padding: 0.75rem;
    align-items: stretch;
  }
  .prompt-input-row input { font-size: 0.9rem; min-height: 2rem; }
  .prompt-icon { display: none; }
  .prompt-generate { width: 100%; text-align: center; padding: 0.7rem 1rem; }

  /* Mode chips — horizontal scroll on mobile */
  .mode-row {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 4px; gap: 0.4rem;
  }
  .mode-row::-webkit-scrollbar { display: none; }
  .mode-chip { white-space: nowrap; flex-shrink: 0; font-size: 0.75rem; padding: 0.4rem 0.8rem; }
  .credit-cost-display { margin-left: 0.5rem; font-size: 0.72rem; padding: 0.25rem 0.6rem; flex-shrink: 0; }
  .history-btn { font-size: 0.72rem; padding: 0.4rem 0.8rem; flex-shrink: 0; }

  /* Video format options */
  .video-options .mode-row { gap: 4px; }
  .res-chip { padding: 0.25rem 0.6rem; font-size: 0.68rem; }

  /* Preview areas */
  .gen-preview { height: 240px; margin-top: 1rem; }
  .chat-container { height: 280px; }
  .upscale-zone { height: 240px; }
  /* Share bar — compact on mobile */
  .share-bar { flex-wrap: wrap; gap: 0.3rem; }
  .share-btn { padding: 0.3rem 0.5rem; font-size: 0.7rem; }
  .share-btn span { display: none; }
  .share-bar-label { font-size: 0.6rem; }
  .gen-result-action-row { gap: 0.4rem; }
  .gen-result-action-row button { padding: 0.45rem 0.9rem; font-size: 0.75rem; }
  .upscale-zone svg { width: 36px; height: 36px; }
  .upscale-zone .upscale-label { font-size: 0.8rem; text-align: center; padding: 0 1rem; }

  /* History grid */
  .history-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 0.5rem; }
  .history-panel { max-height: 220px; }

  /* Capabilities */
  .capabilities { padding: 4rem 1.25rem; }
  .cap-header { margin-bottom: 2.5rem; }
  .cap-grid { grid-template-columns: 1fr; gap: 1rem; }
  .cap-card { aspect-ratio: 16/10; }
  .cap-content { padding: 1.25rem; }
  .cap-content h3 { font-size: 1.3rem; }
  .cap-content p { font-size: 0.82rem; }
  .cap-stats { gap: 1rem; }
  .cap-stat-val { font-size: 0.95rem; }

  /* Gallery */
  .gallery-section { padding: 4rem 0; }
  .gallery-header { padding: 0 1.25rem; margin-bottom: 2rem; }
  .gallery-item { width: 260px; height: 160px; border-radius: 12px; }

  /* Stats */
  .stats-bar { padding: 2rem 1.25rem; }
  .stats-inner {
    flex-direction: column; gap: 1.5rem;
    padding: 2rem 1.5rem; border-radius: 16px;
  }
  .stat-num { font-size: 2rem; }
  .stat-divider { width: 50px; height: 1px; }

  /* Pricing */
  .pricing-section { padding: 4rem 1.25rem; }
  .pricing-sub { font-size: 0.9rem; }
  .pricing-grid { grid-template-columns: 1fr; gap: 1rem; }
  .price-card { padding: 1.75rem 1.25rem; border-radius: 16px; }
  .price-amount { font-size: 2.5rem; }
  .billing-toggle { margin-bottom: 2rem; }
  .billing-btn { padding: 0.5rem 1rem; font-size: 0.8rem; }

  /* Credits accordion */
  .credits-accordion { margin-top: 2rem; }
  .credits-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .credit-example-grid { grid-template-columns: 1fr; gap: 0.25rem; }
  .credits-toggle { font-size: 0.85rem; padding: 0.75rem; }

  /* FAQ */
  .faq-section { margin-top: 2rem; padding: 0 0.5rem; }
  .faq-section h3 { font-size: 1.1rem; }
  .faq-item { padding: 1rem; }
  .faq-item h4 { font-size: 0.88rem; }
  .faq-item p { font-size: 0.8rem; }

  /* Final CTA */
  .final-cta { padding: 5rem 1.25rem; }
  .final-cta h2 { font-size: clamp(1.8rem, 7vw, 3rem); }
  .final-cta p { font-size: 0.95rem; }

  /* Footer */
  footer {
    flex-direction: column; gap: 1rem; padding: 2rem 1.25rem; text-align: center;
  }
  footer .footer-links { flex-wrap: wrap; justify-content: center; gap: 1rem; }

  /* Auth modal */
  .modal-box { width: 92%; max-width: 400px; padding: 1.75rem 1.25rem; border-radius: 16px; }
  .modal-logo { width: 40px; height: 40px; font-size: 1.2rem; }
  .modal-box h2 { font-size: 1.3rem; }
  .modal-field input { padding: 0.65rem 0.85rem; font-size: 0.9rem; }
  .modal-submit { padding: 0.7rem; font-size: 0.9rem; }
}

/* Small phones */
@media (max-width: 380px) {
  .ghostwriter-text { font-size: 0.65rem; }
  .prompt-top { padding: 0.75rem 1rem; }
  .prompt-title { font-size: 0.65rem; }
  .mode-chip { font-size: 0.7rem; padding: 0.35rem 0.65rem; }
  .price-amount { font-size: 2rem; }
  .stat-num { font-size: 1.6rem; }
  .cap-card { aspect-ratio: 3/2; }
}

/* ═══════════════════════════════════════════════ */
/* ═══  ANIMATIONS — Cool effects layer  ═══════ */
/* ═══════════════════════════════════════════════ */

/* Cursor glow follower */
.cursor-glow { display: none; }

/* Logo glitch on hover — digital distortion for pixel font */
.logo { position: relative; }
.logo:hover { animation: logoGlitch 0.5s ease-in-out; }
@keyframes logoGlitch {
  0%, 100% { transform: translate(0); filter: none; }
  8% { transform: translate(-2px, 1px) skewX(-1deg); filter: hue-rotate(90deg); }
  16% { transform: translate(2px, -1px) skewX(1deg); filter: hue-rotate(-90deg); }
  24% { transform: translate(-1px, 2px); clip-path: inset(20% 0 50% 0); }
  32% { transform: translate(1px, -1px); clip-path: inset(60% 0 10% 0); }
  40% { transform: translate(-2px, 0); filter: hue-rotate(180deg); clip-path: none; }
  48% { transform: translate(0); filter: none; }
}

/* CRT scan lines on hero — removed */
.hero::before { display: none; }

/* Ghostwriter breathing glow */
@keyframes ghostBreathe {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(0,0,0,0.3),
      inset 0 1px 0 rgba(255,255,255,0.12),
      inset 0 -1px 0 rgba(255,255,255,0.04),
      0 0 0 rgba(56,189,248,0);
    border-color: rgba(255,255,255,0.15);
  }
  50% {
    box-shadow: 0 8px 32px rgba(0,0,0,0.3),
      inset 0 1px 0 rgba(255,255,255,0.12),
      inset 0 -1px 0 rgba(255,255,255,0.04),
      0 0 25px rgba(56,189,248,0.08);
    border-color: rgba(56,189,248,0.2);
  }
}
.ghostwriter-box { animation: ghostBreathe 4s ease-in-out infinite; }

/* Nav staggered entrance */
.nav-links li {
  opacity: 0; animation: navSlideIn 0.5s ease-out forwards;
}
.nav-links li:nth-child(1) { animation-delay: 0.15s; }
.nav-links li:nth-child(2) { animation-delay: 0.25s; }
.nav-links li:nth-child(3) { animation-delay: 0.35s; }
.nav-links li:nth-child(4) { animation-delay: 0.45s; }
.nav-links li:nth-child(5) { animation-delay: 0.55s; }
.nav-links li:nth-child(6) { animation-delay: 0.65s; }
.nav-links li:nth-child(7) { animation-delay: 0.75s; }
@keyframes navSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.nav-actions {
  opacity: 0; animation: navSlideIn 0.5s 0.3s ease-out forwards;
}

/* Enhanced section reveals */
.reveal { transform: translateY(40px) scale(0.97); }
.reveal.visible { transform: translateY(0) scale(1); }

/* 3D tilt perspective on cap cards */
.cap-card { transform-style: preserve-3d; perspective: 800px; }
.cap-card .cap-content { transform: translateZ(20px); }
.cap-card .cap-overlay { transition: opacity 0.4s; }
.cap-card:hover .cap-overlay { opacity: 0.85; }

/* Pricing card hover glow */
.price-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.price-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 30px rgba(56,189,248,0.06);
}
.price-card.featured:hover {
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 40px rgba(56,189,248,0.12);
}

/* Gallery hover glow enhancement */
.gallery-item {
  border: 1px solid transparent; transition: all 0.4s ease;
}
.gallery-item:hover {
  border-color: rgba(56,189,248,0.2);
  box-shadow: 0 8px 30px rgba(56,189,248,0.08);
}

/* Shimmer gradient text for headings */
.shimmer-text {
  background: linear-gradient(90deg,
    #e0e0ec 0%, var(--accent) 30%, var(--accent2) 50%, var(--accent3) 70%, #e0e0ec 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: textShimmer 6s ease-in-out infinite;
}
@keyframes textShimmer {
  0% { background-position: 100% 0; }
  50% { background-position: 0% 0; }
  100% { background-position: 100% 0; }
}

/* ─── VIDEO GALLERY ─── */
.video-gallery-section { padding: 2rem 0 6rem; overflow: hidden; background: rgba(3,3,6,0.85); position: relative; z-index: 1; }
.video-gallery-header { text-align: center; padding: 0 3rem; margin-bottom: 3rem; }
.video-gallery-rows { display: flex; flex-direction: column; gap: 1.25rem; }
.video-gallery-scroll {
  display: flex; gap: 1.25rem;
  animation: vgSlide 55s linear infinite;
  width: max-content;
}
.video-gallery-scroll.reverse {
  animation-direction: reverse;
  animation-duration: 60s;
}
.video-gallery-item {
  width: 360px; height: 210px; border-radius: 16px; overflow: hidden;
  flex-shrink: 0; position: relative; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.video-gallery-item:hover {
  border-color: rgba(56,189,248,0.3);
  transform: scale(1.04);
  box-shadow: 0 16px 48px rgba(56,189,248,0.1), 0 0 0 1px rgba(56,189,248,0.15);
}
.video-gallery-item video {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.video-gallery-item:hover video { transform: scale(1.08); }
.video-gallery-item .vg-overlay { display: none; }
.vg-label, .vg-play { display: none; }
@keyframes vgSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.video-gallery-tag {
  position: absolute; top: 10px; right: 10px;
  padding: 0.2rem 0.5rem; border-radius: 6px;
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; backdrop-filter: blur(8px);
  background: rgba(192,132,252,0.2); color: var(--accent3);
  border: 1px solid rgba(192,132,252,0.15);
}

/* CTA button pulse */
.final-cta .btn-primary {
  animation: ctaPulse 3s ease-in-out infinite;
}
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56,189,248,0.3); }
  50% { box-shadow: 0 0 20px 4px rgba(56,189,248,0.15); }
}

/* Mobile adjustments for video gallery */
@media (max-width: 768px) {
  .video-gallery-section { padding: 2rem 0 4rem; }
  .video-gallery-header { padding: 0 1.25rem; margin-bottom: 2rem; }
  .video-gallery-item { width: 240px; height: 140px; border-radius: 12px; }
  .video-gallery-rows { gap: 0.75rem; }
  .cursor-glow { display: none; }
}