:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: #0f172a;
  --panel-strong: #111827;
  --border: #1e293b;
  --text: #cbd5e1;
  --text-strong: #f8fafc;
  --text-muted: #64748b;
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.12);
  --green-glow: rgba(34, 197, 94, 0.24);
  --blue: #38bdf8;
  --blue-soft: rgba(56, 189, 248, 0.14);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
}

body {
  min-height: 100vh;
  background: linear-gradient(180deg, #020617 0%, #020817 100%);
}

button, input { font: inherit; }
button { cursor: pointer; }

.hidden { display: none !important; }

/* ── Nav ─────────────────────────────────────── */

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--green);
}

.nav-title {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-strong);
}

.nav-accent { color: var(--green); }

.nav-actions { display: flex; gap: 0.5rem; }

/* ── Buttons ──────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.15rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--green);
  color: #020617;
  border-color: var(--green);
}
.btn-primary:hover {
  background: #16a34a;
  border-color: #16a34a;
}

.btn-outline {
  background: transparent;
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.32);
}
.btn-outline:hover {
  background: var(--green-soft);
  border-color: var(--green);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text-strong); background: rgba(255,255,255,0.04); }

.btn-lg { padding: 0.7rem 1.5rem; font-size: 0.95rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Hero ──────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  max-width: 1100px;
  margin: 4rem auto;
  padding: 0 2rem;
  align-items: center;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.75rem;
}

.hero h1 {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1.2;
}

.hero-description {
  margin: 1rem 0 0;
  color: var(--text);
  font-size: 1.05rem;
  max-width: 28rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.copy-ssh {
  display: inline-flex;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.copy-ssh .copy-hint {
  font-family: Inter, sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 3px;
  padding: 0.05em 0.45em;
  flex-shrink: 0;
}
.copy-ssh.copied .copy-hint {
  color: var(--green);
  border-color: var(--green);
}

/* ── Terminal window ─────────────────────── */

.terminal-window {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  background: var(--panel-strong);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red    { background: #f87171; }
.dot-yellow { background: #fbbf24; }
.dot-green  { background: #22c55e; }

.terminal-title {
  margin-left: 0.6rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: 0.75rem 1rem;
  min-height: 220px;
  max-height: 320px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
}

.terminal-line {
  display: flex;
  gap: 0.5rem;
}

.terminal-prompt { color: var(--green); flex-shrink: 0; }
.terminal-ts    { color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.terminal-user  { font-weight: 700; flex-shrink: 0; }
.terminal-text  { color: var(--text); word-break: break-word; }
.terminal-divider {
  color: var(--text-muted);
  text-align: center;
  margin: 0.35rem 0;
  font-size: 0.7rem;
}

/* ── Features ────────────────────────── */

.features {
  max-width: 1100px;
  margin: 5rem auto;
  padding: 0 2rem;
}

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

.feature-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--panel);
  transition: border-color 0.2s;
}
.feature-card:hover { border-color: rgba(34, 197, 94, 0.32); }

.feature-icon {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-strong);
}

.feature-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── Stats bar ───────────────────────────── */

.stats-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.stats-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.stat-item .stat-value {
  color: var(--green);
  font-weight: 700;
  font-family: var(--mono);
}

/* ── Footer ───────────────────────────────── */

.footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer-sep { margin: 0 0.5rem; }

/* ── Auth overlay ────────────────────────── */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 200;
  padding: 1rem;
}

.auth-modal {
  width: min(24rem, 100%);
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--panel);
  position: relative;
}

.auth-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.25rem;
}
.auth-close:hover { color: var(--text); }

.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.auth-tab {
  flex: 1;
  padding: 0.6rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.auth-tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.auth-field input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: var(--panel-strong);
  color: var(--text-strong);
  font-size: 0.9rem;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--green);
}

.auth-error {
  margin-bottom: 1rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.4rem;
  background: var(--red-soft);
  color: var(--red);
  font-size: 0.8rem;
  border: 1px solid rgba(248, 113, 113, 0.2);
}

/* ── Responsive ──────────────────────────── */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 2rem auto;
  }
  .hero h1 { font-size: 1.65rem; }
  .hero-terminal { order: -1; }
  .features-grid { grid-template-columns: 1fr; }
  .stats-inner { gap: 1rem; }
}

@media (max-width: 480px) {
  .nav-bar { padding: 0.6rem 1rem; }
  .nav-title { font-size: 0.95rem; }
  .hero { padding: 0 1rem; }
  .features { padding: 0 1rem; }
  .hero-actions { flex-direction: column; }
  .copy-ssh { font-size: 0.7rem; }
}
