/* Gatematix web — marketing site. Pure CSS, no framework, no web fonts. Light/dark by
   prefers-color-scheme. Tokens first; components below. */

:root {
  --bg: #f7f8f6;
  --bg-alt: #eef1ed;
  --surface: #ffffff;
  --ink: #0f1d1b;
  --ink-2: #3d4c49;
  --muted: #5d6b68;
  --line: #d9dfdb;
  --brand: #0f6b5c;
  --brand-ink: #ffffff;
  --brand-soft: #dcefe9;
  --accent: #d98a00;
  --accent-soft: #fff1d6;
  --ok: #187a3e;
  --ok-soft: #dff3e6;
  --warn: #8a5a00;
  --warn-soft: #fff1d6;
  --bad: #b3261e;
  --bad-soft: #fde4e1;
  --band: #0f2a26;
  --band-ink: #f2f7f5;
  --focus: #1b74e4;
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(15, 29, 27, .06), 0 8px 24px rgba(15, 29, 27, .07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1514;
    --bg-alt: #121d1b;
    --surface: #16221f;
    --ink: #e8efec;
    --ink-2: #c3cfcb;
    --muted: #93a29e;
    --line: #26332f;
    --brand: #3fbfa6;
    --brand-ink: #06231d;
    --brand-soft: #173a33;
    --accent: #f2b23c;
    --accent-soft: #3a2d12;
    --ok: #5fd08b;
    --ok-soft: #173426;
    --warn: #f2b23c;
    --warn-soft: #3a2d12;
    --bad: #ff8a80;
    --bad-soft: #3d1a18;
    --band: #0a3a32;
    --band-ink: #eaf6f2;
    --focus: #7db4ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.015em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--ink-2); }
.narrow { max-width: 46rem; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .09em; font-size: .78rem; font-weight: 700;
  color: var(--brand); margin-bottom: .6em;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50; padding: 10px 14px;
  background: var(--surface); color: var(--ink); border-radius: var(--radius-s); box-shadow: var(--shadow);
}
.skip:focus { top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: transform .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-small { min-height: 38px; padding: 0 16px; font-size: .92rem; }
.btn-invert { background: var(--band-ink); color: var(--band); border-color: var(--band-ink); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 20px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; margin: 0; }
.brand-mark { width: 30px; height: 30px; fill: var(--ink); }
.brand-mark .bar { fill: var(--accent); }
.brand-mark .dot { fill: var(--brand); }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink-2);
  text-decoration: none; font-weight: 600; font-size: .95rem;
}
.nav a:hover { background: var(--bg-alt); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang { position: relative; }
.lang summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px;
  font-weight: 700; font-size: .85rem; color: var(--ink-2); background: var(--surface);
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.lang ul {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px; margin: 0; padding: 6px;
  list-style: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-s); box-shadow: var(--shadow);
}
.lang ul a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.lang ul a:hover { background: var(--bg-alt); }
.lang ul a[aria-current="true"] { font-weight: 700; color: var(--brand); }

/* First-visit language suggestion (LangPref): no script; both options are plain links. */
.langbanner { background: var(--brand-soft); border-bottom: 1px solid var(--line); color: var(--ink); }
.langbanner-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 0; }
.langbanner p { margin: 0; font-weight: 600; }
.langbanner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.langbanner-keep { color: var(--ink-2); font-weight: 600; font-size: .92rem; }

@media (max-width: 820px) {
  .header-row { flex-wrap: wrap; gap: 8px 12px; padding: 10px 0; }
  .header-actions { margin-left: auto; }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .nav ul { gap: 2px; }
  .nav a { padding: 6px 10px; font-size: .9rem; white-space: nowrap; }
}

/* Sections */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-alt { background: var(--bg-alt); }
.page-head { padding: clamp(48px, 7vw, 92px) 0 0; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.split-rev > :first-child { order: 2; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split-rev > :first-child { order: 0; } }

/* Hero */
.hero { padding: clamp(48px, 8vw, 110px) 0 clamp(56px, 8vw, 100px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 28px; }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--ink-2); font-size: .98rem; }
.hero-points li { padding-left: 28px; position: relative; }
.hero-points li::before, .checks li::before {
  content: ""; position: absolute; left: 0; top: .42em; width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand-soft) linear-gradient(var(--brand), var(--brand)) no-repeat center / 6px 6px;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-visual { position: relative; min-height: 380px; }
.mock-pass {
  position: relative; margin-left: auto; width: min(320px, 100%); padding: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
}
.mock-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 0 0 4px; }
.mock-name { font-weight: 700; margin: 0 0 14px; }
.mock-code { font: 700 2rem/1 var(--mono); letter-spacing: .08em; color: var(--brand); margin: 0 0 8px; }
.mock-meta { color: var(--muted); font-size: .9rem; margin: 0 0 18px; }
.mock-qr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 112px; }
.mock-qr span { aspect-ratio: 1; border-radius: 4px; background: var(--ink); }
.mock-qr span:nth-child(2), .mock-qr span:nth-child(4), .mock-qr span:nth-child(8) { background: var(--line); }
.mock-qr span:nth-child(5) { background: var(--accent); }
.mock-alert {
  position: absolute; left: 0; bottom: 8px; display: flex; gap: 12px; align-items: flex-start;
  width: min(320px, 92%); padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.mock-dot { flex: none; width: 12px; height: 12px; margin-top: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 5px var(--ok-soft); }
.mock-alert-title { font-weight: 700; margin: 0; font-size: .95rem; }
.mock-alert-text { margin: 0; color: var(--muted); font-size: .9rem; }
@media (max-width: 900px) {
  .hero-visual { min-height: 0; display: grid; gap: 16px; }
  .mock-pass { margin: 0; }
  .mock-alert { position: static; }
}

/* Steps */
.steps { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: none; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.step-num {
  display: inline-grid; place-items: center; width: 38px; height: 38px; margin-bottom: 14px;
  border-radius: 50%; background: var(--accent-soft); color: var(--warn); font-weight: 800;
}
.step p { color: var(--ink-2); margin: 0; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* Lists */
.checks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 28px; color: var(--ink-2); }

/* Quote / ledger mocks */
.quote-card {
  margin: 0; padding: 30px; background: var(--surface); border: 1px solid var(--line);
  border-left: 5px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow);
}
.quote-card blockquote { margin: 0; font-size: 1.2rem; font-weight: 600; }
.quote-card figcaption { margin-top: 12px; color: var(--muted); font-size: .9rem; }
.ledger { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ledger-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pill { flex: none; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-wait { background: var(--warn-soft); color: var(--warn); }
.pill-late { background: var(--bad-soft); color: var(--bad); }
.ledger-bar { margin: 18px 0 8px; height: 10px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; }
.ledger-bar span { display: block; width: 92%; height: 100%; background: var(--brand); border-radius: inherit; }
.ledger-foot { margin: 0; color: var(--muted); font-size: .9rem; }

/* Cards */
.cards { display: grid; gap: 20px; margin-top: 32px; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .cards-2, .cards-3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.card p { color: var(--ink-2); margin: 0; }
.card h2 { font-size: 1.2rem; }
.card-app { border-top: 4px solid var(--brand); }
.card-app + .card-app { border-top-color: var(--accent); }

/* CTA band */
.cta-band { background: var(--band); color: var(--band-ink); }
.cta-band p { color: color-mix(in srgb, var(--band-ink) 82%, transparent); margin: 0; }
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }

/* Features page */
.feature-list { display: grid; gap: 18px; }
.feature {
  display: grid; grid-template-columns: 72px 1fr; gap: 20px; padding: 30px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.feature-num { font: 800 1.6rem/1 var(--mono); color: var(--accent); }
.feature h2 { font-size: 1.4rem; }
.feature p { color: var(--ink-2); }
@media (max-width: 640px) { .feature { grid-template-columns: 1fr; gap: 8px; padding: 22px; } }

/* Pricing */
.tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: stretch; }
.tier {
  display: flex; flex-direction: column; padding: 26px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.tier .checks { margin-bottom: 24px; }
.tier .btn { margin-top: auto; }
.tier-featured { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.tier h2 { font-size: 1.35rem; margin-bottom: .2em; }
.tier-tag { color: var(--muted); font-size: .95rem; min-height: 3em; }
.tier-price { font-weight: 800; font-size: 1.1rem; color: var(--brand); padding: 12px 0; border-block: 1px solid var(--line); }
@media (max-width: 1020px) { .tiers { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .tiers { grid-template-columns: 1fr; } }
.note { margin-top: 28px; color: var(--muted); max-width: 52rem; font-size: .95rem; }
/* Pricing — published prices (PricingController) */
.tiers-1 { grid-template-columns: minmax(0, 360px); }
.tiers-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiers-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tier-price p { margin: 0; }
.tier-amount { font-size: 1.6rem; line-height: 1.2; overflow-wrap: anywhere; }
.tier-amount-text { font-size: 1.1rem; }
.tier-per { font-size: .95rem; font-weight: 600; color: var(--muted); }
.tier-period { font-weight: 600; font-size: .95rem; color: var(--ink-2); margin-top: 4px !important; }
.tier-save {
  display: inline-block; margin-top: 8px !important; padding: 2px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--warn); font-size: .85rem; font-weight: 700;
}
.tier-limits-head { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.tier-limits { margin: 0 0 24px; display: grid; gap: 0; }
.tier-limits div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.tier-limits div:last-child { border-bottom: 0; }
.tier-limits dt { color: var(--ink-2); }
.tier-limits dd { margin: 0; font-weight: 700; text-align: end; color: var(--ink); }
.tier-limits .limit-off dt, .tier-limits .limit-off dd { color: var(--muted); font-weight: 400; }
.currency-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 22px; }
.currency-switch-label { font-weight: 700; color: var(--ink-2); }
.currency-switch ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.currency-switch a {
  display: inline-block; min-width: 3.4em; text-align: center; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 700 .9rem/1.2 var(--mono); text-decoration: none;
}
.currency-switch a:hover { border-color: var(--brand); }
.currency-switch a[aria-current="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
@media (max-width: 1020px) { .tiers-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .tiers-1, .tiers-2, .tiers-3 { grid-template-columns: 1fr; } }

/* Security */
.arch { margin: 0 0 12px; padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.arch-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.arch-flow li {
  position: relative; padding: 18px; border-radius: var(--radius-s); background: var(--bg-alt);
  border: 1px solid var(--line); display: grid; gap: 6px;
}
.arch-flow li:nth-child(3) { background: var(--brand-soft); border-color: var(--brand); }
.arch-flow li span { color: var(--muted); font-size: .9rem; }
.arch-flow li:not(:last-child)::after {
  content: "→"; position: absolute; right: -14px; top: 50%; transform: translate(50%, -50%);
  color: var(--muted); font-weight: 700;
}
.arch figcaption { margin-top: 14px; color: var(--muted); font-size: .92rem; }
@media (max-width: 860px) {
  .arch-flow { grid-template-columns: 1fr; }
  .arch-flow li:not(:last-child)::after { content: "↓"; right: 50%; top: auto; bottom: -14px; transform: translate(50%, 50%); }
}
.callout { margin-top: 28px; padding: 24px 26px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.callout h2 { font-size: 1.2rem; }
.callout p { margin: 0; }

/* FAQ */
.faq { max-width: 52rem; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; color: var(--brand); font-weight: 400;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item summary h2 { display: inline; font-size: 1.12rem; margin: 0; }
.faq-item p { color: var(--ink-2); padding: 0 0 18px; margin: 0; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.form { display: grid; gap: 18px; padding: clamp(20px, 3vw, 32px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.field { display: grid; gap: 6px; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
.form label { font-weight: 650; font-size: .95rem; }
.form .opt { color: var(--muted); font-weight: 400; font-size: .88rem; }
.form .req { color: var(--bad); }
.form input, .form select, .form textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s);
}
.form textarea { resize: vertical; min-height: 160px; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--brand); outline: 3px solid color-mix(in srgb, var(--brand) 30%, transparent); outline-offset: 0; }
.form [aria-invalid="true"] { border-color: var(--bad); }
.form .btn { justify-self: start; }
.hint { color: var(--muted); font-size: .88rem; margin: 0; }
.field-error { color: var(--bad); font-size: .9rem; font-weight: 600; margin: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 18px 20px; border-radius: var(--radius-s); margin-bottom: 20px; }
.alert h2 { font-size: 1.15rem; margin-bottom: .3em; }
.alert p { margin: 0; }
.alert-ok { background: var(--ok-soft); color: var(--ink); border: 1px solid var(--ok); }
.alert-error { background: var(--bad-soft); color: var(--ink); border: 1px solid var(--bad); }

/* 404 */
.page-404 { padding-bottom: clamp(56px, 8vw, 110px); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-alt); padding: 56px 0 24px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
.site-footer h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--brand); text-decoration: underline; }
.site-footer a[aria-current="true"] { color: var(--brand); font-weight: 700; }
.footer-base { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }
.footer-base p { margin: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 12px;
  border-radius: 10px; background: var(--ink); color: var(--bg); line-height: 1.15; font-weight: 700;
  opacity: .9;
}
.badge svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.badge > span { display: grid; }
.badge small { font-weight: 500; font-size: .7rem; opacity: .8; }
