/* ============================================================================
   AIStoryToVideo.com — Linear / Runway Gen-3 / Luma Dream Machine Dark Cinema UI
   Zero-Emoji Vector Aesthetic · Progressive Disclosure · Responsive Grid
   ============================================================================ */

:root {
  --bg-base: #06070a;
  --bg-surface: #0c0e14;
  --bg-elevated: #12151f;
  --bg-glass: rgba(16, 19, 28, 0.78);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(99, 102, 241, 0.45);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-glow: rgba(99, 102, 241, 0.22);
  --success: #10b981;
  --warning: #f59e0b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 80% 45% at 50% -10%, rgba(99, 102, 241, 0.15), transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% 15%, rgba(139, 92, 246, 0.08), transparent 65%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: #a5b4fc;
  text-decoration: none;
  transition: color 0.18s ease;
}

a:hover {
  color: #ffffff;
}

/* ============================================================================
   1. HEADER & NAVIGATION
   ============================================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(6, 7, 10, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-wrap {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.brand-text small {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.85em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 4px;
  border-radius: 999px;
}

.nav-links a {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.16s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a.active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
}

.credit-pill:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.credit-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.btn-upgrade-sm {
  padding: 7px 15px;
  border-radius: 999px;
  background: #f8fafc;
  color: #06070a;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-upgrade-sm:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

/* ============================================================================
   2. HERO SECTION
   ============================================================================ */
.hero {
  text-align: center;
  padding: 44px 0 28px;
  max-width: 760px;
  margin: 0 auto;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.24);
  color: #a5b4fc;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #818cf8;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================================================================
   3. SPOTLIGHT PROMPT DOCK (Human-Centric First Screen)
   ============================================================================ */
.studio-shell {
  margin-bottom: 64px;
}

.spotlight-dock {
  max-width: 920px;
  margin: 0 auto 36px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow:
    0 24px 60px -15px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.spotlight-dock:focus-within {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow:
    0 24px 60px -15px rgba(0, 0, 0, 0.75),
    0 0 0 3px rgba(99, 102, 241, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.prompt-textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.04rem;
  line-height: 1.55;
  resize: none;
  outline: none;
  padding: 4px 4px 14px;
}

.prompt-textarea::placeholder {
  color: var(--text-muted);
}

/* Visual Style Pill Selector Bar */
.style-pills-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.bar-label {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-right: 6px;
}

.style-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.style-card:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
}

.style-card.active {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(99, 102, 241, 0.55);
  color: #ffffff;
  font-weight: 600;
}

/* Inline Parameters & Primary Generate Button */
.dock-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
}

.dock-params {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.param-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 5px 10px;
}

.param-pill label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.studio-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.81rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.studio-select option {
  background: #12151f;
  color: #f8fafc;
}

.btn-icon-only {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-only:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.btn-primary-generate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.45);
  transition: all 0.16s ease;
}

.btn-primary-generate:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -4px rgba(99, 102, 241, 0.6);
}

.btn-primary-generate:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* Inspiration Chips Row */
.inspiration-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

.ins-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.preset-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-chip {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.btn-inspire {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #a5b4fc;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-inspire:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* ============================================================================
   4. UNIFIED STORYBOARD HEADER & ACTION TOOLBAR
   ============================================================================ */
.storyboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.sb-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.sb-title-row h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.anchor-seed {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 3px 9px;
  border-radius: 6px;
}

.btn-toggle-anchor {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-toggle-anchor:hover {
  background: rgba(16, 185, 129, 0.15);
}

.sb-cta-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-render-free,
.btn-render-full,
.btn-toolbar-ghost {
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-render-free {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.btn-render-free:hover {
  background: rgba(255, 255, 255, 0.11);
}

.btn-render-full {
  background: #f8fafc;
  border: 1px solid #ffffff;
  color: #06070a;
}

.btn-render-full:hover {
  background: #e2e8f0;
}

.btn-toolbar-ghost {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 500;
}

.btn-toolbar-ghost:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

/* Collapsible Character Anchor Drawer */
.anchor-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.anchor-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.anchor-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
}

/* ============================================================================
   5. CLEAN 4-SCENE CINEMA GRID (Progressive Disclosure)
   ============================================================================ */
.storyboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.scene-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.scene-card:hover {
  border-color: var(--border-strong);
}

.scene-card-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.shot-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.shot-badge.badge-active {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
}

.scene-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #050608;
  overflow: hidden;
}

.scene-canvas,
.real-media-img,
.real-media-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scene-lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 7, 10, 0.68);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
}

.scene-lock-overlay.hidden {
  display: none;
}

.lock-pill {
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 10px;
  border-radius: 999px;
}

.btn-unlock-scene {
  background: #f8fafc;
  color: #06070a;
  border: none;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

/* Clean Card Footer + Collapsible Drawer */
.scene-summary-bar {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.scene-narration-preview {
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.35rem;
}

.scene-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.btn-scene-sm {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 0.73rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s ease;
  text-align: center;
}

.btn-scene-sm:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* On-Demand Scene Edit Drawer (Hidden by Default) */
.scene-drawer {
  padding: 12px 14px 14px;
  background: rgba(0, 0, 0, 0.32);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scene-drawer[hidden] {
  display: none !important;
}

.scene-field-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.scene-prompt-text,
.scene-voice-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 7px 9px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  outline: none;
}

.scene-prompt-text:focus,
.scene-voice-input:focus {
  border-color: var(--accent-primary);
}

/* ============================================================================
   6. PROGRESS BAR & COLLAPSIBLE MASTER FILM DRAWER
   ============================================================================ */
.job-progress-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.job-progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 500;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.job-progress-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
}

.job-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.3s ease;
}

.master-player-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 20px;
}

.master-player-panel[hidden] {
  display: none !important;
}

.master-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.master-player-title {
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 700;
}

.master-player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-dl-video,
.btn-dl-sub {
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.btn-dl-video {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  font-weight: 600;
}

.master-stage-wrap {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  align-items: center;
}

.master-canvas-box {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #000;
}

.master-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.master-timeline-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-scene-pill {
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.timeline-scene-pill.active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}

/* Compact Export & Notification Bar */
.export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.export-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
}

.export-title {
  font-weight: 600;
  color: var(--text-primary);
}

.export-sub {
  color: var(--text-secondary);
}

.export-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.email-input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--text-primary);
  font-size: 0.8rem;
  width: 220px;
  outline: none;
}

.btn-email-notify {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}

/* ============================================================================
   7. EDITORIAL SEO CONTENT SECTIONS
   ============================================================================ */
.content-section {
  padding: 44px 0;
  border-top: 1px solid var(--border-subtle);
}

.content-section h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.content-section p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  max-width: 880px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

.stat-val {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #818cf8;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.step-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.step-card p {
  font-size: 0.88rem;
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.comparison-table th,
.comparison-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.comparison-table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
}

.features-grid,
.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.feature-card,
.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

.feature-card h3,
.faq-item h3 {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feature-card p,
.faq-item p {
  font-size: 0.86rem;
  margin-bottom: 0;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.matrix-card {
  display: block;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all 0.16s ease;
}

.matrix-card:hover,
.matrix-card-active {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.06);
}

.matrix-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  color: #a5b4fc;
  margin-bottom: 6px;
}

.matrix-card h3 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.matrix-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ============================================================================
   8. MODALS & FOOTER
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 4, 7, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8);
}

.modal-card-wide {
  max-width: 780px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.modal-card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.modal-perks {
  list-style: none;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.modal-perks li::before {
  content: "• ";
  color: #818cf8;
  font-weight: bold;
}

.btn-google-oauth {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 10px;
  background: #ffffff;
  color: #090a0f;
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.modal-footnote {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
}

.pricing-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.price-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.price-card-featured {
  border-color: rgba(99, 102, 241, 0.55);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, var(--bg-surface) 100%);
}

.price-ribbon {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: #a5b4fc;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.price-amount {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  margin: 6px 0 4px;
}

.price-amount span {
  font-size: 0.84rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.price-credits {
  font-size: 0.8rem;
  color: #34d399;
  margin-bottom: 14px;
}

.price-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  flex: 1;
}

.price-features li::before {
  content: "— ";
  color: #6366f1;
}

.btn-checkout-pro,
.btn-checkout-pack {
  width: 100%;
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-checkout-pro {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  border: none;
}

.btn-checkout-pack {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  border: 1px solid var(--border-strong);
}

.checkout-status-msg {
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  font-size: 0.8rem;
  text-align: center;
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 36px 0;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand p {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-top: 4px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.8rem;
}

/* ============================================================================
   9. RESPONSIVE BREAKPOINTS
   ============================================================================ */
@media (max-width: 1024px) {
  .storyboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps-grid {
    grid-template-columns: 1fr;
  }
  .master-stage-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .nav-links {
    display: none;
  }
  .storyboard-grid,
  .features-grid,
  .faq-grid,
  .pricing-cards-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .dock-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-primary-generate {
    width: 100%;
    justify-content: center;
  }
}
