/* ============================================
   Liminal Cosmos Landing Page
   ============================================ */

/* CSS Custom Properties (Design Tokens) */
:root {
  /* Colors - from app's accent and severity colors */
  --color-accent: #00C7D4;
  --color-accent-dark: #00A3AD;
  --color-purple: rgb(153, 51, 204);
  --color-orange: rgb(255, 153, 51);
  --color-blue: rgb(51, 153, 255);
  --color-teal: #00C7D4;
  --color-green: #34C759;
  --color-red: #FF3B30;

  /* Background colors */
  --color-bg-primary: #0a0a0f;
  --color-bg-secondary: #12121a;
  --color-bg-card: rgba(255, 255, 255, 0.05);
  --color-bg-card-hover: rgba(255, 255, 255, 0.08);

  /* Text colors */
  --color-text-primary: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.7);
  --color-text-tertiary: rgba(255, 255, 255, 0.5);

  /* Spacing - matching app's Spacing constants */
  --spacing-xxs: 4px;
  --spacing-xs: 6px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 20px;
  --spacing-xxl: 24px;
  --spacing-xxxl: 32px;
  --spacing-huge: 40px;

  /* Typography sizes - matching app's Typography */
  --font-display-large: 60px;
  --font-display-medium: 48px;
  --font-display-small: 36px;
  --font-headline-large: 28px;
  --font-headline-medium: 20px;
  --font-body: 16px;
  --font-body-small: 14px;
  --font-caption: 12px;

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;
}

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

*,
*::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: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  font-size: var(--font-body);
  line-height: 1.5;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================
   Stars Background
   ============================================ */

.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  animation: twinkle var(--duration, 3s) infinite ease-in-out;
  animation-delay: var(--delay, 0s);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.8; }
}

/* ============================================
   Header & Navigation
   ============================================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--spacing-lg) var(--spacing-xxl);
  background: linear-gradient(to bottom, rgba(10, 10, 15, 0.95), transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.nav-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
}

.nav-title {
  font-size: var(--font-headline-medium);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-cta {
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--color-accent);
  color: var(--color-bg-primary);
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.nav-cta:hover {
  background: var(--color-accent-dark);
  transform: scale(1.02);
}

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

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px var(--spacing-xxl) var(--spacing-huge);
  gap: var(--spacing-huge);
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero-badge {
  display: inline-block;
  padding: var(--spacing-xxs) var(--spacing-md);
  background: var(--color-bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  font-size: var(--font-caption);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xl);
}

.hero-title {
  font-size: clamp(var(--font-display-small), 8vw, var(--font-display-large));
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--spacing-xl);
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-green), var(--color-accent), var(--color-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--font-headline-medium);
  font-weight: 400;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: var(--spacing-xxxl);
}

.hero-actions {
  display: flex;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-xxl);
  font-size: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-primary {
  background: var(--color-text-primary);
  color: var(--color-bg-primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2);
}

.btn-secondary {
  background: var(--color-bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-primary);
}

.btn-secondary:hover {
  background: var(--color-bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
  width: 20px;
  height: 20px;
}

/* Phone Mockup */
.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 400px;
}

.phone-frame {
  position: relative;
  width: 280px;
  height: 580px;
  background: linear-gradient(145deg, #2a2a35, #1a1a22);
  border-radius: 44px;
  padding: 12px;
  box-shadow:
    0 50px 100px -20px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--color-bg-secondary);
  border-radius: 36px;
  overflow: hidden;
  position: relative;
}

.aurora-preview {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 120% 60% at 50% 0%, rgba(0, 199, 212, 0.3), transparent 60%),
    radial-gradient(ellipse 80% 40% at 30% 10%, rgba(52, 199, 89, 0.2), transparent 50%),
    radial-gradient(ellipse 60% 30% at 70% 5%, rgba(153, 51, 204, 0.2), transparent 40%),
    radial-gradient(circle at 50% 50%, #0a1628, #040810);
  animation: aurora-pulse 8s ease-in-out infinite;
}

@keyframes aurora-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* ============================================
   Features Section
   ============================================ */

.features {
  position: relative;
  z-index: 1;
  padding: var(--spacing-huge) var(--spacing-xxl);
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-huge);
}

.section-title {
  font-size: var(--font-display-small);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-md);
}

.section-subtitle {
  font-size: var(--font-headline-medium);
  color: var(--color-text-secondary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--spacing-xl);
}

.feature-card {
  padding: var(--spacing-xxl);
  background: var(--color-bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
}

.feature-card:hover {
  background: var(--color-bg-card-hover);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-4px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature-icon-purple {
  background: rgba(153, 51, 204, 0.15);
  color: var(--color-purple);
}

.feature-icon-orange {
  background: rgba(255, 153, 51, 0.15);
  color: var(--color-orange);
}

.feature-icon-blue {
  background: rgba(51, 153, 255, 0.15);
  color: var(--color-blue);
}

.feature-icon-teal {
  background: rgba(0, 199, 212, 0.15);
  color: var(--color-teal);
}

.feature-icon-green {
  background: rgba(52, 199, 89, 0.15);
  color: var(--color-green);
}

.feature-icon-red {
  background: rgba(255, 59, 48, 0.15);
  color: var(--color-red);
}

.feature-title {
  font-size: var(--font-headline-medium);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.feature-description {
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ============================================
   Data Source Section
   ============================================ */

.data-source {
  position: relative;
  z-index: 1;
  padding: var(--spacing-huge) var(--spacing-xxl);
}

.data-source-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: var(--spacing-huge);
  background: linear-gradient(135deg, rgba(0, 199, 212, 0.1), rgba(153, 51, 204, 0.05));
  border: 1px solid rgba(0, 199, 212, 0.2);
  border-radius: var(--radius-xl);
}

.data-source-badge {
  display: inline-block;
  padding: var(--spacing-xxs) var(--spacing-md);
  background: rgba(0, 199, 212, 0.15);
  color: var(--color-accent);
  border-radius: var(--radius-full);
  font-size: var(--font-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-lg);
}

.data-source-title {
  font-size: var(--font-headline-large);
  font-weight: 700;
  margin-bottom: var(--spacing-lg);
}

.data-source-description {
  font-size: var(--font-body);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--spacing-xxxl);
}

.data-points {
  display: flex;
  justify-content: center;
  gap: var(--spacing-huge);
  flex-wrap: wrap;
}

.data-point {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xxs);
}

.data-point-value {
  font-size: var(--font-headline-large);
  font-weight: 700;
  color: var(--color-accent);
}

.data-point-label {
  font-size: var(--font-body-small);
  color: var(--color-text-tertiary);
}

/* ============================================
   Download Section
   ============================================ */

.download {
  position: relative;
  z-index: 1;
  padding: var(--spacing-huge) var(--spacing-xxl);
  text-align: center;
}

.download-content {
  max-width: 500px;
  margin: 0 auto;
}

.download-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto var(--spacing-xxl);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.download-title {
  font-size: var(--font-headline-large);
  font-weight: 700;
  margin-bottom: var(--spacing-md);
}

.download-subtitle {
  font-size: var(--font-body);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xxl);
}

.app-store-badge {
  display: inline-block;
  transition: transform var(--transition-fast);
}

.app-store-badge:hover {
  transform: scale(1.05);
}

.app-store-svg {
  height: 54px;
  width: auto;
}

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

.footer {
  position: relative;
  z-index: 1;
  padding: var(--spacing-xxxl) var(--spacing-xxl);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xl);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.footer-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.footer-title {
  font-size: var(--font-body);
  font-weight: 600;
}

.footer-links {
  display: flex;
  gap: var(--spacing-xxl);
}

.footer-link {
  font-size: var(--font-body-small);
  color: var(--color-text-tertiary);
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--color-text-primary);
}

.footer-copyright {
  font-size: var(--font-caption);
  color: var(--color-text-tertiary);
}

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

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: 140px;
  }

  .hero-content {
    max-width: none;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    max-width: 280px;
  }

  .phone-frame {
    width: 240px;
    height: 500px;
  }
}

@media (max-width: 600px) {
  .header {
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .nav-title {
    font-size: var(--font-body);
  }

  .hero {
    padding: 120px var(--spacing-lg) var(--spacing-xxxl);
  }

  .hero-title {
    font-size: var(--font-headline-large);
  }

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

  .btn {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-body-small);
  }

  .features,
  .data-source,
  .download,
  .footer {
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .data-points {
    flex-direction: column;
    gap: var(--spacing-xl);
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
  }
}
