/* ===== Reset & base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #0f172a;
  background: #ffffff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

:root {
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --accent: #f59e0b;
  --success: #10b981;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Topbar ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  display: flex; justify-content: space-between; align-items: center;
  height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 18px;
}
.brand__mark {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white; border-radius: 8px;
  font-size: 18px;
}
.nav {
  display: flex; gap: 24px; align-items: center;
}
.nav a:not(.btn) {
  font-size: 14px; font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav a:not(.btn):hover { color: var(--text); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600; font-size: 14px;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--lg { padding: 14px 28px; font-size: 16px; }
.btn--primary {
  background: var(--primary); color: white;
}
.btn--primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--secondary {
  background: var(--bg-alt); color: var(--text);
  border-color: var(--border);
}
.btn--secondary:hover { background: white; border-color: var(--border-strong); }
.btn--ghost {
  background: transparent; color: var(--primary);
  border-color: var(--border);
}

/* ===== Hero ===== */
.hero {
  padding: 80px 0 64px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(79, 70, 229, 0.08), transparent 70%),
    var(--bg);
}
.hero__eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  margin-bottom: 24px;
}
.hero__title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero__sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 32px;
}
.hero__cta {
  display: flex; gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.hero__meta {
  display: flex; gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Sections ===== */
.section { padding: 80px 0; }
.section--alt { background: var(--bg-alt); }
.section__title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.section__sub {
  font-size: 17px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 48px;
}

/* ===== Templates grid ===== */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-align: left;
  transition: all 0.2s;
  cursor: pointer;
  display: flex; flex-direction: column;
}
.template-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.template-card__emoji {
  font-size: 32px;
  margin-bottom: 12px;
}
.template-card__title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}
.template-card__desc {
  font-size: 14px;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 16px;
}
.template-card__price {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* ===== Modal / Runner ===== */
.modal {
  display: none;
  position: fixed; inset: 0;
  z-index: 100;
}
.modal[aria-hidden="false"] { display: block; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}
.modal__panel {
  position: relative;
  background: white;
  max-width: 560px;
  margin: 60px auto;
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  max-height: 80vh;
  overflow-y: auto;
}
.modal__close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  font-size: 24px;
  color: var(--text-muted);
}
.modal__close:hover { background: var(--bg-alt); }

.runner-form {
  display: flex; flex-direction: column;
  gap: 16px;
}
.runner-form label {
  display: flex; flex-direction: column;
  gap: 6px;
  font-size: 14px; font-weight: 500;
}
.runner-form input,
.runner-form textarea,
.runner-form select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
}
.runner-form input:focus,
.runner-form textarea:focus,
.runner-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.runner-form textarea { min-height: 80px; resize: vertical; }
.runner-form button[type="submit"] { margin-top: 8px; }

.runner-result {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-alt);
  border-radius: 12px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid var(--border);
}
.runner-result__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.runner-error {
  margin-top: 16px;
  padding: 12px 16px;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 10px;
  font-size: 14px;
}
.runner-loading {
  margin-top: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== Steps ===== */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}
.step { text-align: center; }
.step__num {
  display: inline-grid; place-items: center;
  width: 48px; height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 20px; font-weight: 700;
  margin-bottom: 16px;
}
.step h3 {
  font-size: 18px; font-weight: 600;
  margin-bottom: 8px;
}
.step p { color: var(--text-muted); font-size: 15px; }

/* ===== Pricing ===== */
.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 920px;
  margin: 0 auto;
}
.plan {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  position: relative;
  display: flex; flex-direction: column;
}
.plan--featured {
  border-color: var(--primary);
  border-width: 2px;
  transform: scale(1.02);
}
.plan__badge {
  position: absolute;
  top: -10px; right: 20px;
  background: var(--accent);
  color: white;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.plan h3 {
  font-size: 20px;
  margin-bottom: 12px;
}
.plan__price {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}
.plan__price span {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
}
.plan__features {
  list-style: none;
  margin-bottom: 24px;
  flex: 1;
}
.plan__features li {
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.plan__features li:last-child { border-bottom: none; }
.plan__features li::before {
  content: "✓ ";
  color: var(--success);
  font-weight: 700;
  margin-right: 4px;
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-alt);
  padding: 48px 0 24px;
  border-top: 1px solid var(--border);
}
.footer__inner {
  display: flex; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.footer__tag {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 8px;
  max-width: 320px;
}
.footer__links {
  display: flex; gap: 24px; flex-wrap: wrap;
}
.footer__links a {
  color: var(--text-muted);
  font-size: 14px;
}
.footer__links a:hover { color: var(--text); }
.footer__bottom {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .nav a:not(.btn) { display: none; }
  .hero { padding: 56px 0; }
  .section { padding: 56px 0; }
  .modal__panel { margin: 24px 16px; padding: 24px; }
  .plan--featured { transform: none; }
}