/* KeepChat site — visual identity matches the extension (ChatGPT-adjacent).
   No third-party fonts or assets. CSP allows style-src 'self' only. */
:root {
  color-scheme: light dark;
  --text: #0d0d0d;
  --muted: #5d5d5d;
  --surface: #ffffff;
  --surface-2: #f7f7f8;
  --border: #e5e5e5;
  --accent: #10a37f;
  /* Darker green for text/buttons that need ~4.5:1 on white */
  --accent-ink: #0b7a5e;
  --accent-soft: #e6f5f0;
  /* Filled buttons/badges: text on --accent-ink */
  --on-accent: #ffffff;
  --danger: #d93025;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --font: ui-sans-serif, -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --max: 1100px;
  --narrow: 720px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #ececec;
    --muted: #afafaf;
    --surface: #212121;
    --surface-2: #2f2f2f;
    --border: #444;
    --accent: #19c37d;
    --accent-ink: #19c37d;
    --accent-soft: #16352c;
    --on-accent: #0d0d0d;
    --danger: #ff6b5f;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible, .button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; }
h1 { font-size: clamp(2rem, 4.5vw, 2.85rem); margin: 0 0 0.6em; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin: 0 0 0.55em; }
h3 { font-size: 1.15rem; margin: 0 0 0.4em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}
.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2rem, var(--narrow)); }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--accent-ink); color: var(--on-accent); padding: 0.5rem 0.9rem; border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 3.5rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  color: var(--text); text-decoration: none; font-weight: 650;
}
.brand img { border-radius: 7px; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 0.45rem 0.7rem; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 0.95rem;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.header-cta { white-space: nowrap; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Mobile menu (≤720px): <details>/<summary>, no JavaScript. Hidden on wider
   screens, where .site-nav shows the same links inline. */
.nav-menu { display: none; }
@media (max-width: 720px) {
  /* Not sticky on small screens: an open menu scrolls away with the page
     after following a link (without JS, nothing would close it). */
  .site-header { position: relative; }
  .header-inner { gap: 0.6rem; }
  .site-nav { display: none; }
  .header-cta { margin-left: auto; }
  .nav-menu { display: block; }
  .nav-menu-button {
    display: grid; place-items: center;
    width: 2.75rem; height: 2.75rem; margin-right: -0.4rem;
    border-radius: 10px; cursor: pointer; list-style: none; color: var(--text);
  }
  .nav-menu-button::-webkit-details-marker { display: none; }
  .nav-menu-button:hover, .nav-menu[open] .nav-menu-button { background: var(--surface-2); }
  .nav-menu-icon, .nav-menu-icon::before, .nav-menu-icon::after {
    display: block; width: 1.25rem; height: 2px; border-radius: 2px; background: currentColor;
  }
  .nav-menu-icon { position: relative; }
  .nav-menu-icon::before, .nav-menu-icon::after { content: ""; position: absolute; left: 0; }
  .nav-menu-icon::before { top: -6px; }
  .nav-menu-icon::after { top: 6px; }
  /* Open: the three bars become an ×. */
  .nav-menu[open] .nav-menu-icon { background: transparent; }
  .nav-menu[open] .nav-menu-icon::before { top: 0; transform: rotate(45deg); }
  .nav-menu[open] .nav-menu-icon::after { top: 0; transform: rotate(-45deg); }
  .nav-menu-panel {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .nav-menu-panel ul {
    list-style: none; margin: 0 auto; padding: 0.5rem 0 0.75rem;
    width: min(100% - 2rem, var(--max));
  }
  .nav-menu-panel a {
    display: block; padding: 0.75rem 0.6rem; border-radius: 8px;
    color: var(--text); text-decoration: none; font-weight: 550;
  }
  .nav-menu-panel li + li { border-top: 1px solid var(--border); }
  .nav-menu-panel a:hover, .nav-menu-panel a[aria-current="page"] { background: var(--surface-2); }
  .nav-menu-panel a[aria-current="page"] { color: var(--accent-ink); }
  .nav-menu-panel a:focus-visible { outline-offset: -2px; }
}

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.7rem 1.15rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--surface-2); text-decoration: none; }
.button-primary {
  background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent);
}
.button-primary:hover { filter: brightness(1.08); background: var(--accent-ink); color: var(--on-accent); }
.button-small { padding: 0.4rem 0.85rem; font-size: 0.9rem; }

/* Hero */
.hero { padding: 3.5rem 0 2rem; }
.hero-inner {
  display: grid; gap: 2.5rem; align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.05fr 1fr; gap: 3rem; }
}
.eyebrow {
  display: inline-block; margin: 0 0 0.75rem;
  color: var(--accent-ink); font-weight: 650; font-size: 0.9rem; letter-spacing: 0.02em;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 38rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.4rem 0 0.8rem; }
.hero-note { color: var(--muted); font-size: 0.95rem; margin: 0; }

.shot {
  margin: 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--surface-2);
}
.shot img { width: 100%; }

/* Sections */
.section { padding: 4rem 0; }
.section-alt { background: var(--surface-2); }
.section-title { text-align: center; }
.section-lead {
  text-align: center; color: var(--muted); max-width: 36rem;
  margin: -0.2rem auto 2.2rem;
}
.feature-row {
  display: grid; gap: 1.75rem; align-items: center;
  margin-bottom: 3rem;
}
@media (min-width: 860px) {
  .feature-row { grid-template-columns: 1fr 1.2fr; gap: 2.5rem; }
  .feature-row-reverse { grid-template-columns: 1.2fr 1fr; }
  .feature-row-reverse .feature-copy { order: 2; }
  .feature-row-reverse .feature-shot { order: 1; }
}
.feature-copy h3 { margin-top: 1.4rem; }
.feature-copy h3:first-child { margin-top: 0; }
.feature-copy p { color: var(--muted); }
.feature-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.feature-grid li {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1.25rem 1.3rem;
}
.feature-grid p { color: var(--muted); margin: 0; font-size: 0.98rem; }
.section-alt .feature-grid li { background: var(--surface); }

/* Pricing */
.pricing {
  display: grid; gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 800px) {
  .pricing { grid-template-columns: 0.9fr 1.2fr; align-items: start; }
}
.plan {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.6rem 1.5rem;
}
.plan-pro {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: var(--shadow);
}
.plan-name { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.pro-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 0.8rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px;
}
.plan-price { margin: 0.2rem 0 0.4rem; }
.amount { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; }
.plan-sub { color: var(--muted); font-size: 0.95rem; }
.checklist { list-style: none; padding: 0; margin: 1rem 0 1.25rem; }
.checklist li {
  position: relative; padding: 0.35rem 0 0.35rem 1.55rem;
  color: var(--text);
}
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.7em;
  width: 0.55rem; height: 0.3rem; border-left: 2px solid var(--accent-ink);
  border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg);
}
.checklist-pro { margin-bottom: 1.4rem; }
.price-options { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: 0.7rem; }
.price-option {
  display: grid; gap: 0.15rem;
  padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.price-option-best {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.option-name { font-weight: 650; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.option-price { font-size: 1.05rem; }
.option-note { color: var(--muted); font-size: 0.88rem; }
.save-badge {
  background: var(--accent-ink); color: var(--on-accent);
  font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.plan-cta { width: 100%; }

/* FAQ */
.faq { display: grid; gap: 0.6rem; }
.faq details {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); padding: 0.15rem 1rem;
}
.faq summary {
  cursor: pointer; font-weight: 650; padding: 0.9rem 0;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; float: right; color: var(--muted); font-weight: 400; font-size: 1.2rem;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin-top: 0; }

.cta { text-align: center; }
.cta-inner { padding: 1rem 0; }
.cta .button { margin-top: 0.4rem; }

/* Legal / support */
.legal { padding: 2.5rem 0 4rem; }
.legal-header { margin-bottom: 1.8rem; }
.legal-meta { color: var(--muted); margin: -0.4rem 0 1rem; }
.notice {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.85rem 1rem; background: var(--surface-2); color: var(--muted);
}
.notice-draft { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.summary {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; margin-bottom: 2rem; background: var(--surface-2);
}
.summary .checklist { margin: 0.6rem 0 0; }
.toc { margin-bottom: 2.2rem; }
.toc h2 { font-size: 1.05rem; }
.toc ol { color: var(--muted); }
.legal section { margin-bottom: 2rem; scroll-margin-top: 4.5rem; }
.legal h2 { font-size: 1.3rem; }
.defs { margin: 0; }
.defs dt { font-weight: 650; margin-top: 0.8rem; }
.defs dd { margin: 0.25rem 0 0; color: var(--muted); }
.contact-card { margin: 0 0 2rem; }
.page-support .legal section { scroll-margin-top: 4.5rem; }
.not-found { padding: 5rem 0 6rem; text-align: center; }
.not-found .hero-actions { justify-content: center; }

.placeholder {
  background: #fff3bf; color: #5c4800; padding: 0.05em 0.3em; border-radius: 4px;
  font-style: normal; font-weight: 650;
}
@media (prefers-color-scheme: dark) {
  .placeholder { background: #5c4800; color: #ffe8a3; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border); padding: 2.5rem 0 2rem;
  background: var(--surface-2); color: var(--muted); font-size: 0.95rem;
}
.footer-inner {
  display: grid; gap: 1.5rem;
  grid-template-columns: 1fr;
  margin-bottom: 1.5rem;
}
@media (min-width: 700px) {
  .footer-inner { grid-template-columns: 1.4fr 1fr; align-items: start; }
}
.footer-brand p { margin: 0.7rem 0 0; max-width: 28rem; }
.site-footer nav ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem;
}
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--accent-ink); text-decoration: underline; }
.footer-legal { border-top: 1px solid var(--border); padding-top: 1.2rem; font-size: 0.85rem; }
.footer-legal p { margin: 0; max-width: 55rem; }

/* Cookie consent banner (shown by analytics.js until the visitor chooses; [hidden] without JavaScript).
   Fixed at the bottom, so it never moves the page; .consent-open reserves room below the footer. */
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  border-top: 1px solid var(--border); background: var(--surface);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
  padding: 0.9rem 0 calc(0.9rem + env(safe-area-inset-bottom, 0px));
}
.consent[hidden] { display: none; }
.consent-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }
.consent p { flex: 1 1 22rem; margin: 0; font-size: 0.92rem; color: var(--text); }
.consent-actions { display: flex; gap: 0.6rem; flex: 0 0 auto; }
.consent-actions .button { min-width: 7rem; }
@media (max-width: 480px) {
  .consent-actions { flex: 1 1 100%; }
  .consent-actions .button { flex: 1 1 0; min-width: 0; }
}
.consent-open .site-footer { padding-bottom: calc(2rem + var(--consent-height, 0px)); }
.link-button {
  appearance: none; border: 0; padding: 0; background: none;
  font: inherit; color: var(--text); cursor: pointer;
}
.link-button:hover { color: var(--accent-ink); text-decoration: underline; }
