/* bilva.app — the whole site's stylesheet.
   Tokens are verbatim from SPEC.md §1.1/§1.2 via SPEC-site.md §2.
   Two background colours, no gradient, no shadow, elevation none. */

/* ── Fonts ────────────────────────────────────────────────────────────────
   The same files the Android app bundles, converted to woff2 and subset to
   Latin, served from bilva.app. No Google Fonts, no CDN, no third party.   */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/plex-sans-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/plex-sans-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/plex-sans-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Condensed";
  src: url("/fonts/plex-sans-condensed-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light dark;

  --bg: #F3F5F6;
  --surface: #FFFFFF;
  --panel: #F3F5F6;          /* invoice-render container: bg light, surface-2 dark */
  --ink: #141A1D;
  --ink-2: #485257;
  --ink-3: #66727A;
  --border: #D3DADE;
  --accent: #0B5E6C;
  --accent-pressed: #084B57;
  --accent-tint: #E1EFF1;

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

  --gutter: clamp(16px, 4vw, 32px);
  --measure: 760px;          /* text pages; / and /pricing override to 960 */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121517;
    --surface: #1B2023;
    --panel: #242B2F;        /* surface-2 */
    --ink: #ECF0F1;
    --ink-2: #AEB8BD;
    --ink-3: #859299;
    --border: #333C41;
    --accent: #5FBFCB;
    --accent-pressed: #7FCDD6;
    --accent-tint: #123A41;
  }
}

/* ── Base ─────────────────────────────────────────────────────────────────
   tabular-nums is the app-wide rule from SPEC.md §2. IBM Plex ships no tnum
   feature because its figures are already tabular (one advance for all ten);
   the declaration is kept so the rule also binds any fallback face.        */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 24px;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

body.wide { --measure: 960px; }

main { flex: 1 0 auto; }

h1, h2, h3, p, li { text-wrap: pretty; }

a { color: var(--accent); }
a:hover { color: var(--accent-pressed); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }

/* --measure is the MEASURE — the width of the text column itself. The page
   gutter sits outside it, as it does in the design files, which use the
   default content-box. With border-box everywhere, that means adding the
   gutters back: 960 + 2x32 = 1024 total on the wide pages at 1280px. */
.wrap {
  width: 100%;            /* body is a flex column; auto cross-axis margins
                             disable stretch, so <main class="wrap"> would
                             shrink-to-fit and centre on the shorter pages. */
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.lockup { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.lockup svg { display: block; flex: none; }
.lockup .bar { fill: var(--ink); }
.lockup .tick {
  fill: none; stroke: var(--accent); stroke-width: 7;
  stroke-linecap: square; stroke-linejoin: miter;
}
.lockup-word {
  font-family: var(--cond);
  font-weight: 600; font-size: 20px; line-height: 24px;
  letter-spacing: -0.2px;             /* -1% at 20px */
  color: var(--ink);
}

.nav-main { display: flex; align-items: center; gap: clamp(14px, 3vw, 24px); }
.nav-main a {
  font-size: 14px; font-weight: 500; line-height: 20px;
  text-decoration: none;
  display: flex; align-items: center; min-height: 48px;   /* 48x48 target */
  white-space: nowrap;                                     /* never wraps at 360 */
}
.nav-main a[aria-current="page"] { font-weight: 600; color: var(--ink); }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: clamp(32px, 5vw, 56px);
}
.site-footer .wrap { padding-block: clamp(28px, 4vw, 40px); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.footer-nav a {
  font-size: 15px; line-height: 22px; text-decoration: none;
  display: flex; align-items: center; min-height: 48px;
}
.footer-note {
  margin: 20px 0 0; padding-top: 20px;
  border-top: 1px solid var(--border);
  max-width: 70ch;
  font-size: 14px; line-height: 20px; color: var(--ink-3);
}
.footer-legal { margin: 12px 0 0; font-size: 14px; line-height: 20px; color: var(--ink-3); }

/* 404 drops the footer nav; the note then opens the block. */
.footer-bare .footer-note { margin-top: 0; padding-top: 0; border-top: 0; }

/* ── Sections and the 2px rule motif ──────────────────────────────────── */
.band { background: var(--surface); border-top: 1px solid var(--border); }
.band--closed { border-bottom: 1px solid var(--border); }
.band > .wrap { padding-block: clamp(28px, 5vw, 48px); }

.section { margin-top: clamp(32px, 6vw, 56px); }
.section-first { margin-top: clamp(28px, 5vw, 44px); }

/* The site's only decorative device, lifted from the app's Total rule. */
.rule { height: 0; border-top: 2px solid var(--ink); }
.rule + h2, .rule + h3 { margin-top: 20px; }

/* ── Type ─────────────────────────────────────────────────────────────── */
.h1-hero, .h1-page, .h1-pricing,
.h2-section, .h2-landing, .h2-pricing, .h2-pair, .money {
  font-family: var(--cond); font-weight: 600; color: var(--ink); margin: 0;
}
.h1-hero    { font-size: clamp(34px, 8.6vw, 60px); line-height: 1.04; letter-spacing: -0.01em; max-width: 26ch; }
.h1-page    { font-size: clamp(30px, 7vw, 46px);   line-height: 1.06; letter-spacing: -0.01em; max-width: 24ch; }
.h1-pricing { font-size: clamp(32px, 7.6vw, 52px); line-height: 1.05; letter-spacing: -0.01em; max-width: 22ch; }
.h2-section { font-size: clamp(22px, 4.4vw, 28px); line-height: 1.14; letter-spacing: -0.005em; }
.h2-landing { font-size: clamp(22px, 4.6vw, 30px); line-height: 1.14; letter-spacing: -0.005em; }
.h2-pricing { font-size: clamp(24px, 5vw, 34px);   line-height: 1.12; letter-spacing: -0.005em; }
.h2-pair    { font-size: clamp(20px, 3.6vw, 26px); line-height: 1.15; }

h3, .h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 24px; color: var(--ink); }

.lede { margin: 16px 0 0; max-width: 52ch; font-size: clamp(17px, 2.2vw, 19px); line-height: 1.5; color: var(--ink-2); }
.lede-46 { max-width: 46ch; }
.lede-48 { max-width: 48ch; }
.lede-50 { max-width: 50ch; }

p { margin: 12px 0 0; color: var(--ink-2); }
p.tight { margin-top: 6px; }
.m0 { margin-top: 0; }
.prose-52 { max-width: 52ch; }
.prose-56 { max-width: 56ch; }
.prose-58 { max-width: 58ch; }
.prose-60 { max-width: 60ch; }
.prose-62 { max-width: 62ch; }

.small { font-size: 15px; line-height: 22px; }
.caption { font-size: 14px; line-height: 20px; color: var(--ink-3); }
.label {
  margin: 0;
  font-size: 13px; font-weight: 500; line-height: 16px;
  letter-spacing: 0.78px; text-transform: uppercase; color: var(--ink-2);
}

/* ── Grids ────────────────────────────────────────────────────────────── */
.grid { display: grid; }
.grid-promise { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: clamp(20px, 3vw, 28px); }
.grid-lists   { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 0 clamp(24px, 4vw, 48px); }
.grid-cards   { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: clamp(16px, 2.5vw, 24px); }
.grid-pair    { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: clamp(24px, 4vw, 40px); }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: clamp(24px, 4vw, 32px); }

/* ── Card, callout, rows, steps ───────────────────────────────────────── */
.card {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); padding: 16px;
}
.card-wide { padding: clamp(16px, 3vw, 24px); }

.callout {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--accent-tint); padding: clamp(16px, 3vw, 20px);
}
.callout p { margin: 0; color: var(--ink); }

.rows { margin: 20px 0 0; padding: 0; list-style: none; }
.rows li { padding: 14px 0; border-top: 1px solid var(--border); font-size: 16px; line-height: 24px; color: var(--ink-2); }
.rows li:last-child { border-bottom: 1px solid var(--border); }
.rows-free { margin: 0; }
.rows-free li { padding: 12px 0; color: var(--ink); }
.rows-free li:last-child { border-bottom: 0; }
.rows-data li { color: var(--ink-2); padding: 12px 0; }
.rows-data li:last-child { border-bottom: 0; }
.rows-data { margin-top: 8px; }

.steps { margin: 20px 0 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.steps li:last-child { border-bottom: 1px solid var(--border); }
.steps .n {
  flex: none; width: 28px;
  font-family: var(--cond); font-weight: 600; font-size: 20px; line-height: 26px;
  color: var(--accent);
}
.steps .t { font-size: 16px; line-height: 26px; color: var(--ink); }
b, strong { font-weight: 600; color: var(--ink); }

/* ── Table ────────────────────────────────────────────────────────────── */
.table-scroll { margin-top: 24px; overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.table-scroll table { width: 100%; border-collapse: collapse; }
.t-compare { min-width: 520px; }
.t-events  { min-width: 560px; }
.table-scroll th {
  text-align: left; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 500; line-height: 16px;
  letter-spacing: 0.78px; text-transform: uppercase; color: var(--ink-2);
}
.table-scroll td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 16px; line-height: 22px; color: var(--ink); }
.table-scroll tbody tr:last-child td { border-bottom: 0; }
th.num, td.num { text-align: right; }
.money-cell { font-weight: 600; }
.muted { color: var(--ink-2); }
.tinted td { background: var(--accent-tint); }
.tinted-2 td { border-top: 1px solid var(--border); }
.t-events td { padding: 12px 16px; vertical-align: top; }
.t-events .ev { font-family: var(--mono); font-size: 13px; line-height: 20px; color: var(--ink); }
.t-events .what { font-size: 15px; line-height: 22px; color: var(--ink-2); }

/* ── Money display ────────────────────────────────────────────────────── */
.price-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
.price-line-pro { gap: 6px 12px; margin-top: 8px; }
.money { font-size: clamp(40px, 10vw, 64px); line-height: 1; letter-spacing: -0.01em; }
.money-pro { font-size: clamp(28px, 6vw, 38px); line-height: 1.1; }
.money-note { font-size: 17px; font-weight: 600; line-height: 24px; color: var(--ink-2); }

/* ── FAQ (plain h3 + p, never a <details>) ────────────────────────────── */
.faq { margin-top: 20px; }
.faq > div { padding: 18px 0; border-top: 1px solid var(--border); }
.faq > div:last-child { border-bottom: 1px solid var(--border); }

/* ── Support email block ──────────────────────────────────────────────── */
.email-big {
  margin: 8px 0 0;
  font-family: var(--cond); font-weight: 600;
  font-size: clamp(26px, 6vw, 38px); line-height: 1.1;
  letter-spacing: -0.005em; word-break: break-word;
}
.email-big a { text-decoration: none; }

/* ── 404 route list ───────────────────────────────────────────────────── */
.routes { margin-top: clamp(28px, 5vw, 40px); }
.routes a { display: block; padding: 16px 0; border-bottom: 1px solid var(--border); text-decoration: none; }
.routes .r-name { display: block; font-size: 17px; font-weight: 600; line-height: 24px; }
.routes .r-what { display: block; margin-top: 2px; font-size: 15px; line-height: 22px; color: var(--ink-2); }

/* ── Postal address (privacy and terms only) ──────────────────────────── */
.postal { margin: 12px 0 0; font-style: normal; font-size: 16px; line-height: 24px; color: var(--ink-2); }

/* ── The invoice render ───────────────────────────────────────────────────
   A picture of a printed page. Theme-independent print tokens from SPEC.md
   §1.4; it does not respond to dark mode. Inner box 660x933 = A4 at 1pt.
   The 11px body is below the site's 13px minimum by design — its legibility
   target is print, not screen.                                            */
.doc-frame {
  margin-top: 24px;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: clamp(10px, 2vw, 20px);
  overflow-x: auto; overflow-y: hidden;
  height: min(973px, max(420px, 100vw));
}
.doc {
  width: 660px; height: 933px; margin: 0 auto;
  background: #FFFFFF; color: #141A1D;
  padding: 57px 57px 47px;
  display: flex; flex-direction: column;
  font-size: 11px; line-height: 15px;
  font-variant-numeric: tabular-nums;
}
.doc b { color: inherit; font-weight: 600; }
.doc .two-up { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; }
.doc .min0 { min-width: 0; }
.doc-title { font-family: var(--cond); font-weight: 600; font-size: 37px; line-height: 37px; letter-spacing: -0.01em; }
.doc-meta { margin-top: 15px; display: flex; flex-direction: column; gap: 3px; }
.doc .seller { text-align: right; flex: none; max-width: 280px; }
.doc .seller-name { font-family: var(--cond); font-weight: 600; font-size: 19px; line-height: 22px; }
.doc .seller-addr { margin-top: 6px; }
.doc .dim { color: #5B666C; }
.doc .lbl { font-size: 8px; font-weight: 500; line-height: 12px; letter-spacing: 0.64px; text-transform: uppercase; color: #5B666C; }
.doc .accent-rule { height: 0; border-top: 1.5px solid #0B5E6C; margin: 19px 0; }
.doc .bill-to { margin-top: 5px; font-weight: 600; }
.doc .due-box { flex: none; min-width: 156px; border: 0.75px solid #141A1D; padding: 9px 12px; text-align: right; }
.doc .due-amt { margin-top: 4px; font-family: var(--cond); font-weight: 600; font-size: 22px; line-height: 25px; }
.doc .due-by { margin-top: 2px; }
.doc .items { margin-top: 25px; }
.doc .row { display: flex; gap: 9px; }
.doc .items .head { padding-bottom: 6px; }
.doc .items .line { font-size: 11px; line-height: 14px; padding: 5px 0; border-top: 0.75px solid #D3DADE; }
.doc .items .line:last-child { border-bottom: 0.75px solid #141A1D; }
.doc .c-desc { flex: 1; min-width: 0; }
.doc .c-qty  { width: 42px; text-align: right; }
.doc .c-unit { width: 63px; text-align: right; }
.doc .c-vat  { width: 36px; text-align: right; }
.doc .c-amt  { width: 69px; text-align: right; }
.doc .totals { margin-top: 6px; display: flex; justify-content: flex-end; }
.doc .totals > div { width: 225px; }
.doc .t-row { display: flex; justify-content: space-between; padding: 4px 0; }
.doc .t-total { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0 0; margin-top: 2px; border-top: 0.75px solid #141A1D; }
.doc .t-total .k { font-size: 11.5px; font-weight: 600; line-height: 16px; }
.doc .t-total .v { font-size: 16px; font-weight: 600; line-height: 20px; color: #0B5E6C; }
.doc .spacer { flex: 1; min-height: 9px; }
.doc .pay { border-top: 0.75px solid #D3DADE; padding-top: 12px; display: flex; gap: 18px; }
.doc .pay > div { flex: 1; min-width: 0; }
.doc .pay .lbl + div { margin-top: 5px; }
.doc .page-foot { margin-top: 12px; display: flex; justify-content: space-between; font-size: 8px; line-height: 12px; color: #5B666C; }
.doc-caption { margin: 10px 0 0; font-family: var(--mono); font-size: 12px; line-height: 18px; color: var(--ink-3); }

/* Each caption note is shown only at the widths where the thing it describes
   is actually true, so a desktop reader is never told to swipe something that
   already fits. Both thresholds are measured, not derived: the render stops
   scrolling sideways at 752px, and the invoice's last line clears the bottom
   of the frame at 925px. (Between 925 and 973 a sliver of the document's
   bottom margin is still clipped, but no content is, so it is not cropped in
   any sense the reader would care about.) Re-measure with tool/measure.mjs if
   the frame's padding, border or height formula changes. */
@media (min-width: 925px) { .only-cropped { display: none; } }
@media (min-width: 752px) { .only-narrow  { display: none; } }

/* ── Landing hero ─────────────────────────────────────────────────────── */
.hero { padding-block: clamp(32px, 7vw, 64px) clamp(24px, 5vw, 40px); }
.cta { margin-top: clamp(24px, 4vw, 32px); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cta-primary { margin: 0; font-size: 17px; font-weight: 600; line-height: 24px; color: var(--ink); }
.cta-note { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink-3); }
.hero-who { margin-top: clamp(28px, 5vw, 40px); padding-top: 20px; border-top: 1px solid var(--border); max-width: 52ch; }

/* Below 900px the hero is a single column in source order, spaced by the
   margins above — identical to what it was. From 900px the two supporting
   blocks sit side by side under one full-width rule, so the hero occupies
   the measure rather than leaving half of it empty. */
@media (min-width: 900px) {
  .hero-support {
    margin-top: clamp(28px, 5vw, 40px);
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(24px, 4vw, 40px);
    align-items: start;
  }
  .hero-support .cta { margin-top: 0; }
  .hero-support .hero-who { margin-top: 0; padding-top: 0; border-top: 0; }
}
.promise .rule + h3 { margin-top: 12px; }
.label + h2 { margin-top: 12px; }
.mw-28 { max-width: 28ch; }
.mw-30 { max-width: 30ch; }
.mt-16 { margin-top: 16px; }
.hero-page { padding-block: clamp(32px, 6vw, 56px) clamp(24px, 4vw, 32px); }

/* Row headers in the comparison table are <th scope="row">, not the label style. */
.t-compare th[scope="row"] {
  text-transform: none; letter-spacing: 0;
  font-size: 16px; font-weight: 400; line-height: 22px;
  color: var(--ink); padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.t-compare th.strong { font-weight: 600; }
.t-compare tbody tr:last-child th { border-bottom: 0; }
.tinted th { background: var(--accent-tint); }
.tinted-2 th { border-top: 1px solid var(--border); }
.rule + .label { margin-top: 20px; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mw-20 { max-width: 20ch; }
.dim3 { color: var(--ink-3); }
.page-main { padding-top: clamp(28px, 5vw, 48px); }
.main-404 { padding-top: clamp(40px, 8vw, 72px); }

/* h3 inside a prose section opens a block; h2 after the first in a run. */
.h3-block { margin-top: 24px; }
.h3-block-20 { margin-top: 20px; }
.h2-gap { margin-top: 32px; }
.section-pad { padding-block: clamp(32px, 6vw, 56px); }
