/* ---------------------------------------------------------------------------
   Citri for brands - built from design-system/citri/MASTER.md and tokens.json.
   Shared by / (English) and /cs/ (Czech). No build step, no external
   requests, no framework.

   Dark values live on :root, light values redefine the same names under
   .tone-light. No component references a hex directly.
   Typography: Archivo (prose, headlines, buttons, wordmark), IBM Plex Mono
   (stats, table cells, labels, prices, eyebrows).
   --------------------------------------------------------------------------- */

:root {
  /* --- tokens.json, dark theme (the default). ------------------------------ */
  --surface: #101214;
  --surface-raised: #191C1F;
  --border: #23272B;
  --border-subtle: #1F2326;
  --ink: #F2F1EC;
  --ink-muted: #9A9C99;
  --brand: #67C971;
  --brand-strong: #67C971;
  --brand-hover: #86D68D;
  --on-brand: #0F1A12;
  --tag: #FBE56F;
  --on-tag: #1B1B1B;
  --wordmark-hero: var(--tag);
  --delta-good: var(--brand);
  --delta-bad: #F0716F;

  /* --- spacing and radius, tokens.json ------------------------------------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-18: 72px;
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --dur-fast: 150ms;
  --dur-base: 200ms;

  --font-sans: "Archivo", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo,
    monospace;

  /* Content max-width 1136px; page inset 72px on desktop, 16px on phones. */
  --content: 1136px;
  --inset: clamp(var(--space-4), 5.6vw, var(--space-18));
  --header-h: 72px;
  --z-header: 40;
}

/* --- light theme ---------------------------------------------------------------
   The same variable names, light values. .tone-light--raised is the alternate
   ground inside the light run. Buttons keep --brand fill / --on-brand text in
   both themes.
   --------------------------------------------------------------------------- */

.tone-light {
  --surface: #F2F1EC;
  --surface-raised: #FFFFFF;
  --border: #D9D8D3;
  --border-subtle: #E6E5E0;
  --ink: #101214;
  --ink-muted: #5C5F5D;
  --brand-strong: #257A34;
  --delta-good: var(--brand-strong);
  --delta-bad: #B8433F;
  background: var(--surface);
  color: var(--ink);
}

.tone-light--raised {
  background: var(--surface-raised);
  border-top: 1px solid var(--border);
}

/* --- base ------------------------------------------------------------------- */

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

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

[id] {
  scroll-margin-top: calc(var(--header-h) + var(--space-4));
}

body {
  margin: 0;
  background-color: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 600;
  text-wrap: balance;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.tone-light :focus-visible {
  outline-color: var(--brand-strong);
}

.shell {
  width: min(100% - 2 * var(--inset), var(--content));
  margin-inline: auto;
}

.visually-hidden,
.trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--space-2);
  top: -4rem;
  z-index: calc(var(--z-header) + 10);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--dur-fast) ease;
}

.skip:focus {
  top: var(--space-2);
}

/* --- type ------------------------------------------------------------------- */

.mono {
  font-family: var(--font-mono);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.h2 {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.h3 {
  font-size: 20px;
  line-height: 1.3;
}

.h3--sm {
  font-size: 15px;
}

.lead {
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.body-muted {
  color: var(--ink-muted);
}

.cap {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-muted);
}

.stat {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
}

/* --- wordmark (MASTER.md "Wordmark (L3e)") ------------------------------------
   Live text with a dotless i (U+0131) and an absolutely positioned bar: 0.26em
   wide, 0.10em tall, top 0.10em, centred on the stem. Sizes are set by the
   parent: 22px header, 18px footer, 15px report header, 44/36px hero.
   --------------------------------------------------------------------------- */

.wordmark {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}

.wordmark__i {
  position: relative;
  display: inline-block;
}

.wordmark__bar {
  position: absolute;
  left: 50%;
  top: 0.1em;
  width: 0.26em;
  height: 0.1em;
  margin-left: -0.13em;
  background: var(--brand);
}

.tone-light .wordmark__bar {
  background: var(--brand-strong);
}

.wordmark--hero {
  font-size: 44px;
}

.wordmark--hero .wordmark__bar {
  background: var(--wordmark-hero);
}

.descriptor {
  font-size: 13px;
  line-height: 1;
  font-weight: 400;
  color: var(--ink-muted);
}

/* --- buttons and links ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 var(--space-6);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: var(--on-brand);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-base) ease;
}

.btn:hover {
  background: var(--brand-hover);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--sm {
  height: 44px;
}

.link {
  color: var(--brand-strong);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--dur-base) ease;
}

.link:hover {
  color: var(--brand-hover);
}

.tone-light .link:hover {
  opacity: 0.8;
  color: var(--brand-strong);
}

/* --- header ----------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header__bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-8);
  height: var(--header-h);
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.lockup .wordmark {
  font-size: 22px;
}

.lockup__rule {
  width: 1px;
  height: 18px;
  background: var(--border);
}

.site-header__panel {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-left: auto;
}

.nav {
  display: flex;
  gap: var(--space-6);
}

.nav a,
.lang-switch {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color var(--dur-base) ease;
}

.nav a:hover,
.lang-switch:hover {
  color: var(--ink);
}

.nav a[aria-current="true"] {
  color: var(--brand);
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--ink);
  cursor: pointer;
}

.menu-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

/* --- sections ----------------------------------------------------------------- */

.band {
  padding-block: var(--space-18);
}

.band--strip {
  padding-block: var(--space-8);
  border-block: 1px solid var(--border);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-8);
}

.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.stack--6 {
  gap: var(--space-6);
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

/* --- hero ------------------------------------------------------------------- */

.hero-eyebrow {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.hero h1 {
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.accent {
  color: var(--brand);
}

.hero .lead {
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-6);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-muted);
}

.card-head .live {
  color: var(--brand);
}

.tone-light .card-head .live {
  color: var(--brand-strong);
}

/* --- stats strip ---------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-8);
}

.stats > div,
.fact {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.fact {
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.cases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

.case {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

.step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: var(--space-4);
  border-top: 2px solid var(--ink);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--brand-strong);
}

/* --- report tables ------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
}

th {
  padding: var(--space-2) 12px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-muted);
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--ink);
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

/* Chain and product/SKU cells may wrap so the verdict column stays on screen
   at desktop widths; narrower than that the card scrolls sideways. */
.table--wrap td:nth-child(-n + 2) {
  white-space: normal;
}

.hero th,
.hero td {
  padding-inline: var(--space-2);
}

.r {
  text-align: right;
}

.tag {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--tag);
  color: var(--on-tag);
  font-weight: 600;
}

.v-good,
.v-bad {
  font-weight: 600;
}

.v-good { color: var(--delta-good); }
.v-bad { color: var(--delta-bad); }
td.v-mute,
.mute { color: var(--ink-muted); }

.report-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.report-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.report-brand .wordmark {
  font-size: 15px;
}

.report-meta {
  margin-left: auto;
}

.report-meta b {
  font-weight: 400;
  color: var(--ink);
}

.report-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-strip {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

/* --- chains ----------------------------------------------------------------------- */

.chains {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-4);
}

.chain {
  padding: 14px var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

/* --- price ------------------------------------------------------------------------ */

.price-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-8);
  padding: var(--space-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.price-panel > div {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.price-panel .price-cta {
  grid-column: span 2;
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.price-unit {
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-muted);
}

/* --- faq -------------------------------------------------------------------------- */

.faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6) var(--space-8);
}

.faq > div {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* --- pilot form ------------------------------------------------------------------- */

.bullets {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-left: 18px;
  color: var(--ink-muted);
  list-style: disc;
}

.form-card {
  padding: var(--space-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field > span {
  font-size: 13px;
  color: var(--ink-muted);
}

/* 16px keeps iOS from zooming on focus. */
.field input {
  height: 48px;
  padding: 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  transition: border-color var(--dur-base) ease;
}

.field input:hover {
  border-color: var(--ink-muted);
}

.field input:focus-visible {
  border-color: var(--brand);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.form-note {
  margin-top: var(--space-4);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-muted);
}

.form-status {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
}

.form-status:empty {
  display: none;
}

/* Form validation is the one place outside table verdicts --delta-bad is allowed. */
.form-status[data-state="error"] {
  background: color-mix(in srgb, var(--delta-bad) 12%, transparent);
  border: 1px solid var(--delta-bad);
  color: var(--delta-bad);
}

.form-status[data-state="ok"] {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--ink);
}

/* --- footer ----------------------------------------------------------------------- */

.site-footer {
  padding: var(--space-8) 0 var(--space-12);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-brand .wordmark {
  font-size: 18px;
}

.footer-row .link {
  margin-left: auto;
}

.footer-disclaimer {
  max-width: 880px;
  margin-top: var(--space-6);
}

/* --- responsive ------------------------------------------------------------------- */

.show-sm {
  display: none;
}

@media (max-width: 1000px) {
  .grid-12 > * {
    grid-column: 1 / -1;
  }

  .cases,
  .steps {
    grid-template-columns: 1fr;
  }

  .chains {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  :root {
    --header-h: 64px;
  }

  .menu-btn {
    display: none;
  }

  .js-menu .menu-btn {
    display: inline-flex;
  }

  /* Without JS the panel is a plain wrapped row under the bar. */
  .site-header__bar {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-h);
    gap: var(--space-2);
  }

  .site-header__panel {
    flex-basis: 100%;
    flex-wrap: wrap;
    margin-left: 0;
    padding-bottom: var(--space-4);
    gap: var(--space-4);
  }

  .js-menu .site-header__bar {
    height: var(--header-h);
  }

  .js-menu .site-header__panel {
    display: none;
    position: absolute;
    top: 100%;
    left: calc(-1 * var(--inset));
    right: calc(-1 * var(--inset));
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-4) var(--inset) var(--space-6);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }

  .js-menu .site-header__panel.is-open {
    display: flex;
  }

  .nav {
    flex-direction: column;
    gap: var(--space-4);
  }
}

@media (max-width: 640px) {
  .band {
    padding-block: var(--space-12);
  }

  .hero {
    padding-block: 40px var(--space-6);
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero .lead {
    font-size: 15px;
  }

  .wordmark--hero {
    font-size: 36px;
  }

  .hero-eyebrow {
    gap: 10px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
  }

  .hero-actions .link {
    align-self: flex-start;
  }

  .hero .card {
    padding: var(--space-4);
    gap: 12px;
  }

  th,
  td {
    padding-inline: var(--space-2);
  }

  /* Phones: no wrapping, the card scrolls sideways instead. */
  .table--wrap td:nth-child(-n + 2) {
    white-space: nowrap;
  }

  .hide-sm {
    display: none;
  }

  .show-sm {
    display: inline;
  }

  .h2 {
    font-size: 28px;
  }

  .stats,
  .facts,
  .faq,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6) var(--space-4);
  }

  .chains {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .price-panel {
    grid-template-columns: 1fr;
    padding: var(--space-6);
  }

  .price-panel .price-cta {
    grid-column: auto;
  }

  .form-card {
    padding: var(--space-6);
  }

  .report-meta {
    margin-left: 0;
  }

  .footer-row .link {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
