/* The website's one stylesheet (apps/web/site, scripts/build-site.mjs): the app's colours and type (src/index.css),
   light and dark, no web fonts, no scripts but the sign-up's (signup.js, welcome.js). WCAG 2.2 AA: text at 4.5:1 or more, targets 44 px, a visible focus ring,
   Reduce Motion respected (e2e/site.spec.ts checks the measurable ones). */
:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f0eeea;
  --border: #e2dfd8;
  --text: #1d1b18;
  --muted: #5f5a52;
  --accent: #9a4f1c;
  --accent-fg: #ffffff;
  --accent-soft: #f6e7dc;
  --ok: #2e7d32;
  --warn-bg: #fdf1dc;
  --warn-text: #6e3f00;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141311;
    --surface: #1d1c19;
    --surface-2: #26241f;
    --border: #35322c;
    --text: #efece6;
    --muted: #b0aa9f;
    --accent: #e08a4f;
    --accent-fg: #1b120b;
    --accent-soft: #3a2616;
    --ok: #74c47a;
    --warn-bg: #3a2a10;
    --warn-text: #f5c77e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(32px, 6vw, 52px); margin: 0 0 16px; }
h2 { font-size: clamp(24px, 3.4vw, 32px); margin: 48px 0 12px; }
h3 { font-size: 20px; margin: 24px 0 8px; }
p, ul, ol { margin: 0 0 14px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); max-width: 40em; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); }
.skip:focus { top: 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.site-header.plain { position: static; background: var(--bg); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; font-size: 18px; min-height: 44px; white-space: nowrap; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.tagline { color: var(--muted); font-size: 15px; }
.nav-wide { display: flex; gap: 4px; margin-left: 12px; }
.nav-wide a, .nav-signin { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 16px; white-space: nowrap; }
.nav-wide a:hover, .nav-signin:hover { background: var(--surface-2); }
.nav-wide a[aria-current='page'] { color: var(--accent); font-weight: 600; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-menu { display: none; position: relative; }
.nav-menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 16px; white-space: nowrap; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu nav { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; display: flex; flex-direction: column; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 32px rgb(0 0 0 / 0.16); }
.nav-menu nav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--text); text-decoration: none; }
.nav-menu nav a:hover { background: var(--surface-2); }
@media (max-width: 880px) {
  .nav-wide, .nav-signin { display: none; }
  .nav-menu { display: block; }
  .header-actions { gap: 6px; }
}
@media (max-width: 400px) {
  .wrap { padding: 0 16px; }
  .marketing .brand-name, .tagline { display: none; }
}

/* Buttons: one line, room around the label, 44 px (docs/DESIGN.md → Buttons) */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 6px 22px; border-radius: 999px; font-weight: 600; font-size: 17px; text-decoration: none; white-space: nowrap; border: 1px solid transparent; }
.btn-small { min-height: 44px; padding: 6px 16px; font-size: 15px; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 24px 0 8px; }

/* Sections */
.hero { padding: 72px 0 48px; }
.hero .eyebrow { display: inline-block; font-size: 14px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 4px 12px; margin-bottom: 18px; }
.section { padding: 32px 0; }
.section > .wrap > h2:first-child { margin-top: 0; }
.band { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); margin: 20px 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px; }
.band .card { background: var(--bg); }
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.feature { display: grid; gap: 8px 40px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); padding: 36px 0; border-top: 1px solid var(--border); }
.feature:first-of-type { border-top: 0; }
.feature h2 { margin-top: 0; }
@media (max-width: 760px) { .feature { grid-template-columns: 1fr; } }
.pill { display: inline-block; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 2px 10px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; white-space: nowrap; }
.checks { list-style: none; padding: 0; }
.checks li { position: relative; padding-left: 28px; }
.checks li::before { content: ''; position: absolute; left: 4px; top: 0.55em; width: 12px; height: 7px; border-left: 2.5px solid var(--ok); border-bottom: 2.5px solid var(--ok); transform: rotate(-45deg); }

/* Pricing */
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); margin: 28px 0; }
.plan { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; }
.plan.featured { border: 2px solid var(--accent); }
.plan h2 { margin: 0 0 4px; font-size: 24px; }
.price { font-size: 44px; font-weight: 700; letter-spacing: -0.02em; margin: 12px 0 0; line-height: 1.1; }
.price small { font-size: 17px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan .yearly { color: var(--muted); font-size: 15px; margin: 6px 0 16px; }
.plan .btn { margin-top: auto; }
.plan ul { margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 16px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; }
.table-scroll { overflow-x: auto; }

/* Questions */
details.faq { border-bottom: 1px solid var(--border); }
details.faq summary { cursor: pointer; min-height: 44px; padding: 12px 0; font-weight: 600; list-style-position: outside; }
details.faq > div { padding: 0 0 12px; }

/* Documents (legal, help) */
main.doc { max-width: 760px; margin: 0 auto; padding: 32px 24px 56px; }
@media (max-width: 400px) { main.doc { padding: 24px 16px 48px; } }
main.doc h1 { font-size: clamp(30px, 5vw, 40px); }
main.doc h2 { font-size: 22px; margin: 36px 0 10px; }
main.doc h3 { font-size: 18px; }
.date { color: var(--muted); font-size: 15px; margin: -6px 0 24px; }
.draft { background: var(--warn-bg); color: var(--warn-text); border-radius: 12px; padding: 12px 16px; margin: 0 0 24px; font-size: 16px; }
.summary { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin: 20px 0; }
.summary p:last-child { margin-bottom: 0; }
.toc { columns: 2 220px; font-size: 16px; }
ol.clauses { padding-left: 0; list-style: none; }

/* The sign-up form (site/signup.html) */
.hero-tight { padding: 48px 0 16px; }
.signup { max-width: 560px; margin: 8px 0 24px; }
.field { display: block; margin: 0 0 18px; }
.field > span, .choices legend { display: block; font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.field small { display: block; font-size: 14px; margin-top: 6px; }
.field input { width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.choices { border: 0; padding: 0; margin: 0 0 18px; }
.choice { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 0; font-size: 16px; cursor: pointer; }
.choice input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.signup .btn[disabled] { opacity: 0.7; cursor: default; }
.form-error { background: var(--warn-bg); color: var(--warn-text); border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.form-note { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 32px 0 40px; font-size: 15px; }
.footer-cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.footer-cols h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 6px; }
.footer-cols nav { display: flex; flex-direction: column; }
.footer-cols a, .footer-row a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); }
.footer-row { display: flex; flex-wrap: wrap; gap: 0 20px; }
.site-footer.plain .footer-row a { color: var(--muted); }
.fine { color: var(--muted); font-size: 14px; margin-top: 20px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media print {
  .site-header, .site-footer, .skip { display: none; }
}
.h3 { font-size: 20px; margin: 0 0 8px; }
