/* ============================================
   KAI / kəˈnektəd Waitlist - Custom Styles
   Ethereal Portal Color Palette
   ============================================ */

/* CSS Variables */
:root {
  --kai-twilight: #1E3A8A;
  --kai-twilight-dark: #152a66;
  --kai-sky: #60A5FA;
  --kai-sky-light: #93c5fd;
  --kai-gold: #F59E0B;
  --kai-gold-light: #fbbf24;
  --kai-violet: #C026D3;
  --kai-violet-light: #d946ef;
  --kai-white: #F8FAFC;
  --kai-white-muted: #94a3b8;
  --kai-bg: #0c1426;
  --kai-surface: #1a2744;
  --kai-error: #ef4444;
  --kai-success: #22c55e;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

/* Selection */
::selection {
  background: var(--kai-sky);
  color: var(--kai-bg);
}

/* ============================================
   BRAND ELEMENTS: Light Nodes & Particles
   ============================================ */

/* Starfield / Light Nodes Container */
.light-nodes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Individual light node */
.light-node {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--kai-sky);
  border-radius: 50%;
  opacity: 0;
  animation: twinkle 4s ease-in-out infinite;
}

.light-node::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: inherit;
  border-radius: 50%;
  filter: blur(3px);
  opacity: 0.5;
}

/* Variations for organic feel */
.light-node--gold { background: var(--kai-gold); }
.light-node--violet { background: var(--kai-violet); }
.light-node--white { background: var(--kai-white); opacity: 0.6; }

/* Different animation delays for natural movement */
.light-node:nth-child(1) { top: 10%; left: 15%; animation-delay: 0s; }
.light-node:nth-child(2) { top: 20%; left: 80%; animation-delay: 0.5s; }
.light-node:nth-child(3) { top: 35%; left: 25%; animation-delay: 1s; }
.light-node:nth-child(4) { top: 45%; left: 70%; animation-delay: 1.5s; }
.light-node:nth-child(5) { top: 60%; left: 10%; animation-delay: 2s; }
.light-node:nth-child(6) { top: 75%; left: 85%; animation-delay: 2.5s; }
.light-node:nth-child(7) { top: 15%; left: 50%; animation-delay: 0.7s; }
.light-node:nth-child(8) { top: 85%; left: 40%; animation-delay: 1.2s; }
.light-node:nth-child(9) { top: 50%; left: 90%; animation-delay: 1.8s; }
.light-node:nth-child(10) { top: 30%; left: 5%; animation-delay: 0.3s; }
.light-node:nth-child(11) { top: 70%; left: 60%; animation-delay: 2.2s; }
.light-node:nth-child(12) { top: 5%; left: 35%; animation-delay: 0.9s; }

@keyframes twinkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 0.8;
    transform: scale(1);
  }
}

/* Kinetic connection lines (subtle neural network effect) */
.kinetic-lines {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.15;
}

.kinetic-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--kai-sky), transparent);
  transform-origin: left center;
  animation: kinetic-pulse 8s ease-in-out infinite;
}

.kinetic-line:nth-child(1) {
  top: 20%;
  left: 10%;
  width: 200px;
  transform: rotate(25deg);
  animation-delay: 0s;
}

.kinetic-line:nth-child(2) {
  top: 40%;
  left: 60%;
  width: 150px;
  transform: rotate(-15deg);
  animation-delay: 2s;
}

.kinetic-line:nth-child(3) {
  top: 70%;
  left: 20%;
  width: 180px;
  transform: rotate(10deg);
  animation-delay: 4s;
}

@keyframes kinetic-pulse {
  0%, 100% {
    opacity: 0;
    transform: scaleX(0) rotate(var(--rotation, 0deg));
  }
  50% {
    opacity: 1;
    transform: scaleX(1) rotate(var(--rotation, 0deg));
  }
}

/* ============================================
   BRAND ELEMENTS: Breathing Circles
   Communities within communities - living & growing
   ============================================ */

.breathing-circles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breathing-circle {
  position: absolute;
  border-radius: 50%;
  animation: breathe 8s ease-in-out infinite;
}

/* Outer circle - largest community */
.breathing-circle--outer {
  width: 600px;
  height: 600px;
  background: conic-gradient(
    from 0deg,
    rgba(96, 165, 250, 0.15),
    rgba(245, 158, 11, 0.12),
    rgba(192, 38, 211, 0.1),
    rgba(96, 165, 250, 0.15)
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), white calc(100% - 1px), white 100%, transparent 100%);
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), white calc(100% - 1px), white 100%, transparent 100%);
}

/* Middle circle */
.breathing-circle--middle {
  width: 400px;
  height: 400px;
  background: conic-gradient(
    from 90deg,
    rgba(245, 158, 11, 0.18),
    rgba(96, 165, 250, 0.12),
    rgba(192, 38, 211, 0.1),
    rgba(245, 158, 11, 0.18)
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), white calc(100% - 1px), white 100%, transparent 100%);
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), white calc(100% - 1px), white 100%, transparent 100%);
  animation-delay: 1s;
  animation-duration: 10s;
}

/* Inner circle - intimate community */
.breathing-circle--inner {
  width: 200px;
  height: 200px;
  background: conic-gradient(
    from 180deg,
    rgba(192, 38, 211, 0.2),
    rgba(96, 165, 250, 0.15),
    rgba(245, 158, 11, 0.12),
    rgba(192, 38, 211, 0.2)
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), white calc(100% - 1px), white 100%, transparent 100%);
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), white calc(100% - 1px), white 100%, transparent 100%);
  animation-delay: 2s;
  animation-duration: 6s;
}

/* Solid color circle variations */
.breathing-circle--sky {
  border: 1px solid rgba(96, 165, 250, 0.2);
  background: transparent;
}

.breathing-circle--gold {
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: transparent;
}

.breathing-circle--violet {
  border: 1px solid rgba(192, 38, 211, 0.2);
  background: transparent;
}

@keyframes breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.7;
  }
}

/* ============================================
   BRAND ELEMENTS: Glowing Orb / Sun Center
   ============================================ */

.glowing-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: orb-pulse 6s ease-in-out infinite;
}

.glowing-orb--gold {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
  filter: blur(40px);
}

.glowing-orb--sky {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.1) 0%, transparent 70%);
  filter: blur(60px);
}

.glowing-orb--violet {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(192, 38, 211, 0.1) 0%, transparent 70%);
  filter: blur(50px);
}

@keyframes orb-pulse {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

/* ============================================
   BRAND ELEMENTS: Spiral (Kai's essence)
   ============================================ */

.spiral-element {
  position: absolute;
  width: 400px;
  height: 400px;
  pointer-events: none;
  opacity: 0.1;
  animation: spiral-rotate 60s linear infinite;
}

.spiral-element svg {
  width: 100%;
  height: 100%;
}

@keyframes spiral-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--kai-bg);
  background: linear-gradient(135deg, var(--kai-gold) 0%, var(--kai-gold-light) 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 56px;
  text-decoration: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--kai-gold-light) 0%, var(--kai-gold) 100%);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--kai-sky);
  background: transparent;
  border: 2px solid var(--kai-sky);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 56px;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(96, 165, 250, 0.1);
  border-color: var(--kai-sky-light);
  transform: translateY(-2px);
}

/* Glass Card */
.glass-card {
  background: rgba(26, 39, 68, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(96, 165, 250, 0.3);
}

/* Form Inputs */
.input-field {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  color: var(--kai-white);
  background: rgba(26, 39, 68, 0.8);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 12px;
  outline: none;
  transition: all 0.3s ease;
  min-height: 56px;
}

.input-field::placeholder {
  color: var(--kai-white-muted);
  opacity: 0.6;
}

.input-field:focus {
  border-color: var(--kai-sky);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.input-field.error {
  border-color: var(--kai-error);
}

/* Radio Options */
.radio-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: rgba(26, 39, 68, 0.6);
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.radio-option:hover {
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(26, 39, 68, 0.8);
}

.radio-option.selected {
  border-color: var(--kai-sky);
  background: rgba(96, 165, 250, 0.1);
}

.radio-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--kai-white-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.radio-option.selected .radio-dot {
  border-color: var(--kai-sky);
  background: var(--kai-sky);
}

.radio-option.selected .radio-dot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--kai-bg);
}

/* Checkbox */
.checkbox-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--kai-white-muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.checkbox-box:hover {
  border-color: var(--kai-sky);
}

/* Social Icons */
.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(96, 165, 250, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kai-white-muted);
  transition: all 0.3s ease;
}

.social-icon:hover {
  border-color: var(--kai-sky);
  color: var(--kai-sky);
  transform: translateY(-2px);
}

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

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce-slow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(96, 165, 250, 0.4);
  }
}

.animate-fade-in {
  animation: fade-in 0.8s ease-out forwards;
}

.animate-fade-in-up {
  animation: fade-in-up 0.8s ease-out forwards;
}

.animate-bounce-slow {
  animation: bounce-slow 2s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

.animation-delay-200 {
  animation-delay: 0.2s;
  opacity: 0;
}

.animation-delay-400 {
  animation-delay: 0.4s;
  opacity: 0;
}

.animation-delay-600 {
  animation-delay: 0.6s;
  opacity: 0;
}

/* Scroll Indicator */
.scroll-indicator {
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.scroll-indicator:hover {
  opacity: 1;
}

/* Focus States */
*:focus-visible {
  outline: 2px solid var(--kai-sky);
  outline-offset: 2px;
}

/* ============================================
   Accessibility: Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .light-nodes,
  .kinetic-lines,
  .breathing-circles,
  .spiral-element {
    display: none;
  }
  
  .glowing-orb {
    animation: none;
  }
}

/* Loading State */
.btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hide default elements */
.hidden {
  display: none !important;
}

/* Smooth scrolling offset for fixed header */
html {
  scroll-padding-top: 80px;
}
