/*
  kavouki.com — one stylesheet (D-94). The app's Design System colours (DESIGN_SYSTEM.md §2), Manrope for headings
  (self-hosted, OFL), the system font for text. Light and dark, no JavaScript, no external requests.
  Components are documented in site-src/README.md.
*/

@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --ink: #18312C;
  --text: #2B433D;
  --muted: #526A5F;
  --forest: #145B50;
  --forest-soft: #397667;
  --on-forest: #FFFFFF;
  --mint: #DDF3E8;
  --mint-light: #EFF8F1;
  --border: #DBE6DE;
  --bg: #FAFBF7;
  --surface: #FFFFFF;
  --tint: #EFF8F1;
  --warning: #8A5A00;
  --warning-bg: #FFF3DC;
  --peach: #F6D9C8;
  --shadow: 0 1px 2px rgba(24, 49, 44, 0.06), 0 8px 24px rgba(24, 49, 44, 0.08);
  --frame: #18312C;
  --radius: 20px;
  --radius-sm: 12px;
  --heading: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E4EEE9;
    --text: #CBD9D2;
    --muted: #A6BAB1;
    --forest: #8FD5B9;
    --forest-soft: #A3CFBF;
    --on-forest: #07251C;
    --mint: #1F4A3F;
    --mint-light: #16251F;
    --border: #33483F;
    --bg: #0F1A17;
    --surface: #13211D;
    --tint: #16251F;
    --warning: #F2C15A;
    --warning-bg: #3A2E14;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --frame: #2C413A;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--forest); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--forest); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--heading); color: var(--ink); line-height: 1.18; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin: 0.25em 0; }
code, kbd { font: 0.92em ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--tint); border-radius: 6px; padding: 0.1em 0.35em; overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* Layout */
.container { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.narrow { width: min(100% - 2 * var(--gutter), 760px); margin-inline: auto; }
.section { padding-block: clamp(48px, 7vw, 96px); }
.section-tinted { background: var(--tint); }
.section-head { max-width: 720px; margin-bottom: 2rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.overline { font: 700 0.8rem/1 var(--heading); letter-spacing: 0.12em; text-transform: uppercase; color: var(--forest); margin-bottom: 0.9rem; }
.lead { font-size: clamp(1.08rem, 1rem + 0.4vw, 1.25rem); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.grid { display: grid; gap: clamp(16px, 2.4vw, 24px); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.split { display: grid; gap: clamp(24px, 5vw, 64px); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 880px) { .split { grid-template-columns: 1.1fr 0.9fr; } .split.reverse > :first-child { order: 2; } }

/* Skip link, header, navigation */
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--forest); color: var(--on-forest); padding: 10px 14px; border-radius: 10px; z-index: 10; }
.skip-link:focus { left: 8px; }
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 68px; padding-block: 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-name { font: 800 1.35rem/1 var(--heading); letter-spacing: -0.02em; }
.brand-shell { fill: var(--forest); }
.brand-scute { fill: var(--mint); }
.brand-house { fill: var(--forest); }
.brand-door { fill: var(--mint); }
.nav-desktop { margin-left: auto; display: none; }
.nav-list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a, .nav-mobile a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.nav-list a:hover, .nav-list a[aria-current="page"] { background: var(--mint); }
.lang-switch { margin-left: auto; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.92rem; min-height: 44px; display: inline-flex; align-items: center; }
.nav-mobile { position: relative; }
.nav-mobile summary { list-style: none; cursor: pointer; padding: 10px 14px; border-radius: 999px; background: var(--mint); color: var(--ink); font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile nav { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 8px; min-width: 220px; }
.nav-mobile ul { list-style: none; margin: 0; padding: 0; }
/* Language menu: shown instead of the single switch when a page exists in more than two languages (D-102). */
.lang-menu { position: relative; margin-left: auto; }
.lang-menu summary { list-style: none; cursor: pointer; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--ink); font-weight: 600; font-size: 0.92rem; min-height: 44px; display: inline-flex; align-items: center; gap: 4px; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: "▾"; font-size: 0.8em; color: var(--muted); }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 8px); list-style: none; margin: 0; padding: 8px; min-width: 180px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); z-index: 10; }
.lang-menu a { display: flex; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; min-height: 44px; }
.lang-menu a:hover { background: var(--mint); }
@media (min-width: 1000px) { .nav-desktop { display: block; } .nav-mobile { display: none; } .lang-switch, .lang-menu { margin-left: 8px; } }

.breadcrumbs { padding-top: 20px; font-size: 0.9rem; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }

/* Buttons and badges */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 1.5rem 0 0.75rem; }
.button { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 700; text-decoration: none; border: 2px solid transparent; }
.button-primary { background: var(--forest); color: var(--on-forest); }
.button-primary:hover { background: var(--forest-soft); }
.button-secondary { border-color: var(--forest); color: var(--forest); background: transparent; }
.button .icon { width: 20px; height: 20px; }
.note { font-size: 0.92rem; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; font: 700 0.78rem/1 var(--heading); padding: 6px 10px; border-radius: 999px; background: var(--mint); color: var(--forest); vertical-align: middle; }
.badge-plus { background: var(--peach); color: #6B3418; }
.badge-soon { background: var(--warning-bg); color: var(--warning); }
.badge-free { background: var(--mint); color: var(--forest); }
.badge-plain { background: var(--tint); color: var(--ink); }
@media (prefers-color-scheme: dark) { .badge-plus { background: #4A2A1A; color: #F6D9C8; } }

/* Icons */
.icon { width: 24px; height: 24px; fill: currentColor; flex: none; }
.icon-tile { width: 52px; height: 52px; border-radius: 14px; background: var(--mint); color: var(--forest); display: grid; place-items: center; margin-bottom: 14px; }
.icon-tile .icon { width: 26px; height: 26px; }

/* Hero */
.hero { padding-block: clamp(40px, 7vw, 96px) clamp(32px, 6vw, 72px); }
.hero h1 { max-width: 14ch; }
.hero .lead { max-width: 40ch; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 1.25rem 0 0; }
.hero-pills li { margin: 0; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.hero-pills .icon { width: 18px; height: 18px; color: var(--forest); }
.hero-shots { display: flex; justify-content: center; gap: 16px; }
.hero-shots .phone:nth-child(2) { margin-top: 48px; }

/* Phone-framed screenshots */
.phone { margin: 0; width: min(100%, 300px); }
.phone img { border-radius: 28px; border: 8px solid var(--frame); box-shadow: var(--shadow); background: var(--surface); }
.phone figcaption { text-align: center; font-size: 0.88rem; color: var(--muted); margin-top: 10px; }
.phone.small { width: min(100%, 220px); }
.shots-row { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; }
.shots-row .phone { flex: 0 0 220px; scroll-snap-align: start; }
.doc-shot { margin: 0; max-width: 420px; }
.doc-shot img { border-radius: 8px; border: 1px solid var(--border); box-shadow: var(--shadow); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(20px, 2.6vw, 28px); }
.card h3 { margin-bottom: 0.35em; }
.card h2 { font-size: 1.3rem; margin-bottom: 0.4em; }
.card p:last-child { margin-bottom: 0; }
a.card { display: block; text-decoration: none; color: var(--text); transition: transform 0.15s ease, box-shadow 0.15s ease; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
a.card .more { color: var(--forest); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; }
.card-list { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.card-list li { position: relative; padding-left: 30px; margin: 0.45em 0; }
.card-list li > .icon:first-child { position: absolute; left: 0; top: 0.15em; }
.card-list .icon { width: 20px; height: 20px; color: var(--forest); }
.narrow > ul + h2, .narrow > p + h2, .narrow > .table-wrap + h2 { margin-top: 2.2rem; }

/* Steps */
.steps { list-style: none; counter-reset: step; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.steps[start="2"] { counter-reset: step 1; }
.steps[start="3"] { counter-reset: step 2; }
.steps[start="4"] { counter-reset: step 3; }
.steps[start="5"] { counter-reset: step 4; }
.steps[start="6"] { counter-reset: step 5; }
.steps[start="7"] { counter-reset: step 6; }
.steps[start="8"] { counter-reset: step 7; }
.steps[start="9"] { counter-reset: step 8; }
.steps[start="10"] { counter-reset: step 9; }
.steps[start="11"] { counter-reset: step 10; }
.steps[start="12"] { counter-reset: step 11; }
.steps > li { counter-increment: step; position: relative; padding: 18px 20px 18px 68px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 0; }
.steps > li::before { content: counter(step); position: absolute; left: 18px; top: 16px; width: 34px; height: 34px; border-radius: 50%; background: var(--forest); color: var(--on-forest); font: 800 1rem/34px var(--heading); text-align: center; }
.steps > li h3 { margin-bottom: 0.2em; font-size: 1.05rem; }
.steps > li p { margin-bottom: 0; }

/* Callouts */
.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--mint-light); border: 1px solid var(--border); margin: 1.5rem 0; }
.callout .icon { color: var(--forest); margin-top: 2px; }
.callout p:last-child { margin-bottom: 0; }
.callout-warning { background: var(--warning-bg); border-color: transparent; }
.callout-warning .icon { color: var(--warning); }

/* App labels in guides: Settings › Data & backup */
.ui { font-weight: 700; color: var(--ink); white-space: nowrap; }
@media (max-width: 600px) { .ui { white-space: normal; } }
.callout > div, .steps li > * { min-width: 0; overflow-wrap: break-word; }

/* FAQ */
.faq { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin: 0 0 12px; }
.faq summary { cursor: pointer; padding: 16px 48px 16px 20px; font-weight: 700; color: var(--ink); position: relative; list-style: none; min-height: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 12px; font: 400 1.6rem/1 var(--heading); color: var(--forest); }
.faq[open] summary::after { content: "−"; }
.faq-body { padding: 0 20px 16px; }

/* Tables (pricing, comparisons) */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.96rem; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { font-family: var(--heading); color: var(--ink); background: var(--tint); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.yes, td.no { text-align: center; font-weight: 700; }
td.yes { color: var(--forest); }
td.no { color: var(--muted); }

/* Pricing */
.plans { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.plan.featured { border: 2px solid var(--forest); }
.plan .price { font: 800 2.4rem/1 var(--heading); color: var(--ink); margin: 0.4em 0 0.2em; }
.plan .price small { font-size: 1rem; font-weight: 600; color: var(--muted); }

/* Guides */
.guide-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0.5rem 0 1.5rem; }
.guide-body h2 { margin-top: 2.2rem; font-size: 1.5rem; }
.guide-body img { margin: 1rem auto; }
.guide-body .phone, .guide-body .doc-shot { margin-inline: auto; }
.guide-toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 20px; margin: 1.5rem 0; }
.guide-toc h2 { font-size: 1rem; margin: 0 0 0.5em; }
.guide-toc ol { margin: 0; }
.related { margin-top: 3rem; }

/* Legal and long text */
.prose h2 { font-size: 1.35rem; margin-top: 2rem; }
.prose .meta { color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding-block: 48px 32px; margin-top: 48px; font-size: 0.95rem; }
.footer-brand { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 24px; }
.footer-brand p { margin: 0; }
.footer-brand .footer-note { flex-basis: 100%; }
.footer-cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 24px; }
.footer-col h2 { font-size: 0.95rem; margin-bottom: 0.6em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col a { color: var(--text); text-decoration: none; display: inline-block; padding: 4px 0; }
.footer-col a:hover { color: var(--forest); text-decoration: underline; }
.footer-note { color: var(--muted); font-size: 0.88rem; margin: 0.4em 0 0; }

/* Print: guides and checklists print cleanly */
@media print {
  .site-header, .site-footer, .breadcrumbs, .cta-row, .skip-link { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  a { color: #000; }
  .section { padding-block: 12pt; }
  tr, .card, .callout, figure { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  .page-break { break-before: page; }
}
@page { size: A4; margin: 12mm; }

/* Utilities (inline style attributes are blocked by the CSP) */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.center { text-align: center; }
.cta-row.center { justify-content: center; }

/* Grid and split children may shrink below their content (stops sideways scrolling on phones). */
.split > *, .grid > * { min-width: 0; }
.hero-shots .phone { width: min(48%, 300px); }
html, body { overflow-x: clip; }

/* Header v2 (WEBSITE_PLAN §2): Uses disclosure, CTA, grouped mobile menu */
.nav-list { align-items: center; }
.nav-uses { position: relative; }
.nav-uses summary { list-style: none; cursor: pointer; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.nav-uses summary::-webkit-details-marker { display: none; }
.nav-uses summary::after { content: "▾"; font-size: 0.8em; color: var(--muted); }
.nav-uses summary:hover, .nav-uses[open] summary { background: var(--mint); }
.nav-uses ul { position: absolute; left: 0; top: calc(100% + 8px); list-style: none; margin: 0; padding: 8px; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.nav-uses li { margin: 0; }
.nav-cta { min-height: 44px; padding: 0 16px; margin-left: 8px; font-size: 0.95rem; }
@media (max-width: 559px) { .nav-cta { display: none; } }
.nav-mobile .nav-group { margin: 4px 12px; font: 700 0.75rem/1.4 var(--heading); letter-spacing: 0.1em; text-transform: uppercase; color: var(--forest); }
.nav-mobile .nav-rest { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
.nav-mobile nav { max-height: 75vh; overflow-y: auto; min-width: 260px; }
.checked { margin-top: 0; margin-bottom: 2rem; font-style: italic; }

/* Store links on /download/ */
.store-button { min-width: 240px; justify-content: center; }
.store-note { display: inline-block; font-weight: 600; color: var(--ink); padding: 12px 0; }
