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

:root {
  --blurple: #5865f2;
  --blurple-dark: #4752c4;
  --blurple-light: #7289da;
  --bg-primary: #0b0d13;
  --bg-secondary: #111318;
  --bg-card: #16181e;
  --bg-card-hover: #1c1f27;
  --bg-code: #1a1d25;
  --text-primary: #f2f3f5;
  --text-secondary: #b5bac1;
  --text-muted: #80848e;
  --border: #2a2d35;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1120px;
  --nav-height: 64px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--blurple-light);
  text-decoration: none;
  transition: color 0.2s;
}

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

code {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875em;
}

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

/* === Navigation === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(11, 13, 19, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: height 0.3s, background 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
  height: 52px;
  background: rgba(11, 13, 19, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

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

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

.brand-icon {
  width: 1.5em;
  height: 1.5em;
}

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

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

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

.nav-github {
  background: var(--bg-card);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

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

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

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* === Hero === */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin-top: var(--nav-height);
  padding: 96px 24px 100px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(88, 101, 242, 0.2) 0%, transparent 60%),
    linear-gradient(rgba(11, 13, 19, 0.76), rgba(11, 13, 19, 0.92)),
    url('hero-background.png') center / cover no-repeat;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom, transparent 52%, var(--bg-primary) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(88, 101, 242, 0.1);
  border: 1px solid rgba(88, 101, 242, 0.25);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blurple-light);
  margin-bottom: 24px;
  letter-spacing: 0.025em;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.14em;
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

.hero-tech {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.tech-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--blurple);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blurple-dark);
  color: #fff;
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-small {
  padding: 8px 18px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--blurple);
  color: #fff;
}

.btn-small:hover {
  background: var(--blurple-dark);
  color: #fff;
}

/* === Sections === */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-secondary);
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 56px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* === Features Grid === */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

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

.feature-card:hover {
  border-color: rgba(88, 101, 242, 0.3);
  transform: translateY(-2px);
}

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

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

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

/* === Escalation === */
.escalation-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.escalation-step {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 40px;
  min-width: 160px;
}

.escalation-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--blurple);
  line-height: 1;
}

.escalation-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.escalation-action {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.escalation-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
}

.escalation-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* === Commands === */
.commands-group {
  margin-bottom: 48px;
}

.commands-group:last-child {
  margin-bottom: 0;
}

.commands-group-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--blurple-light);
}

.commands-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.command-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.command-card code {
  font-size: 0.85rem;
  color: var(--blurple-light);
  background: rgba(88, 101, 242, 0.1);
  display: inline-block;
  margin-bottom: 8px;
}

.command-perm {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-code);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.command-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* === Setup Steps === */
.setup-steps {
  max-width: 640px;
  margin: 0 auto;
  list-style: none;
}

.setup-step {
  display: flex;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.setup-step:last-child {
  border-bottom: none;
}

.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blurple);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  border-radius: 50%;
}

.step-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.step-content {
  min-width: 0;
}

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

.step-content code {
  display: inline-block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.verification-prerequisite {
  max-width: 640px;
  margin: 0 auto 20px;
  padding: 16px 20px;
  color: var(--text-secondary);
  background: rgba(88, 101, 242, 0.08);
  border: 1px solid rgba(88, 101, 242, 0.25);
  border-radius: var(--radius-sm);
}

.verification-prerequisite strong {
  color: var(--text-primary);
}

/* === Self-Hosting === */
.selfhost-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.selfhost-code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-header {
  padding: 12px 20px;
  background: var(--bg-code);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.selfhost-code pre {
  padding: 20px;
  overflow-x: auto;
}

.selfhost-code code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.code-comment {
  color: var(--text-muted);
}

.selfhost-info {
  padding: 8px 0;
}

.selfhost-info h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.selfhost-info p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.selfhost-info img {
  margin-bottom: 28px;
}

.selfhost-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.detail-item strong {
  color: var(--text-primary);
}

.detail-item span {
  color: var(--text-secondary);
}

/* === Footer === */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand {
  max-width: 280px;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 64px;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  text-align: center;
}

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

.footer-bottom a {
  color: var(--text-muted);
}

.footer-bottom a:hover {
  color: var(--text-secondary);
}

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

  .selfhost-content {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
  }

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

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

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

  .escalation-steps {
    flex-direction: column;
  }

  .escalation-arrow {
    transform: rotate(90deg);
  }

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

  .footer-links {
    gap: 40px;
  }

  .section {
    padding: 72px 0;
  }

  .hero {
    padding: 56px 24px 72px;
  }

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

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

@media (max-width: 480px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

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

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

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

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