/* SelfHost Buddy — design system. One palette, one type scale, one spacing scale. */
:root {
  --bg: #0a0e17;
  --bg-soft: #0f1522;
  --panel: #131b2c;
  --panel-2: #182236;
  --border: #243150;
  --border-soft: #1b2438;
  --text: #e8edf7;
  --text-dim: #9aa8c4;
  --text-faint: #6c7a99;
  --accent: #7c8cff;
  --accent-2: #43d6b5;
  --accent-glow: rgba(124, 140, 255, 0.35);
  --danger: #ff6b81;
  --warn: #ffb454;
  --code-bg: #0b1120;
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1120px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.6);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
}
[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-soft: #eef2f9;
  --panel: #ffffff;
  --panel-2: #f3f6fc;
  --border: #d7e0ee;
  --border-soft: #e6ecf6;
  --text: #14213a;
  --text-dim: #4a5b7a;
  --text-faint: #76859f;
  --accent: #4f5bff;
  --accent-2: #0f9d83;
  --accent-glow: rgba(79, 91, 255, 0.22);
  --code-bg: #0f1729;
  --shadow: 0 18px 50px -28px rgba(20, 33, 58, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5rem; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1rem; color: var(--text-dim); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-faint); }
.accent { color: var(--accent); }
.accent2 { color: var(--accent-2); }
.center { text-align: center; }

/* ---------- header ---------- */
header.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; color: var(--text); font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.logo {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800; font-size: 15px; box-shadow: 0 6px 18px -6px var(--accent-glow);
}
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--text-dim); font-size: .95rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; color: var(--text-dim);
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: inherit; font-size: .98rem; font-weight: 600; padding: 12px 22px;
  border-radius: 11px; border: 1px solid transparent; transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 10px 30px -10px var(--accent-glow); }
.btn-ghost { background: var(--panel); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 84px 0 56px; }
.hero::before {
  content: ""; position: absolute; inset: -40% 0 auto 0; height: 620px; z-index: -1;
  background: radial-gradient(60% 60% at 50% 0%, var(--accent-glow), transparent 70%);
  filter: blur(8px);
}
.pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600;
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text-dim); margin-bottom: 22px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 20%, transparent); }
.hero h1 { max-width: 16ch; margin-inline: auto; }
.hero .sub { font-size: clamp(1.05rem, 2vw, 1.28rem); max-width: 56ch; margin: 1.1rem auto 1.8rem; color: var(--text-dim); }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 16px; font-size: .85rem; color: var(--text-faint); }
.grad-text { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- generic section ---------- */
section { padding: 64px 0; }
.section-head { text-align: center; max-width: 60ch; margin: 0 auto 44px; }
.section-head p { font-size: 1.05rem; }
.kicker { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }

/* ---------- features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .feature-grid { grid-template-columns: 1fr; } }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); transform: translateY(-3px); }
.card .ico {
  width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 16px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
}
.card h3 { color: var(--text); }
.card p { margin-bottom: 0; font-size: .96rem; }

/* ---------- generator ---------- */
.gen-wrap { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
@media (max-width: 940px) { .gen-wrap { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.form { padding: 24px; }
.form h3 { margin-bottom: 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.field .hint { font-size: .78rem; color: var(--text-faint); font-weight: 400; }
input[type="text"], input[type="number"], input[type="email"], select {
  width: 100%; font-family: inherit; font-size: .95rem; padding: 11px 13px; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: border-color .12s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
.seg { display: flex; gap: 6px; background: var(--bg-soft); padding: 5px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.seg button {
  flex: 1; cursor: pointer; font-family: inherit; font-size: .88rem; font-weight: 600; padding: 9px 8px;
  border: none; border-radius: 7px; background: transparent; color: var(--text-dim);
}
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.checks { display: grid; gap: 9px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; color: var(--text); }
.check input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

/* ---------- output ---------- */
.out { min-height: 480px; display: flex; flex-direction: column; }
.tabs { display: flex; gap: 4px; padding: 12px 12px 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  cursor: pointer; font-family: inherit; font-size: .86rem; font-weight: 600; white-space: nowrap;
  padding: 9px 14px; border: none; background: transparent; color: var(--text-dim); border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }
.tabpanel { position: relative; flex: 1; }
.codebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border-soft); font-size: .8rem; color: var(--text-faint);
}
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-family: inherit;
  font-size: .8rem; font-weight: 600; padding: 6px 12px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text-dim);
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }
.copy-btn.ok { color: var(--accent-2); border-color: var(--accent-2); }
pre {
  margin: 0; padding: 18px; overflow-x: auto; background: var(--code-bg); color: #d7e2f5;
  font-family: var(--mono); font-size: .855rem; line-height: 1.65; border-radius: 0 0 var(--radius) var(--radius);
  max-height: 560px;
}
pre .c { color: #6c7a99; }
pre .k { color: #7c8cff; }
pre .s { color: #43d6b5; }
pre .n { color: #ffb454; }

/* ---------- pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 860px) { .price-grid { grid-template-columns: 1fr; } }
.price {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column;
}
.price.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); position: relative; }
.price.featured::before {
  content: "Most popular"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: .72rem; font-weight: 700;
  padding: 4px 14px; border-radius: 999px;
}
.price .tier { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.price .amt { font-size: 2.4rem; font-weight: 800; margin: 10px 0 2px; color: var(--text); }
.price .amt small { font-size: .9rem; font-weight: 500; color: var(--text-faint); }
.price .inr { font-size: .85rem; color: var(--text-faint); margin-bottom: 18px; }
.price ul { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 11px; }
.price li { display: flex; gap: 10px; font-size: .92rem; color: var(--text-dim); }
.price li svg { flex-shrink: 0; color: var(--accent-2); margin-top: 3px; }
.price .btn { margin-top: auto; justify-content: center; }

/* ---------- steps / how ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: s; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.step .num {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 12px;
  background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); font-weight: 800;
}
.step h3 { font-size: 1.02rem; color: var(--text); }
.step p { font-size: .9rem; margin-bottom: 0; }

/* ---------- cta band ---------- */
.cta-band {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--panel)), color-mix(in srgb, var(--accent-2) 14%, var(--panel)));
  border: 1px solid var(--border); border-radius: 20px; padding: 48px 32px; text-align: center;
}

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border-soft); padding: 40px 0; margin-top: 40px; }
.foot-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.foot-links { display: flex; gap: 26px; flex-wrap: wrap; }
.foot-links a { color: var(--text-dim); font-size: .9rem; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--accent-2); color: var(--text); padding: 11px 20px;
  border-radius: 11px; font-size: .9rem; font-weight: 600; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.legal { max-width: 760px; margin: 0 auto; padding: 40px 0; }
.legal h2 { margin-top: 36px; }
.legal p, .legal li { color: var(--text-dim); }
.badge-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; font-size: .82rem; color: var(--text-faint); }
.badge-row span { display: inline-flex; align-items: center; gap: 6px; }
