/*
  Starblaze.ai — Cosmic Coming Soon Styles
  Dark space aesthetic with neon accents
*/

/* ========================================
   CSS Variables
   ======================================== */

:root {
  /* Color Palette */
  --color-deep-space: #0B0E14;
  --color-cosmos-navy: #0A1B2E;
  --color-electric-blue: #4FC3F7;
  --color-blaze-orange: #FF7A18;
  --color-star-white: #F5F8FF;
  --color-muted-text: #95A1B2;

  /* Gradients */
  --gradient-blaze: linear-gradient(135deg, var(--color-blaze-orange), var(--color-electric-blue));
  --gradient-nebula: radial-gradient(ellipse at 30% 20%, rgba(79, 195, 247, 0.15) 0%, transparent 50%),
                      radial-gradient(ellipse at 70% 80%, rgba(255, 122, 24, 0.1) 0%, transparent 50%);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  /* Typography */
  --font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-base: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 3rem;
  --font-size-4xl: 4rem;
  --letter-spacing-wide: 0.05em;
  --letter-spacing-wider: 0.1em;

  /* Effects */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --shadow-glow-blue: 0 0 20px rgba(79, 195, 247, 0.4), 0 0 40px rgba(79, 195, 247, 0.2);
  --shadow-glow-orange: 0 0 20px rgba(255, 122, 24, 0.4), 0 0 40px rgba(255, 122, 24, 0.2);
  --shadow-glow-mixed: 0 0 30px rgba(79, 195, 247, 0.3), 0 0 60px rgba(255, 122, 24, 0.2);

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --duration-fast: 0.2s;
  --duration-normal: 0.4s;
  --duration-slow: 0.6s;
}

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

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

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

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-star-white);
  background-color: var(--color-deep-space);
  background-image: var(--gradient-nebula);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Persistent starfield background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(1px 1px at 20% 30%, white, transparent),
    radial-gradient(1px 1px at 60% 70%, white, transparent),
    radial-gradient(1px 1px at 50% 50%, white, transparent),
    radial-gradient(1px 1px at 80% 10%, white, transparent),
    radial-gradient(1px 1px at 90% 60%, white, transparent),
    radial-gradient(1px 1px at 33% 80%, white, transparent),
    radial-gradient(1px 1px at 15% 90%, white, transparent),
    radial-gradient(1px 1px at 70% 40%, white, transparent),
    radial-gradient(2px 2px at 25% 15%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(2px 2px at 75% 85%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 45% 25%, rgba(79, 195, 247, 0.6), transparent),
    radial-gradient(1px 1px at 85% 45%, rgba(255, 122, 24, 0.6), transparent);
  background-size: 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 300% 300%, 300% 300%, 250% 250%, 250% 250%;
  background-position: 0% 0%, 100% 100%, 50% 50%, 0% 100%, 100% 0%, 33% 66%, 66% 33%, 10% 90%, 20% 80%, 80% 20%, 40% 60%, 60% 40%;
  opacity: 0.6;
  pointer-events: none;
  z-index: 1;
  animation: twinkleStars 100s linear infinite;
}

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

@keyframes twinkleStars {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.4;
  }
}

main {
  position: relative;
  z-index: 2;
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: var(--letter-spacing-wide);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

a:hover {
  color: var(--color-electric-blue);
}

a:focus-visible {
  outline: 2px solid var(--color-electric-blue);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

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

.glow {
  box-shadow: var(--shadow-glow-mixed);
}

/* ========================================
   Motion Toggle Button
   ======================================== */

.motion-toggle {
  position: fixed;
  top: var(--space-sm);
  right: var(--space-sm);
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 14, 20, 0.8);
  backdrop-filter: blur(10px);
  color: var(--color-star-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.motion-toggle:hover {
  background: rgba(11, 14, 20, 0.95);
  border-color: var(--color-electric-blue);
  box-shadow: var(--shadow-glow-blue);
  transform: scale(1.05);
}

.motion-toggle:active {
  transform: scale(0.95);
}

.motion-toggle:focus-visible {
  outline: 2px solid var(--color-electric-blue);
  outline-offset: 2px;
}

.motion-toggle.reduced {
  color: var(--color-blaze-orange);
  border-color: var(--color-blaze-orange);
}

/* ========================================
   Header
   ======================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: var(--space-md);
  z-index: 100;
  background: linear-gradient(to bottom, rgba(11, 14, 20, 0.9), transparent);
}

.logo-link {
  display: inline-block;
  transition: transform var(--duration-normal) var(--ease-smooth);
}

.logo-link:hover {
  transform: translateY(-2px);
}

.logo-link:focus-visible {
  outline: 2px solid var(--color-electric-blue);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.logo {
  height: 40px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 10px rgba(79, 195, 247, 0.3));
  transition: filter var(--duration-normal) var(--ease-smooth);
}

.logo-link:hover .logo {
  filter: drop-shadow(0 0 20px rgba(79, 195, 247, 0.5)) drop-shadow(0 0 40px rgba(255, 122, 24, 0.3));
  animation: starTwinkle 0.6s var(--ease-smooth);
}

@keyframes starTwinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

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

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at center, var(--color-cosmos-navy) 0%, var(--color-deep-space) 70%);
}

/* Video Background (Square 1:1 aspect ratio) */
.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  /* For square video, use height to fill viewport and center horizontally */
  min-width: 100vh;
  min-height: 100vh;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  opacity: 0.6;
  z-index: 0;
}

/* On mobile/portrait, fill by width instead */
@media (max-aspect-ratio: 1/1) {
  .hero-video {
    min-width: 100vw;
    min-height: 100vw;
  }
}

.hero-video.hidden {
  display: none;
}

/* Canvas Fallback */
.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: none;
}

.hero-canvas.active {
  display: block;
}

/* Hero Content */
.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 800px;
  padding: var(--space-md);
  animation: fadeInUp 1s var(--ease-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

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

/* Hero Logo Text Overlay */
.hero-logo-text {
  font-family: var(--font-family);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  line-height: 1.1;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2em;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.hero-logo-main {
  font-size: clamp(2.5rem, 10vw, 6rem);
  color: var(--color-star-white);
  display: block;
  font-weight: 900;
}

.hero-logo-sub {
  font-size: clamp(1.5rem, 6vw, 4rem);
  color: var(--color-star-white);
  display: block;
  font-weight: 700;
  margin-top: -0.2em;
}

.hero-title {
  font-size: clamp(var(--font-size-2xl), 5vw, var(--font-size-4xl));
  margin-bottom: var(--space-md);
  letter-spacing: var(--letter-spacing-wide);
  background: linear-gradient(135deg, var(--color-star-white), var(--color-electric-blue));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(79, 195, 247, 0.3);
}

.hero-subtitle {
  font-size: clamp(var(--font-size-lg), 3vw, var(--font-size-xl));
  color: var(--color-muted-text);
  margin-bottom: var(--space-sm);
  letter-spacing: var(--letter-spacing-wider);
}

.hero-kicker {
  font-size: var(--font-size-base);
  color: var(--color-blaze-orange);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wider);
  opacity: 0.8;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  color: var(--color-muted-text);
  animation: bounce 2s infinite;
  opacity: 0.6;
}

@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 10px); }
}

.scroll-indicator svg {
  display: block;
}

/* ========================================
   Signals Section
   ======================================== */

.signals {
  padding: var(--space-xl) var(--space-md);
  position: relative;
}

.signals-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.signal-card {
  background: rgba(10, 27, 46, 0.4);
  border: 1px solid rgba(79, 195, 247, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--duration-normal) var(--ease-smooth);
  backdrop-filter: blur(10px);
}

.signal-card:hover {
  transform: scale(1.02);
  border-color: var(--color-electric-blue);
  box-shadow: var(--shadow-glow-blue);
  background: rgba(10, 27, 46, 0.6);
}

.signal-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-md);
  color: var(--color-electric-blue);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.signal-card:hover .signal-icon {
  color: var(--color-blaze-orange);
  filter: drop-shadow(var(--shadow-glow-orange));
  transform: translateY(-4px);
}

.signal-title {
  font-size: var(--font-size-xl);
  color: var(--color-star-white);
  letter-spacing: var(--letter-spacing-wide);
}

/* ========================================
   Contact Section
   ======================================== */

.contact {
  padding: var(--space-xl) var(--space-md);
  background: radial-gradient(ellipse at center, rgba(10, 27, 46, 0.6), transparent);
  position: relative;
}

.contact-container {
  max-width: 600px;
  margin: 0 auto;
}

.contact-title {
  font-size: clamp(var(--font-size-xl), 4vw, var(--font-size-3xl));
  text-align: center;
  margin-bottom: var(--space-lg);
  background: var(--gradient-blaze);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-label {
  font-size: var(--font-size-base);
  color: var(--color-star-white);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  font-size: 0.875rem;
  font-weight: 600;
}

.form-input,
.form-textarea {
  padding: var(--space-sm) var(--space-md);
  background: rgba(11, 14, 20, 0.6);
  border: 1px solid rgba(79, 195, 247, 0.3);
  border-radius: var(--radius-md);
  color: var(--color-star-white);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  transition: all var(--duration-normal) var(--ease-smooth);
  backdrop-filter: blur(10px);
}

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

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-electric-blue);
  box-shadow: var(--shadow-glow-blue);
  background: rgba(11, 14, 20, 0.8);
}

.form-input:focus-visible,
.form-textarea:focus-visible {
  outline: 2px solid var(--color-electric-blue);
  outline-offset: 2px;
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Form Button */
.form-button {
  padding: var(--space-sm) var(--space-lg);
  background: var(--gradient-blaze);
  border: none;
  border-radius: var(--radius-md);
  color: var(--color-star-white);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 700;
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  align-self: flex-start;
  transition: all var(--duration-normal) var(--ease-smooth);
  box-shadow: 0 4px 20px rgba(79, 195, 247, 0.3);
}

.form-button:hover {
  box-shadow: var(--shadow-glow-mixed);
  transform: translateY(-2px);
}

.form-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(79, 195, 247, 0.4);
}

.form-button:focus-visible {
  outline: 2px solid var(--color-electric-blue);
  outline-offset: 4px;
}

.form-button svg {
  transition: transform var(--duration-normal) var(--ease-smooth);
}

.form-button:hover svg {
  transform: translateX(4px);
}

/* Fallback mailto link */
.contact-fallback {
  margin-top: var(--space-md);
  text-align: center;
}

.contact-link {
  color: var(--color-electric-blue);
  text-decoration: underline;
}

.contact-link:hover {
  color: var(--color-blaze-orange);
}

/* Social Links */
.social-links {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-top: var(--space-lg);
}

.social-link {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(10, 27, 46, 0.4);
  border: 1px solid rgba(79, 195, 247, 0.2);
  color: var(--color-star-white);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.social-link:hover {
  background: rgba(10, 27, 46, 0.8);
  border-color: var(--color-electric-blue);
  box-shadow: var(--shadow-glow-blue);
  transform: translateY(-2px);
}

.social-link:focus-visible {
  outline: 2px solid var(--color-electric-blue);
  outline-offset: 2px;
}

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

.site-footer {
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  border-top: 1px solid rgba(79, 195, 247, 0.1);
}

.footer-legal {
  font-size: 0.875rem;
  color: var(--color-muted-text);
  letter-spacing: var(--letter-spacing-wide);
}

/* ========================================
   Reduced Motion Preferences
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scroll-indicator {
    animation: none;
  }

  .logo-link:hover .logo {
    animation: none;
  }

  .hero-content {
    animation: none;
  }

  .signal-card:hover {
    transform: none;
  }

  .signal-card:hover .signal-icon {
    transform: none;
  }

  .form-button:hover {
    transform: none;
  }

  .social-link:hover {
    transform: none;
  }
}

/* Reduced motion via JS toggle */
body.motion-reduced *,
body.motion-reduced *::before,
body.motion-reduced *::after {
  animation: none !important;
  transition: none !important;
}

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

@media (max-width: 768px) {
  :root {
    --space-lg: 3rem;
    --space-xl: 4rem;
  }

  .site-header {
    padding: var(--space-sm) var(--space-md);
  }

  .hero-content {
    padding: var(--space-sm);
    gap: var(--space-md);
  }

  .hero-logo-main {
    font-size: clamp(2.5rem, 10vw, 6rem);
  }

  .hero-logo-sub {
    font-size: clamp(1.5rem, 6vw, 4rem);
  }

  .signals-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .contact-container {
    padding: 0 var(--space-sm);
  }
}

@media (max-width: 480px) {
  .motion-toggle {
    top: var(--space-xs);
    right: var(--space-xs);
    width: 40px;
    height: 40px;
  }

  .logo {
    height: 32px;
  }

  .hero-title {
    font-size: var(--font-size-2xl);
  }

  .hero-subtitle {
    font-size: var(--font-size-lg);
  }

  .signal-title {
    font-size: var(--font-size-lg);
  }
}
