/* ============================================
   DevPort Landing Page — CSS
   ============================================ */

/* --- Design Tokens --- */
:root {
  --bg-primary: #1e1e1e;
  --bg-secondary: #252526;
  --bg-tertiary: #2d2d30;
  --bg-hover: #3c3c3c;
  --text-primary: #cccccc;
  --text-secondary: #858585;
  --text-muted: #6e6e6e;
  --border-color: #3c3c3c;
  --accent-color: #0078d4;
  --accent-hover: #1984db;
  --success-color: #4ec9b0;
  --warning-color: #dcdcaa;
  --error-color: #f14c4c;
  --gradient-start: #4F46E5;
  --gradient-end: #06B6D4;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --nav-height: 60px;
  --section-padding: 80px 0;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

a { color: var(--accent-color); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img, svg { display: block; max-width: 100%; }

/* --- Utility --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(30, 30, 30, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-logo svg {
  width: 28px;
  height: 28px;
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-github {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-github:hover {
  color: var(--text-primary);
}

.nav-github svg {
  width: 22px;
  height: 22px;
}

.nav-cta {
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff !important;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.nav-cta:hover {
  opacity: 0.9;
  color: #fff !important;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Mobile nav open */
.nav-hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content { z-index: 1; }

.hero-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 500;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 500px;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  text-decoration: none;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  color: #fff;
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}

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

/* Terminal Preview */
.hero-terminal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.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 {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.terminal-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.8;
  min-height: 260px;
}

.terminal-line {
  white-space: nowrap;
  overflow: hidden;
}

.terminal-prompt {
  color: var(--success-color);
}

.terminal-cmd {
  color: var(--text-primary);
}

.terminal-output {
  color: var(--text-secondary);
}

.terminal-accent {
  color: var(--accent-color);
}

.terminal-warning {
  color: var(--warning-color);
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--text-primary);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ============================================
   SECTIONS — shared
   ============================================ */
.section {
  padding: var(--section-padding);
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   FEATURES
   ============================================ */
.features {
  background: var(--bg-secondary);
}

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

.feature-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 28px 24px;
  transition: border-color 0.3s, transform 0.3s;
}

.feature-card:hover {
  border-color: var(--gradient-start);
  transform: translateY(-4px);
}

.feature-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  color: var(--accent-color);
}

.feature-icon svg {
  width: 100%;
  height: 100%;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

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

/* ============================================
   HOW IT WORKS
   ============================================ */
.steps-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  position: relative;
}

/* Connecting line */
.steps-row::before {
  content: '';
  position: absolute;
  top: 40px;
  left: calc(16.66% + 20px);
  right: calc(16.66% + 20px);
  height: 2px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  z-index: 0;
}

.step {
  text-align: center;
  position: relative;
  z-index: 1;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.step h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.step p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.step-code {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--success-color);
  text-align: left;
  overflow-x: auto;
}

/* ============================================
   DOWNLOAD
   ============================================ */
.download {
  background: var(--bg-secondary);
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.download-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s;
}

.download-card:hover {
  border-color: var(--gradient-start);
  transform: translateY(-4px);
}

.download-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--text-secondary);
}

.download-icon svg {
  width: 100%;
  height: 100%;
}

.download-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.download-card .download-ext {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 16px;
}

.download-card .download-version {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
}

.download-btn:hover {
  opacity: 0.9;
  color: #fff;
}

.download-cli {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px 32px;
  text-align: center;
}

.download-cli h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.download-cli p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.cli-command {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--success-color);
}

.cli-command button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.cli-command button:hover {
  color: var(--text-primary);
}

.cli-command button svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color 0.2s;
}

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

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

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

@media (max-width: 768px) {
  :root {
    --section-padding: 56px 0;
  }

  /* Nav mobile */
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    gap: 16px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-desktop-cta {
    display: none;
  }

  /* Hero */
  .hero .container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Features */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .section-header h2 {
    font-size: 1.75rem;
  }

  /* Steps */
  .steps-row {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .steps-row::before {
    display: none;
  }

  /* Download */
  .download-grid {
    grid-template-columns: 1fr;
  }
}

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

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