/* Luppis public site — the one stylesheet (LUP-340).
   Used by website/base_marketing.html and every public page: home, /vodic/,
   /vodic/struke/, /tools/kpd/, /kontakt/. The app has its own theme; never mix them.

   Tokens: colours, font and sizes live in the custom properties below. Change the
   look here, not in templates. Two palettes:
     reading  (default, light) - :root
     Noć      (dark)           - @media (prefers-color-scheme: dark), and forced by
                                 <body class="night"> (the home page)
   Components: .site-header .site-footer .btn(-primary|-dark|-lg) .field .find
     .chips .docs(-rail|-main|-toc) .article .note .meta .page-title .list
     .table-wrap .kpd-code .section .wrap .hp .sr-only
   Rules:
     - A public template may only use classes defined in this file
       (website/test_public_guards.py checks it). Add a class here, never inline.
     - No page-specific stylesheets, no frameworks, no icon fonts (inline SVG).
     - site.css + site.js stay under 20 KB together (also checked).
     - Text that explains a layout is a layout bug: fix the layout instead. */

:root {
  --font: "Host Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #fff;
  --ink: #16152b;
  --text: #3d3b57;
  --muted: #706e8c;
  --danger: #c53030;
  --line: #e7e6f0;
  --surface: #fafafd;
  --tint: #efeeff;
  --brand: #605dff;
  --brand-ink: #4b48e0;
  --header-bg: rgba(255, 255, 255, .86);
  --radius: 10px;
  --wrap: 1280px;
  --measure: 70ch;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e26;
    --ink: #fff;
    --text: #dddbf7;
    --muted: #a3a1c9;
    --danger: #ff8080;
    --line: rgba(255, 255, 255, .1);
    --surface: rgba(255, 255, 255, .04);
    --tint: rgba(96, 93, 255, .2);
    --brand-ink: #b3b1ff;
    --header-bg: rgba(15, 14, 38, .82);
    color-scheme: dark;
  }
}

.night {
  --bg: #0f0e26;
  --ink: #fff;
  --text: #dddbf7;
  --muted: #a3a1c9;
  --danger: #ff8080;
  --line: rgba(255, 255, 255, .1);
  --surface: rgba(255, 255, 255, .04);
  --tint: rgba(96, 93, 255, .2);
  --brand-ink: #b3b1ff;
  --header-bg: rgba(15, 14, 38, .82);
  color-scheme: dark;
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/1.6 var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink); font-weight: 600; line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.sr-only, .hp {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 50; padding: 8px 14px; border-radius: var(--radius); background: var(--ink); color: var(--bg); }
.skip-link:focus { top: 12px; }

/* logos: ink on light, white on dark */
.logo-white { display: none; }
@media (prefers-color-scheme: dark) {
  .logo-ink { display: none; }
  .logo-white { display: block; }
}
.night .logo-ink { display: none; }
.night .logo-white { display: block; }

/* ---- buttons, fields ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border: 1px solid transparent; border-radius: 999px;
  font-weight: 600; font-size: 15px; line-height: 1.2; white-space: nowrap; cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #5350f0; }
.btn-dark { background: var(--ink); color: var(--bg); border-radius: var(--radius); }
.btn-lg { padding: 14px 24px; font-size: 16px; }

.field {
  width: 100%; padding: 11px 14px; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.field::placeholder { color: var(--muted); }
textarea.field { resize: vertical; min-height: 120px; }
.find { display: flex; gap: 8px; }
.find .field { flex: 1; min-width: 0; }
@media (max-width: 479px) {
  .find { flex-wrap: wrap; }
  .find .btn { width: 100%; }
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button, .chips a {
  padding: 5px 12px; font-size: 14px; color: var(--ink); background: none;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--header-bg); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.site-header .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; height: 68px; }
.site-logo img { height: 36px; width: auto; }
.site-nav { display: flex; gap: 30px; font-weight: 500; font-size: 15px; color: var(--ink); }
.site-nav a:hover, .site-signin:hover { color: var(--brand-ink); }
.site-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.site-signin { color: var(--muted); font-weight: 500; font-size: 15px; white-space: nowrap; }
.site-search {
  display: grid; place-items: center; width: 36px; height: 36px;
  color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
}
.site-search svg { width: 16px; height: 16px; }
.site-menu { display: none; position: relative; }
.site-menu summary { list-style: none; display: grid; place-items: center; width: 36px; height: 36px; color: var(--ink); cursor: pointer; }
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu summary svg { width: 22px; height: 22px; }
.site-menu-panel {
  position: absolute; right: -8px; top: 46px; width: min(280px, calc(100vw - 32px));
  display: grid; gap: 2px; padding: 8px; font-weight: 500;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 14, 38, .16);
}
.site-menu-panel a { padding: 10px 12px; border-radius: 8px; color: var(--ink); }
.site-menu-panel a:hover { background: var(--surface); }

@media (max-width: 899px) {
  .site-header .wrap { grid-template-columns: 1fr auto; padding: 0 16px; gap: 12px; height: 60px; }
  .site-nav, .site-signin, .site-search { display: none; }
  .site-menu { display: block; }
  .site-actions { gap: 8px; }
  .site-logo img { height: 30px; }
  .site-actions .btn { padding: 8px 14px; font-size: 14px; }
}

/* ---- search dialog ---- */
.search {
  width: min(640px, calc(100vw - 32px)); margin: 12vh auto auto; padding: 0;
  color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 30px 80px rgba(15, 14, 38, .3);
}
.search::backdrop { background: rgba(15, 14, 38, .45); }
.search .field { font-size: 17px; padding: 16px 18px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: 55vh; overflow-y: auto; }
.search-results:empty { display: none; }
.search-results a, .search-results button {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px; width: 100%;
  padding: 10px 12px; text-align: left; color: var(--ink); background: none; border: 0; border-radius: 8px; cursor: pointer;
}
.search-results small { flex: none; font-size: 13px; color: var(--muted); }
.search-results [data-active="true"] { background: var(--tint); }
.search-results button { color: var(--brand-ink); font-weight: 500; }

/* ---- home (always dark: <body class="night">) ----
   One bold thing: the brand glow behind the real invoice. Everything else quiet. */
.hero { position: relative; overflow: hidden; padding-top: 72px; text-align: center; }
.hero::before {
  content: ""; position: absolute; left: 50%; top: 320px; width: min(1100px, 130vw); height: 700px;
  transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(closest-side, rgba(96, 93, 255, .45), rgba(96, 93, 255, 0) 70%);
}
.hero .wrap { position: relative; }
.hero-title { max-width: 900px; margin: 0 auto 28px; font-size: clamp(36px, 6vw, 68px); line-height: 1.04; letter-spacing: -.03em; }
.hero-shot {
  max-width: 920px; margin: 56px auto 0; overflow: hidden; background: #fff;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0;
  box-shadow: 0 -10px 80px rgba(96, 93, 255, .35);
}
.hero-shot img, .shot img { width: 100%; height: auto; }
.section h2 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -.02em; margin-bottom: 28px; }
.narrow { max-width: 860px; }
.story { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; }
.steps h3 { font-size: 19px; margin-bottom: 6px; }
.steps h3::before { content: counter(step); display: inline-block; width: 1.6em; color: var(--brand-ink); }
.steps p { color: var(--muted); }
.shot { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.status-row { display: grid; grid-template-columns: 170px 220px minmax(0, 1fr); gap: 24px; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--line); }
.status { display: inline-block; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: lowercase; }
.status::first-letter { text-transform: uppercase; }
.status-list > :first-child .status { color: #3ecf8e; }
.status-row h3 { font-size: 16px; }
.status-row p { font-size: 15px; color: var(--muted); }
.status-list + .meta { margin-top: 18px; }
.price { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.price-tag { margin: 8px 0; font-size: 56px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.price-tag span { font-size: 18px; font-weight: 500; color: var(--muted); }
.price .btn { margin-top: 12px; }
.ticks { gap: 0; }
.ticks li { padding: 11px 0; border-top: 1px solid var(--line); }
.faq details { padding: 16px 0; border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; font-size: 17px; font-weight: 600; color: var(--ink); }
.faq details p { margin-top: 10px; color: var(--muted); }
.links a { display: block; padding: 14px 0; font-size: 17px; color: var(--ink); border-top: 1px solid var(--line); }
.links a:hover { color: var(--brand-ink); }
/* Two class names that live INSIDE translated strings on the home page (the
   honesty line's FAQ link, the pricing heading); the msgids must stay verbatim. */
.text-primary { color: var(--brand-ink); }
.text-warning { color: inherit; }
@media (max-width: 899px) {
  .story, .price { grid-template-columns: minmax(0, 1fr); }
  .status-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

/* ---- simple one-column pages (contact) ---- */
.single { max-width: 640px; padding-top: 40px; }
.single .page-title { margin-bottom: 28px; }
.stack { display: grid; gap: 18px; }
.label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 15px; color: var(--ink); }
.error { margin-top: 6px; font-size: 14px; color: var(--danger); }
.cf-turnstile { min-height: 0; }

/* ---- footer ---- */
.site-footer { margin-top: 96px; padding: 48px 0 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: grid; grid-template-columns: 1.6fr 1fr 1fr auto; gap: 32px; align-items: start; }
.site-footer .site-logo img { height: 30px; margin-bottom: 14px; }
.site-footer .list a { color: var(--text); }
.site-footer .list a:hover { color: var(--brand-ink); }
.lang { display: flex; gap: 4px; }
.lang a, .lang button {
  padding: 4px 10px; font-size: 13px; font-weight: 600; color: var(--muted);
  background: none; border: 1px solid transparent; border-radius: 999px; cursor: pointer;
}
.lang [aria-current="true"] { color: var(--ink); border-color: var(--line); }
@media (max-width: 767px) {
  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
  .site-footer .wrap > :first-child { grid-column: 1 / -1; }
}

/* ---- lists, titles, notes ---- */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.page-title { font-size: clamp(28px, 3.2vw, 38px); line-height: 1.12; letter-spacing: -.02em; margin-bottom: 10px; overflow-wrap: anywhere; }
.meta { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.meta a, .note a { color: var(--brand-ink); }
.note {
  padding: 12px 16px; margin-bottom: 20px; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.section { padding: 88px 0; border-top: 1px solid var(--line); }

/* ---- docs layout: rail · main · toc ---- */
.docs {
  display: grid; grid-template-columns: 220px minmax(0, 1fr) 220px; gap: 48px;
  max-width: var(--wrap); margin: 0 auto; padding: 40px 24px 0;
}
.docs-main { min-width: 0; max-width: var(--measure); }
.docs-rail, .docs-toc {
  position: sticky; top: 92px; align-self: start;
  max-height: calc(100vh - 110px); overflow-y: auto; font-size: 14px;
}
.docs-rail h2, .docs-toc h2 { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 10px; }
.docs-rail .list { gap: 1px; margin-bottom: 28px; }
.docs-rail .list a { display: block; padding: 5px 10px; border-radius: 7px; color: var(--text); }
.docs-rail .list a:hover { color: var(--ink); background: var(--surface); }
.docs-rail .list a[aria-current="page"] { color: var(--brand-ink); background: var(--tint); font-weight: 500; }
.docs-toc .list { gap: 2px; }
.docs-toc .list a { display: block; padding: 4px 0; color: var(--muted); line-height: 1.35; }
.docs-toc .list a:hover { color: var(--ink); }
.docs-main .find { margin-bottom: 26px; }
.article-cta { margin-top: 40px; }
/* In the HTML the article comes first (phones, screen readers); on wider screens
   the rail moves to the left column. */
@media (min-width: 768px) {
  .docs-rail { grid-column: 1; grid-row: 1; }
  .docs-main { grid-column: 2; grid-row: 1; }
  .docs-toc { grid-column: 3; grid-row: 1; }
}

/* two columns (no "on this page"): guides index, trades directory */
@media (min-width: 1200px) { .docs-2 { grid-template-columns: 220px minmax(0, 1fr); } }
.docs-2 .docs-main { max-width: none; }
.group { margin-top: 44px; scroll-margin-top: 92px; }
.group h2 { font-size: 22px; margin-bottom: 10px; }
.cols { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 28px; }
.cols a { display: block; padding: 7px 0; color: var(--ink); }
.cols a:hover { color: var(--brand-ink); }
.cols small { display: block; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 1199px) {
  .docs { grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
  .docs-toc { display: none; }
}
@media (max-width: 767px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 28px 16px 0; }
  .docs-rail { position: static; max-height: none; border-top: 1px solid var(--line); padding-top: 24px; }
  .jump { display: none; }
}

/* ---- article (rendered markdown) ---- */
.article { font-size: 16.5px; line-height: 1.72; color: var(--text); }
.article > * + * { margin-top: 18px; }
.article h2 { font-size: 24px; letter-spacing: -.01em; margin-top: 44px; scroll-margin-top: 92px; }
.article h3 { font-size: 19px; margin-top: 30px; scroll-margin-top: 92px; }
.article h2 + *, .article h3 + * { margin-top: 10px; }
.article a { color: var(--brand-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article strong { color: var(--ink); font-weight: 600; }
.article ul, .article ol { padding-left: 1.3em; }
.article li + li { margin-top: 6px; }
.article blockquote { margin: 22px 0 0; padding: 14px 18px; background: var(--surface); border-left: 3px solid var(--brand); border-radius: 0 var(--radius) var(--radius) 0; }
.article blockquote > * + * { margin-top: 10px; }
.article hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.article code { font-size: .92em; padding: 1px 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
/* code blocks (templates readers copy): wrap instead of widening the page */
.article pre { padding: 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }
.article pre code { padding: 0; font-size: inherit; background: none; border: 0; }
.article table, .table-wrap table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.article th, .table-wrap th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); }
.article td, .table-wrap td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; }
.article th:first-child, .table-wrap th:first-child { white-space: nowrap; }
@media (max-width: 767px) {
  .article table { display: block; overflow-x: auto; }
}

/* ---- KPD tool (/tools/kpd/) ----
   The kpd-* names are hooks the page's own script reads (copy all, CSV): keep them. */
.btn-line { color: var(--ink); background: none; border-color: var(--line); }
.btn-line.copied { color: var(--brand-ink); border-color: var(--brand); }
.tool { max-width: 860px; padding-top: 40px; }
.mode { border-top: 1px solid var(--line); padding: 14px 0; }
.mode summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.mode[open] summary { margin-bottom: 14px; }
.tool-form { display: grid; gap: 12px; }
.tool-form .btn { justify-self: start; }
.results { margin-top: 40px; display: grid; gap: 16px; }
.results h2 { font-size: 22px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.choices, .code-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.code-list li { display: flex; gap: 12px; align-items: baseline; }
.choice { display: flex; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.choice:hover { border-color: var(--brand); }
.kpd-result { padding-top: 14px; border-top: 1px solid var(--line); }
.kpd-result__query { font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.kpd-catalog__name { display: block; font-weight: 500; color: var(--ink); }
.kpd-catalog__official, .kpd-name { font-size: 14px; color: var(--muted); }
.kpd-catalog__official { display: block; }
.kpd-catalog__table td:nth-child(2) { white-space: nowrap; }
.kpd-catalog__codes { margin-top: 4px; }
.kpd-chip { font-size: 14px; }
.kpd-paste, .kpd-chooser { min-width: 0; }
.kpd-save-form { display: inline-flex; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* A KPD guide opens with a note pointing at the KPD tool; when the page shows the
   search field itself, that note would say the same thing twice. */
.article.has-search > blockquote:first-child:has(a[href^="/tools/kpd/"]) { display: none; }

/* a KPD code you can click to copy */
.kpd-code {
  display: inline; padding: 1px 6px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--ink); background: var(--tint); border: 0; border-radius: 6px; cursor: copy;
}
.kpd-code[data-state="copied"] { background: var(--brand); color: #fff; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
