/* ==========================================================================
   ECOMVIDEO FACTORY — Design System
   Inherits dark-room editorial aesthetic from OpenMontage Backlot
   ========================================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
  /* Backgrounds */
  --bg:             #08080b;
  --bg-elevated:    #0c0c10;
  --surface:        #111115;
  --surface-2:      #18181d;
  --surface-3:      #1e1e24;

  /* Borders */
  --border:         #222228;
  --border-soft:    #1a1a1f;
  --border-hover:   #2e2e38;

  /* Text */
  --text:           #e8e8ed;
  --text-2:         #a0a0ab;
  --text-3:         #5f5f6b;

  /* Brand Accent — purple gradient for e-commerce */
  --accent:         #7c5cfc;
  --accent-2:       #a855f7;
  --accent-glow:    rgba(124, 92, 252, 0.18);
  --accent-glow-strong: rgba(124, 92, 252, 0.35);
  --accent-gradient: linear-gradient(135deg, #6c5ce7 0%, #a855f7 100%);

  /* Semantic */
  --green:          #4fc283;
  --green-dim:      rgba(79, 194, 131, 0.12);
  --amber:          #f0a83c;
  --amber-dim:      rgba(240, 168, 60, 0.14);
  --red:            #e5544b;
  --red-dim:        rgba(229, 84, 75, 0.12);
  --blue:           #6aa1ff;

  /* Pipeline stage colors */
  --stage-done:     #4fc283;
  --stage-active:   #f0a83c;
  --stage-pending:  #3a3a44;
  --stage-failed:   #e5544b;

  /* Typography */
  --sans:           'Inter', 'Noto Sans SC', -apple-system, sans-serif;
  --mono:           'JetBrains Mono', ui-monospace, monospace;

  /* Spacing */
  --page-pad:       28px;
  --section-gap:    80px;
  --card-gap:       20px;
  --panel-pad:      24px;

  /* Radii */
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --radius-xl:      20px;
  --radius-pill:    99px;

  /* Shadows */
  --shadow-sm:      0 1px 2px rgba(0,0,0,.4);
  --shadow-md:      0 4px 20px rgba(0,0,0,.5);
  --shadow-lg:      0 12px 48px rgba(0,0,0,.65);
  --shadow-glow:    0 0 40px var(--accent-glow);

  /* Transitions */
  --ease-out:       cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:    cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:       150ms;
  --dur-normal:     300ms;
  --dur-slow:       500ms;

  /* Layout */
  --max-width:      1440px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

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

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle grain texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover { color: var(--accent-2); }

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--mono);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: 3.2rem; letter-spacing: -0.03em; }
h2 { font-size: 2rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

.section-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-2);
  font-size: 1.05rem;
  max-width: 560px;
  line-height: 1.65;
}

/* ==========================================================================
   Layout Utilities
   ========================================================================== */

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.section {
  padding: var(--section-gap) 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header .section-label { margin-bottom: 12px; }
.section-header .section-desc { margin: 0 auto; }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--card-gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--card-gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--card-gap); }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--card-gap); }

@media (max-width: 1024px) {
  .grid-3, .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 8, 11, 0.82);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--border-soft);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.nav-brand:hover { color: var(--text); }

.nav-brand .brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gradient);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--dur-fast) var(--ease-out);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--surface-2);
}

.nav-cta {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  background: var(--accent-gradient);
  color: #fff;
  transition: all var(--dur-fast) var(--ease-out);
  text-decoration: none;
}

.nav-cta:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
  color: #fff;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
  box-shadow: 0 4px 24px var(--accent-glow-strong);
  transform: translateY(-1px);
  color: #fff;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-hover);
  color: var(--text);
}

.btn-ghost {
  color: var(--text-2);
  padding: 8px 16px;
  font-size: 0.8rem;
}

.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

.btn-lg {
  padding: 16px 36px;
  font-size: 1rem;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.75rem;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--panel-pad);
  transition: all var(--dur-normal) var(--ease-out);
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* ==========================================================================
   Chips & Badges
   ========================================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface-2);
  transition: all var(--dur-fast) var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.chip.active {
  border-color: var(--accent);
  color: var(--accent-2);
  background: var(--accent-glow);
}

.chip.accent {
  background: var(--accent-glow);
  border-color: rgba(124, 92, 252, 0.3);
  color: var(--accent-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-green { background: var(--green-dim); color: var(--green); }
.badge-amber { background: var(--amber-dim); color: var(--amber); }
.badge-red   { background: var(--red-dim); color: var(--red); }
.badge-accent { background: var(--accent-glow); color: var(--accent-2); }

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  position: relative;
  padding: 100px 0 80px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-2);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  line-height: 1.15;
}

.hero h1 .gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-2);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .hero { padding: 60px 0 50px; }
}

/* ==========================================================================
   Metrics Strip
   ========================================================================== */

.metrics-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 28px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

.metric {
  text-align: center;
}

.metric-value {
  font-family: var(--mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.metric-value .accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-top: 4px;
}

@media (max-width: 640px) {
  .metrics-strip { gap: 24px; }
}

/* ==========================================================================
   Pipeline Cards (Index page)
   ========================================================================== */

.pipeline-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.pipeline-card .card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.pipeline-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.pipeline-card .card-desc {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 16px;
}

.pipeline-card .card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.pipeline-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pipeline-card .card-arrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--dur-fast) var(--ease-out);
}

.pipeline-card:hover .card-arrow { gap: 10px; }

.pipeline-card .stage-count {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-3);
}

/* ==========================================================================
   Steps (How it works)
   ========================================================================== */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--card-gap);
  position: relative;
}

.step-card {
  text-align: center;
  padding: 32px var(--panel-pad);
  position: relative;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  margin: 0 auto 20px;
}

.step-card h4 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.55;
}

@media (max-width: 768px) {
  .steps { grid-template-columns: 1fr; }
  .step-card { padding: 24px; }
}

/* ==========================================================================
   Comparison Table
   ========================================================================== */

.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.compare-table th,
.compare-table td {
  padding: 16px 20px;
  text-align: left;
  font-size: 0.9rem;
}

.compare-table thead th {
  background: var(--surface-2);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}

.compare-table tbody td {
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-2);
}

.compare-table tbody tr:last-child td { border-bottom: none; }

.compare-table .col-ours {
  color: var(--accent-2);
  font-weight: 500;
}

.compare-table .check { color: var(--green); }
.compare-table .cross { color: var(--red); }

@media (max-width: 640px) {
  .compare-table { font-size: 0.78rem; }
  .compare-table th, .compare-table td { padding: 12px 14px; }
}

/* ==========================================================================
   Detail Page — Common Layout
   ========================================================================== */

.detail-page {
  padding-top: 32px;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-2);
  margin-bottom: 32px;
  transition: color var(--dur-fast) var(--ease-out);
  text-decoration: none;
}

.back-link:hover { color: var(--text); }

/* Detail Hero */
.detail-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 60px;
}

.detail-hero-info .pipeline-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-2);
  margin-bottom: 16px;
}

.detail-hero-info h1 {
  font-size: 2.4rem;
  margin-bottom: 16px;
}

.detail-hero-info .hero-desc {
  text-align: left;
  margin: 0 0 24px;
}

.detail-hero-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.detail-hero-meta .meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-item .meta-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.meta-item .meta-value {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.detail-hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}

.hero-visual-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 40%, var(--accent-glow) 0%, transparent 70%);
}

@media (max-width: 900px) {
  .detail-hero { grid-template-columns: 1fr; gap: 32px; }
  .detail-hero-visual { order: -1; }
  .detail-hero-info h1 { font-size: 1.8rem; }
}

/* ==========================================================================
   Prompt Zone (The "manager-friendly" core)
   ========================================================================== */

.prompt-zone {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 60px;
}

.prompt-zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.prompt-zone-header h3 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.prompt-zone-header h3 .icon-bulb {
  font-size: 1.2rem;
}

/* Scenario Cards */
.scenario-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.scenario-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.scenario-card:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.scenario-card .sc-title {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.scenario-card .sc-preview {
  font-size: 0.75rem;
  color: var(--text-3);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Prompt Chips Row */
.prompt-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.prompt-chip {
  font-family: var(--mono);
  font-size: 0.73rem;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface-2);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}

.prompt-chip:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  background: var(--accent-glow);
}

.prompt-chip.selected {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

/* Prompt Input */
.prompt-input-wrap {
  position: relative;
  margin-bottom: 20px;
}

.prompt-input {
  width: 100%;
  min-height: 100px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color var(--dur-fast) var(--ease-out);
  outline: none;
}

.prompt-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.prompt-input::placeholder {
  color: var(--text-3);
}

.prompt-input-counter {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-3);
}

/* Upload Zone */
.upload-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  margin-bottom: 16px;
  color: var(--text-2);
  font-size: 0.85rem;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--text);
}

.upload-zone .upload-icon {
  font-size: 1.3rem;
}

/* Extra options row */
.prompt-extra-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.extra-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.extra-option label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.extra-option select {
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
}

.extra-option select:focus {
  border-color: var(--accent);
}

/* Generate button */
.generate-btn-wrap {
  text-align: center;
}

.generate-btn {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  padding: 16px 48px;
  border-radius: var(--radius-pill);
  background: var(--accent-gradient);
  color: #fff;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-out);
  box-shadow: 0 4px 20px var(--accent-glow);
  letter-spacing: 0.02em;
}

.generate-btn:hover {
  box-shadow: 0 6px 32px var(--accent-glow-strong);
  transform: translateY(-2px);
}

.generate-btn .btn-spark {
  margin-right: 6px;
}

/* ==========================================================================
   Pipeline Stage Rail
   ========================================================================== */

.stage-rail-section {
  margin-bottom: 60px;
}

.stage-rail-section .section-header {
  text-align: left;
  margin-bottom: 28px;
}

.stage-rail {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.stage-node-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 80px;
  position: relative;
}

.stage-node-line {
  position: absolute;
  top: 13px;
  left: 50%;
  width: 100%;
  height: 1px;
  background: var(--border);
  z-index: 0;
}

.stage-node-wrap:last-child .stage-node-line { display: none; }

.stage-node {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-3);
  z-index: 1;
  position: relative;
  transition: all var(--dur-normal) var(--ease-out);
}

.stage-node.done {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green);
}

.stage-node.active {
  background: var(--amber-dim);
  border-color: var(--amber);
  color: var(--amber);
  box-shadow: 0 0 12px var(--amber-dim);
  animation: nodePulse 2s ease-in-out infinite;
}

.stage-node.failed {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red);
}

.stage-node-label {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 500;
  color: var(--text-3);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.stage-node-wrap.done .stage-node-label { color: var(--green); }
.stage-node-wrap.active .stage-node-label { color: var(--amber); }

@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 8px var(--amber-dim); }
  50% { box-shadow: 0 0 20px rgba(240, 168, 60, 0.3); }
}

/* ==========================================================================
   Output Preview Zone — Enhanced with sample thumbnails
   ========================================================================== */

.output-zone {
  margin-bottom: 60px;
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--card-gap);
}

.output-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--dur-normal) var(--ease-out);
  cursor: pointer;
}

.output-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}

.output-card:hover .thumb-play {
  transform: scale(1.1);
  background: var(--accent);
  box-shadow: 0 0 24px var(--accent-glow-strong);
}

/* --- Thumbnail area — realistic sample frame --- */
.output-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Sample video frame backgrounds — product-themed gradients */
.output-thumb.sample-product {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
}

.output-thumb.sample-beauty {
  background: linear-gradient(135deg, #2d1b2e 0%, #3d2c42 40%, #5b3a5c 100%);
}

.output-thumb.sample-tech {
  background: linear-gradient(135deg, #0d1b2a 0%, #1b2838 40%, #1b3a4b 100%);
}

.output-thumb.sample-food {
  background: linear-gradient(135deg, #2b1e0e 0%, #3d2c14 40%, #5c3d1e 100%);
}

.output-thumb.sample-fashion {
  background: linear-gradient(135deg, #1c1c28 0%, #2a2a3a 40%, #3d3d52 100%);
}

.output-thumb.sample-live {
  background: linear-gradient(135deg, #1a1020 0%, #251535 40%, #3a2050 100%);
}

.output-thumb.sample-global {
  background: linear-gradient(135deg, #0f1a2e 0%, #152840 40%, #1a3558 100%);
}

/* Sample product mockup inside thumbnail */
.output-thumb .sample-visual {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  z-index: 0;
}

.output-thumb .sample-visual .sample-icon {
  font-size: 3rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.5));
  opacity: 0.9;
}

.output-thumb .sample-visual .sample-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: rgba(255,255,255,.6);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Gradient shine overlay */
.output-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 30%, rgba(255,255,255,.06) 0%, transparent 60%),
              linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.4) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Text overlay on thumbnail */
.output-thumb .thumb-overlay-text {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 2;
  pointer-events: none;
}

.output-thumb .thumb-overlay-text .overlay-title {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.7);
  line-height: 1.2;
  margin-bottom: 4px;
}

.output-thumb .thumb-overlay-text .overlay-sub {
  font-size: 0.72rem;
  color: rgba(255,255,255,.75);
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

/* Play button */
.output-thumb .thumb-play {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 3;
  border: 2px solid rgba(255,255,255,.2);
  transition: all var(--dur-normal) var(--ease-out);
  color: #fff;
}

/* Platform badge top-left */
.output-thumb .thumb-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
}

/* Duration badge bottom-right */
.output-thumb .thumb-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 3;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,.7);
  color: #fff;
  backdrop-filter: blur(4px);
}

/* Progress bar at bottom of thumbnail */
.output-thumb .thumb-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,.12);
  z-index: 3;
}

.output-thumb .thumb-progress::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 35%;
  background: var(--accent-gradient);
  border-radius: 0 2px 2px 0;
}

/* --- Card body --- */
.output-body {
  padding: 16px;
}

.output-body h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.output-body .output-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-3);
  margin-bottom: 10px;
}

.output-body .platform-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ==========================================================================
   Featured Samples Section (Index page)
   ========================================================================== */

.featured-samples {
  margin-bottom: 60px;
}

.samples-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--card-gap);
}

.sample-showcase {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--dur-normal) var(--ease-out);
  cursor: pointer;
}

.sample-showcase:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}

.sample-showcase .sample-frame {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sample-showcase .sample-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 100%);
  z-index: 1;
}

.sample-showcase .sample-frame .sample-play-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  z-index: 2;
  border: 2px solid rgba(255,255,255,.18);
  transition: all var(--dur-normal) var(--ease-out);
}

.sample-showcase:hover .sample-frame .sample-play-btn {
  background: var(--accent);
  border-color: var(--accent-2);
  transform: scale(1.08);
  box-shadow: 0 0 28px var(--accent-glow-strong);
}

.sample-showcase .sample-info {
  padding: 16px;
}

.sample-showcase .sample-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.sample-showcase .sample-info .sample-pipeline {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.sample-showcase .sample-info .sample-desc {
  font-size: 0.78rem;
  color: var(--text-2);
  line-height: 1.45;
}

@media (max-width: 900px) {
  .samples-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  border-top: 1px solid var(--border-soft);
  padding: 40px 0;
  text-align: center;
}

.footer-brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.footer-desc {
  font-size: 0.78rem;
  color: var(--text-3);
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-rise {
  animation: rise var(--dur-slow) var(--ease-out) forwards;
}

.rise-1 { animation-delay: 0ms; opacity: 0; }
.rise-2 { animation-delay: 80ms; opacity: 0; }
.rise-3 { animation-delay: 160ms; opacity: 0; }
.rise-4 { animation-delay: 240ms; opacity: 0; }
.rise-5 { animation-delay: 320ms; opacity: 0; }

/* Shimmer for loading placeholders */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

/* Fade-in on scroll (via JS intersection observer) */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-accent { color: var(--accent-2); }
.text-muted { color: var(--text-3); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.hidden { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  :root {
    --page-pad: 16px;
    --section-gap: 48px;
    --panel-pad: 18px;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .section-title { font-size: 1.5rem; }

  .stage-rail { padding: 16px; }
  .stage-node-label { font-size: 0.56rem; }
  .prompt-zone { padding: 20px; }
}
