/* ============================================================
   MERLYN - Prompt Wizard
   Light mode futuristic landing page
   ============================================================ */

:root {
  --primary: #6C3CE1;
  --primary-light: #8B5CF6;
  --primary-dark: #5521C5;
  --accent: #00D4B8;
  --accent-light: #00E5CC;
  --accent-glow: rgba(0, 212, 184, 0.15);

  --bg: #FAFBFF;
  --bg-soft: #F3F1FA;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-card-hover: rgba(255, 255, 255, 0.9);

  --text: #1A1630;
  --text-secondary: #5C5680;
  --text-dim: #9490B0;

  --border: rgba(108, 60, 225, 0.1);
  --border-hover: rgba(108, 60, 225, 0.25);

  --phase-plan: #E5A000;
  --phase-build: #3B82F6;
  --phase-ship: #22C55E;
  --phase-grow: #00D4B8;

  --terminal-bg: #0D0B14;
  --terminal-text: #E8E4F0;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   AURORA BACKGROUND
   ============================================================ */

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  animation: aurora-float 20s ease-in-out infinite;
}

.aurora-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary-light), transparent 70%);
  top: -10%;
  right: -5%;
  animation-delay: 0s;
  animation-duration: 25s;
}

.aurora-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  bottom: 10%;
  left: -10%;
  animation-delay: -5s;
  animation-duration: 22s;
}

.aurora-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #E879F9, transparent 70%);
  top: 40%;
  left: 30%;
  animation-delay: -10s;
  animation-duration: 28s;
  opacity: 0.2;
}

.aurora-4 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--phase-plan), transparent 70%);
  top: 60%;
  right: 20%;
  animation-delay: -15s;
  animation-duration: 30s;
  opacity: 0.15;
}

@keyframes aurora-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(30px, 40px) scale(1.02); }
}

/* Grid overlay */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(108, 60, 225, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 60, 225, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 70%);
}

/* ============================================================
   NAV
   ============================================================ */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  background: rgba(250, 251, 255, 0.75);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 18px;
}

.logo-icon {
  color: var(--primary);
  font-size: 20px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-cta {
  background: var(--primary);
  color: white !important;
  padding: 6px 16px;
  border-radius: var(--radius-xs);
  font-size: 13px !important;
  transition: background 0.2s, transform 0.15s !important;
}

.nav-cta:hover {
  background: var(--primary-dark) !important;
  transform: translateY(-1px);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  position: relative;
  z-index: 1;
  padding: 160px 24px 80px;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  background: rgba(108, 60, 225, 0.08);
  border: 1px solid rgba(108, 60, 225, 0.15);
  margin-bottom: 32px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(36px, 5.5vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero-line {
  display: block;
}

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

.hero-accent em {
  font-style: italic;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto 40px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.install-cmd {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--terminal-bg);
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  border: 1px solid rgba(108, 60, 225, 0.2);
}

.install-cmd:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108, 60, 225, 0.15);
}

.install-cmd code {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent-light);
  font-weight: 500;
}

.copy-hint {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

/* ============================================================
   TERMINAL DEMO
   ============================================================ */

.terminal-wrapper {
  margin-top: 64px;
  perspective: 1200px;
}

.terminal {
  max-width: 580px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: #FFFFFF;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.04),
    0 20px 60px rgba(108, 60, 225, 0.1),
    0 0 0 1px rgba(108, 60, 225, 0.08);
  transform: rotateX(2deg);
  transition: transform 0.4s ease;
}

.terminal:hover {
  transform: rotateX(0deg) translateY(-4px);
}

.terminal-bar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #F7F5FC;
  border-bottom: 1px solid rgba(108, 60, 225, 0.08);
}

.terminal-dots {
  display: flex;
  gap: 6px;
  margin-right: 16px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #FF5F57; }
.dot-yellow { background: #FEBC2E; }
.dot-green { background: #28C840; }

.terminal-title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

.terminal-body {
  padding: 0;
}

/* TUI frame -- CSS-based, no box-drawing chars */
.tui-frame {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.tui-header {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(108, 60, 225, 0.1);
  gap: 6px;
}

.tui-logo {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.tui-subtitle {
  color: var(--text-dim);
  font-size: 13px;
}

.tui-badge {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(108, 60, 225, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
}

.tui-section {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(108, 60, 225, 0.1);
}

.tui-phase-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.tui-green-bold {
  font-weight: 700;
  color: #22C55E;
}

.tui-bold {
  font-weight: 700;
}

.tui-dim {
  color: var(--text-dim);
}

.tui-progress {
  display: flex;
  gap: 16px;
  font-size: 13px;
}

.tui-check {
  color: #22C55E;
  font-weight: 600;
}

.tui-uncheck {
  color: var(--text-dim);
}

.tui-prompt-section {
  padding: 16px 20px 20px;
}

.tui-prompt-section .tui-bold {
  margin-bottom: 10px;
  font-size: 13px;
}

.tui-prompt-text {
  color: #B45309;
  font-size: 13px;
  line-height: 1.7;
  font-family: var(--mono);
}

.tui-footer {
  display: flex;
  gap: 16px;
  padding: 12px 20px;
  background: #F7F5FC;
  border-top: 1px solid rgba(108, 60, 225, 0.1);
  font-size: 12px;
  color: var(--text-secondary);
}

.tui-key {
  color: var(--text-dim);
}

/* ============================================================
   SECTIONS SHARED
   ============================================================ */

section {
  position: relative;
  z-index: 1;
}

.section-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

section h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
  line-height: 1.15;
}

/* ============================================================
   FEATURES
   ============================================================ */

.features {
  padding: 120px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  transition: all 0.3s ease;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(108, 60, 225, 0.08);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(108, 60, 225, 0.1), rgba(0, 212, 184, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--primary);
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================
   PHASES
   ============================================================ */

.phases {
  padding: 120px 0;
}

.phases-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  position: relative;
}

.phase-connector {
  position: absolute;
  top: 50%;
  left: 5%;
  right: 5%;
  height: 2px;
  background: linear-gradient(90deg,
    var(--phase-plan),
    var(--phase-build),
    var(--phase-ship),
    var(--phase-grow)
  );
  opacity: 0.3;
  transform: translateY(-50%);
  z-index: 0;
}

.phase-card {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  transition: all 0.3s ease;
}

.phase-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06);
}

.phase-number {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  opacity: 0.4;
}

.phase-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}

.phase-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.phase-plan { border-top: 3px solid var(--phase-plan); }
.phase-build { border-top: 3px solid var(--phase-build); }
.phase-ship { border-top: 3px solid var(--phase-ship); }
.phase-grow { border-top: 3px solid var(--phase-grow); }

.phase-plan h3 { color: var(--phase-plan); }
.phase-build h3 { color: var(--phase-build); }
.phase-ship h3 { color: var(--phase-ship); }
.phase-grow h3 { color: var(--phase-grow); }

/* ============================================================
   TOOLS
   ============================================================ */

.tools-section {
  padding: 120px 0;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.tool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.tool-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.tool-item code {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  white-space: nowrap;
}

.tool-item span {
  font-size: 13px;
  color: var(--text-secondary);
}

.tools-note {
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-dim);
}

.tools-note code {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(108, 60, 225, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary);
}

/* ============================================================
   PRINCIPLES
   ============================================================ */

.principles {
  padding: 120px 0;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.principle-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  transition: all 0.3s ease;
}

.principle-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(108, 60, 225, 0.08);
}

.principle-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.principle-card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================
   CTA
   ============================================================ */

.cta {
  padding: 120px 0;
  text-align: center;
}

.cta h2 {
  font-size: clamp(32px, 4.5vw, 48px);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.cta > .container > p {
  color: var(--text-secondary);
  font-size: 18px;
  margin-bottom: 40px;
}

.install-cmd-lg {
  display: inline-flex;
  margin: 0 auto;
}

.install-cmd-lg code {
  font-size: 17px;
}

.cta-mcp {
  margin-top: 48px;
}

.cta-mcp p {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.mcp-config {
  display: inline-block;
  text-align: left;
  background: var(--terminal-bg);
  padding: 24px 32px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(108, 60, 225, 0.15);
}

.mcp-config code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--terminal-text);
  line-height: 1.7;
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-dim);
}

.footer-right a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-right a:hover {
  color: var(--primary);
}

.footer-sep {
  opacity: 0.3;
}

/* ============================================================
   ANIMATIONS (scroll-triggered via IntersectionObserver in JS)
   ============================================================ */

.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger .fade-up:nth-child(1) { transition-delay: 0ms; }
.stagger .fade-up:nth-child(2) { transition-delay: 80ms; }
.stagger .fade-up:nth-child(3) { transition-delay: 160ms; }
.stagger .fade-up:nth-child(4) { transition-delay: 240ms; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .features-grid,
  .principles-grid,
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .phases-track {
    grid-template-columns: 1fr 1fr;
  }

  .phase-connector {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 120px 20px 60px;
  }

  .nav-links {
    display: none;
  }

  .mobile-menu {
    display: flex;
  }

  .phases-track {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
  }

  .terminal {
    transform: none;
  }

  .terminal:hover {
    transform: none;
  }

  .tui-frame {
    font-size: 11px;
  }

  .tui-footer {
    flex-wrap: wrap;
    gap: 10px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
  }
}
