/* ─── Tokens ─────────────────────────────────── */
:root {
  --text: #171717;
  --muted: #6b7280;
  --hint: #9ca3af;
  --bg: #f4f4f6;
  --surface: #ffffff;
  --surface-soft: #fff5f1;
  --line: #e5e7eb;
  --primary: #f45b26;
  --primary-dark: #d94714;
  --primary-bg: #fff0ea;
  --primary-border: #ffd0bd;
  --dark: #111827;
  --dark-surface: #1f2937;
  --dark-border: #374151;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.07);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

/* ─── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a, button { font: inherit; }
h1, h2, h3, p, ul { margin: 0; }

/* ─── Layout ──────────────────────────────────── */
.site-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

/* ─── Topbar ──────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 900;
  flex-shrink: 0;
}

nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

nav a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 8px;
  transition: color .15s, background .15s;
}

nav a:hover {
  color: var(--text);
  background: var(--surface);
}

nav .nav-cta {
  background: var(--primary);
  color: #fff;
  padding: 7px 16px;
  border-radius: 8px;
}

nav .nav-cta:hover {
  background: var(--primary-dark);
  color: #fff;
}

/* ─── Hero ────────────────────────────────────── */
.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: center;
  padding: clamp(32px, 5vw, 64px) clamp(28px, 5vw, 56px);
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: var(--surface-soft);
  z-index: 0;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--primary-bg);
  color: var(--primary-dark);
  border: 1px solid var(--primary-border);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
}

h1 {
  font-size: clamp(38px, 6vw, 58px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -.02em;
  color: #111;
  margin-bottom: 16px;
}

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

.hero-copy {
  color: var(--muted);
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.65;
  max-width: 440px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ─── Buttons ─────────────────────────────────── */
.btn-primary,
.btn-ghost,
.btn-white {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  min-height: 44px;
  padding: 0 18px;
  text-decoration: none;
  transition: background .15s, transform .1s;
}

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

.btn-ghost { background: #f0f1f3; color: #3f3f46; }
.btn-ghost:hover { background: #e4e5e8; }

.btn-white { background: #fff; color: #111; }
.btn-white:hover { background: #f3f4f6; }

/* ─── Code panel ──────────────────────────────── */
.code-panel {
  background: var(--dark);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--dark-surface);
  position: relative;
  z-index: 1;
}

.panel-bar {
  background: var(--dark-surface);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--dark-border);
}

.panel-dots {
  display: flex;
  gap: 6px;
}

.panel-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.panel-dots span:nth-child(1) { background: #f45b26; }
.panel-dots span:nth-child(2) { background: #ffd166; }
.panel-dots span:nth-child(3) { background: #31d0aa; }

.panel-title {
  color: var(--hint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
}

.panel-body { padding: 22px; }

.panel-body strong {
  display: block;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 8px;
}

.panel-body p {
  color: #9ca3af;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.file-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--dark-surface);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12px;
  color: #d1d5db;
}

.file-icon { font-size: 13px; }

.file-tag {
  margin-left: auto;
  background: var(--dark-border);
  color: var(--hint);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

/* ─── Stats ───────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.stats article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats span {
  color: var(--hint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.stats strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.stats strong.accent { color: var(--primary); }

.stats small {
  color: var(--muted);
  font-size: 12px;
}

/* ─── Feature cards ───────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: box-shadow .2s, transform .2s;
}

.feature-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.feature-card h2 {
  font-size: 17px;
  font-weight: 800;
  color: #111;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  flex: 1;
}

.card-link {
  display: inline-block;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  margin-top: 18px;
}

/* ─── How it works ────────────────────────────── */
.how-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.how-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
}

.how-step {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-bg);
  border: 2px solid var(--primary-border);
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 900;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
}

.how-card h3 {
  font-size: 16px;
  font-weight: 800;
  color: #111;
  margin-bottom: 8px;
}

.how-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.how-connector {
  color: var(--hint);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

/* ─── CTA ─────────────────────────────────────── */
.cta-block {
  background: var(--dark);
  border-radius: 16px;
  padding: clamp(28px, 4vw, 40px) clamp(24px, 4vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cta-text h2 {
  color: #fff;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 800;
  margin-bottom: 6px;
}

.cta-text p {
  color: #9ca3af;
  font-size: 14px;
  line-height: 1.6;
}

/* ─── Theme: cool (blue) ──────────────────────── */
body.is-cool {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-bg: #eff6ff;
  --primary-border: #bfdbfe;
}

/* ─── Responsive ──────────────────────────────── */
@media (max-width: 800px) {
  .site-shell {
    width: min(100% - 20px, 1080px);
    padding: 16px 0 36px;
  }

  .topbar { flex-wrap: wrap; }

  .hero {
    grid-template-columns: 1fr;
    padding: 32px 24px;
  }

  .hero::before { display: none; }

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

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

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

  .how-connector { transform: rotate(90deg); }

  .cta-block {
    flex-direction: column;
    align-items: flex-start;
  }
}
