/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #1A1C2C;
  --bg-card: #29263C;
  --bg-card-hover: #3E3546;
  --text: #F4F4F4;
  --text-muted: #9088A0;
  --primary: #38B764;
  --primary-dim: #257953;
  --secondary: #E43B44;
  --accent: #F7D51D;
  --purple: #7E57C2;
  --terminal-bg: #1A1C2C;
  --border: #3E3546;
  --font-pixel: 'Press Start 2P', monospace;
  --font-mono: 'Space Mono', monospace;
}

html {
  scroll-behavior: smooth;
}

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

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

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: twinkle var(--duration) ease-in-out infinite;
  opacity: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.1; }
  50% { opacity: var(--max-opacity); }
}

/* === Nav === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(26, 28, 44, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 1.5rem;
}

.logo-text {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--primary);
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

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

/* === Hero === */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
  padding: 6rem 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

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

.hero-badge {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: 0.4rem 1rem;
  margin-bottom: 1.5rem;
  animation: blink-border 2s ease-in-out infinite;
}

@keyframes blink-border {
  0%, 100% { border-color: var(--accent); }
  50% { border-color: transparent; }
}

.hero h1 {
  font-family: var(--font-pixel);
  font-size: 1.6rem;
  line-height: 2.2;
  color: #fff;
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.highlight {
  color: var(--primary);
  font-weight: 700;
}

.hero-cta {
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  padding: 0.9rem 1.8rem;
  text-decoration: none;
  border: 2px solid;
  transition: all 0.2s;
  cursor: pointer;
  letter-spacing: 1px;
}

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

.btn-primary:hover {
  background: transparent;
  color: var(--primary);
  box-shadow: 0 0 20px rgba(56, 183, 100, 0.3);
}

.btn-secondary {
  background: transparent;
  border-color: var(--text-muted);
  color: var(--text-muted);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* === Terminal Mock === */
.hero-terminal {
  flex: 1;
  max-width: 480px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(56, 183, 100, 0.08);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #29263C;
  border-bottom: 1px solid var(--border);
}

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

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.terminal-body {
  background: var(--terminal-bg);
  padding: 1.25rem;
  font-size: 0.78rem;
  line-height: 1.6;
}

.terminal-body pre {
  font-family: var(--font-mono);
  white-space: pre;
}

.t-header { color: var(--primary); font-weight: 700; }
.t-label { color: var(--accent); }
.t-line { color: var(--border); }
.t-checkpoint { color: var(--secondary); }
.t-entry { color: var(--text); }
.t-tag { color: var(--purple); }
.t-hint { color: var(--text-muted); font-size: 0.7rem; }

/* === Principles === */
.principles {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 2rem 6rem;
}

.principle {
  text-align: center;
  padding: 2rem 1.5rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.3s, transform 0.3s;
}

.principle:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
}

.principle-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 1rem;
}

.principle h3 {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.principle p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === Section Titles === */
.section-title {
  font-family: var(--font-pixel);
  font-size: 1rem;
  color: var(--accent);
  text-align: center;
  margin-bottom: 1rem;
}

/* === Features === */
.features {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.feature-card {
  padding: 2rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.3s;
}

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

.feature-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: #fff;
  margin-bottom: 0.75rem;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === Download === */
.download {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.download-sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 3rem;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.download-card {
  position: relative;
  padding: 2.5rem 2rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-align: center;
  transition: border-color 0.3s;
}

.download-card:hover {
  border-color: var(--primary);
}

.download-platform {
  margin-bottom: 1rem;
}

.platform-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
}

.download-platform h3 {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: #fff;
}

.download-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.03);
}

.store-badge:hover {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(56, 183, 100, 0.15);
}

.store-badge div {
  text-align: left;
}

.store-badge small {
  display: block;
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.store-badge strong {
  font-size: 0.95rem;
}

.coming-soon-badge {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.3rem 0.7rem;
  margin-top: 1rem;
  letter-spacing: 1px;
  animation: blink-border 2s ease-in-out infinite;
}

/* === TUI Section === */
.tui {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.tui-sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 3rem;
}

.tui-install h3 {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--primary);
  margin-bottom: 1rem;
  margin-top: 2.5rem;
}

.tui-install h3:first-child {
  margin-top: 0;
}

.code-block {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #29263C;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.copy-btn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.code-block pre {
  padding: 1rem;
  background: var(--terminal-bg);
  overflow-x: auto;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--primary);
}

.tui-requirements {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tui-requirements li {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.req-check {
  color: var(--primary);
}

.keybindings {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.key-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.key-row kbd {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: #29263C;
  border: 1px solid var(--border);
  border-bottom-width: 3px;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  color: var(--accent);
  min-width: 2rem;
  text-align: center;
}

/* === Pricing === */
.pricing {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.pricing-card {
  text-align: center;
  padding: 3rem 2rem;
  border: 2px solid var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 30px rgba(56, 183, 100, 0.08);
}

.pricing-badge {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--bg);
  background: var(--primary);
  padding: 0.4rem 1.2rem;
  margin-bottom: 1.5rem;
}

.pricing-tagline {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.pricing-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.pricing-highlight {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--primary);
  letter-spacing: 2px;
}

/* === Legal Pages (Privacy, Terms) === */
.legal {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
}

.legal-title {
  font-family: var(--font-pixel);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.legal-updated {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
}

.legal-body h2 {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--primary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
}

.legal-body h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

.legal-body ul {
  list-style: none;
  padding: 0;
  margin-bottom: 0.75rem;
}

.legal-body ul li {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.8;
  padding-left: 1.25rem;
  position: relative;
}

.legal-body ul li::before {
  content: "▸";
  color: var(--primary);
  position: absolute;
  left: 0;
}

.legal-body a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

.legal-body a:hover {
  color: var(--accent);
}

/* === Footer === */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
}

.footer-logo {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.footer-links {
  margin-bottom: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

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

.footer-sep {
  color: var(--border);
  margin: 0 0.75rem;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.5;
}

/* === Responsive === */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 3rem;
    padding-top: 5rem;
  }

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

  .hero-terminal {
    max-width: 100%;
  }

  .principles {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .download-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

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

@media (max-width: 600px) {
  .hero h1 {
    font-size: 1rem;
  }

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

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

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.75rem;
  }
}
