/* ── pgStack Landing Page ────────────────────────────────────── */

/* ── Custom Properties ───────────────────────────────────────── */
:root {
  --bg: #0f172a;
  --bg-light: #1e293b;
  --bg-card: #1e293b;
  --bg-code: #0b1120;
  --border: #334155;
  --border-light: #475569;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --accent-glow: rgba(88, 166, 255, 0.15);
  --accent-dim: rgba(88, 166, 255, 0.08);
  --white: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', Consolas, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
  --max-width: 1200px;
  --ease: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

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

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

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

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

section {
  padding: 80px 0;
}

/* ── Section Titles ───────────────────────────────────────────── */
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--white);
}

.section-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.7;
}

.text-center {
  text-align: center;
}

.text-center .section-desc {
  margin: 0 auto;
}

/* ── Navigation ───────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.nav-brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand .dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

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

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

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

.nav-links .nav-cta {
  background: var(--accent);
  color: var(--bg);
  padding: 6px 16px;
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: 0.8125rem;
  transition: background var(--ease);
}

.nav-links .nav-cta:hover {
  background: var(--accent-hover);
  color: var(--bg);
}

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  padding: 140px 0 80px;
  text-align: center;
}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--white);
}

.hero-title .accent {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.hero-desc {
  font-size: 1.125rem;
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 32px;
  display: inline-block;
  margin-bottom: 40px;
  max-width: 100%;
  overflow-x: auto;
}

.hero-code code {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--accent);
  white-space: pre;
}

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

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

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: var(--shadow), 0 0 24px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--bg);
  box-shadow: var(--shadow-md), 0 0 40px var(--accent-glow);
}

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

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

/* ── Feature Grid ─────────────────────────────────────────────── */
.features {
  border-top: 1px solid var(--border);
}

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

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all var(--ease);
}

.feature-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px var(--accent-dim);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-dim);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.25rem;
}

.feature-name {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--white);
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Architecture ─────────────────────────────────────────────── */
.architecture {
  border-top: 1px solid var(--border);
}

.arch-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  margin-top: 48px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.arch-diagram {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 2;
  color: var(--text-muted);
  white-space: pre;
  overflow-x: auto;
}

.arch-diagram .highlight {
  color: var(--accent);
  font-weight: 600;
}

.arch-diagram .subtle {
  color: var(--text-dim);
}

.arch-compare {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.arch-compare-item {
  text-align: center;
}

.arch-compare-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.arch-compare-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}

.arch-compare-value .accent {
  color: var(--accent);
}

/* ── Quick Start ──────────────────────────────────────────────── */
.quickstart {
  border-top: 1px solid var(--border);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 48px;
}

.step {
  position: relative;
}

.step-num {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.step-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--white);
}

.step-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

.step-code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  overflow-x: auto;
  white-space: nowrap;
}

/* ── Examples Grid ────────────────────────────────────────────── */
.examples {
  border-top: 1px solid var(--border);
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.example-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: all var(--ease);
  display: block;
}

.example-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 24px var(--accent-dim);
  color: inherit;
}

.example-num {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.example-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
}

.example-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.example-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 10px;
}

.badge-basic {
  background: rgba(88, 166, 255, 0.12);
  color: #58a6ff;
}

.badge-intermediate {
  background: rgba(63, 185, 80, 0.12);
  color: #3fb950;
}

.badge-advanced {
  background: rgba(210, 168, 40, 0.12);
  color: #d2a828;
}

.badge-fullstack {
  background: rgba(188, 140, 255, 0.12);
  color: #bc8cff;
}

/* ── Footer ───────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
}

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

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color var(--ease);
}

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

.footer-meta {
  text-align: right;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-dim);
}

.footer-license {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ── Responsive: Tablet ───────────────────────────────────────── */
@media (max-width: 960px) {
  .hero-title {
    font-size: 3rem;
  }

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

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

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

  .arch-block {
    padding: 28px;
  }

  .arch-diagram {
    font-size: 0.8125rem;
  }
}

/* ── Responsive: Mobile ───────────────────────────────────────── */
@media (max-width: 640px) {
  section {
    padding: 56px 0;
  }

  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 100px 0 56px;
  }

  .hero-title {
    font-size: 2.25rem;
  }

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

  .hero-desc {
    font-size: 1rem;
  }

  .hero-code {
    padding: 16px 20px;
  }

  .hero-code code {
    font-size: 0.8125rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .feature-grid,
  .example-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .arch-block {
    padding: 20px;
  }

  .arch-diagram {
    font-size: 0.75rem;
    line-height: 1.8;
  }

  .arch-compare {
    gap: 24px;
  }

  .nav-links .hide-mobile {
    display: none;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-meta {
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}
