:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-dark: #0f172a;
  --text: #1e293b;
  --text-soft: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --accent: #0ea5e9;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand .logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 8px;
}

.nav a:hover {
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
}

.nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav .btn {
  margin-left: 6px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.btn:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-soft);
}

.btn-success {
  background: var(--success);
}

.btn-success:hover {
  background: #15803d;
}

.btn-lg {
  padding: 13px 26px;
  font-size: 1rem;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.narrow {
  max-width: 820px;
}

main {
  padding-bottom: 80px;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 64px 0 48px;
}

.hero .eyebrow {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero p.lead {
  font-size: 1.1rem;
  color: var(--text-soft);
  max-width: 640px;
  margin: 0 auto 28px;
}

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

/* ---------- Cards grid ---------- */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 48px 0 6px;
  letter-spacing: -0.01em;
}

.section-sub {
  color: var(--text-soft);
  margin-bottom: 24px;
  font-size: 0.98rem;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: block;
  color: var(--text);
}

a.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  text-decoration: none;
}

.card .card-icon {
  font-size: 1.7rem;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  border-radius: 10px;
  margin-bottom: 14px;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.card p {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.55;
}

.card .card-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Route page (roadmap.sh style) ---------- */
.route-hero {
  padding: 48px 0 8px;
}

.route-hero .crumbs {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 18px;
}

.route-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.route-hero .subtitle {
  color: var(--text-soft);
  font-size: 1.05rem;
  max-width: 720px;
}

.route-hero .badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.badge.blue {
  background: var(--primary-soft);
  border-color: #bfdbfe;
  color: var(--primary);
}

.badge.green {
  background: var(--success-soft);
  border-color: #bbf7d0;
  color: var(--success);
}

.badge.purple {
  background: var(--purple-soft);
  border-color: #ddd6fe;
  color: var(--purple);
}

/* Content sections */
.content-section {
  padding-top: 40px;
}

.content-section > h2 {
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  scroll-margin-top: 80px;
}

.content-section > h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 26px 0 10px;
  scroll-margin-top: 80px;
}

.content-section p {
  margin-bottom: 14px;
  color: #334155;
}

.content-section ul,
.content-section ol {
  margin: 0 0 16px 22px;
}

.content-section li {
  margin-bottom: 8px;
  color: #334155;
}

.content-section strong {
  color: var(--text);
}

.callout {
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  margin: 18px 0;
  font-size: 0.94rem;
}

.callout.warn {
  border-color: var(--warning);
  background: var(--warning-soft);
}

.callout.ok {
  border-color: var(--success);
  background: var(--success-soft);
}

/* Tech item list (mini-guide per tech) */
.tech-list {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.tech-item {
  display: flex;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  align-items: flex-start;
}

.tech-item .tech-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.tech-item .tech-body {
  flex: 1;
}

.tech-item h4 {
  font-size: 0.98rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tech-item h4 .tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
}

.tag.req {
  background: var(--success-soft);
  color: var(--success);
}

.tag.opt {
  background: var(--warning-soft);
  color: var(--warning);
}

.tag.free {
  background: var(--primary-soft);
  color: var(--primary);
}

.tech-item p {
  font-size: 0.88rem;
  color: var(--text-soft);
  margin: 4px 0 6px;
}

.tech-item .tech-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.83rem;
  font-weight: 600;
}

/* ---------- Checklist ---------- */
.checklist {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-top: 10px;
}

.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 0;
  cursor: pointer;
  font-size: 0.94rem;
  color: #334155;
  border-bottom: 1px dashed var(--border);
}

.checklist label:last-child {
  border-bottom: none;
}

.checklist input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.checklist label.done {
  color: var(--text-soft);
  text-decoration: line-through;
}

.checklist-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.checklist-head strong {
  font-size: 0.9rem;
}

.checklist-progress {
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 700;
}

/* ---------- CTA band ---------- */
.cta-band {
  margin-top: 48px;
  background: linear-gradient(135deg, var(--bg-dark), #1e3a8a);
  border-radius: 16px;
  padding: 36px 32px;
  color: #fff;
  text-align: center;
}

.cta-band h3 {
  font-size: 1.35rem;
  font-weight: 750;
  margin-bottom: 8px;
}

.cta-band p {
  color: #cbd5e1;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.cta-band .btn {
  background: #fff;
  color: var(--bg-dark);
}

.cta-band .btn:hover {
  background: #e2e8f0;
}

/* ---------- Planner ---------- */
.planner {
  padding-top: 36px;
}

.stepper {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.stepper .step {
  flex: 1;
  min-width: 110px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.stepper .step.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.stepper .step.done {
  background: var(--success-soft);
  border-color: #bbf7d0;
  color: var(--success);
}

.wizard-panel {
  display: none;
  animation: fade 0.25s ease;
}

.wizard-panel.active {
  display: block;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.wizard-panel h2 {
  font-size: 1.3rem;
  font-weight: 750;
  margin-bottom: 6px;
}

.wizard-panel .hint {
  color: var(--text-soft);
  font-size: 0.92rem;
  margin-bottom: 20px;
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.option {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  cursor: pointer;
  background: var(--bg);
  transition: all 0.15s;
  user-select: none;
}

.option:hover {
  border-color: var(--accent);
}

.option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.option .opt-title {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.option .opt-desc {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-top: 4px;
  line-height: 1.45;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 26px;
  gap: 12px;
}

.text-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 18px;
  background: var(--bg);
}

.text-input:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

/* ---------- Output ---------- */
.output-area {
  width: 100%;
  min-height: 340px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.83rem;
  line-height: 1.6;
  background: var(--bg-dark);
  color: #e2e8f0;
  resize: vertical;
}

.output-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.copy-feedback {
  font-size: 0.85rem;
  color: var(--success);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}

.copy-feedback.show {
  opacity: 1;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--text-soft);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer a {
  color: var(--text-soft);
}

/* ---------- TOC sidebar (route pages) ---------- */
.with-toc {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 1024px) {
  .with-toc {
    grid-template-columns: 1fr 240px;
    align-items: start;
  }

  .toc {
    position: sticky;
    top: 84px;
  }
}

.toc {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 0.85rem;
  order: -1;
}

@media (min-width: 1024px) {
  .toc {
    order: 0;
  }
}

.toc strong {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.toc a {
  display: block;
  color: var(--text-soft);
  padding: 4px 0;
}

.toc a:hover {
  color: var(--primary);
  text-decoration: none;
}

/* ---------- Utilities ---------- */
.mt-0 {
  margin-top: 0;
}

.center {
  text-align: center;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

@media (max-width: 720px) {
  .site-header .container {
    height: auto;
    flex-direction: column;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 8px;
  }

  .nav {
    justify-content: center;
  }

  .hero {
    padding: 44px 0 32px;
  }
}
