/* beankeeper.app. Values follow the Beankeeper design system (tokens.json). Self-hosted fonts, no third-party requests. */

@font-face { font-family: "Plex Sans"; src: url("/assets/fonts/plex-sans-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("/assets/fonts/plex-sans-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("/assets/fonts/plex-sans-semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/assets/fonts/plex-mono-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

/* Theme: follows prefers-color-scheme; a stored choice (theme.js) pins data-theme on <html>. */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

:root {
  --paper:         light-dark(#fbfbf9, #121211);
  --paper-sunk:    light-dark(#f3f3f0, #1a1a18);
  --paper-raised:  light-dark(#ffffff, #1f1f1d);
  --ink:           light-dark(#1b1b19, #ecece8);
  --ink-soft:      light-dark(#4a4a46, #b8b8b2);
  --ink-faint:     light-dark(#66665f, #8f8f89);
  --rule:          light-dark(#1b1b1914, #ecece817);
  --rule-strong:   light-dark(#1b1b1933, #ecece833);
  --action:        var(--ink);
  --on-action:     light-dark(#fbfbf9, #121211);
  --sage:          light-dark(#2f6b50, #7fbf9f);
  --sage-wash:     light-dark(#2f6b5014, #7fbf9f17);
  --agent:         light-dark(#8a5300, #e3b25a);
  --focus:         var(--ink);
  --shadow-raised: 0 1px 2px light-dark(#1b1b190f, #0000004d), 0 12px 32px -16px light-dark(#1b1b1929, #00000080);

  --sans: "Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px;
  --space-8: 32px; --space-12: 48px; --space-16: 64px; --space-24: 96px;
  --radius-sm: 4px; --radius-md: 8px; --radius-turn: 12px; --radius-lg: 14px; --radius-pill: 999px;
  --wrap: 1152px; --measure: 608px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--sage); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--sage); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--radius-sm); }
code { font: 400 .88em var(--mono); padding: .08em .35em; border-radius: var(--radius-sm); background: var(--sage-wash); }
strong, b { font-weight: 600; }

.skip { position: absolute; left: var(--space-4); top: -64px; z-index: 20; padding: 10px 16px; background: var(--action); color: var(--on-action); border-radius: var(--radius-md); }
.skip:focus { top: var(--space-4); }
.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }

/* Mark: light and dark versions, one shown per theme */
.mark-dark { display: none; }
:root[data-theme="dark"] .mark-light { display: none; }
:root[data-theme="dark"] .mark-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mark-light { display: none; }
  :root:not([data-theme="light"]) .mark-dark { display: block; }
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--rule); }
.header-row { display: flex; align-items: center; gap: var(--space-4); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 20px/1 var(--sans); letter-spacing: -.015em; }
.brand:hover { color: inherit; }
.brand .mark { width: 32px; height: 32px; }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: var(--space-6); margin: 0; padding: 0; list-style: none; font-size: 15px; }
.nav a { color: var(--ink-soft); text-decoration: none; }
.nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--sage); }
.icon-btn, .menu summary {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--rule-strong); border-radius: var(--radius-pill); background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn[hidden] { display: none; }
.icon-btn:hover, .menu summary:hover { background: var(--sage-wash); }
.icon-btn svg, .menu summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .i-moon { display: none; }
.icon-btn[aria-pressed="true"] .i-sun { display: none; }
.icon-btn[aria-pressed="true"] .i-moon { display: block; }
.menu { display: none; position: relative; margin-left: auto; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu ul { position: absolute; right: 0; top: 48px; min-width: 220px; margin: 0; padding: var(--space-2); list-style: none; background: var(--paper-raised); border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised); }
.menu a { display: block; padding: 10px 12px; border-radius: var(--radius-md); text-decoration: none; }
.menu a:hover { background: var(--sage-wash); color: var(--ink); }
@media (max-width: 860px) { .nav { display: none; } .menu { display: block; } }

/* Type */
h1, h2, h3 { margin: 0; font-family: var(--sans); font-weight: 600; text-wrap: balance; color: var(--ink); }
h1 { font-size: 56px; line-height: 1.08; letter-spacing: -.02em; }
h2 { font-size: 36px; line-height: 1.15; letter-spacing: -.015em; }
h3 { font-size: 19px; line-height: 1.3; }
@media (max-width: 640px) { h1 { font-size: 36px; } h2 { font-size: 28px; } }
.lede { max-width: var(--measure); margin: var(--space-4) 0 0; font-size: 19px; line-height: 1.6; color: var(--ink-soft); text-wrap: pretty; }
.eyebrow { margin: 0 0 var(--space-3); font: 600 13px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.fine { margin: var(--space-4) 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-faint); }

/* Buttons */
.cta-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: 48px; padding: 11px 20px;
  border: 1.5px solid transparent; border-radius: var(--radius-pill); font: 600 16px/1.2 var(--sans); text-decoration: none;
  transition: transform .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--action); color: var(--on-action); }
.btn-primary:hover { background: var(--ink-soft); color: var(--on-action); }
.btn-ghost { color: var(--ink); border-color: var(--rule-strong); }
.btn-ghost:hover { color: var(--ink); border-color: var(--sage); background: var(--sage-wash); }

/* Hero */
.hero { padding-block: var(--space-16) var(--space-24); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-12); align-items: center; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } }
.pill { display: inline-flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-6); padding: 5px 14px 5px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius-pill); background: var(--paper-raised); font-size: 14px; line-height: 1.4; color: var(--ink-soft); }
.pill b { color: var(--ink); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); }
.hero .lede + .lede { margin-top: var(--space-3); }

/* Example chat */
.chat-window { margin: 0; padding: var(--space-6); border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); background: var(--paper-raised); box-shadow: var(--shadow-raised); }
.chat-window figcaption { margin: 0 0 var(--space-4); font-size: 13px; line-height: 1.45; color: var(--ink-faint); }
.chat { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.turn { max-width: 88%; padding: var(--space-3) var(--space-4); border-radius: var(--radius-turn); font-size: 15px; line-height: 1.5; }
.turn p { margin: 0; }
.who { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--ink-faint); }
.you { justify-self: end; background: var(--action); color: var(--on-action); border-bottom-right-radius: var(--radius-sm); }
.you .who { color: inherit; opacity: .8; }
.agent { justify-self: start; background: var(--paper-sunk); border: 1px solid var(--rule); border-bottom-left-radius: var(--radius-sm); }
.receipt { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin-top: var(--space-2); font-size: 13px; color: var(--ink-faint); }
.receipt .by { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--agent); }
.receipt .by::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--agent); }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.suggest { justify-self: start; max-width: 88%; }
.suggest-label { display: block; margin: 0 0 6px 2px; font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--ink-faint); }
.suggest ul { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius-pill); background: var(--paper-raised); font-size: 14px; line-height: 1.3; }

/* Sections */
.section { padding-block: var(--space-24); border-top: 1px solid var(--rule); }
@media (max-width: 640px) { .section { padding-block: var(--space-16); } .hero { padding-block: var(--space-12) var(--space-16); } }
.section-sunk { background: var(--paper-sunk); }
.section-head { max-width: 720px; margin-bottom: var(--space-12); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-12); align-items: start; }
.split .section-head { margin-bottom: 0; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: var(--space-8); } }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin: 0; padding: 0; list-style: none; counter-reset: step; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: step; padding: var(--space-6); border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); background: var(--paper-raised); }
.steps li::before { content: counter(step); display: block; margin-bottom: var(--space-3); font: 600 32px/1 var(--sans); color: var(--ink-faint); }
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.how-note { margin: var(--space-8) 0 0; max-width: var(--measure); color: var(--ink-soft); text-wrap: pretty; }

/* Safety */
.proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); }
@media (max-width: 860px) { .proof { grid-template-columns: 1fr; gap: var(--space-6); } }
.proof article { padding-top: var(--space-4); border-top: 2px solid var(--ink); }
.proof h3 { margin-bottom: var(--space-2); }
.proof p { margin: 0; color: var(--ink-soft); }
.more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--space-8); margin: var(--space-12) 0 0; padding: var(--space-8) 0 0; list-style: none; border-top: 1px solid var(--rule-strong); font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.more strong { color: var(--ink); }
@media (max-width: 860px) { .more { grid-template-columns: 1fr; } }

/* Privacy */
.facts { margin: 0; border-top: 1px solid var(--rule-strong); }
.facts div { display: grid; grid-template-columns: 180px 1fr; gap: var(--space-4); padding: var(--space-4) 0; border-bottom: 1px solid var(--rule-strong); }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 640px) { .facts div { grid-template-columns: 1fr; gap: var(--space-1); } }

/* Pricing */
.price-card { padding: var(--space-8); border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); background: var(--paper-raised); }
.price-amount { margin: 0; font-size: 40px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.price-period { font-size: 19px; font-weight: 500; letter-spacing: 0; color: var(--ink-soft); }
.price-note { margin: var(--space-3) 0 var(--space-6); font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.ticks { margin: 0 0 var(--space-8); padding: 0; list-style: none; display: grid; gap: var(--space-3); }
.ticks li { display: grid; grid-template-columns: 20px 1fr; gap: var(--space-3); }
.ticks li::before { content: "✓"; font-weight: 600; color: var(--sage); }

/* For the technical */
.repos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 760px) { .repos { grid-template-columns: 1fr; } }
.repo { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-6); border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); background: var(--paper-raised); text-decoration: none; transition: border-color .15s ease; }
.repo:hover { color: inherit; border-color: var(--ink-soft); }
.tag { align-self: flex-start; padding: 2px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius-pill); font-size: 13px; color: var(--ink-soft); }
.repo-name { font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.repo-desc { font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.repo-url { margin-top: auto; padding-top: var(--space-2); font-size: 14px; color: var(--ink-faint); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.specs { margin: var(--space-12) 0 0; padding: 0 0 0 1.2em; display: grid; gap: var(--space-3); max-width: 820px; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.specs li::marker { color: var(--ink-faint); }

/* Closing */
.closing-box { max-width: 720px; text-align: center; }
.closing-box .lede { margin-inline: auto; }
.closing-box .cta-row { justify-content: center; }

/* Footer */
.site-footer { padding-block: var(--space-12); border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-faint); }
.footer-row { display: grid; gap: var(--space-4); }
.footer-brand { display: flex; align-items: center; gap: var(--space-3); color: var(--ink-soft); }
.footer-brand .mark { width: 24px; height: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-6); margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--ink-soft); }
.site-footer .fine { margin: 0; }

/* 404 */
.notfound { min-height: 70vh; display: grid; place-content: center; text-align: center; padding: var(--space-16) 20px; }
.notfound .brand { justify-self: center; margin-bottom: var(--space-8); }
.notfound .lede { margin-inline: auto; }
.notfound .cta-row { justify-content: center; }

/* Load-in: copy rises, then the conversation plays out. Nothing loops. */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
  .hero-copy > :nth-child(2) { animation-delay: .06s; }
  .hero-copy > :nth-child(3) { animation-delay: .12s; }
  .hero-copy > :nth-child(4) { animation-delay: .18s; }
  .hero-copy > :nth-child(5) { animation-delay: .24s; }
  .hero-copy > :nth-child(6) { animation-delay: .3s; }
  .chat-window { animation: rise .7s .15s cubic-bezier(.2,.7,.2,1) both; }
  .chat > li { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
  .chat > li:nth-child(1) { animation-delay: .5s; }
  .chat > li:nth-child(2) { animation-delay: .9s; }
  .chat > li:nth-child(3) { animation-delay: 1.5s; }
  .chat > li:nth-child(4) { animation-delay: 1.9s; }
  .chat > li:nth-child(5) { animation-delay: 2.4s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }


/* Agent install prompt box */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.install-block { margin-top: var(--space-8); }
.install-audience { margin: 0 0 var(--space-4); max-width: var(--measure); font-size: 16px; line-height: 1.55; color: var(--ink); text-wrap: pretty; }
.install-alt { margin-top: var(--space-8); }
.install-alt .install-downloads { margin-bottom: 0; }
.install-box { margin-top: 0; padding: var(--space-6); border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); background: var(--paper-raised); }
.install-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-3); }
.install-head h3 { margin: 0; }
.install-prompt-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4); border: 1px solid var(--rule-strong); border-radius: var(--radius-md); background: var(--paper-sunk); }
.install-prompt { margin: 0; font: 400 16px/1.5 var(--sans); color: var(--ink); word-break: break-word; user-select: all; }
.install-prompt-row .btn { flex: none; cursor: pointer; }
.copy-status { min-height: 1.4em; margin: var(--space-2) 0 0; font-size: 13px; color: var(--sage); }
.install-box .fine + .fine { margin-top: var(--space-3); }
.install-note { margin: var(--space-4) 0 0; max-width: var(--measure); font-size: 16px; line-height: 1.55; color: var(--ink); text-wrap: pretty; }
.install-note p { margin: 0; }
.install-note p + p { margin-top: var(--space-3); }
@media (max-width: 640px) { .install-prompt-row { flex-direction: column; align-items: stretch; } }

/* Privacy: recovery */
.break-note { margin-top: var(--space-12); max-width: var(--measure); }
.break-note h3 { margin: 0 0 var(--space-3); }
.break-note p { margin: 0; color: var(--ink-soft); text-wrap: pretty; }

@media print {
  .site-header, .icon-btn, .cta-row, .menu { display: none; }
  body { background: #fff; color: #000; }
}

.install-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  margin: 0 0 var(--space-5);
  padding: 0;
  list-style: none;
  font-size: 16px;
  line-height: 1.5;
}
.install-downloads a { font-weight: 600; }

.download-page { padding-block: var(--space-16) var(--space-24); border-top: 0; }
.download-group { max-width: var(--measure); margin-top: var(--space-10); }
.download-group h2 { margin: 0 0 var(--space-3); }
.download-group p { margin: 0 0 var(--space-4); }
.download-files { margin: 0; padding: 0; list-style: none; }
.download-files li { margin: 0 0 var(--space-2); }
.download-page .install-prompt { margin: 0 0 var(--space-5); }

/* Legal pages */
.legal-page { padding-block: var(--space-16) var(--space-24); border-top: 0; }
.legal-page .section-head { margin-bottom: var(--space-8); }
.legal-updated { margin: var(--space-3) 0 0; font-size: 15px; color: var(--ink-faint); }
.legal-toc { margin: 0 0 var(--space-12); padding: 0; list-style: none; max-width: 720px; }
.legal-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }
.legal-toc a { font-weight: 600; }
.legal-body { max-width: 720px; }
.legal-body h2 { margin: var(--space-12) 0 var(--space-4); font-size: 22px; letter-spacing: -.01em; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body p, .legal-body li { color: var(--ink-soft); text-wrap: pretty; }
.legal-body p { margin: 0 0 var(--space-4); }
.legal-body ul, .legal-body ol { margin: 0 0 var(--space-4); padding-left: 1.2em; display: grid; gap: var(--space-2); }
.legal-body li::marker { color: var(--ink-faint); }
@media print {
  .legal-toc { break-after: avoid; }
  .legal-body h2 { break-after: avoid; }
}
