/*
 * styles.css — Vaytrion Technologies "Coming Soon" Landing Page
 *
 * Layout:
 *   - Single full-viewport hero section with stacked layers (background + content)
 *   - All responsive sizing via CSS clamp() — no breakpoints except one at 480px
 *     for CTA stacking (layout change that can't be done with clamp)
 *
 * Z-index stack (within .background-layer):
 *   0  #glow-backdrop    — colored radial gradient, drifts between colors
 *   1  .horizon-fill-svg — black fill below the horizon curve (masks glow below)
 *   2  .horizon-svg      — horizon line + glow arcs (no fill)
 *   3  #particles-canvas — starry night canvas (twinkle + mouse parallax)
 *   10 .content-layer    — text, subheader, CTA
 *
 * Animation states:
 *   .word          — hidden by default (opacity:0, blur:6px)
 *   .word.revealed — visible (JS adds class with staggered delays)
 *   .cta           — hidden by default (opacity:0, blur:4px)
 *   .cta.revealed  — visible (0.8s fade-in)
 *   html.no-js *   — fallback: everything visible, no transitions
 */

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

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

:root {
  --bg: #0A0A0A;
  --text: #FFFFFF;
  --grey-border: #333333;
  --text-muted: rgba(255, 255, 255, 0.6);
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* ===========================
   Background Layer
   =========================== */

.background-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ===========================
   Content Layer
   =========================== */

.content-layer {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  padding: clamp(1rem, 3vw, 2rem);
  text-align: center;
}

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

.header {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 500;
  font-size: clamp(32px, 5vw, 60px);
  line-height: 1.2;
  letter-spacing: -0.05em;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-line {
  display: block;
}

.header-line + .header-line {
  margin-top: clamp(-10px, -0.8vw, -6px);
}

/* Mobile: bump header size */
@media (max-width: 480px) {
  .header {
    font-size: clamp(44px, 12vw, 56px);
  }
}

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

.subheader {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: clamp(14px, 1.5vw, 16px);
  line-height: 1.6;
  letter-spacing: -0.04em;
  color: var(--text-muted);
  margin-top: clamp(8px, 1.5vw, 11px);
  max-width: 300px;
}

/* ===========================
   Call to Action
   =========================== */

.cta {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(0.3rem, 0.8vw, 0.5rem);
  margin-top: clamp(14px, 3vw, 21px);
  border-radius: clamp(4px, 0.6vw, 6px);
  padding: clamp(0.25rem, 0.5vw, 0.35rem);
  padding-left: clamp(0.8rem, 1.5vw, 1.2rem);
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 90%;
  width: clamp(280px, 40vw, 420px);
}

.cta-input {
  flex: 1;
  min-width: 0;
  padding: clamp(0.4rem, 0.8vw, 0.6rem) 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.85rem, 1.2vw, 0.95rem);
  outline: none;
}

.cta-input::placeholder {
  color: #666666;
}

.cta-button {
  padding: clamp(0.5rem, 1vw, 0.7rem) clamp(0.9rem, 1.8vw, 1.4rem);
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(0.85rem, 1.2vw, 0.95rem);
  cursor: pointer;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.cta-button:hover {
  opacity: 0.85;
}

.cta-button:focus-visible {
  outline: 2px solid #428EFF;
  outline-offset: 2px;
}

/* Mobile: stack CTA, border wraps input only */
@media (max-width: 480px) {
  .cta {
    flex-direction: column;
    width: clamp(240px, 75vw, 320px);
    padding: 0;
    border: none;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    align-items: stretch;
    gap: clamp(0.5rem, 1.5vw, 0.75rem);
  }

  .cta-input {
    padding: clamp(0.4rem, 1vw, 0.6rem) clamp(0.8rem, 1.5vw, 1.2rem);
    min-height: 44px;
    border: 1px solid var(--grey-border);
    border-radius: clamp(4px, 0.6vw, 6px);
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .cta-button {
    width: 100%;
    text-align: center;
    min-height: 44px;
    border-radius: clamp(4px, 0.6vw, 6px);
  }
}

/* ===========================
   Glow Backdrop
   =========================== */

/* Glow backdrop entrance: initial state is scaled down + invisible.
   JS sets --glow-color and adds .visible to trigger the entrance.
   Base transition handles the 5s color drift; .visible adds the 0.8s entrance. */

#glow-backdrop {
  --glow-color: transparent;
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -30%) scale(0.4);
  transform-origin: center center;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    var(--glow-color) 0%,
    transparent 70%
  );
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: background 5s ease;
}

#glow-backdrop.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 1.2s ease-out, transform 1.8s cubic-bezier(0.16, 1, 0.3, 1), background 5s ease;
}

/* Mobile: align glow center with the raised horizon */
@media (max-width: 480px) {
  #glow-backdrop {
    top: 45%;
  }
}

/* ===========================
   Particles Canvas
   =========================== */

#particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

/* ===========================
   Horizon SVG
   =========================== */

/* Horizon: curve on top with black fill extending to viewport bottom.
   ViewBox is 1440x1000; curve sits at y=400 (40% from top).
   Desktop: positioned so horizon line sits behind/just below the CTA.
   Mobile: positioned so horizon line sits in the middle of the header.
   Split into two SVGs:
     .horizon-fill-svg (z:1) — opaque black below the curve, masks glow beneath horizon
     .horizon-svg      (z:2) — glow arcs + horizon line */

.horizon-fill-svg {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(80%, 55vw + 316px, 110%);
  z-index: 1;
  overflow: visible;
  top: 55%;
  height: 65%;
}

.horizon-svg {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(80%, 55vw + 316px, 110%);
  z-index: 2;
  overflow: visible;

  /* Desktop: horizon behind CTA */
  top: 55%;
  height: 65%;
}

/* Tablet: slightly wider than viewport so edges are cropped,
   but less aggressive than mobile. Horizon raised 5% from desktop. */
@media (max-width: 1024px) and (min-width: 481px) {
  .header {
    font-size: clamp(40px, 7vw, 54px);
  }

  .horizon-fill-svg {
    width: 160%;
    top: 37%;
  }

  .horizon-svg {
    width: 160%;
    top: 37%;
  }
}

/* Mobile: raise horizon to sit behind the middle of the header.
   Width overflows viewport so only the flatter middle arc is visible. */
@media (max-width: 480px) {
  .horizon-fill-svg {
    top: 28%;
    height: 80%;
    width: 250%;
  }

  .horizon-svg {
    top: 28%;
    height: 80%;
    width: 250%;
  }
}

/* ===========================
   Text Animations (Phase 3)
   =========================== */

/* Text animation states: JS splits text into .word spans and staggers
   the .revealed class. Double requestAnimationFrame ensures the browser
   paints the hidden state before transitioning. */

.word {
  display: inline-block;
  opacity: 0;
  filter: blur(6px);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.word.revealed {
  opacity: 1;
  filter: blur(0px);
}

/* CTA entrance: fades in simultaneously with subheader words.
   Longer 0.8s transition for a gentle appearance. */

.cta {
  opacity: 0;
  filter: blur(4px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.cta.revealed {
  opacity: 1;
  filter: blur(0px);
}

/* No-JS fallback: if JS fails to load or execute, html retains the
   .no-js class and everything is shown immediately without animation. */

html.no-js .word,
html.no-js .cta {
  opacity: 1;
  filter: none;
  transition: none;
}

html.no-js #glow-backdrop {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition: none;
}

/* ===========================
   Responsive: Fluid (no breakpoints)
   =========================== */

/* All sizing uses clamp() for fluid scaling — no additional breakpoints needed. */
