/* ==========================================================================
   Cosmos Landing Page — styles.css
   Apple-inspired design + cosmic dark palette from Theme.swift
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
  /* Backgrounds */
  --bg-base: #03091F;
  --bg-card: #0A1535;
  --bg-elevated: #132048;
  --bg-detail: #061428;
  --border: #1A2D4A;

  /* Text */
  --text-primary: #F8FAFB;
  --text-secondary: #B4C7D4;
  --text-tertiary: #7A8E9F;

  /* Accents */
  --teal: #81F8EE;
  --cyan: #88FBF0;
  --blue: #3FB4D7;

  /* Typography */
  --font: -apple-system, 'SF Pro Display', 'Inter', 'Segoe UI', Helvetica, Arial, sans-serif;

  /* Layout */
  --content-width: 1080px;
  --narrow-width: 720px;
  --section-pad: 140px;
  --section-pad-mobile: 80px;

  /* Nav */
  --nav-height: 64px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* ---------- Utility ---------- */
.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}
.narrow {
  max-width: var(--narrow-width);
  margin: 0 auto;
}
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.gradient-text {
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Fade-in animation ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Typography ---------- */
.section-label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 16px;
}
.section-headline {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 24px;
}
.section-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(3, 9, 31, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
}
.nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.nav-links {
  display: flex;
  gap: 32px;
}
.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bg-base);
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  padding: 8px 20px;
  border-radius: 980px;
  transition: opacity 0.2s;
}
.nav-cta:hover { opacity: 0.85; }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav overlay */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 9, 31, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  z-index: 999;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}
#star-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}
.hero-icon {
  width: 160px;
  height: 160px;
  border-radius: 36px;
  margin: 0 auto 40px;
  box-shadow:
    0 0 80px rgba(129, 248, 238, 0.15),
    0 0 160px rgba(129, 248, 238, 0.05);
}
.hero-headline {
  font-size: 4.5rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 24px;
}
.hero-subtitle {
  font-size: 1.375rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 560px;
  margin: 0 auto 40px;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--bg-base);
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  padding: 16px 36px;
  border-radius: 980px;
  transition: opacity 0.2s, transform 0.2s;
}
.hero-cta:hover {
  opacity: 0.9;
  transform: scale(1.02);
}
.hero-cta svg {
  width: 20px;
  height: 20px;
}
.hero-price {
  display: inline-block;
  margin-left: 4px;
  font-weight: 400;
  opacity: 0.7;
}
.hero-meta {
  margin-top: 20px;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}
.hero-screenshot {
  margin-top: 80px;
  max-width: 900px;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 0.9375rem;
}

/* ==========================================================================
   How It Works
   ========================================================================== */
.how-it-works {
  padding: var(--section-pad) 24px;
  text-align: center;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-top: 64px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.step-number {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.step-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.step-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Features
   ========================================================================== */
.features {
  padding: var(--section-pad) 24px;
}
.features-header {
  text-align: center;
  margin-bottom: 100px;
}
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: var(--content-width);
  margin: 0 auto 120px;
}
.feature-row:last-child { margin-bottom: 0; }
.feature-row.reverse .feature-text { order: 2; }
.feature-row.reverse .feature-visual { order: 1; }
.feature-text h3 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 20px;
}
.feature-text p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.65;
}
.feature-visual {
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 0.9375rem;
}

/* ---------- Feature: Animated Icon Displays ---------- */
.feature-icon-display {
  background: transparent;
  border: none;
}

/* Animated Lock */
.animated-lock {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lock-icon {
  width: 100px;
  height: 120px;
  animation: lockBreathe 4s ease-in-out infinite;
}
@keyframes lockBreathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.06); opacity: 1; }
}
.lock-glow {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129,248,238,0.1) 0%, transparent 70%);
  animation: lockGlow 4s ease-in-out infinite;
}
@keyframes lockGlow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Mode Icons */
.feature-modes-display {
  background: transparent;
  border: none;
}
.mode-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}
.mode-icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 28px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  transition: border-color 0.3s, background 0.3s;
}
.mode-icon-card:hover {
  border-color: rgba(129,248,238,0.3);
  background: var(--bg-elevated);
}
.mode-label {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
}
.mode-desc {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}
.mode-divider {
  width: 1px;
  height: 80px;
  background: var(--border);
}

/* Animated Undo */
.animated-undo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.undo-icon {
  width: 100px;
  height: 100px;
}
.undo-arrow {
  stroke-dasharray: 150;
  stroke-dashoffset: 150;
  animation: undoDraw 2.5s ease-in-out infinite;
}
@keyframes undoDraw {
  0% { stroke-dashoffset: 150; }
  40% { stroke-dashoffset: 0; }
  70%, 100% { stroke-dashoffset: 0; }
}
.undo-head {
  animation: undoHeadFade 2.5s ease-in-out infinite;
}
@keyframes undoHeadFade {
  0%, 20% { opacity: 0; }
  40% { opacity: 1; }
  70%, 100% { opacity: 1; }
}
.undo-glow {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129,248,238,0.1) 0%, transparent 70%);
  animation: glowPulse 3s ease-in-out infinite;
}

/* ==========================================================================
   Learning Section
   ========================================================================== */
.learning {
  padding: var(--section-pad) 24px;
  background: var(--bg-card);
}
.learning-inner {
  max-width: var(--narrow-width);
  margin: 0 auto;
  text-align: center;
}
.learning-body {
  margin-top: 48px;
  text-align: left;
}
.learning-body p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}
.learning-quote {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-align: center;
  margin: 48px 0;
  padding: 0 16px;
}

/* ==========================================================================
   Privacy Section
   ========================================================================== */
.privacy-section {
  padding: var(--section-pad) 24px;
  text-align: center;
}
.privacy-list {
  max-width: 520px;
  margin: 56px auto 0;
  text-align: left;
}
.privacy-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
}
.privacy-item + .privacy-item {
  border-top: 1px solid rgba(26, 45, 74, 0.5);
}
.privacy-check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(129, 248, 238, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.privacy-check svg {
  width: 14px;
  height: 14px;
  color: var(--teal);
}
.privacy-item span {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.privacy-summary {
  margin-top: 40px;
  font-size: 1.0625rem;
  color: var(--text-secondary);
}
.privacy-summary strong {
  color: var(--text-primary);
}
.privacy-link {
  display: inline-block;
  margin-top: 24px;
  font-size: 0.9375rem;
  color: var(--teal);
  transition: opacity 0.2s;
}
.privacy-link:hover { opacity: 0.7; }

/* ==========================================================================
   Pricing
   ========================================================================== */
.pricing {
  padding: var(--section-pad) 24px;
  background: var(--bg-card);
  text-align: center;
}
.pricing-card {
  max-width: 480px;
  margin: 56px auto 0;
  background: var(--bg-base);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 48px 40px;
}
.pricing-amount {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.pricing-original {
  font-size: 1.125rem;
  color: var(--text-tertiary);
  text-decoration: line-through;
  margin-top: 8px;
}
.pricing-label {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-top: 8px;
}
.pricing-features {
  margin-top: 32px;
  text-align: left;
}
.pricing-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}
.pricing-features li svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--teal);
}
.pricing-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--bg-base);
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  padding: 14px 32px;
  border-radius: 980px;
  transition: opacity 0.2s;
}
.pricing-cta:hover { opacity: 0.85; }

/* Comparison */
.comparison {
  max-width: 520px;
  margin: 64px auto 0;
}
.comparison h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-secondary);
}
.comparison-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(26, 45, 74, 0.5);
  font-size: 0.9375rem;
}
.comparison-row:last-child { border-bottom: none; }
.comparison-name { color: var(--text-secondary); }
.comparison-price { font-weight: 600; }
.comparison-row.highlight .comparison-name { color: var(--text-primary); }
.comparison-row.highlight .comparison-price { color: var(--teal); }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq {
  padding: var(--section-pad) 24px;
}
.faq-inner {
  max-width: 680px;
  margin: 0 auto;
}
.faq-header {
  text-align: center;
  margin-bottom: 64px;
}
.faq details {
  border-bottom: 1px solid var(--border);
}
.faq summary {
  padding: 24px 0;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--text-primary);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 0.3s;
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}
.faq details p {
  padding: 0 0 24px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding: 80px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin: 0 auto 16px;
}
.footer-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: 32px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 40px;
}
.footer-col h5 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}
.footer-col a {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  line-height: 1.6;
}

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

/* Tablet */
@media (max-width: 900px) {
  :root {
    --section-pad: 100px;
  }
  .hero-headline { font-size: 3.25rem; }
  .section-headline { font-size: 2.5rem; }
  .feature-row {
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 80px;
  }
  .feature-row.reverse .feature-text { order: 1; }
  .feature-row.reverse .feature-visual { order: 2; }
  .steps { gap: 32px; }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --section-pad: 80px;
    --nav-height: 56px;
  }
  .nav-links, .nav > .nav-inner > .nav-cta { display: none; }
  .nav-hamburger { display: flex; }

  .hero { padding: 100px 20px 60px; min-height: auto; }
  .hero-icon { width: 120px; height: 120px; border-radius: 28px; margin-bottom: 32px; }
  .hero-headline { font-size: 2.5rem; }
  .hero-subtitle { font-size: 1.125rem; }
  .hero-screenshot { margin-top: 48px; }

  .section-headline { font-size: 2rem; }
  .section-subtitle { font-size: 1.0625rem; }

  .steps {
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 360px;
  }

  .feature-text h3 { font-size: 1.75rem; }
  .mode-icons { gap: 20px; }
  .mode-icon-card { padding: 24px 20px; }
  .lock-icon { width: 80px; height: 96px; }
  .undo-icon { width: 80px; height: 80px; }
  .learning-quote { font-size: 1.375rem; }

  .pricing-card { padding: 36px 24px; }
  .pricing-amount { font-size: 3rem; }

  .footer-links { flex-direction: column; gap: 24px; }
}

/* Small mobile */
@media (max-width: 375px) {
  .hero-headline { font-size: 2rem; }
  .hero-cta { padding: 14px 28px; font-size: 1rem; }
  .pricing-amount { font-size: 2.5rem; }
}
