:root {
  --bg-base: #0d0b08;
  --bg-surface: #15110c;
  --bg-elevated: #1a1610;
  --bg-hover: #241e15;
  --border: #322a1f;
  --border-subtle: #221c14;
  --text-primary: #f3efe9;
  --text-secondary: #a59f93;
  --text-muted: #6b6457;
  --accent: #7c5cfc;
  --accent-2: #8b6cff;
  --accent-dim: #4a3899;
  --success: #22c55e;
  --warning: #f59e0b;
  --code-bg: #120f0a;
  --code-fg: #ddd6cb;
  --dot: #342d22;
  --header-bg: rgba(13, 11, 8, 0.72);
  --mono: "SF Mono", "Cascadia Code", "Fira Code", ui-monospace, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --maxw: 1080px;
}

/* Light theme tokens, shared by the forced and system-preference selectors. */
:root[data-theme="light"],
:root.pp-light {
  --bg-base: #f2e7cf;
  --bg-surface: #ebddc0;
  --bg-elevated: #f8f0dd;
  --bg-hover: #e3d3b2;
  --border: #d8c6a0;
  --border-subtle: #e7dabd;
  --text-primary: #2b2316;
  --text-secondary: #5e5135;
  --text-muted: #8a7b5c;
  --accent: #6d3ff0;
  --accent-2: #7c5cfc;
  --accent-dim: #5a32cf;
  --code-bg: #ebddc0;
  --code-fg: #2b2316;
  --dot: #cdbd98;
  --header-bg: rgba(242, 231, 207, 0.8);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg-base: #f2e7cf;
    --bg-surface: #ebddc0;
    --bg-elevated: #f8f0dd;
    --bg-hover: #e3d3b2;
    --border: #d8c6a0;
    --border-subtle: #e7dabd;
    --text-primary: #2b2316;
    --text-secondary: #5e5135;
    --text-muted: #8a7b5c;
    --accent: #6d3ff0;
    --accent-2: #7c5cfc;
    --accent-dim: #5a32cf;
    --code-bg: #ebddc0;
    --code-fg: #2b2316;
    --dot: #cdbd98;
    --header-bg: rgba(242, 231, 207, 0.8);
  }
}

/* Three-state theme switch */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
}
.theme-switch button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.15s,
    color 0.15s;
}
.theme-switch button svg {
  width: 16px;
  height: 16px;
}
.theme-switch button:hover {
  color: var(--text-secondary);
}
.theme-switch button[aria-pressed="true"] {
  background: var(--bg-hover);
  color: var(--accent-2);
}
@media (max-width: 600px) {
  .wrap {
    padding: 0 16px;
  }
  .nav {
    gap: 12px;
  }
}
@media (max-width: 480px) {
  .theme-switch button {
    width: 26px;
    height: 26px;
  }
  .logo span {
    font-size: 14px;
  }
}
@media (max-width: 380px) {
  .logo span {
    display: none;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.logo img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.logo span {
  font-size: 15px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav a {
  color: var(--text-secondary);
  font-size: 14px;
  transition: color 0.15s;
}
.nav a:hover {
  color: var(--text-primary);
}
.nav .btn-sm {
  color: var(--text-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.05s;
}
.btn:hover {
  background: var(--bg-hover);
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-dim);
}
.btn-sm {
  padding: 7px 14px;
  font-size: 14px;
  border-radius: 8px;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  text-align: center;
  padding: 96px 0 72px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -30% 0 auto 0;
  height: 620px;
  background: radial-gradient(
    60% 60% at 50% 0%,
    rgba(124, 92, 252, 0.28),
    rgba(124, 92, 252, 0) 70%
  );
  pointer-events: none;
}
.hero-icon {
  width: 112px;
  height: 112px;
  border-radius: 26px;
  box-shadow: 0 20px 60px rgba(124, 92, 252, 0.35);
}
.hero h1 {
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.05;
  margin: 26px 0 0;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.hero h1 .grad {
  background: linear-gradient(120deg, #b9a6ff, #7c5cfc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.tag {
  font-size: clamp(16px, 2.4vw, 20px);
  color: var(--text-secondary);
  max-width: 660px;
  margin: 20px auto 0;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 34px;
  flex-wrap: wrap;
}
.badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 34px;
}
.badge {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-secondary);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
}
.badge b {
  color: var(--accent-2);
  font-weight: 600;
}

/* ---- Sections ---- */
section {
  padding: 72px 0;
}
.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}
.section-head h2 {
  font-size: clamp(26px, 4vw, 38px);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.section-head p {
  color: var(--text-secondary);
  margin: 0;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
}

/* ---- Features ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  transition:
    border-color 0.15s,
    transform 0.15s,
    background 0.15s;
}
.card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-3px);
  background: var(--bg-elevated);
}
.card .ic {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(124, 92, 252, 0.12);
  color: var(--accent-2);
  margin-bottom: 14px;
}
.card .ic svg {
  width: 20px;
  height: 20px;
}
.card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

/* ---- How it works ---- */
.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  counter-reset: step;
}
.step {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 16px;
  position: relative;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-2);
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}
.step h4 {
  margin: 0 0 4px;
  font-size: 14.5px;
}
.step p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ---- MCP highlight ---- */
.mcp {
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-base));
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.mcp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.mcp-grid ul {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.mcp-grid li {
  padding: 8px 0 8px 26px;
  position: relative;
  color: var(--text-secondary);
  font-size: 15px;
}
.mcp-grid li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent-2);
}

/* ---- Code ---- */
.code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.code-dots {
  display: flex;
  gap: 7px;
}
.code-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--dot);
  display: inline-block;
}
.code-copy {
  font-size: 12px;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px 10px;
  cursor: pointer;
}
.code-copy:hover {
  color: var(--text-primary);
  border-color: var(--accent-dim);
}
.code pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--code-fg);
}
.code .c {
  color: var(--text-muted);
}
.code .p {
  color: var(--accent-2);
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0;
  color: var(--text-muted);
}
.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer a {
  color: var(--text-secondary);
  font-size: 14px;
}
.site-footer a:hover {
  color: var(--text-primary);
}
.foot-links {
  display: flex;
  gap: 22px;
}
.creator {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 22px;
  flex-wrap: wrap;
}
.creator p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.creator-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.creator-links a {
  font-size: 13px;
}

/* ---- Legal pages (terms / privacy) ---- */
.legal {
  padding: 56px 0 72px;
}
.legal .wrap {
  max-width: 760px;
}
.legal h1 {
  font-size: 32px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.legal .updated {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 28px;
}
.legal h2 {
  font-size: 19px;
  margin: 34px 0 10px;
}
.legal p,
.legal li {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 15px;
}
.legal ul {
  padding-left: 20px;
  margin: 10px 0;
}
.legal li {
  margin: 6px 0;
}
.legal a {
  color: var(--accent);
}
.legal a:hover {
  text-decoration: underline;
}

/* ---- Responsive ---- */
@media (max-width: 880px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .mcp-grid {
    grid-template-columns: 1fr;
  }
  .nav a:not(.btn-sm) {
    display: none;
  }
}
@media (max-width: 520px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .steps {
    grid-template-columns: 1fr;
  }
}
