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

:root {
  --bg: #0a0a0a;
  --bg-elevated: #252530;
  --bg-card: #2c2c38;
  --surface: #1a1a1a;
  --border: #262626;
  --border-warm: #2a2218;
  --text: #e8e4de;
  --text-dim: #807a70;
  --text-muted: #555049;
  --amber: #e8a040;
  --amber-dim: #c4802a;
  --amber-glow: #e8a04030;
  --orange: #d4622a;
  --green: #7fbe5c;
  --red: #d45050;
  --cyan: #5caaaa;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', 'Fira Code', monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

::selection {
  background: var(--amber);
  color: var(--bg);
}

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

/* ── Grain Overlay ──────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ── Ambient Glow ───────────────────────────────────── */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: -1;
}
.glow-orb--amber {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--amber-glow), transparent 70%);
  top: -100px; right: -100px;
  animation: drift 20s ease-in-out infinite alternate;
}
.glow-orb--orange {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #d4622a18, transparent 70%);
  bottom: 20%; left: -80px;
  animation: drift 25s ease-in-out 5s infinite alternate-reverse;
}

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.1); }
  100% { transform: translate(-20px, -10px) scale(0.95); }
}

/* ── Layout ─────────────────────────────────────────── */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Nav ────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0a0a0aee;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
nav .logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
nav .logo span { color: var(--amber); }
nav .nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}
nav .nav-links a {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.3s;
}
nav .nav-links a:hover { color: var(--amber); }
nav .nav-links .gh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.8rem;
  transition: border-color 0.3s, background 0.3s;
}
nav .nav-links .gh-btn:hover {
  border-color: var(--amber-dim);
  background: var(--amber-glow);
}
nav .nav-links .gh-btn svg {
  width: 16px; height: 16px;
  fill: currentColor;
}

/* ── Hero ───────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 5rem;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border-warm);
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--amber);
  letter-spacing: 0.03em;
  margin-bottom: 2rem;
  width: fit-content;
  background: #1a160e;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.2s forwards;
}
.hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) 0.4s forwards;
}
.hero h1 em {
  font-style: italic;
  color: var(--amber);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 520px;
  line-height: 1.8;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) 0.6s forwards;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) 0.8s forwards;
}

/* ── Install Tabs ──────────────────────────────────── */
.install-tabs {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.install-tab-buttons {
  display: flex;
  gap: 0;
}
.install-tab-btn {
  padding: 0.4rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  letter-spacing: 0.02em;
}
.install-tab-btn:hover {
  color: var(--text-dim);
}
.install-tab-btn.active {
  color: var(--amber);
  background: var(--surface);
  border-color: var(--border);
}
.install-tabs .install-cmd {
  border-radius: 0 8px 8px 8px;
}
.install-tabs--cta {
  display: inline-flex;
  align-items: center;
  flex-direction: column;
}
.install-tabs--cta .install-tab-buttons {
  align-self: flex-start;
}
.install-tabs--cta .cta-install {
  border-radius: 0 8px 8px 8px;
}

.install-cmd {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
  position: relative;
}
.install-cmd:hover {
  border-color: var(--amber-dim);
  box-shadow: 0 0 20px var(--amber-glow);
}
.install-cmd .prompt { color: var(--amber); user-select: none; }
.install-cmd .copy-icon {
  color: var(--text-muted);
  transition: color 0.2s;
  flex-shrink: 0;
}
.install-cmd:hover .copy-icon { color: var(--amber); }
.install-cmd .tooltip {
  position: absolute;
  top: -2rem;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--amber);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.install-cmd .tooltip.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.hero-link {
  font-size: 0.85rem;
  color: var(--text-dim);
  border-bottom: 1px dashed var(--text-muted);
  padding-bottom: 2px;
  transition: color 0.3s, border-color 0.3s;
}
.hero-link:hover {
  color: var(--amber);
  border-color: var(--amber);
}

/* ── Terminal ──────────────────────────────────────── */
.hero-terminal {
  margin-top: 4rem;
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) 1s forwards;
}

.terminal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 4px 24px rgba(0,0,0,0.4),
    0 0 60px var(--amber-glow);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.terminal-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.terminal-dot--red { background: #d45050; }
.terminal-dot--yellow { background: #e8a040; }
.terminal-dot--green { background: #7fbe5c; }
.terminal-title {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.terminal-body {
  padding: 1.5rem;
  font-size: 0.82rem;
  line-height: 1.9;
  min-height: 120px;
}
.terminal-body .line { opacity: 0; animation: typeLine 0.4s var(--ease-out) forwards; }
.terminal-body .prompt-char { color: var(--amber); }
.terminal-body .cmd { color: var(--text); }
.terminal-body .flag { color: var(--cyan); }
.terminal-body .output { color: #a8a29e; }
.terminal-body .highlight { color: var(--green); }
.terminal-body .id { color: var(--orange); }
.terminal-body .desc { color: #9a948c; font-style: italic; }
.terminal-body .cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--amber);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes typeLine {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Compact terminal (steps/cta) ──────────────────── */
.terminal--compact .terminal-bar {
  padding: 0.6rem 0.85rem;
}
.terminal--compact .terminal-body {
  padding: 1.1rem 1.25rem;
  font-size: 0.78rem;
  min-height: 80px;
}

/* ── Sections ───────────────────────────────────────── */
section {
  padding: 7rem 0;
}
.section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--amber);
  margin-bottom: 1rem;
}
.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}
.section-desc {
  color: var(--text-dim);
  max-width: 540px;
  font-size: 0.9rem;
  line-height: 1.8;
  margin-bottom: 3.5rem;
}

/* ── Feature Grid ──────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.feature-card {
  background: var(--bg);
  padding: 2rem;
  position: relative;
  transition: background 0.4s;
}
.feature-card:hover {
  background: var(--bg-elevated);
}
.feature-icon {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  display: block;
}
.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}
.feature-card p {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.7;
}

/* ── How it Works ──────────────────────────────────── */
.steps {
  display: grid;
  gap: 0;
  position: relative;
}
.step {
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  gap: 2rem;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.step:last-child { border-bottom: none; }
.step-number {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--amber);
  line-height: 1;
  opacity: 0.5;
}
.step-content h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}
.step-content p {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.8;
}
.step-terminal {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}
.step-terminal .terminal {
  width: 100%;
}

/* ── Templates ─────────────────────────────────────── */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.template-logo {
  width: 28px;
  height: 28px;
  margin-bottom: 0.75rem;
  opacity: 0.6;
  transition: opacity 0.3s;
}
.template-card:hover .template-logo {
  opacity: 1;
}
.template-card {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  cursor: default;
}
.template-card:hover {
  border-color: var(--amber-dim);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.template-name {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.template-cmd {
  font-size: 0.72rem;
  color: var(--text-muted);
  word-break: break-all;
}

/* ── CTA ────────────────────────────────────────────── */
.cta {
  text-align: center;
  padding: 8rem 0;
  position: relative;
}
.cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, var(--amber-glow), transparent 70%);
  filter: blur(80px);
  pointer-events: none;
}
.cta h2 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  position: relative;
}
.cta p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 2.5rem;
  position: relative;
}
.cta-terminal {
  max-width: 580px;
  margin: 0 auto 3rem;
  position: relative;
  text-align: left;
}
.cta-install {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: var(--amber);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.3s;
  position: relative;
}
.cta-install:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--amber-glow);
  color: var(--bg);
}

/* ── Footer ─────────────────────────────────────────── */
footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}
footer a { color: var(--text-dim); }
footer a:hover { color: var(--amber); }

/* ── Scroll animations ──────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 1rem; }
  nav .nav-links { gap: 1rem; }
  nav .nav-links a:not(.gh-btn) { display: none; }
  .hero { min-height: auto; padding: 8rem 0 4rem; }
  .hero h1 { font-size: 3rem; }
  .step {
    grid-template-columns: 50px 1fr;
    gap: 1rem;
  }
  .step-number { font-size: 2rem; }
  .step-terminal {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .templates-grid { grid-template-columns: repeat(2, 1fr); }
  footer { flex-direction: column; gap: 1rem; text-align: center; }
}

/* ── Platforms line ─────────────────────────────────── */
#platforms { padding: 2rem 0; }
.platforms-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.platforms-label { color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; }
.platforms-icons { display: flex; gap: 0.5rem; align-items: center; }
.platform-icon { width: 18px; height: 18px; opacity: 0.6; filter: brightness(0) invert(0.7); }

@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }
  .hero h1 { font-size: 2.5rem; }
  .features-grid { grid-template-columns: 1fr; }
  .templates-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .install-cmd { justify-content: center; }
}
