@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Theme V1: Ethereal Horizon (Reference Screenshot Style) --- */
html[data-theme="v1"], html:not([data-theme]) {
  color-scheme: light;
  --bg-page: #FFFFFF;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --pill-bg: rgba(255, 255, 255, 0.75);
  --pill-border: rgba(15, 23, 42, 0.12);
  --pill-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  --btn-bg: #0F172A;
  --btn-text: #FFFFFF;
  --btn-hover: #1E293B;
  --accent: #0284C7;
  --modal-bg: rgba(255, 255, 255, 0.92);
  --modal-border: rgba(15, 23, 42, 0.1);
  --input-bg: #F8FAFC;
  --input-border: #E2E8F0;
  --link-color: #334155;
  --link-hover: #0284C7;
}

/* --- Theme V2: Obsidian Void (Dark Cyber / Neo-Luxury) --- */
html[data-theme="v2"] {
  color-scheme: dark;
  --bg-page: #07080D;
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --pill-bg: rgba(15, 18, 28, 0.8);
  --pill-border: rgba(255, 255, 255, 0.12);
  --pill-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  --btn-bg: #FFFFFF;
  --btn-text: #07080D;
  --btn-hover: #E2E8F0;
  --accent: #38BDF8;
  --modal-bg: rgba(15, 18, 28, 0.95);
  --modal-border: rgba(255, 255, 255, 0.12);
  --input-bg: #0B0D14;
  --input-border: rgba(255, 255, 255, 0.1);
  --link-color: #94A3B8;
  --link-hover: #FFFFFF;
}

/* --- Theme V3: Cosmic Velvet (Deep Royal Indigo & Stardust) --- */
html[data-theme="v3"] {
  color-scheme: dark;
  --bg-page: #0B0B1A;
  --text-primary: #FFFFFF;
  --text-secondary: #A5B4FC;
  --text-muted: #6366F1;
  --pill-bg: rgba(20, 20, 42, 0.85);
  --pill-border: rgba(165, 180, 252, 0.2);
  --pill-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(165, 180, 252, 0.15) inset;
  --btn-bg: #6366F1;
  --btn-text: #FFFFFF;
  --btn-hover: #4F46E5;
  --accent: #818CF8;
  --modal-bg: rgba(20, 20, 42, 0.95);
  --modal-border: rgba(165, 180, 252, 0.2);
  --input-bg: #0F0F24;
  --input-border: rgba(165, 180, 252, 0.15);
  --link-color: #C7D2FE;
  --link-hover: #FFFFFF;
}

/* Theme-based Logo Visibility */
html[data-theme="v1"] .logo-dark, 
html:not([data-theme]) .logo-dark { 
  display: none !important; 
}
html[data-theme="v1"] .logo-light, 
html:not([data-theme]) .logo-light { 
  display: inline-block !important; 
}

html[data-theme="v2"] .logo-light, 
html[data-theme="v3"] .logo-light { 
  display: none !important; 
}
html[data-theme="v2"] .logo-dark, 
html[data-theme="v3"] .logo-dark { 
  display: inline-block !important; 
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100dvh;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  /* Removed transition for instant 0ms theme swap */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient WebGL / 2D Canvas */
#ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* Subtle Film Grain Texture */
.grain-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

h1, h2, h3, .font-display {
  font-family: var(--font-display);
  font-style: normal;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

/* Interactive Pill Bar */
.capture-pill {
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  box-shadow: var(--pill-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.capture-pill:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2), var(--pill-shadow);
}

/* Tactile Physics */
.btn-primary {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
}

.btn-primary:hover {
  background-color: var(--btn-hover);
}

.btn-primary:active {
  transform: scale(0.97);
}

/* Theme Switcher Button */
.theme-btn {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.theme-btn:hover {
  color: var(--text-primary);
}

.theme-btn.active {
  color: var(--text-primary);
  background: rgba(125, 125, 125, 0.12);
  box-shadow: 0 0 0 1px var(--pill-border);
}

/* Subtle Link Underline Effect */
.interactive-link {
  color: var(--link-color);
  transition: color 0.2s ease;
  position: relative;
  text-decoration: none;
}

.interactive-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 1px;
  background-color: currentColor;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.interactive-link:hover::after {
  width: 100%;
}

/* Interactive Modal */
.modal-backdrop {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--modal-bg);
  border: 1px solid var(--modal-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.modal-backdrop.active .modal-card {
  transform: scale(1) translateY(0);
}

/* Toast */
.toast-box {
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.toast-box.active {
  transform: translateY(0);
  opacity: 1;
}

/* Sparkle icon spin microinteraction */
.sparkle-icon {
  animation: sparkle-float 6s infinite ease-in-out;
}

@keyframes sparkle-float {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.9; }
  50% { transform: scale(1.15) rotate(180deg); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .sparkle-icon, * {
    animation: none !important;
    transition: none !important;
  }
}
/* --- Staggered Entrance Animations --- */
@keyframes slideFadeUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  opacity: 0;
  animation: slideFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }

/* --- Text Shimmer / Gradient --- */
@keyframes textShimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.text-shimmer {
  background: linear-gradient(
    90deg, 
    var(--text-primary) 0%, 
    var(--accent) 50%, 
    var(--text-primary) 100%
  );
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: textShimmer 4s ease-in-out infinite;
}

/* --- Premium Infinite Marquee --- */
.marquee-container {
  position: relative;
  display: flex;
  overflow: hidden;
  width: 100%;
  /* Creates a smooth fade out on the left and right edges */
  mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.marquee-content {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: scroll-marquee 40s linear infinite;
  will-change: transform;
}

/* Pause on hover for a premium interactive feel */
.marquee-container:hover .marquee-content {
  animation-play-state: paused;
}

@keyframes scroll-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  padding: 0 1rem;
}
