/* ---------------------------------------------------------------------------------------------
   Marketing site stylesheet (v3.2.0)
   The only stylesheet a public page loads. No web fonts, no CDN, no framework.
   Budget: keep this file under 40 KB uncompressed. It is currently well inside that.

   Written mobile-first: the base rules ARE the phone layout, and the two min-width blocks at the
   end widen it. Every colour is a token, redefined for dark mode both by preference and by an
   explicit [data-theme] attribute, so a future toggle needs no new CSS.
--------------------------------------------------------------------------------------------- */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --surface: #ffffff;
  --border: #e2e6ec;
  --text: #16202c;
  --muted: #5a6675;
  --accent: #0b5fd0;          /* 4.9:1 on white — passes AA for normal text */
  --accent-ink: #ffffff;
  --accent-soft: #e8f0fd;
  --success: #0b6b33;
  --warn: #8a6d00;
  --danger: #a4262c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,32,44,.06), 0 8px 24px rgba(16,32,44,.06);
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --bg-alt: #111a2b;
    --surface: #131d30;
    --border: #24314a;
    --text: #e7edf6;
    --muted: #a3b0c2;
    --accent: #6ea8fe;        /* 7.1:1 on the dark background */
    --accent-ink: #0b1220;
    --accent-soft: #17243c;
    --success: #5ed39a;
    --warn: #e8c45c;
    --danger: #ff9a9f;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --bg-alt: #111a2b; --surface: #131d30; --border: #24314a;
  --text: #e7edf6; --muted: #a3b0c2; --accent: #6ea8fe; --accent-ink: #0b1220;
  --accent-soft: #17243c; --success: #5ed39a; --warn: #e8c45c; --danger: #ff9a9f;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;              /* 16px+ keeps iOS from zooming on focus */
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;           /* nothing on this site may scroll sideways */
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* --- Typography -------------------------------------------------------------------------- */
h1, h2, h3 { line-height: 1.22; margin: 0 0 .5em; letter-spacing: -.015em; font-weight: 650; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 1.15rem + 1.3vw, 2.1rem); margin-top: 1.6em; }
h3 { font-size: 1.16rem; margin-top: 1.4em; }
p { margin: 0 0 1.05em; }
p, li { max-width: 68ch; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
small, .muted { color: var(--muted); }
ul, ol { padding-left: 1.2em; }
li { margin: .35em 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
img { max-width: 100%; height: auto; }

/* Focus: visible, always, and never removed. 3:1 against both themes. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 12px 18px; border-radius: 0 0 var(--radius) 0; font-weight: 600;
}
.skip:focus { left: 0; }

/* --- Buttons: 44px minimum touch target ---------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 11px 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-lg { min-height: 52px; padding: 14px 26px; font-size: 1.05rem; }

/* --- Header ------------------------------------------------------------------------------- */
.mk-head { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--border); }
.mk-head-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.mk-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.05rem; }

.mk-burger { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 0 10px; background: none; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.mk-burger span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

.mk-nav { display: none; }
body.nav-open .mk-nav {
  display: flex; flex-direction: column; gap: 4px;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 12px 16px 20px; box-shadow: var(--shadow);
}
.mk-nav-link, .mk-drop > summary { display: block; min-height: 44px; line-height: 44px; font-weight: 600; color: var(--text); text-decoration: none; cursor: pointer; }
.mk-drop > summary { list-style: none; }
.mk-drop > summary::-webkit-details-marker { display: none; }
.mk-drop > summary::after { content: ' ▾'; color: var(--muted); }
.mk-drop-menu { display: flex; flex-direction: column; padding: 4px 0 8px 12px; }
.mk-drop-menu a { min-height: 40px; line-height: 40px; color: var(--muted); text-decoration: none; }
.mk-drop-menu a:hover { color: var(--accent); }

/* --- Breadcrumb --------------------------------------------------------------------------- */
.mk-crumb { padding-top: 14px; }
.mk-crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .45em; margin: 0; padding: 0; font-size: .9rem; color: var(--muted); }
.mk-crumb li + li::before { content: '/'; margin-right: .45em; color: var(--border); }

/* --- Sections ----------------------------------------------------------------------------- */
.sec { padding: 48px 0; }
.sec-alt { background: var(--bg-alt); }
.lead { font-size: 1.14rem; color: var(--muted); max-width: 62ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: .78rem; font-weight: 700; color: var(--accent); margin: 0 0 .6em; }

.hero { padding: 40px 0 46px; }
.hero h1 { margin-bottom: .35em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 14px; }
.hero-note { font-size: .93rem; color: var(--muted); }

.grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.checks { list-style: none; padding: 0; }
.checks li { position: relative; padding-left: 1.75em; }
.checks li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 700; }

/* --- Tables (scroll inside their own box, never the page) --------------------------------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .96rem; }
caption { text-align: left; padding: 12px 14px; color: var(--muted); font-size: .9rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 650; background: var(--bg-alt); }
tbody tr:last-child td { border-bottom: 0; }

/* --- FAQ (works with no JavaScript) -------------------------------------------------------- */
.faq { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq details { border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 600; min-height: 44px; 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.3em; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq .faq-body { padding: 0 18px 16px; color: var(--muted); }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* --- Forms -------------------------------------------------------------------------------- */
label { display: block; font-weight: 600; margin-bottom: 5px; }
.hint { font-size: .9rem; color: var(--muted); margin: 4px 0 0; }
input[type=text], input[type=email], input[type=tel], select, textarea {
  width: 100%; min-height: 46px; padding: 11px 12px; font: inherit; font-size: 16px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
}
textarea { min-height: 140px; resize: vertical; }
.field { margin-bottom: 18px; }
.field-error input, .field-error textarea { border-color: var(--danger); }
.err { color: var(--danger); font-size: .92rem; margin: 5px 0 0; font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.flash { padding: 13px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-alt); margin: 18px 0; }
.flash.success { border-color: var(--success); }
.flash.error { border-color: var(--danger); }

/* --- CTA band ----------------------------------------------------------------------------- */
.cta { background: var(--accent-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 44px 0; text-align: center; }
.cta h2 { margin-top: 0; }
.cta p { margin-left: auto; margin-right: auto; }

/* --- Footer ------------------------------------------------------------------------------- */
.mk-foot { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 40px 0 28px; font-size: .95rem; }
.mk-foot-cols { display: grid; gap: 26px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mk-foot h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 .7em; }
.mk-foot ul { list-style: none; margin: 0; padding: 0; }
.mk-foot li { margin: .45em 0; }
.mk-foot a { color: var(--text); text-decoration: none; }
.mk-foot a:hover { color: var(--accent); text-decoration: underline; }
.mk-foot-legal { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); }
.mk-foot-legal p { margin: 0 0 .5em; max-width: none; }
.mk-made { font-size: .9rem; }

/* --- Wider screens ------------------------------------------------------------------------ */
@media (min-width: 720px) {
  .mk-burger { display: none; }
  .mk-nav { display: flex; align-items: center; gap: 22px; position: static; padding: 0; border: 0; box-shadow: none; background: none; }
  .mk-drop { position: relative; }
  .mk-drop-menu {
    position: absolute; top: calc(100% + 8px); left: 0; min-width: 232px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 8px; z-index: 50;
  }
  .mk-drop-menu a { padding: 0 10px; border-radius: 6px; }
  .mk-drop-menu a:hover { background: var(--bg-alt); }
  .sec { padding: 64px 0; }
  .hero { padding: 68px 0 60px; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mk-foot-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mk-foot-cols { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: center; }
}

/* --- Print -------------------------------------------------------------------------------- */
@media print {
  .mk-head, .mk-foot-cols, .cta, .skip, .mk-crumb { display: none; }
  body { font-size: 11pt; color: #000; background: #fff; }
  a[href^="http"]::after { content: ' (' attr(href) ')'; font-size: .85em; color: #444; }
}
/* ------------------------------------------------------------------------------------------
   Package 2 additions to the marketing stylesheet (v3.2.0).

   APPEND to static/css/marketing.css — do not add a second <link>, which would cost a request:
       cat static/css/marketing-extra.css >> static/css/marketing.css && rm static/css/marketing-extra.css
------------------------------------------------------------------------------------------- */

/* --- Pricing period toggle -----------------------------------------------------------------
   Two radio inputs and a sibling selector. No JavaScript, so switching period cannot cause a
   layout shift or a flash of the wrong price — both of which cost Lighthouse points on the one
   page where a visitor is deciding whether to pay you.                                     */
.pricing-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 4px; margin-top: 22px; background: var(--surface); }
.pricing-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.pricing-toggle label { display: inline-flex; align-items: center; gap: .5em; min-height: 40px; padding: 0 18px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--muted); }
.pricing-toggle input:checked + label { background: var(--accent); color: var(--accent-ink); }
.pricing-toggle input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.pricing-toggle .save { font-size: .8rem; opacity: .9; }

/* Monthly is the default; checking the annual radio swaps which figures show. :has() is
   supported everywhere that matters now, and the fallback is simply "monthly always shows",
   which is honest rather than broken. */
.price-annual { display: none; }
body:has(#per-annual:checked) .price-annual { display: inline; }
body:has(#per-annual:checked) .price-monthly { display: none; }

.price { margin: 14px 0 2px; font-size: 2.1rem; font-weight: 700; line-height: 1.1; }
.price-unit { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); margin-top: 4px; }
.plan { display: flex; flex-direction: column; }
.plan ul { flex: 1; }
.plan-featured { border-color: var(--accent); box-shadow: var(--shadow); }

/* --- Search results ------------------------------------------------------------------------ */
.result { padding: 16px 0; border-bottom: 1px solid var(--border); }
.result:last-child { border-bottom: 0; }
.result h3 { margin: 0 0 .25em; font-size: 1.08rem; }
.result .path { font-size: .85rem; color: var(--muted); }
mark { background: var(--accent-soft); color: inherit; padding: 0 2px; border-radius: 2px; }

/* --- Changelog ----------------------------------------------------------------------------- */
.release { padding: 18px 0; border-bottom: 1px solid var(--border); }
.release:last-child { border-bottom: 0; }
.release h3 { margin: 0 0 .3em; font-size: 1.05rem; }
.release .ver { display: inline-block; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); margin-right: .6em; }
.release .current { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 999px; margin-left: .5em; }

/* --- Status -------------------------------------------------------------------------------- */
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.status-row:last-child { border-bottom: 0; }
.dot { display: inline-flex; align-items: center; gap: .5em; font-weight: 600; }
.dot::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--success); }
.dot.warn::before { background: var(--warn); }
.dot.down::before { background: var(--danger); }

/* --- Feature hub --------------------------------------------------------------------------- */
.feat { border-left: 3px solid var(--accent); padding-left: 18px; margin: 28px 0; }
.feat h3 { margin-top: 0; }
