/**
 * PolySM Studio — Master Design System & Bento Stylesheet
 * Elite-Web-Engineering Standard: Anti-AI Slop, Obsidian Void, Hairline Speculars, Spring Physics
 */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Bangers&family=Bebas+Neue&family=JetBrains+Mono:wght@400;500;600;700&family=Montserrat:wght@700;800;900&family=Outfit:wght@500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

html {
  scroll-behavior: smooth;
}

/* ==========================================================================
   1. Design System Tokens & Custom Properties
   ========================================================================== */
:root {
  /* Surfaces: Obsidian Void Palette */
  --bg-obsidian-void: #030508;
  --bg-surface-0: #06080e;
  --bg-surface-1: #090c15;
  --bg-surface-2: #0e121e;
  --bg-surface-3: #14192b;
  --bg-surface-floating: #192035;

  /* Specular Hairlines & Glass */
  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-hairline-subtle: rgba(255, 255, 255, 0.04);
  --border-hairline-hover: rgba(255, 255, 255, 0.16);
  --border-specular-glow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --glass-blur-lg: blur(20px);
  --glass-blur-md: blur(12px);

  /* Surgical Color Accents */
  --accent: #6366f1;
  --accent-indigo: #6366f1;
  --color-indigo: #6366f1;
  --color-indigo-glow: rgba(99, 102, 241, 0.28);
  --color-cyan: #06b6d4;
  --color-cyan-glow: rgba(6, 182, 212, 0.28);
  --color-emerald: #10b981;
  --color-emerald-glow: rgba(16, 185, 129, 0.28);
  --color-rose: #f43f5e;
  --color-rose-glow: rgba(244, 63, 94, 0.28);
  --color-amber: #f59e0b;
  --color-amber-glow: rgba(245, 158, 11, 0.28);
  --color-violet: #8b5cf6;

  /* Typography Stacks */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  /* Motion & Spring Dynamics */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.15s var(--ease-spring);
  --transition-base: 0.25s var(--ease-spring);
  --transition-slow: 0.45s var(--ease-spring);

  /* Elevation Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 48px -10px rgba(0, 0, 0, 0.8), var(--border-specular-glow);
  --shadow-glow-indigo: 0 0 35px -5px rgba(99, 102, 241, 0.35);
  --shadow-glow-cyan: 0 0 35px -5px rgba(6, 182, 212, 0.35);

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-full: 9999px;
}

/* ==========================================================================
   2. Reset & Base Typography
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
  background-color: var(--bg-obsidian-void);
}

body {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-obsidian-void);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  position: relative;
}

/* Ambient Canvas Particle Background */
#ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

/* Background Vignette & Subtle Grid */
.bg-vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background: 
    radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 65%),
    radial-gradient(circle at 100% 100%, rgba(6, 182, 212, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(3, 5, 8, 0.8) 0%, transparent 70%);
}

.page-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(2.5rem, 5.5vw, 4.25rem); }
h2 { font-size: clamp(1.85rem, 3.8vw, 2.75rem); }
h3 { font-size: clamp(1.35rem, 2.5vw, 1.85rem); }
h4 { font-size: 1.25rem; font-weight: 600; }
h5 { font-size: 1.05rem; font-weight: 600; }
h6 { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }

p {
  color: var(--text-secondary);
}

a {
  color: var(--color-indigo);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-cyan);
}

/* Tabular & Code Numbers */
code, pre, .font-mono, .telemetry-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Selection */
::selection {
  background: rgba(99, 102, 241, 0.35);
  color: #ffffff;
}

/* Focus Visibility */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-obsidian-void), 0 0 0 4px var(--color-indigo);
  border-radius: var(--radius-xs);
}

/* ==========================================================================
   3. Layout Grid & Containers
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.container-narrow {
  max-width: 980px;
}

.section {
  padding-top: clamp(4rem, 8vw, 7rem);
  padding-bottom: clamp(4rem, 8vw, 7rem);
  position: relative;
}

/* 12-Column Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}

.col-span-12 { grid-column: span 12; }
.col-span-8 { grid-column: span 8; }
.col-span-7 { grid-column: span 7; }
.col-span-6 { grid-column: span 6; }
.col-span-5 { grid-column: span 5; }
.col-span-4 { grid-column: span 4; }
.col-span-3 { grid-column: span 3; }

@media (max-width: 1024px) {
  .col-span-8, .col-span-7, .col-span-6, .col-span-5, .col-span-4, .col-span-3 {
    grid-column: span 12;
  }
}

/* ==========================================================================
   4. Bento Card & Dynamic Spotlight Architecture
   ========================================================================== */
.bento-card, .spotlight-card {
  position: relative;
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-md), var(--border-specular-glow);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  overflow: hidden;
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

/* Interactive Cursor Spotlight Sweep */
.bento-card::before, .spotlight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    550px circle at var(--mouse-x, -200px) var(--mouse-y, -200px),
    rgba(99, 102, 241, 0.12),
    transparent 50%
  );
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 1;
}

.bento-card:hover::before, .spotlight-card:hover::before {
  opacity: 1;
}

.bento-card:hover, .spotlight-card:hover {
  border-color: rgba(99, 102, 241, 0.32);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px -10px rgba(99, 102, 241, 0.2);
}

.bento-card > *, .spotlight-card > * {
  position: relative;
  z-index: 2;
}

/* Card Variants */
.card-elevated {
  background-color: var(--bg-surface-2);
}

.card-hollow {
  background-color: transparent;
  border: 1px dashed var(--border-hairline);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.12);
  color: var(--color-indigo);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.card-icon.icon-cyan {
  background: rgba(6, 182, 212, 0.12);
  color: var(--color-cyan);
  border-color: rgba(6, 182, 212, 0.25);
}

.card-icon.icon-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-emerald);
  border-color: rgba(16, 185, 129, 0.25);
}

/* ==========================================================================
   5. Buttons & Tactile Micro-Interactions
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.975);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary Indigo Button with Specular Edge */
.btn-primary {
  background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #6d70f7 0%, #5850ec 100%);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  color: #ffffff;
}

/* Electric Cyan Button */
.btn-cyan {
  background: linear-gradient(180deg, #06b6d4 0%, #0891b2 100%);
  color: #030508;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-cyan:hover {
  background: linear-gradient(180deg, #22d3ee 0%, #06b6d4 100%);
  box-shadow: 0 6px 22px rgba(6, 182, 212, 0.6);
  color: #030508;
}

/* Secondary Ghost/Obsidian Button */
.btn-secondary {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-sm), var(--border-specular-glow);
}

.btn-secondary:hover {
  background: var(--bg-surface-3);
  border-color: var(--border-hairline-hover);
  color: #ffffff;
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-hairline-subtle);
}

/* Danger / Rose Button */
.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--color-rose);
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.btn-danger:hover {
  background: var(--color-rose);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.4);
}

/* Button Sizing */
.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.775rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.95rem 1.85rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Shimmer Light Sweep on CTA */
.btn-shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 30%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  animation: shimmerSweep 4.5s infinite cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

@keyframes shimmerSweep {
  0% { transform: translateX(-120%); }
  35%, 100% { transform: translateX(120%); }
}

/* ==========================================================================
   6. Live Status Beacons & Badges
   ========================================================================== */
.beacon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 8px;
  height: 8px;
}

.beacon-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--color-emerald);
}

.beacon-ping {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background-color: var(--color-emerald);
  opacity: 0.75;
  animation: beaconPing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes beaconPing {
  75%, 100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

.beacon-cyan .beacon-dot, .beacon-cyan .beacon-ping { background-color: var(--color-cyan); }
.beacon-indigo .beacon-dot, .beacon-indigo .beacon-ping { background-color: var(--color-indigo); }
.beacon-amber .beacon-dot, .beacon-amber .beacon-ping { background-color: var(--color-amber); }
.beacon-rose .beacon-dot, .beacon-rose .beacon-ping { background-color: var(--color-rose); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.725rem;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
}

.badge-indigo {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

.badge-cyan {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.25);
  color: #67e8f9;
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.badge-amber {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}

.badge-rose {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.25);
  color: #fda4af;
}

/* ==========================================================================
   7. Form Controls & Hardware Segmented Switches
   ========================================================================== */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--bg-surface-0);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  color: var(--text-primary);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--color-indigo);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-dim);
}

.form-textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

/* Segmented Control & Navigation Tabs (Obsidian Void Style) */
.segmented-control {
  display: inline-flex;
  padding: 0.35rem;
  background: rgba(9, 12, 21, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  gap: 0.35rem;
  width: 100%;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.segment-item {
  flex: 1;
  text-align: center;
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.04);
  outline: none;
  white-space: nowrap;
}

.segment-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.segment-item.active {
  background: rgba(99, 102, 241, 0.16);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(0);
}

/* Platform Toggle Pills with High-Contrast Active State & Glow */
.platform-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  background: rgba(14, 18, 30, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  opacity: 0.55;
  filter: grayscale(70%);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.platform-toggle:hover {
  opacity: 0.85;
  filter: grayscale(20%);
  border-color: rgba(255, 255, 255, 0.2);
}

.platform-toggle .plat-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.platform-toggle .plat-check svg {
  display: none;
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 3.5;
}

.platform-toggle.active {
  opacity: 1;
  filter: none;
  color: #ffffff;
}

.platform-toggle.active .plat-check {
  border-color: transparent;
}

.platform-toggle.active .plat-check svg {
  display: block;
}

.platform-toggle[data-platform="youtube"].active {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.7);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.32), inset 0 0 8px rgba(244, 63, 94, 0.12);
}
.platform-toggle[data-platform="youtube"].active .plat-check {
  background: #f43f5e;
  color: #ffffff;
}

.platform-toggle[data-platform="instagram"].active {
  background: rgba(225, 48, 108, 0.15);
  border-color: rgba(225, 48, 108, 0.7);
  box-shadow: 0 0 16px rgba(225, 48, 108, 0.32), inset 0 0 8px rgba(225, 48, 108, 0.12);
}
.platform-toggle[data-platform="instagram"].active .plat-check {
  background: #e1306c;
  color: #ffffff;
}

.platform-toggle[data-platform="tiktok"].active {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.7);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.32), inset 0 0 8px rgba(6, 182, 212, 0.12);
}
.platform-toggle[data-platform="tiktok"].active .plat-check {
  background: #06b6d4;
  color: #030508;
}

/* ==========================================================================
   8. Photorealistic 9:16 Phone Chassis & HUD Safe Zone Overlays
   ========================================================================== */
.phone-chassis {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  background: #020305;
  border-radius: 44px;
  padding: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  box-shadow: 
    0 0 0 2px #0a0e17,
    0 25px 60px -15px rgba(0, 0, 0, 0.9),
    0 0 40px -10px rgba(99, 102, 241, 0.25),
    inset 0 1px 1px rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000000;
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Dynamic Island */
.phone-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #030508;
  border-radius: var(--radius-full);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.phone-island-camera {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: #0d121d;
  box-shadow: inset 0 0 2px #06b6d4;
}

.phone-island-sensor {
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: #080c14;
}

/* Safe Zone HUD Layer */
.safe-zone-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
  display: none;
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.safe-zone-overlay.is-visible {
  display: block;
}

/* Prevent collision between Safe Zone HUD top overlay and Draft Mode tag (DEF-004) */
.preview-chassis:has(.safe-zone-overlay.is-visible) #ws-preview-tag,
.phone-viewport:has(.safe-zone-overlay.is-visible) #ws-preview-tag {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Top Margin Unsafe (220px / 1920px = 11.45%) */
.safe-zone-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 11.5%;
  background: rgba(244, 63, 94, 0.12);
  border-bottom: 1px dashed rgba(244, 63, 94, 0.6);
  color: var(--color-rose);
  padding: 24px 8px 4px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

/* Bottom Margin Unsafe (400px / 1920px = 20.8%) */
.safe-zone-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20.8%;
  background: rgba(244, 63, 94, 0.12);
  border-top: 1px dashed rgba(244, 63, 94, 0.6);
  color: var(--color-rose);
  padding: 6px 8px;
}

/* Right Margin Unsafe (140px / 1080px = 13%) */
.safe-zone-right {
  position: absolute;
  top: 11.5%;
  right: 0;
  width: 13%;
  height: 67.7%;
  background: rgba(244, 63, 94, 0.08);
  border-left: 1px dashed rgba(244, 63, 94, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  padding: 8px 0;
}

.hud-action-dummy {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

/* Absolute Safe Center Box */
.safe-zone-target {
  position: absolute;
  top: 15.6%;
  left: 7.4%;
  width: 79.6%;
  height: 60%;
  border: 1px solid rgba(6, 182, 212, 0.5);
  box-shadow: inset 0 0 15px rgba(6, 182, 212, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: rgba(6, 182, 212, 0.8);
}

/* Kinetic Captions Simulation Layer */
.kinetic-captions-layer {
  position: absolute;
  bottom: 26%;
  left: 8%;
  width: 84%;
  z-index: 35;
  text-align: center;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.kinetic-chunk,
#ws-kinetic-text {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 0 2px rgba(0, 0, 0, 0.9);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
}

.kinetic-chunk .word-highlight {
  color: #facc15; /* Punch Yellow */
  background: rgba(0, 0, 0, 0.7);
  padding: 0.1em 0.25em;
  border-radius: 4px;
  display: inline-block;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ==========================================================================
   9. Modals & Telemetry Overlays
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 5, 8, 0.82);
  backdrop-filter: var(--glass-blur-md);
  -webkit-backdrop-filter: var(--glass-blur-md);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.modal-backdrop.is-open {
  display: flex;
  opacity: 1;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-lg), 0 0 50px -10px rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  transition: transform var(--transition-base);
}

.modal-backdrop.is-open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.5rem 1.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-hairline-subtle);
}

.modal-body {
  padding: 1.75rem;
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  background: var(--bg-surface-0);
  border-top: 1px solid var(--border-hairline-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 280px;
  max-width: 420px;
  animation: toastEntrance 0.35s var(--ease-spring);
}

@keyframes toastEntrance {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-success { border-color: rgba(16, 185, 129, 0.4); }
.toast-error { border-color: rgba(244, 63, 94, 0.4); }
.toast-info { border-color: rgba(6, 182, 212, 0.4); }

/* ==========================================================================
   10. Utility Classes & Animation Helpers
   ========================================================================== */
.text-gradient-indigo {
  background: linear-gradient(135deg, #ffffff 30%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-cyan {
  background: linear-gradient(135deg, #ffffff 30%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-cyan { color: var(--color-cyan); }
.text-indigo { color: var(--color-indigo); }
.text-emerald { color: var(--color-emerald); }
.text-rose { color: var(--color-rose); }
.text-amber { color: var(--color-amber); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.w-full { width: 100%; }

.svg-icon {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.15em;
  fill: currentColor;
  flex-shrink: 0;
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes panDrift {
  0% { transform: scale(1) translate(0%, 0%); }
  50% { transform: scale(1.08) translate(-3%, -2%); }
  100% { transform: scale(1) translate(2%, 1%); }
}

/* ==========================================================================
   11. Omni Workstation UI Components
   ========================================================================== */

/* iOS Style Switch */
.switch-ios {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch-ios input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-surface-0);
  border: 1px solid var(--border-hairline);
  transition: .3s var(--ease-spring);
  border-radius: 24px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #94a3b8;
  transition: .3s var(--ease-spring);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.switch-ios input:checked + .switch-slider {
  background-color: var(--color-indigo);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 12px var(--color-indigo-glow);
}

.switch-ios input:checked + .switch-slider:before {
  transform: translateX(20px);
  background-color: #ffffff;
}

/* Inspiration Chips */
.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-surface-0);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
}

.preset-chip:hover {
  background: var(--bg-surface-2);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.preset-chip.active,
.preset-chip.selected,
.ep-pill.active,
.ep-pill.selected,
.sc-pill.active,
.sc-pill.selected,
.option-pill.active,
.option-pill.selected {
  background: rgba(99, 102, 241, 0.28) !important;
  color: #ffffff !important;
  border: 1.5px solid var(--accent-indigo, #6366f1) !important;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.2) !important;
  font-weight: 700 !important;
  transform: translateY(-1px);
}

/* Logos */
.header-logo-img {
  height: 32px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  display: block;
}

.footer-logo-img {
  height: 28px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  display: block;
}

/* Channel Fleet Selected Card */
.channel-fleet-card.selected {
  border-color: var(--color-cyan) !important;
  background: rgba(6, 182, 212, 0.08) !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.25) !important;
}

/* Reference Dropzone */
.dropzone-container {
  border: 1.5px dashed var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  background: var(--bg-surface-0);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.dropzone-container:hover, .dropzone-container.is-dragover {
  border-color: var(--color-indigo);
  background: rgba(99, 102, 241, 0.05);
}

/* Quantum Launch Button */
.btn-launch-quantum {
  width: 100%;
  padding: 1.15rem 2rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 60%, #06b6d4 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.btn-launch-quantum:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px -5px rgba(99, 102, 241, 0.7), 0 0 25px rgba(6, 182, 212, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-launch-quantum:active {
  transform: scale(0.985);
}

/* Episode Horizontal Ribbon */
.episodes-ribbon {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 0.85rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hairline) transparent;
}

.episode-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.15rem;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.episode-tab:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border-color: var(--border-hairline-hover);
}

.episode-tab.active {
  background: var(--bg-surface-3);
  color: #ffffff;
  border-color: var(--color-indigo);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Granular Scene Cards */
.scene-card-item {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md), var(--border-specular-glow);
  margin-bottom: 1.25rem;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.scene-card-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.scene-card-item .scene-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.scene-card-item .scene-textareas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 900px) {
  .scene-card-item .scene-textareas {
    grid-template-columns: 1fr;
  }
}


