/* ===== Design Tokens ===== */
:root {
  /* Color palette — deep, rich dark theme */
  --color-bg: hsl(230, 25%, 7%);
  --color-surface: hsla(230, 20%, 14%, 0.6);
  --color-surface-border: hsla(230, 30%, 30%, 0.3);
  --color-text-primary: hsl(220, 20%, 95%);
  --color-text-secondary: hsl(220, 15%, 65%);
  --color-text-muted: hsl(220, 10%, 45%);

  /* Accent gradient stops */
  --accent-1: hsl(239, 84%, 67%);   /* Indigo */
  --accent-2: hsl(271, 91%, 65%);   /* Purple */
  --accent-3: hsl(330, 81%, 60%);   /* Pink */

  /* Glassmorphism */
  --glass-bg: hsla(230, 25%, 12%, 0.55);
  --glass-border: hsla(230, 40%, 40%, 0.2);
  --glass-blur: 24px;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Typography */
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 0.3s var(--ease-out-expo);
}

/* ===== Reset & Base ===== */
@layer reset, base, components, utilities;

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

@layer base {
  html {
    color-scheme: dark;
    scroll-behavior: smooth;
  }

  body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text-primary);
    min-block-size: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* ===== Particle Canvas ===== */
@layer components {
  #particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
  }

  /* ===== Floating Orbs ===== */
  .orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
  }

  .orb-1 {
    inline-size: clamp(300px, 40vw, 600px);
    block-size: clamp(300px, 40vw, 600px);
    background: radial-gradient(circle, var(--accent-1), transparent 70%);
    inset-block-start: -10%;
    inset-inline-end: -5%;
    animation: float-orb-1 20s ease-in-out infinite;
  }

  .orb-2 {
    inline-size: clamp(250px, 35vw, 500px);
    block-size: clamp(250px, 35vw, 500px);
    background: radial-gradient(circle, var(--accent-2), transparent 70%);
    inset-block-end: -15%;
    inset-inline-start: -10%;
    animation: float-orb-2 25s ease-in-out infinite;
  }

  .orb-3 {
    inline-size: clamp(200px, 25vw, 350px);
    block-size: clamp(200px, 25vw, 350px);
    background: radial-gradient(circle, var(--accent-3), transparent 70%);
    inset-block-start: 40%;
    inset-inline-start: 50%;
    animation: float-orb-3 18s ease-in-out infinite;
  }

  @keyframes float-orb-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-40px, 60px) scale(1.05); }
    66% { transform: translate(30px, -40px) scale(0.95); }
  }

  @keyframes float-orb-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -30px) scale(1.08); }
    66% { transform: translate(-30px, 50px) scale(0.92); }
  }

  @keyframes float-orb-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-60px, -40px) scale(1.1); }
  }

  /* ===== Main Container ===== */
  .container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
    padding: var(--space-xl);
    max-inline-size: 720px;
    inline-size: 100%;
    animation: fade-up 1s var(--ease-out-expo) both;
  }

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

  /* ===== Brand ===== */
  .brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: fade-up 1s var(--ease-out-expo) 0.1s both;
  }

  .logo-icon {
    inline-size: 48px;
    block-size: 48px;
    flex-shrink: 0;
  }

  .logo-icon svg {
    inline-size: 100%;
    block-size: 100%;
    animation: logo-spin 30s linear infinite;
  }

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

  .brand-name {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--color-text-primary) 40%, var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  /* ===== Glass Card ===== */
  .glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: var(--space-3xl) var(--space-2xl);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fade-up 1s var(--ease-out-expo) 0.2s both;
  }

  /* Subtle shimmer on the card edge */
  .glass-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(
      135deg,
      transparent 30%,
      hsla(271, 91%, 65%, 0.15) 50%,
      transparent 70%
    );
    z-index: -1;
    animation: shimmer 6s ease-in-out infinite;
  }

  @keyframes shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
  }

  /* ===== Status Badge ===== */
  .status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: hsla(271, 91%, 65%, 0.1);
    border: 1px solid hsla(271, 91%, 65%, 0.2);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent-2);
  }

  .pulse-dot {
    inline-size: 8px;
    block-size: 8px;
    border-radius: 50%;
    background: var(--accent-2);
    position: relative;
  }

  .pulse-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--accent-2);
    opacity: 0.4;
    animation: pulse 2s ease-in-out infinite;
  }

  @keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.8); opacity: 0; }
  }

  /* ===== Headline ===== */
  .headline {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--color-text-primary);
  }

  .gradient-text {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 4s ease-in-out infinite;
  }

  @keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
  }

  /* ===== Subtext ===== */
  .subtext {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    line-height: 1.7;
    color: var(--color-text-secondary);
    max-inline-size: 520px;
    text-wrap: pretty;
  }

  /* ===== Progress Section ===== */
  .progress-section {
    inline-size: 100%;
    max-inline-size: 400px;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }

  .progress-track {
    block-size: 4px;
    background: hsla(230, 20%, 30%, 0.5);
    border-radius: 100px;
    position: relative;
    overflow: hidden;
  }

  .progress-fill {
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    block-size: 100%;
    inline-size: 66%;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
    border-radius: inherit;
    animation: fill-grow 2s var(--ease-out-expo) 0.8s both;
  }

  @keyframes fill-grow {
    from { inline-size: 0%; }
    to { inline-size: 66%; }
  }

  .progress-glow {
    position: absolute;
    inset-block-start: -4px;
    inset-inline-start: 64%;
    inline-size: 12px;
    block-size: 12px;
    background: var(--accent-2);
    border-radius: 50%;
    filter: blur(6px);
    opacity: 0.8;
    animation: fill-grow-glow 2s var(--ease-out-expo) 0.8s both,
               glow-pulse 2s ease-in-out infinite 2.8s;
  }

  @keyframes fill-grow-glow {
    from { inset-inline-start: 0%; opacity: 0; }
    to { inset-inline-start: 64%; opacity: 0.8; }
  }

  @keyframes glow-pulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.5); }
  }

  .progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .progress-label {
    color: var(--color-text-muted);
    transition: color var(--transition-base);
  }

  .progress-label.active {
    color: var(--accent-2);
  }

  /* ===== Contact Section ===== */
  .contact-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
  }

  .contact-text {
    font-size: 0.9rem;
    color: var(--color-text-muted);
  }

  .cta-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-base),
                box-shadow var(--transition-base);
  }

  .cta-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
    opacity: 0;
    transition: opacity var(--transition-base);
  }

  .cta-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px hsla(271, 91%, 65%, 0.3);
  }

  .cta-button:hover:not(:disabled)::before {
    opacity: 1;
  }

  .cta-button span,
  .cta-button svg {
    position: relative;
    z-index: 1;
  }

  .cta-button svg {
    transition: transform var(--transition-base);
  }

  .cta-button:hover:not(:disabled) svg {
    transform: translateX(4px);
  }

  /* ===== Footer ===== */
  .footer {
    animation: fade-up 1s var(--ease-out-expo) 0.4s both;
  }

  .footer p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
  }
}

/* ===== Responsive ===== */
@layer utilities {
  /* Allow scrolling on mobile when content exceeds viewport */
  @media (max-width: 768px) {
    body {
      align-items: flex-start;
      padding-block: env(safe-area-inset-top, 0) env(safe-area-inset-bottom, 0);
      padding-inline: env(safe-area-inset-left, 0) env(safe-area-inset-right, 0);
    }

    .container {
      padding: var(--space-xl) var(--space-lg);
      min-block-size: 100dvh;
      justify-content: center;
    }

    .glass-card {
      padding: var(--space-2xl) var(--space-lg);
      border-radius: 20px;
    }

    .headline {
      font-size: clamp(1.5rem, 6vw, 2.2rem);
    }

    .subtext {
      font-size: 0.95rem;
    }

    .progress-section {
      max-inline-size: 100%;
    }

    .progress-labels {
      font-size: 0.7rem;
      letter-spacing: 0.02em;
    }

    .orb {
      opacity: 0.25;
    }
  }

  @media (max-width: 480px) {
    .container {
      padding: var(--space-lg) var(--space-md);
      gap: var(--space-md);
    }

    .glass-card {
      padding: var(--space-xl) var(--space-md);
      border-radius: 16px;
      gap: var(--space-md);
    }

    .brand {
      gap: var(--space-xs);
    }

    .logo-icon {
      inline-size: 36px;
      block-size: 36px;
    }

    .brand-name {
      font-size: 1.1rem;
    }

    .headline {
      font-size: clamp(1.3rem, 5.5vw, 1.8rem);
    }

    .status-badge {
      font-size: 0.7rem;
      padding: 4px 10px;
    }

    .subtext {
      font-size: 0.88rem;
      line-height: 1.6;
    }

    .progress-labels {
      font-size: 0.65rem;
    }

    .cta-button {
      padding: var(--space-sm) var(--space-md);
      font-size: 0.9rem;
    }

    .contact-text {
      font-size: 0.82rem;
    }

    .footer p {
      font-size: 0.72rem;
    }
  }

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

    .orb {
      animation: none;
    }

    #particle-canvas {
      display: none;
    }
  }
}
