/* ========================================
   KingChat Landing Page - Exact Framer Match
   ======================================== */

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

:root {
  --bg: rgb(10, 10, 10);
  --text-primary: rgb(240, 240, 240);
  --text-secondary: rgba(255, 255, 255, 0.56);
  --text-muted: rgb(153, 153, 153);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.08);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
}

html, body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ========================================
   Background Container (Framer Structure)
   ======================================== */
.background-container {
  position: fixed;
  width: 1200px;
  height: 800px;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg);
  overflow: hidden;
  z-index: 0;
}

/* Gradient Canvas Wrapper */
.gradient-wrapper {
  position: absolute;
  inset: 0;
  overflow: visible;
}

#gradientCanvas {
  position: absolute;
  width: 100%;
  height: 100%;
}

/* Blur Overlay */
.blur-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 588px;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
  backdrop-filter: blur(80px);
  -webkit-backdrop-filter: blur(80px);
}

/* Particles */
.particles-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 588px;
}

#particlesCanvas {
  width: 100%;
  height: 100%;
}

/* Top Linear Gradient */
.top-linear {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
}

/* Radial Glow in Middle */
.radial-glow {
  position: absolute;
  bottom: 265px;
  left: calc(47.9167% - 393.5px);
  width: 787px;
  height: 111px;
  background: radial-gradient(50% 50%, rgba(255, 255, 255, 0.5) 0%, transparent 100%);
  filter: blur(57px);
}

/* Ellipse Glow */
.ellipse-glow {
  position: absolute;
  bottom: -662px;
  left: -443px;
  right: -443px;
  height: 955px;
  background: linear-gradient(to bottom, white 0%, transparent 100%);
  border-radius: 100%;
}

/* Base Glow - The Main Effect */
.base-glow {
  position: absolute;
  bottom: -668px;
  left: -521px;
  right: -521px;
  aspect-ratio: 2.34682;
  background-color: var(--bg);
  border-radius: 100%;
  box-shadow: 
    inset 0 2px 20px white,
    0 -10px 50px 1px rgba(255, 255, 255, 0.49);
}

/* Fade Container */
.fade-container {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.fade-left {
  width: 600px;
  height: 100%;
  background: linear-gradient(to right, var(--bg) 0%, transparent 100%);
}

.fade-right {
  width: 600px;
  height: 100%;
  background: linear-gradient(to left, var(--bg) 0%, transparent 100%);
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
}

/* ========================================
   Badge
   ======================================== */
.badge {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50px;
  width: 430px;
  
  /* Animation */
  opacity: 0;
  transform: translateY(100px) scale(0.9);
  animation: badgeAppear 0.8s cubic-bezier(0.33, 1, 0.68, 1) 0.1s forwards;
}

@keyframes badgeAppear {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.badge p {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.03em;
  text-align: center;
  color: var(--text-primary);
}

/* ========================================
   Heading Section
   ======================================== */
.heading-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 26px;
  width: 100%;
  height: 264px;
}

.main-heading {
  font-family: var(--font-sans);
  font-size: 60px;
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 110%;
  text-align: center;
  color: var(--text-primary);
  width: 60%;
  max-width: 100%;
}

.main-heading .serif-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

.sub-heading {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 150%;
  text-align: center;
  color: var(--text-secondary);
  width: 46%;
  max-width: 100%;
}

/* ========================================
   Email Form
   ======================================== */
.form-wrapper {
  width: 395px;
  
  /* Animation */
  opacity: 0;
  animation: formAppear 0.8s cubic-bezier(0.33, 1, 0.68, 1) 1s forwards;
}

@keyframes formAppear {
  to {
    opacity: 1;
  }
}

.email-form {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: row;
  gap: 0;
}

.email-input {
  width: 100%;
  padding: 16px 136px 16px 16px;
  background: rgba(10, 10, 10, 0.56);
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.04em;
  line-height: 1.2em;
  color: white;
  outline: none;
  box-shadow: 
    inset 0 0 0 0px var(--border-subtle),
    inset 0 0 0 1px var(--border-subtle);
}

.email-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.submit-wrapper {
  position: absolute;
  top: 5px;
  right: 5px;
  bottom: 5px;
}

/* Button container for glow effect */
.submit-btn {
  position: relative;
  width: 120px;
  height: 100%;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Rotating glow border - the magic happens here */
.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  padding: 2px;
  background: conic-gradient(
    from var(--angle, 0deg),
    transparent 0%,
    #402fb5 10%,
    transparent 20%,
    transparent 45%,
    #cf30aa 55%,
    transparent 65%,
    transparent 100%
  );
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: rotate-border 3s linear infinite;
}

/* Glow blur layer */
.submit-btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  background: conic-gradient(
    from var(--angle, 0deg),
    transparent 0%,
    rgba(64, 47, 181, 0.5) 10%,
    transparent 20%,
    transparent 45%,
    rgba(207, 48, 170, 0.5) 55%,
    transparent 65%,
    transparent 100%
  );
  filter: blur(8px);
  z-index: -1;
  animation: rotate-border 3s linear infinite;
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotate-border {
  from {
    --angle: 0deg;
  }
  to {
    --angle: 360deg;
  }
}

/* Inner background */
.submit-btn .btn-inner {
  position: absolute;
  inset: 2px;
  background: linear-gradient(
    to bottom,
    #161329 0%,
    #010201 50%,
    #1d1b4b 100%
  );
  border-radius: 6px;
  z-index: 1;
}

/* Text styling */
.submit-btn span:last-child {
  position: relative;
  z-index: 2;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.04em;
  color: rgba(214, 214, 230, 0.9);
  transition: color 0.3s ease;
}

/* Hover effects */
.submit-btn:hover::before,
.submit-btn:hover::after {
  animation-duration: 1.5s;
}

.submit-btn:hover span:last-child {
  color: #f8e7f8;
}

/* ========================================
   Footer
   ======================================== */
.footer-section {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 24px 64px;
  background-color: var(--bg);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 32px;
  z-index: 10;
}

.footer-inner {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: min-content;
  max-width: 1440px;
}

.footer-copyright,
.footer-credit {
  font-size: 12px;
  letter-spacing: -0.04em;
  color: var(--text-secondary);
  white-space: nowrap;
  user-select: none;
}

.footer-separator {
  font-size: 12px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text-muted);
  user-select: none;
}

.footer-credit a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-credit a:hover {
  color: rgba(255, 255, 255, 0.56);
}

/* ========================================
   Responsive (matching Framer breakpoints)
   ======================================== */
@media (min-width: 810px) and (max-width: 1199px) {
  .hero-container {
    max-width: 810px;
    gap: 36px;
  }
  
  .heading-section {
    gap: 24px;
  }
  
  .background-container {
    bottom: 0;
  }
}

@media (max-width: 809px) {
  .hero-section {
    order: 1;
    justify-content: flex-start;
    gap: 36px;
    padding: 164px 32px 150px;
  }
  
  .hero-container {
    max-width: 390px;
  }
  
  .badge {
    width: 81%;
  }
  
  .main-heading {
    font-size: 40px;
    width: 106%;
    text-wrap: balance;
  }
  
  .sub-heading {
    width: 326px;
  }
  
  .form-wrapper {
    width: 304px;
  }
  
  .background-container {
    bottom: 0;
  }
  
  .footer-section {
    padding: 24px 32px;
  }
  
  .footer-inner {
    flex-direction: column;
    gap: 8px;
  }
}
