:root {
  --bg: #faf7f2;
  --panel: #ffffff;
  --panel-2: #f3efe8;
  --text: #1d1b22;
  --muted: #6b6672;
  --border: #e7e1d8;
  --accent: #6d5dfc;
  --accent-text: #ffffff;
  --accent-soft: #ece9ff;
  --bubble-user: #6d5dfc;
  --bubble-user-text: #ffffff;
  --bubble-bot: #f1ede6;
  --danger: #d4383a;
  --ok: #138a5b;
  --warn-bg: #fff6e0;
  --warn-text: #7a5300;
  --shadow: 0 10px 30px rgba(30, 20, 60, 0.08);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121118;
    --panel: #1a1922;
    --panel-2: #23212d;
    --text: #ecebf2;
    --muted: #a19eae;
    --border: #2e2b3a;
    --accent: #8b7dff;
    --accent-soft: #2a2550;
    --bubble-user: #7a6bff;
    --bubble-bot: #262433;
    --warn-bg: #3a2f12;
    --warn-text: #f5d58a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121118;
  --panel: #1a1922;
  --panel-2: #23212d;
  --text: #ecebf2;
  --muted: #a19eae;
  --border: #2e2b3a;
  --accent: #8b7dff;
  --accent-soft: #2a2550;
  --bubble-user: #7a6bff;
  --bubble-bot: #262433;
  --warn-bg: #3a2f12;
  --warn-text: #f5d58a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }

.wrap { width: 100%; margin: 0 auto; padding: 0 clamp(16px, 4vw, 56px); }
.narrow { max-width: none; }

/* Header and footer (injected by site.js) */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.logo-mark { width: 34px; height: 34px; display: block; flex-shrink: 0; border-radius: 10px; box-shadow: 0 4px 14px -4px rgba(124, 92, 255, 0.55); transition: transform 0.2s ease; }
.logo:hover .logo-mark { transform: rotate(-6deg) scale(1.05); }
.site-nav { display: flex; gap: 18px; margin-left: auto; align-items: center; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a.btn { color: var(--accent-text); }
.icon-btn { background: none; border: 1px solid var(--border); color: var(--text); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; font-size: 16px; }
.site-footer { border-top: 1px solid var(--border); margin-top: 64px; padding: 32px 0; color: var(--muted); font-size: 14px; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
.site-footer a { color: var(--muted); }

/* Buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--accent); color: var(--accent-text); transition: transform 0.08s ease, opacity 0.15s; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.secondary { background: var(--panel); color: var(--text); border-color: var(--border); }
.btn.ghost { background: none; color: var(--muted); border-color: var(--border); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
input, textarea, select { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; width: 100%; }
input:focus, textarea:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
.hint { color: var(--muted); font-size: 13px; }
.error-text { color: var(--danger); font-size: 14px; min-height: 1em; }

.badge-ai { display: inline-block; font-size: 8px; line-height: 1.3; font-weight: 700; letter-spacing: 0.04em; padding: 0 4px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }

/* Landing */
.hero { padding: 72px 0 40px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); margin: 0 0 16px; }
.hero p.lead { font-size: 19px; color: var(--muted); margin: 0 0 24px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.phone { background: var(--panel); border: 1px solid var(--border); border-radius: 28px; padding: 18px; box-shadow: var(--shadow); }
.phone .bub { padding: 9px 13px; border-radius: 16px; margin: 6px 0; max-width: 85%; font-size: 15px; }
.phone .bub.me { background: var(--bubble-user); color: var(--bubble-user-text); margin-left: auto; border-bottom-right-radius: 4px; }
.phone .bub.them { background: var(--bubble-bot); border-bottom-left-radius: 4px; }
.phone .who { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px; font-weight: 600; }
.section { padding-top: 40px; padding-bottom: 40px; }
.section h2 { font-size: 30px; margin: 0 0 8px; }
.section .sub { color: var(--muted); margin: 0 0 24px; }
.friends-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.friend-card { text-decoration: none; color: inherit; transition: transform 0.15s, box-shadow 0.15s; }
.friend-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.friend-card h3 { margin: 0 0 4px; }
.friend-card p { margin: 0; color: var(--muted); font-size: 15px; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.features .card h3 { margin: 0 0 6px; font-size: 17px; }
.features .card p { margin: 0; color: var(--muted); font-size: 15px; }

.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.avatar.lg { width: 60px; height: 60px; font-size: 30px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.portrait { aspect-ratio: 1; border-radius: 12px; margin-bottom: 14px; display: grid; place-items: center; overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.plans.two { grid-template-columns: repeat(2, minmax(0, 360px)); justify-content: center; }
.plan h3 { margin: 0; }
.plan .price { font-size: 34px; font-weight: 700; margin: 8px 0 2px; }
.plan .price small { font-size: 15px; color: var(--muted); font-weight: 500; }
.plan ul { padding-left: 0; list-style: none; margin: 16px 0; }
.plan li { padding: 4px 0 4px 24px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.plan li.no { color: var(--muted); }
.plan li.no::before { content: "–"; color: var(--muted); }
.plan.featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.toggle { display: inline-flex; background: var(--panel-2); border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.toggle button { border: none; background: none; padding: 8px 16px; border-radius: 9px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.toggle button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* Text pages */
.prose { padding-top: 40px; padding-bottom: 40px; }
.prose h1 { font-size: 36px; }
.prose h2 { font-size: 22px; margin-top: 32px; }
.prose li { margin: 6px 0; }
.helplines { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(10, 8, 20, 0.55); display: none; place-items: center; z-index: 50; padding: 16px; }
.modal.open { display: grid; }
.modal .card { width: 100%; max-width: 440px; max-height: 92dvh; overflow-y: auto; box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 8px; font-size: 22px; }
.modal .row { display: flex; gap: 8px; margin-top: 16px; }
.divider { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .plans, .plans.two { grid-template-columns: 1fr; }
  .site-nav a.hide-sm { display: none; }
}

/* Analytics opt-in banner (site.js) */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 560px; margin: 0 auto; display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; font-size: 14px; }
.consent p { margin: 0; flex: 1; }
.consent-acts { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 520px) { .consent { flex-direction: column; align-items: stretch; } .consent-acts > .btn { flex: 1; } }

/* Blog and FAQ */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.post-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; transition: transform 0.15s, box-shadow 0.15s; }
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.post-card h2 { font-size: 20px; margin: 0; }
.post-card p { margin: 0; color: var(--muted); font-size: 15px; }
.crumbs { padding-top: 24px; }
.crumbs a { color: inherit; }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.post { padding-top: 8px; max-width: 820px; }
.post .lead { font-size: 19px; color: var(--muted); }
.post h3 { font-size: 18px; margin-top: 24px; }
.post table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; }
.post th, .post td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.post th { background: var(--panel-2); }
.post-note { margin-top: 32px; font-size: 15px; }
.post-note p { margin: 0; }
.post-side { position: sticky; top: 88px; display: grid; gap: 16px; padding-top: 40px; }
.post-side h3 { margin: 0 0 8px; font-size: 17px; }
.post-side p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.post-links { list-style: none; padding: 0; margin: 0; font-size: 15px; }
.post-links li { margin: 0 0 10px; }
@media (max-width: 960px) {
  .post-layout { grid-template-columns: 1fr; gap: 0; }
  .post-side { position: static; padding-top: 0; padding-bottom: 40px; }
}
.faq details { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 18px; margin: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; }
.faq details p { margin: 0 0 16px; color: var(--muted); }
.faq .sub { color: var(--muted); }
