/* ─────────────────────────────────────────────────────────────────────────
   AskBetter AI — landing design system.
   Single stylesheet shared by index / privacy / terms / support / billing.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-elev: #ffffff;
  --bg-mute: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --accent: #6366f1;        /* indigo */
  --accent-hover: #4f46e5;
  --accent-soft: #eef2ff;
  --primary: #0ea5e9;       /* sky */
  --primary-hover: #0284c7;
  --good: #10b981;          /* emerald */
  --warn: #f59e0b;
  --danger: #ef4444;

  --grad: linear-gradient(135deg, #6366f1 0%, #0ea5e9 100%);
  --grad-soft: linear-gradient(135deg, rgba(99,102,241,.10) 0%, rgba(14,165,233,.10) 100%);

  --shadow-sm: 0 1px 0 rgba(15, 23, 42, .04);
  --shadow-md: 0 1px 0 rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --shadow-lg: 0 1px 0 rgba(15, 23, 42, .04), 0 24px 48px -16px rgba(15, 23, 42, .18);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --maxw: 1120px;
  --maxw-narrow: 760px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --bg-soft: #0f1729;
    --bg-elev: #131c30;
    --bg-mute: #182339;
    --text: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-subtle: #94a3b8;
    --border: #1e293b;
    --border-strong: #334155;
    --accent-soft: rgba(99, 102, 241, .15);
    --shadow-sm: 0 1px 0 rgba(0,0,0,.4);
    --shadow-md: 0 1px 0 rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
    --shadow-lg: 0 1px 0 rgba(0,0,0,.4), 0 24px 48px -16px rgba(0,0,0,.8);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.small { font-size: 14px; }
.micro { font-size: 12px; }
.mono { font-family: var(--font-mono); }

/* ─ Nav ───────────────────────────────────────────────────────────────── */
nav.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; max-width: var(--maxw); margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; color: var(--text); font-size: 17px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--grad); color: #fff; font-size: 16px;
}
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a {
  color: var(--text-muted); font-weight: 500; font-size: 14px;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-toggle {
  display: none; background: transparent; border: 0; color: var(--text);
  cursor: pointer; padding: 6px;
}
@media (max-width: 760px) {
  .nav-links {
    display: none; position: absolute; right: 16px; top: 60px;
    flex-direction: column; gap: 12px;
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: inline-flex; }
}

/* ─ Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 14px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }

.btn-primary { background: var(--grad); color: #fff; }
.btn-primary:hover { box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--bg-mute); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-mute); }

/* ─ Hero ──────────────────────────────────────────────────────────────── */
.hero {
  padding: 80px 0 60px;
  background: radial-gradient(60% 80% at 70% 0%, var(--accent-soft) 0%, transparent 70%);
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1; margin: 0 0 16px;
  letter-spacing: -0.02em; font-weight: 800;
}
.hero h1 .accent {
  background: var(--grad); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.hero .lead {
  font-size: clamp(16px, 1.6vw, 20px); color: var(--text-muted);
  margin: 0 0 28px; max-width: 540px;
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: 48px; align-items: center;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.hero-fineprint {
  display: inline-flex; flex-wrap: wrap; gap: 6px 12px;
  font-size: 13px; color: var(--text-subtle);
}
.hero-fineprint .dot {
  width: 3px; height: 3px; border-radius: 50%; background: var(--text-subtle);
  display: inline-block; align-self: center;
}

/* ─ Demo mock (hero right column) ─────────────────────────────────────── */
.demo-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 20px; overflow: hidden;
}
.demo-tabs {
  display: flex; gap: 6px; margin-bottom: 14px;
  font-size: 12px; color: var(--text-subtle);
}
.demo-tab {
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--bg-mute);
}
.demo-tab.active {
  background: var(--accent-soft); color: var(--accent-hover);
}
.demo-input {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 14px 50px; min-height: 130px; position: relative;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.55;
  background: var(--bg-soft); color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.demo-input .typed { color: var(--text-muted); }
.demo-input .streamed {
  color: var(--text);
  border-right: 2px solid var(--accent);
  animation: caret 1s steps(2) infinite;
}
@keyframes caret { 50% { border-color: transparent; } }
.demo-actions {
  position: absolute; bottom: 10px; right: 12px;
  display: flex; gap: 6px; align-items: center;
}
.demo-btn {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-hover);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-size: 16px;
}
.demo-btn.send { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ─ Sections ──────────────────────────────────────────────────────────── */
section { padding: 72px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: 0; }
section.tight { padding: 56px 0; }
.section-eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-hover); margin-bottom: 8px;
}
.section-title {
  font-size: clamp(26px, 3.5vw, 36px); line-height: 1.15;
  letter-spacing: -0.015em; font-weight: 800;
  margin: 0 0 14px;
}
.section-lead {
  font-size: 17px; color: var(--text-muted); max-width: 640px; margin: 0 0 36px;
}

/* ─ Site strip ────────────────────────────────────────────────────────── */
.sites-strip {
  display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center;
  justify-content: center; color: var(--text-subtle); font-size: 14px;
  font-weight: 600;
}
.sites-strip .site {
  display: inline-flex; gap: 8px; align-items: center;
}
.sites-strip .site::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-subtle);
}

/* ─ Steps ─────────────────────────────────────────────────────────────── */
.steps {
  display: grid; gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 14px;
  margin-bottom: 12px;
}
.step h3 { font-size: 17px; margin: 0 0 6px; font-weight: 700; }
.step p { margin: 0; font-size: 14px; color: var(--text-muted); }

/* ─ Before / After ────────────────────────────────────────────────────── */
.compare {
  display: grid; gap: 16px; grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
}
@media (max-width: 760px) {
  .compare { grid-template-columns: 1fr; }
  .compare-arrow { transform: rotate(90deg); justify-self: center; }
}
.compare-side {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.compare-side .label {
  display: inline-block; margin-bottom: 8px;
  font-family: var(--font-sans); font-weight: 700; font-size: 12px;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--radius-pill);
}
.compare-side.before .label { background: rgba(239,68,68,.12); color: var(--danger); }
.compare-side.after  .label { background: rgba(16,185,129,.12); color: var(--good); }
.compare-arrow {
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--text-subtle);
}

/* ─ Features grid ─────────────────────────────────────────────────────── */
.features {
  display: grid; gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 860px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.feature {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
}
.feature-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-hover);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 12px;
}
.feature h3 { font-size: 16px; margin: 0 0 6px; font-weight: 700; }
.feature p { margin: 0; font-size: 14px; color: var(--text-muted); }

/* ─ Pricing ───────────────────────────────────────────────────────────── */
.pricing-card {
  max-width: 460px; margin: 0 auto;
  background: var(--bg-elev); border: 2px solid var(--accent);
  border-radius: var(--radius-xl); padding: 32px;
  box-shadow: var(--shadow-lg); text-align: center;
}
.pricing-card .price-label {
  display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent-hover);
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 14px;
}
.pricing-card .price {
  font-size: 48px; font-weight: 800; letter-spacing: -0.02em;
}
.pricing-card .price small {
  font-size: 16px; font-weight: 500; color: var(--text-muted);
}
.pricing-card .price-sub { color: var(--text-muted); margin: 4px 0 22px; }
.pricing-card ul {
  list-style: none; padding: 0; margin: 0 0 24px; text-align: left;
}
.pricing-card ul li {
  padding: 8px 0; border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; align-items: center; font-size: 14px;
}
.pricing-card ul li::before {
  content: "✓"; color: var(--good); font-weight: 700; font-size: 14px;
}
.pricing-card ul li:last-child { border-bottom: 0; }

/* ─ FAQ ───────────────────────────────────────────────────────────────── */
.faq { display: grid; gap: 12px; }
.faq details {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 18px;
}
.faq summary {
  cursor: pointer; font-weight: 600; font-size: 15px;
  list-style: none; outline: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; float: right; color: var(--text-subtle); font-weight: 400;
}
.faq details[open] summary::after { content: "−"; }
.faq details p {
  margin: 10px 0 0; color: var(--text-muted); font-size: 14px;
}

/* ─ CTA banner ────────────────────────────────────────────────────────── */
.cta-banner {
  background: var(--grad); color: #fff; padding: 56px 24px;
  border-radius: var(--radius-xl); text-align: center;
  box-shadow: var(--shadow-lg);
}
.cta-banner h2 {
  font-size: clamp(24px, 3vw, 32px); margin: 0 0 10px; font-weight: 800;
}
.cta-banner p { margin: 0 0 22px; opacity: .9; }
.cta-banner .btn-primary {
  background: #fff; color: var(--accent-hover);
}
.cta-banner .btn-primary:hover { background: var(--bg-soft); }

/* ─ Footer ────────────────────────────────────────────────────────────── */
footer.site-footer {
  background: var(--bg-soft); border-top: 1px solid var(--border);
  padding: 40px 0; margin-top: 40px;
}
footer .footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 24px; align-items: center;
}
footer .footer-links {
  display: flex; flex-wrap: wrap; gap: 16px;
}
footer .footer-links a {
  color: var(--text-muted); font-size: 14px;
}
footer .copyright {
  font-size: 13px; color: var(--text-subtle);
}

/* ─ Legal/long pages (privacy / terms / support) ──────────────────────── */
.legal {
  max-width: var(--maxw-narrow); margin: 0 auto;
  padding: 56px 24px 80px;
}
.legal h1 {
  font-size: 32px; margin: 0 0 6px; letter-spacing: -0.015em;
}
.legal .meta {
  color: var(--text-subtle); font-size: 13px; margin-bottom: 32px;
}
.legal h2 {
  font-size: 20px; margin: 36px 0 12px; font-weight: 700;
}
.legal h3 {
  font-size: 16px; margin: 24px 0 8px; font-weight: 600;
}
.legal p, .legal li {
  color: var(--text-muted); font-size: 15px;
}
.legal ul { padding-left: 22px; }
.legal hr {
  border: 0; border-top: 1px solid var(--border); margin: 40px 0;
}
.legal .toc {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 20px; margin-bottom: 32px;
  font-size: 14px;
}
.legal .toc ol { margin: 8px 0 0; padding-left: 22px; }
.legal .toc li { margin: 4px 0; }

/* ─ Billing redirect pages ────────────────────────────────────────────── */
.billing-status {
  min-height: 70vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
}
.billing-card {
  max-width: 480px; width: 100%; text-align: center;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 40px 32px;
  box-shadow: var(--shadow-md);
}
.billing-card .icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 30px; margin-bottom: 18px;
}
.billing-card .icon.ok { background: rgba(16,185,129,.15); color: var(--good); }
.billing-card .icon.cancel { background: rgba(245,158,11,.15); color: var(--warn); }
.billing-card h1 { font-size: 24px; margin: 0 0 8px; }
.billing-card p { color: var(--text-muted); margin: 0 0 20px; }
.billing-card .actions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}

/* ─ Helpers ───────────────────────────────────────────────────────────── */
.lang-switch {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--bg-mute); border-radius: var(--radius-pill);
  font-size: 12px;
}
.lang-switch button {
  background: transparent; border: 0; padding: 4px 10px;
  border-radius: var(--radius-pill); font-weight: 600;
  color: var(--text-muted); cursor: pointer;
}
.lang-switch button.active {
  background: var(--bg-elev); color: var(--text);
  box-shadow: var(--shadow-sm);
}
