@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #030408;
  --bg-elevated: #080a10;
  --bg-glow: radial-gradient(circle at 50% 50%, #111528 0%, #030408 100%);
  --surface: rgba(10, 12, 22, 0.65);
  --surface-solid: #090c15;
  --surface-soft: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --ink: #f3f5f9;
  --muted: #8c94a6;
  --soft: #555d6e;
  
  /* Glowing Accents */
  --acid: #ccff00;
  --cyan: #00f0ff;
  --coral: #ff3e6c;
  --violet: #a042ff;
  --success: #00ff87;
  --warning: #ffb700;
  --error: #ff2a5f;
  --running: #0099ff;
  
  --border: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 240, 255, 0.15);
  --accent: var(--cyan);
  
  --scene-a: var(--acid);
  --scene-b: var(--cyan);
  --scene-c: var(--violet);
  
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
  --scroll-progress-scale: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  background-image: var(--bg-glow);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.site-bg-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  filter: brightness(0.2) contrast(1.1) saturate(0.8) blur(4px);
  pointer-events: none;
  opacity: 0.4;
}

/* Film grain noise overlay */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
}

/* Particle burst canvas for workspace entry */
.burst-canvas {
  position: fixed;
  inset: 0;
  z-index: 10035;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0;
}

body.workspace-active {
  overflow: hidden;
  height: 100vh;
}

button, input, textarea, select {
  font: inherit;
  background: none;
  border: none;
  color: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

svg {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
}

::selection {
  background: rgba(0, 240, 255, 0.3);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Scroll Progress & Ambient Cursor */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10020;
  width: 100%;
  height: 4px;
  transform: scaleX(var(--scroll-progress-scale, 0));
  transform-origin: left center;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--acid));
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
  pointer-events: none;
  will-change: transform;
}

.cursor-light {
  position: fixed;
  z-index: 20;
  left: 0;
  top: 0;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.12;
  background: radial-gradient(circle, var(--accent) 0%, rgba(160, 66, 255, 0.2) 40%, transparent 70%);
  filter: blur(40px);
  mix-blend-mode: screen;
  will-change: transform;
}

.cursor-light.touch-active {
  opacity: 0.18;
}

@media (hover: none), (pointer: coarse) {
  .cursor-light {
    width: 280px;
    height: 280px;
    opacity: 0;
    filter: blur(34px);
    transition: opacity 0.22s ease;
  }

  .micro-cursor-dot,
  .micro-cursor-ring {
    display: none;
  }
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 90px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(380px, calc(100vw - 48px));
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(10, 12, 22, 0.85);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 14px;
  backdrop-filter: blur(24px);
  pointer-events: auto;
  animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.toast-out {
  animation: toastOut 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: bold;
}

.toast.success { border-color: rgba(0, 255, 135, 0.3); box-shadow: 0 10px 30px rgba(0, 255, 135, 0.05); }
.toast.error { border-color: rgba(255, 42, 95, 0.3); box-shadow: 0 10px 30px rgba(255, 42, 95, 0.05); }
.toast.warning { border-color: rgba(255, 183, 0, 0.3); box-shadow: 0 10px 30px rgba(255, 183, 0, 0.05); }
.toast.info { border-color: rgba(0, 240, 255, 0.3); box-shadow: 0 10px 30px rgba(0, 240, 255, 0.05); }

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--error); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--cyan); }

.chat-jump-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10010;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid rgba(0, 240, 255, 0.34);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(160, 66, 255, 0.16)),
    rgba(8, 10, 16, 0.84);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.38), 0 0 26px rgba(0, 240, 255, 0.14);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}

.chat-jump-widget svg {
  width: 20px;
  height: 20px;
  color: var(--cyan);
}

.chat-jump-widget:hover,
.chat-jump-widget:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(204, 255, 0, 0.48);
  background:
    linear-gradient(135deg, rgba(204, 255, 0, 0.18), rgba(0, 240, 255, 0.18)),
    rgba(8, 10, 16, 0.92);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.44), 0 0 32px rgba(204, 255, 0, 0.16);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(30px) scale(0.9); }
}

/* Page Transition Backdrop and Elements */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: none;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
}

.transition-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: #030408;
  will-change: opacity;
}

.refraction-sweep {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.02) 40%,
    rgba(255, 255, 255, 0.12) 48%,
    rgba(0, 240, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.12) 52%,
    rgba(255, 255, 255, 0.02) 60%,
    transparent 70%
  );
  background-size: 200% 100%;
  background-position: 150% 0;
  mix-blend-mode: overlay;
  will-change: background-position;
}

.top-loading-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  box-shadow: 0 0 10px var(--cyan), 0 0 20px var(--cyan);
  z-index: 3;
  will-change: width, opacity;
}

/* Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.gsap-ready .reveal {
  transition: none;
}

/* Navigation Bar */
.nav {
  position: fixed;
  inset: 16px 24px auto;
  z-index: 1000;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(5, 7, 12, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  transition: background 0.3s, border-color 0.3s;
  overflow: hidden;
}

/* Nav shimmer on hover */
.nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
  transition: left 0s;
  pointer-events: none;
  z-index: 0;
}
.nav:hover::before {
  left: 160%;
  transition: left 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px 0 24px;
}

.nav-brand, .logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  text-decoration: none;
}

.nav-logo, .logo svg {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.4));
}

.nav-title, .logo h1 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: 999px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.nav-links a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, rgba(0,240,255,0.12) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0s;
  pointer-events: none;
}

.nav-links a:hover::after {
  transform: translateX(110%);
  transition: transform 0.5s ease;
}

.nav-links a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 1px rgba(255, 255, 255, 0.1);
}

.btn-nav-cta, .btn-hero-primary, .btn-hero-secondary, .btn-primary, .btn-refresh, .btn-back, .retry-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-nav-cta, .btn-hero-primary, .btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.25);
}

.btn-nav-cta:hover, .btn-hero-primary:hover, .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 240, 255, 0.45);
}

.btn-hero-secondary, .btn-back, .btn-refresh, .retry-button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

.btn-hero-secondary:hover, .btn-back:hover, .btn-refresh:hover, .retry-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Landing Layout */
.landing {
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

.hero.active-inspired {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 120px 24px 80px;
  text-align: center;
  overflow: hidden;
}

.hero-particle-canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  opacity: 0.35;
  mix-blend-mode: screen;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at center, transparent 30%, var(--bg) 95%);
  pointer-events: none;
}

/* Aurora gradient background layer */
.hero-aurora {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

.hero-aurora::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 60%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 240, 255, 0.06) 0%, transparent 70%);
  animation: auroraFloat 12s ease-in-out infinite alternate;
  filter: blur(60px);
}

.hero-aurora::after {
  content: '';
  position: absolute;
  top: 10%;
  right: -15%;
  width: 55%;
  height: 65%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(160, 66, 255, 0.07) 0%, transparent 70%);
  animation: auroraFloat 15s ease-in-out infinite alternate-reverse;
  filter: blur(80px);
}

@keyframes auroraFloat {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(3%, 5%) scale(1.08); }
  66% { transform: translate(-2%, 3%) scale(0.96); }
  100% { transform: translate(4%, -2%) scale(1.04); }
}

.scene-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 1.5px solid var(--cyan);
  background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  will-change: transform, opacity;
}

.hero-core {
  position: relative;
  width: 280px;
  aspect-ratio: 1;
  margin-bottom: 30px;
}

.core-orbit {
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(0, 240, 255, 0.15);
  border-radius: 50%;
  animation: coreSpin 16s linear infinite;
}

.core-orbit-a { transform: rotateX(60deg) rotateZ(30deg); border-color: rgba(0, 240, 255, 0.2); }
.core-orbit-b { inset: 15%; transform: rotateX(65deg) rotateZ(-40deg); border-color: rgba(160, 66, 255, 0.2); animation-duration: 10s; animation-direction: reverse; }
.core-orbit-c { inset: 30%; transform: rotateX(70deg) rotateZ(80deg); border-color: rgba(204, 255, 0, 0.2); animation-duration: 7s; }

.core-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(10, 15, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
}

.core-mark span {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.core-mark small {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 1px;
  margin-top: 4px;
}

.hero-copy {
  max-width: 720px;
  margin: 0 auto;
}

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 800;
  line-height: 1.1;
  margin: 16px 0;
  letter-spacing: -1px;
  position: relative;
  display: inline-block;
}

/* Shimmer sweep effect over hero-title */
.hero-title::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.55) 50%, transparent 60%);
  background-size: 200% 100%;
  background-position: 200% 0;
  -webkit-background-clip: text;
  background-clip: text;
  animation: titleShimmer 4.5s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: overlay;
}

@keyframes titleShimmer {
  0%, 70% { background-position: 200% 0; }
  100% { background-position: -100% 0; }
}

.hero-desc {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* Scene Mode Strip & Timeline Controls */
.mode-strip {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}

.mode-chip {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.mode-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(0,240,255,0.18), transparent);
  transform: translateX(-100%);
  transition: transform 0s;
  pointer-events: none;
}

.mode-chip:hover::before {
  transform: translateX(110%);
  transition: transform 0.4s ease;
}

.mode-chip.active, .mode-chip:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.hero-engine-controls {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(480px, 90vw);
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(10, 12, 22, 0.6);
  backdrop-filter: blur(12px);
}

.hero-engine-controls.reveal {
  transform: translateX(-50%) translateY(30px);
}

.hero-engine-controls.reveal.is-visible {
  transform: translateX(-50%) translateY(0);
}

.icon-control {
  font-size: 12px;
  color: var(--cyan);
  cursor: pointer;
}

.video-scrubber {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.video-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.timecode {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* Feature Showcase section */
.section {
  padding: 100px 24px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

/* Glowing section divider line */
.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 80vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,240,255,0.25) 30%, rgba(160,66,255,0.25) 70%, transparent);
  pointer-events: none;
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 60px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  margin: 16px 0;
  line-height: 1.2;
}

.section-header p {
  color: var(--muted);
  font-size: 16px;
}

.feature-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 860px) {
  .feature-layout {
    grid-template-columns: 1fr;
  }
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.01);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.feature-card span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: bold;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.feature-card.active, .feature-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.05);
  transform: translateX(8px);
}

.lab-screen {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(10, 12, 22, 0.5);
  backdrop-filter: blur(12px);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: var(--shadow);
}

#featureCanvas {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  background: #05060b;
}

.lab-screen-copy h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.lab-screen-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Scroll Story Card layout */
.scroll-story {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  align-items: start;
}

.story-sticky {
  position: sticky;
  top: 120px;
}

.story-steps {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.story-card {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.story-card span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  font-weight: bold;
}

.story-card h3 {
  margin: 8px 0 12px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.story-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.price-card {
  display: flex;
  flex-direction: column;
  padding: 40px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.01);
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}

.price-card.price-card-featured {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.02);
  box-shadow: 0 15px 40px rgba(0, 240, 255, 0.08);
}

.price-tier {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.price-amount {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  margin: 12px 0 4px;
  color: var(--ink);
}

.price-period {
  font-size: 13px;
  color: var(--muted);
}

.price-card ul {
  list-style: none;
  padding: 0;
  margin: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.price-card li {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.price-card li::before {
  content: "✓";
  color: var(--cyan);
  font-weight: bold;
}

.btn-price {
  width: 100%;
  margin-top: auto;
}

/* Video Lab Demo */
.video-lab {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: center;
}

.video-demo-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

.video-demo-screen video {
  width: 100%;
  display: block;
}

/* Footer styling */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  background: rgba(3, 4, 8, 0.5);
  backdrop-filter: blur(10px);
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* Workspace APP Styles */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
  background-image: var(--bg-glow);
  position: relative;
  z-index: 10;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 22, 0.8);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-back {
  padding: 8px;
  border-radius: 50%;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 8px var(--muted);
}

.status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.status-dot.error {
  background: var(--error);
  box-shadow: 0 0 10px var(--error);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--muted);
}

.user-info input {
  font-size: 13px;
  color: var(--ink);
  outline: none;
  width: 110px;
}

.user-info input::placeholder {
  color: var(--muted);
}

/* Workspace 2-Column Grid Layout */
.workspace-shell {
  display: grid;
  grid-template-columns: 360px 1fr;
  flex: 1;
  min-height: 0;
  background: rgba(0, 0, 0, 0.2);
  perspective: 1500px;
  transform-style: preserve-3d;
}

@media (max-width: 900px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
  backface-visibility: hidden;
}

.workspace-scanline {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 20px var(--cyan), 0 0 40px var(--cyan);
  opacity: 0;
  pointer-events: none;
  z-index: 10030;
}

.compose-panel {
  background: rgba(8, 10, 18, 0.5);
  backdrop-filter: blur(15px);
}

.panel-header {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin: 4px 0 0;
}

.panel-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 1px;
}

/* Job List & Cards */
.job-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-item {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.01);
  cursor: pointer;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.job-item:hover, .job-item.selected {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.job-item.selected {
  border-color: var(--cyan);
  box-shadow: inset 0 0 1px rgba(255, 255, 255, 0.1), 0 0 20px rgba(0, 240, 255, 0.1);
}

.job-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}

.job-mode {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 13px;
}

.badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
}

.badge.queued { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.badge.submitting { background: rgba(0, 240, 255, 0.15); color: var(--cyan); }
.badge.running { background: rgba(160, 66, 255, 0.15); color: var(--violet); }
.badge.succeeded { background: rgba(0, 255, 135, 0.15); color: var(--success); }
.badge.failed { background: rgba(255, 42, 95, 0.15); color: var(--error); }
.badge.cancelled { background: rgba(255, 255, 255, 0.05); color: var(--muted); }

.job-prompt {
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  border-radius: 99px;
  width: 0;
  transition: width 0.4s ease;
}

.progress-bar.is-active {
  animation: progressPulse 1.5s infinite alternate;
}

@keyframes progressPulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.3) drop-shadow(0 0 3px var(--cyan)); }
}

.job-error {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(255, 42, 95, 0.08);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 12px;
  line-height: 1.4;
}

/* Output & Creation Workspace Panel */
.output-panel {
  background: rgba(4, 5, 9, 0.2);
}

.tab-bar {
  display: flex;
  gap: 4px;
  padding: 16px 24px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tab-btn {
  padding: 12px 24px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  background: rgba(255, 255, 255, 0.02);
}

.tab-content {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 32px;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
}

/* Creation Form Tab layout */
.mode-tabs {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  isolation: isolate;
}

.mode-tabs button {
  padding: 8px 24px;
  border: none;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  background: none;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color 0.3s;
}

.mode-tabs button.active {
  background: none !important;
  color: var(--cyan) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.mode-tab-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  z-index: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(160, 66, 255, 0.12));
  border: 1px solid rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
  pointer-events: none;
  will-change: left, width;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.form-group label .optional {
  font-size: 11px;
  color: var(--muted);
  font-weight: normal;
  margin-left: 6px;
}

.form textarea, .form input[type="text"] {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  transition: all 0.3s;
}

.form textarea:focus, .form input[type="text"]:focus {
  border-color: var(--cyan);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

/* File Upload Slot for Video mode */
.image-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.file-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16/9;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.01);
  padding: 24px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s;
}

.file-slot input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.preview-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--muted);
  z-index: 2;
}

.preview-box img, .preview-box video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.file-meta {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
  z-index: 3;
}

.file-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-sub {
  font-size: 10px;
  color: var(--muted);
}

.file-slot:hover, .file-slot.drag-over {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.02);
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.05);
}

.form-message {
  font-size: 13px;
  color: var(--muted);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  display: none;
}

.form-message.success {
  display: block;
  background: rgba(0, 255, 135, 0.08);
  color: var(--success);
  border: 1px solid rgba(0, 255, 135, 0.2);
}

.form-message.error {
  display: block;
  background: rgba(255, 42, 95, 0.08);
  color: var(--error);
  border: 1px solid rgba(255, 42, 95, 0.2);
}

/* Result Showcase view */
.result-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.result-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.result-meta strong {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  font-weight: 700;
}

.result-actions {
  display: flex;
  gap: 12px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.media-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.01);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.media-item img {
  width: 100%;
  border-radius: var(--radius-sm);
  aspect-ratio: 16/10;
  object-fit: contain;
  background: #020306;
}

.media-item a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  text-align: center;
  word-break: break-all;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.failed-state {
  flex-direction: column;
  gap: 16px;
  background: rgba(255, 42, 95, 0.03);
  border-color: rgba(255, 42, 95, 0.15);
  color: var(--error);
  text-align: center;
}

/* Custom Video Player design inside Output Panel */
.video-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: var(--radius-sm);
  background: #020204;
  overflow: hidden;
}

.video-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  background: linear-gradient(180deg, transparent, rgba(3, 4, 8, 0.9));
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

.video-player:hover .video-controls, .video-player.is-paused .video-controls {
  opacity: 1;
  transform: translateY(0);
}

.video-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.video-button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

.video-progress {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.video-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

.video-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  white-space: nowrap;
}

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 25%, rgba(255, 255, 255, 0.06) 37%, rgba(255, 255, 255, 0.02) 63%);
  background-size: 400% 100%;
  animation: skeletonLoading 1.4s ease infinite;
}

.skeleton-job {
  height: 110px;
  border-radius: var(--radius);
  width: 100%;
}

@keyframes skeletonLoading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============ Premium Micro Cursor ============ */
.micro-cursor-dot {
  display: none;
}

.micro-cursor-ring {
  display: none;
}

.micro-cursor-ring.snapped {
  display: none;
}
.micro-cursor-dot.snapped {
  display: none;
}

/* 3D Parallax Hover Tilt & Glass Glare Overlay */
.story-card, .feature-card, .job-item, .media-item, .video-demo-card {
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.25s ease;
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden;
}

.story-card:hover, .feature-card:hover {
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.1);
}

.story-card::after, .feature-card::after, .job-item::after, .media-item::after, .video-demo-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.story-card:hover::after, .feature-card:hover::after, .job-item:hover::after, .media-item:hover::after, .video-demo-card:hover::after {
  opacity: 1;
}

/* Typing Reactive Glows & Sparks */
.form-group {
  position: relative;
  --type-glow: 0;
}

.textarea-glow-bg {
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  box-shadow: 0 0 calc(12px * var(--type-glow)) rgba(0, 240, 255, calc(0.15 * var(--type-glow)));
  border: 1px solid rgba(0, 240, 255, calc(0.3 * var(--type-glow)));
  opacity: 0.8;
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
  z-index: 0;
}

.form textarea, .form input[type="text"] {
  position: relative;
  z-index: 1;
}

.type-spark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

/* Engine Readout status indicators */
.engine-readout {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 36px;
  margin-bottom: 24px;
}

.engine-readout div {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 130px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.engine-readout div:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(0, 240, 255, 0.2);
}

.engine-readout div span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.engine-readout div strong {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--cyan);
  font-weight: 700;
  margin-top: 4px;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* ============ Readout Widget Rolling Animation ============ */
.readout-widget {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 130px;
  backdrop-filter: blur(10px);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.readout-widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,240,255,0.06), transparent);
  transition: left 0s;
  pointer-events: none;
}

.readout-widget:hover::before {
  left: 110%;
  transition: left 0.5s ease;
}

.readout-widget:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(0, 240, 255, 0.25);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.06);
  transform: translateY(-2px);
}

.readout-widget span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.readout-value {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--cyan);
  font-weight: 700;
  margin-top: 4px;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
  display: block;
  height: 1.4em;
  overflow: hidden;
  position: relative;
}

.readout-value.rolling {
  animation: readoutRoll 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes readoutRoll {
  0% { transform: translateY(0); opacity: 1; }
  45% { transform: translateY(-1.4em); opacity: 0; }
  46% { transform: translateY(1.4em); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ============ Stage Index Buttons (Redesigned) ============ */
.stage-index {
  display: flex;
  gap: 20px;
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  align-items: flex-end;
}

.stage-index button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 14px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.01);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
  min-width: 110px;
  overflow: hidden;
}

.stage-index button::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,240,255,0.04), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.stage-index button:hover::before,
.stage-index button.active::before {
  opacity: 1;
}

.stage-index button:hover, .stage-index button.active {
  border-color: rgba(0, 240, 255, 0.25);
  box-shadow: 0 8px 30px rgba(0, 240, 255, 0.08), 0 0 0 1px rgba(0,240,255,0.06);
  transform: translateX(-4px);
}

.stage-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 1px;
  opacity: 0.7;
}

.stage-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

/* Glow ring that expands on click/hover */
.stage-ring {
  position: absolute;
  inset: -2px;
  border-radius: 15px;
  border: 1.5px solid rgba(0, 240, 255, 0);
  pointer-events: none;
  transition: border-color 0.3s;
}

.stage-index button.active .stage-ring {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

@keyframes stageRingPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.stage-index button.pulse-ring .stage-ring {
  animation: stageRingPulse 0.55s cubic-bezier(0.2, 0, 0.8, 1) forwards;
}

/* Stage status badge */
.stage-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.stage-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.75); }
}

/* ============ Hero CTA Button Ripple ============ */
.btn-hero-primary, .btn-nav-cta {
  position: relative;
  overflow: hidden;
}

.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: rippleOut 0.6s linear forwards;
  pointer-events: none;
}

@keyframes rippleOut {
  to { transform: scale(4); opacity: 0; }
}

/* ============ Feature Canvas Scanline ============ */
.lab-screen {
  position: relative;
}

.lab-scanline {
  position: absolute;
  left: 32px;
  right: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,240,255,0.7), transparent);
  box-shadow: 0 0 8px rgba(0,240,255,0.4);
  pointer-events: none;
  opacity: 0;
  top: 32px;
  transition: opacity 0.2s;
  z-index: 5;
}

.lab-screen:hover .lab-scanline {
  opacity: 1;
  animation: scanLine 2.4s linear infinite;
}

@keyframes scanLine {
  0% { top: 32px; }
  100% { top: calc(100% - 32px); }
}

/* ============ Floating orbs behind workspace ============ */
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(2%, -3%) scale(1.05); }
  66% { transform: translate(-1%, 2%) scale(0.97); }
}

/* ============ Corein Spin ============ */
@keyframes coreSpin {
  to { transform: rotateX(60deg) rotateZ(390deg); }
}

/* @media responsive adjustments for stage-index */
@media (max-width: 900px) {
  .stage-index {
    position: static;
    transform: none;
    flex-direction: row;
    justify-content: center;
    margin-top: 32px;
  }

  .stage-index button {
    min-width: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
  }
}

/* ============ Feature Lab: Liquid Glass Cards ============ */
.liquid-glass-card {
  position: relative;
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
}

.liquid-glass-card::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle at center, rgba(160, 66, 255, 0.2), rgba(0, 240, 255, 0.1), transparent 60%);
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.8s ease;
  pointer-events: none;
  z-index: -1;
  mix-blend-mode: screen;
}

.liquid-glass-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 240, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.liquid-glass-card:hover::before {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  animation: liquidAuraRotate 8s linear infinite;
}

@keyframes liquidAuraRotate {
  0% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(360deg); }
}

/* ============ Workflow: Ethereal Aurora Bloom ============ */
.ethereal-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.5s ease;
}

.ethereal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0, 240, 255, 0.15), transparent 70%);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  z-index: 0;
}

.ethereal-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 25px rgba(0, 240, 255, 0.08);
}

.ethereal-card:hover::before {
  opacity: 1;
  transform: scale(1.5);
}

.ethereal-card * {
  position: relative;
  z-index: 1;
}

/* ============ Workflow: Breathing Ribbon ============ */
.story-steps {
  position: relative;
}
.laser-path {
  position: absolute;
  top: 0;
  left: 20px;
  width: 200px;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
#laserLine {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  will-change: stroke-dashoffset;
}
.breathing-ribbon {
  animation: ribbonBreathe 6s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.3));
}

@keyframes ribbonBreathe {
  0% { transform: translateX(0px); filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.2)); }
  100% { transform: translateX(8px); filter: drop-shadow(0 0 12px rgba(160, 66, 255, 0.5)); }
}

/* ============ Video Lab: Iris Reveal & Lens Distortion ============ */
.video-demo-card {
  clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%);
  transition: filter 0.4s, transform 0.4s;
  will-change: clip-path, filter;
  position: relative;
}

.video-demo-card:hover {
  filter: contrast(1.15) saturate(1.2) hue-rotate(15deg) drop-shadow(0 0 40px rgba(160, 66, 255, 0.5));
}

.video-demo-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  background: linear-gradient(45deg, var(--cyan), var(--violet), var(--acid)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 10;
}
.video-demo-card:hover::before {
  opacity: 1;
}

/* Specific Media Queries for Laser Path */
@media (max-width: 860px) {
  .laser-path { left: 16px; width: 50px; }
}

/* ============ Server Feature UI: Assets, Mask, Multi-Angle ============ */
.asset-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  width: 100%;
}

.asset-form,
.asset-library,
.asset-picker {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.asset-form {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 14px;
}

.asset-upload-drop {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 128px;
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(3, 4, 8, 0.72);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.asset-upload-drop:hover {
  transform: translateY(-1px);
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.07);
}

.asset-upload-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.asset-upload-preview {
  display: grid;
  place-items: center;
  width: 104px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(3, 4, 8, 0.86);
  color: var(--soft);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
}

.asset-upload-preview img,
.asset-card > img,
.asset-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-upload-copy {
  display: grid;
  gap: 6px;
}

.asset-upload-copy strong,
.asset-library-head h2,
.asset-picker-head strong {
  margin: 0;
  color: var(--ink);
}

.asset-upload-copy small,
.asset-lora,
.asset-card p,
.asset-picker-empty,
.asset-picker-meta {
  color: var(--muted);
  font-size: 12px;
}

.asset-library {
  display: flex;
  flex-direction: column;
  min-height: 460px;
  overflow: hidden;
}

.asset-library-head,
.asset-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.asset-library-head {
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  padding: 14px;
  overflow-y: auto;
}

.asset-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(8, 10, 16, 0.82);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.asset-card:hover,
.asset-card.selected {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.58);
  background: rgba(15, 18, 29, 0.94);
}

.asset-card.selected {
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.35), 0 0 24px rgba(0, 240, 255, 0.12);
}

.asset-card > img {
  display: block;
  aspect-ratio: 4 / 3;
  background: #030408;
}

.asset-card-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.asset-trigger {
  overflow: hidden;
  color: var(--ink);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-lora {
  overflow: hidden;
  font-family: var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card p {
  display: -webkit-box;
  min-height: 36px;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.asset-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.asset-picker {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.asset-picker-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
}

.asset-chip {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(3, 4, 8, 0.68);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.asset-chip:hover,
.asset-chip.selected {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
}

.asset-chip img {
  display: block;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: #030408;
}

.asset-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-picker-meta {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(3, 4, 8, 0.68);
}

.mask-editor,
.multi-angle-editor {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.mask-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mask-header h3 {
  margin: 0;
  font-size: 15px;
}

.mask-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mask-controls label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.mask-controls button,
.mask-toggle,
.angle-preset-btn {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.mask-controls button:hover,
.mask-toggle:hover,
.angle-preset-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.mask-canvas-container {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #030408;
}

.mask-canvas-container img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
}

.mask-body {
  overflow: hidden;
  transition: max-height 0.28s ease, opacity 0.28s ease;
}

.mask-body.collapsed {
  max-height: 0 !important;
  opacity: 0;
}

.mask-hint {
  margin: 8px 0 0;
  color: var(--soft);
  font-size: 12px;
}

.angle-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.angle-sliders {
  display: grid;
  gap: 10px;
}

.angle-sliders label {
  display: grid;
  grid-template-columns: 64px 42px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.angle-sliders label span {
  color: var(--ink);
  font-family: var(--font-mono);
  text-align: right;
}

.angle-preview {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.angle-preview svg {
  width: 132px;
  height: 132px;
}

@media (max-width: 860px) {
  .asset-workbench {
    grid-template-columns: 1fr;
  }

  .asset-library {
    min-height: 0;
  }

  .asset-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    overflow: visible;
  }

  .asset-upload-drop {
    grid-template-columns: 82px minmax(0, 1fr);
    min-height: 102px;
  }

  .asset-upload-preview {
    width: 82px;
  }

  .asset-picker-rail {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  }

  .mask-editor,
  .multi-angle-editor {
    padding: 12px;
  }

  .mask-header {
    align-items: stretch;
    flex-direction: column;
  }

  .mask-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mask-controls label {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .mask-canvas-container {
    max-width: 100%;
    overflow: auto;
  }

  .mask-canvas-container img,
  #maskSourceImage {
    max-height: 44svh !important;
  }

  #maskCanvas {
    touch-action: none;
  }

  .angle-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .angle-preset-btn {
    width: 100%;
  }
}

/* Keep the workspace inside narrow viewports without hiding server features. */
.app,
.workspace-shell,
.panel,
.tab-content,
.form,
.asset-workbench,
.asset-form,
.asset-library,
.asset-picker,
.media-grid,
.media-item {
  min-width: 0;
}

.app {
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

.workspace-shell {
  width: 100%;
  overflow: hidden;
}

@media (max-width: 860px) {
  body.workspace-active {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.workspace-active .app {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .header {
    gap: 8px;
    padding: 0 12px;
  }

  .header-left,
  .header-right,
  .logo {
    min-width: 0;
  }

  .header-left {
    flex: 1 1 auto;
    gap: 8px;
  }

  .header-right {
    flex: 0 1 auto;
    justify-content: flex-end;
    gap: 6px;
  }

  .header .status-badge {
    display: none;
  }

  .header .logo {
    gap: 8px;
  }

  .header .logo svg {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
  }

  .header .logo h1 {
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-info {
    flex: 0 1 80px;
    gap: 4px;
    max-width: 80px;
    padding: 6px 8px;
  }

  .user-info svg {
    display: none;
  }

  .user-info input {
    width: 64px;
    min-width: 0;
  }

  .workspace-shell {
    grid-template-columns: minmax(0, 1fr);
    display: block;
    min-height: 0;
    overflow: visible;
    perspective: none;
    transform-style: flat;
  }

  .panel {
    width: 100%;
    max-width: 100vw;
    border-right: 0;
  }

  .compose-panel {
    max-height: none;
    border-bottom: 1px solid var(--border);
  }

  .panel-header {
    padding: 16px;
  }

  .panel-header h2 {
    font-size: 18px;
  }

  .job-list {
    min-height: 132px;
    max-height: 34dvh;
    padding: 12px;
  }

  .tab-bar {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 16px 0;
  }

  .tab-btn {
    flex: 0 0 auto;
    padding: 10px 16px;
  }

  .tab-content {
    padding: 16px;
    overflow: visible;
  }

  .mode-tabs {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    align-items: center;
    margin-bottom: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: var(--radius);
  }

  .mode-tabs button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 8px 16px;
    line-height: 1.2;
  }

  .image-inputs,
  .media-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .file-slot {
    padding: 16px;
  }

  .form-row {
    flex-direction: column;
  }

  .asset-library-head,
  .asset-picker-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-jump-widget {
    right: 14px;
    bottom: 14px;
    min-height: 46px;
    max-width: calc(100vw - 28px);
    padding: 0 14px;
    font-size: 13px;
  }

  .chat-jump-widget svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 860px) {
  body.workspace-active {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.workspace-active .app {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  body.workspace-active .workspace-shell {
    display: block;
    min-height: 0;
    overflow: visible;
    perspective: none;
    transform-style: flat;
  }

  body.workspace-active .panel,
  body.workspace-active .output-panel {
    min-height: auto;
  }

  body.workspace-active .compose-panel {
    max-height: none;
    border-bottom: 1px solid var(--border);
  }

  body.workspace-active .tab-content {
    min-height: 0;
    overflow: visible;
  }

  body.workspace-active .job-list {
    min-height: 132px;
    max-height: 34dvh;
    overflow-y: auto;
  }
}
