/* Design tokens — Sumsub-style system: near-black ink, one vivid blue, light-lavender
   cards, 8px buttons, regular-weight display type with tight tracking, mint accents
   on dark sections. Light is default; dark follows the OS unless html[data-theme]. */

/* Flag emoji for Windows (which has none). Only regional-indicator code points
   use it, so the rest of the text is unaffected. Twemoji, CC-BY 4.0. */
@font-face {
  font-family: "Twemoji Country Flags";
  src: url("../fonts/TwemojiCountryFlags.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f3f4f9;
  --bg-tint: #e9f0ff;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --surface-3: #eceef5;
  --line: #e3e5ec;
  --line-strong: #cbd0db;
  --text: #0a0c0e;
  --text-2: #3a3e45;
  --muted: #5d626b;
  --accent: #1764ff;
  --accent-hover: #0d50dc;
  --accent-btn: #1764ff;
  --accent-btn-hover: #0d50dc;
  --accent-text: #1764ff;
  --accent-ink: #ffffff;
  --accent-soft: #e7efff;
  --accent-2: #00b386;
  --accent-3: #7b4dff;
  --mint: #33f5c4;
  --mint-hover: #5cf8d2;
  --mint-ink: #04241b;
  --ink: #0a0c0e;          /* dark section background (both themes) */
  --ink-2: #16191d;        /* cards on dark sections */
  --ink-line: rgba(255, 255, 255, 0.12);
  --ink-text: #ffffff;
  --ink-muted: rgba(255, 255, 255, 0.7);
  --invert-bg: #0a0c0e;
  --invert-text: #ffffff;
  --good: #0ca30c;
  --good-text: #067a06;
  --good-soft: #e3f6e3;
  --warning: #fab219;
  --warning-text: #8a5a00;
  --warning-soft: #fff3d6;
  --critical: #d03b3b;
  --critical-text: #b32626;
  --critical-soft: #fde6e6;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --radius-btn: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 1px 2px rgba(10, 12, 14, 0.04), 0 12px 32px -14px rgba(10, 12, 14, 0.16);
  --shadow-lg: 0 30px 80px -30px rgba(10, 12, 14, 0.3);
  --font: "Twemoji Country Flags", "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --max: 100vw; /* full-bleed like Sumsub: content spans the page, only the gutter stays */
  --gutter: 56px;
  --section: 96px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0c0e;
    --bg-soft: #15171c;
    --bg-tint: #101a33;
    --surface: #111317;
    --surface-2: #181b21;
    --surface-3: #22262e;
    --line: #23272e;
    --line-strong: #343a44;
    --text: #f2f3f5;
    --text-2: #bcc0c8;
    --muted: #8d929c;
    --accent: #3d7dff;
    --accent-hover: #5c91ff;
    --accent-btn: #1764ff;
    --accent-btn-hover: #2f74ff;
    --accent-text: #7fa6ff;
    --accent-soft: #14213f;
    --ink: #050607;
    --ink-2: #121418;
    --invert-bg: #f2f3f5;
    --invert-text: #0a0c0e;
    --good-text: #3ddc84;
    --good-soft: #0f2a1a;
    --warning-text: #ffc94d;
    --warning-soft: #2e2410;
    --critical-text: #ff8a8a;
    --critical-soft: #331616;
    --series-1: #3987e5;
    --series-2: #d95926;
    --grid: #262a31;
    --axis: #3a404a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0c0e;
  --bg-soft: #15171c;
  --bg-tint: #101a33;
  --surface: #111317;
  --surface-2: #181b21;
  --surface-3: #22262e;
  --line: #23272e;
  --line-strong: #343a44;
  --text: #f2f3f5;
  --text-2: #bcc0c8;
  --muted: #8d929c;
  --accent: #3d7dff;
  --accent-hover: #5c91ff;
  --accent-btn: #1764ff;
  --accent-btn-hover: #2f74ff;
  --accent-text: #7fa6ff;
  --accent-soft: #14213f;
  --ink: #050607;
  --ink-2: #121418;
  --invert-bg: #f2f3f5;
  --invert-text: #0a0c0e;
  --good-text: #3ddc84;
  --good-soft: #0f2a1a;
  --warning-text: #ffc94d;
  --warning-soft: #2e2410;
  --critical-text: #ff8a8a;
  --critical-soft: #331616;
  --series-1: #3987e5;
  --series-2: #d95926;
  --grid: #262a31;
  --axis: #3a404a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  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; }
::selection { background: var(--accent-soft); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.mono {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0;
}

/* Buttons: 8px radius, medium weight — large (56px) by default, .btn-sm = header size. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 32px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.btn svg { transition: transform 0.2s ease; }
.btn:hover svg:last-child { transform: translateX(3px); }
.btn-primary { background: var(--accent-btn); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-btn-hover); }
.btn-mint { background: var(--mint); color: var(--mint-ink); }
.btn-mint:hover { background: var(--mint-hover); }
.btn-dark { background: var(--invert-bg); color: var(--invert-text); }
.btn-dark:hover { opacity: 0.86; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--line-strong); }
.btn-light { background: #fff; color: #0a0c0e; }
.btn-light:hover { background: #eef1f7; }
.btn-outline-light { border-color: rgba(255, 255, 255, 0.5); color: #fff; }
.btn-outline-light:hover { border-color: #fff; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 16px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-btn);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-strong); }

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-btn);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(10, 12, 14, 0.12); }

/* Language menu (lang-menu.js): Sumsub-like "globe English ▾" trigger + small card
   dropdown. .is-up / .is-start are set by JS when the list would leave the viewport. */
.lang-menu { position: relative; display: inline-flex; flex: none; }
.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease;
}
.lang-trigger:hover,
.lang-menu.is-open .lang-trigger { background: var(--bg-soft); }
.lang-globe { width: 16px; height: 16px; flex: none; }
.lang-chev { width: 12px; height: 12px; flex: none; color: var(--muted); transition: transform 0.2s ease; }
.lang-menu.is-open .lang-chev { transform: rotate(180deg); }
.lang-short { display: none; } /* pages show it instead of .lang-long where space is tight */
.lang-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 90;
  min-width: 184px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(10, 12, 14, 0.04), 0 16px 40px -12px rgba(10, 12, 14, 0.22);
  transform-origin: top right;
  animation: lang-pop 0.16s ease;
}
.lang-list[hidden] { display: none; }
.lang-menu.is-start .lang-list { right: auto; left: 0; transform-origin: top left; }
.lang-menu.is-up .lang-list { top: auto; bottom: calc(100% + 6px); }
.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}
.lang-item:hover,
.lang-item:focus-visible { background: var(--bg-soft); outline: none; }
.lang-item:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.lang-item[aria-checked="true"] { font-weight: 500; }
.lang-tick { width: 16px; height: 16px; flex: none; color: var(--accent-text); visibility: hidden; }
.lang-item[aria-checked="true"] .lang-tick { visibility: visible; }
@keyframes lang-pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }

/* Theme toggle (theme.js + theme-icon.js): one icon that morphs — crescent moon in the
   light theme, sun in the dark one. Pure CSS from the theme on <html>, so it is right
   before any script runs. */
.theme-switch {
  --ts-size: 36px;
  --ts-icon: 20px;
  flex: none;
  width: var(--ts-size);
  height: var(--ts-size);
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.theme-switch:hover { background: var(--bg-soft); }
.theme-switch:active svg { transform: scale(0.9); }
.theme-switch svg { width: var(--ts-icon); height: var(--ts-icon); overflow: visible; transition: transform 0.15s ease; }
.theme-switch .ts-core,
.theme-switch .ts-bite,
.theme-switch .ts-rays { transform-box: view-box; transform-origin: 12px 12px; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease; }
/* Light theme → moon: full disc with a bite, no rays. */
.theme-switch .ts-rays { opacity: 0; transform: rotate(-60deg) scale(0.5); }
/* Dark theme → sun: small disc, bite slides away, rays spin in. */
:root[data-theme="dark"] .theme-switch .ts-core { transform: scale(0.52); }
:root[data-theme="dark"] .theme-switch .ts-bite { transform: translate(9px, -9px); }
:root[data-theme="dark"] .theme-switch .ts-rays { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-switch .ts-core { transform: scale(0.52); }
  :root:not([data-theme="light"]) .theme-switch .ts-bite { transform: translate(9px, -9px); }
  :root:not([data-theme="light"]) .theme-switch .ts-rays { opacity: 1; transform: none; }
}
.theme-switch-lg { --ts-size: 44px; --ts-icon: 22px; }

/* Theme change (theme.js adds html.theme-anim briefly). The colour TOKENS themselves are
   registered (@property) and transitioned once on <html>; every element reads the same
   interpolated value at the same moment — no per-element transitions, so deeply nested
   (inherited) text no longer lags behind elements with explicit colours. */
@property --bg { syntax: "<color>"; inherits: true; initial-value: #fff; }
@property --bg-soft { syntax: "<color>"; inherits: true; initial-value: #f3f4f9; }
@property --bg-tint { syntax: "<color>"; inherits: true; initial-value: #e9f0ff; }
@property --surface { syntax: "<color>"; inherits: true; initial-value: #fff; }
@property --surface-2 { syntax: "<color>"; inherits: true; initial-value: #f6f7fb; }
@property --surface-3 { syntax: "<color>"; inherits: true; initial-value: #eceef5; }
@property --line { syntax: "<color>"; inherits: true; initial-value: #e3e5ec; }
@property --line-strong { syntax: "<color>"; inherits: true; initial-value: #cbd0db; }
@property --text { syntax: "<color>"; inherits: true; initial-value: #0a0c0e; }
@property --text-2 { syntax: "<color>"; inherits: true; initial-value: #3a3e45; }
@property --muted { syntax: "<color>"; inherits: true; initial-value: #5d626b; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #1764ff; }
@property --accent-text { syntax: "<color>"; inherits: true; initial-value: #1764ff; }
@property --accent-soft { syntax: "<color>"; inherits: true; initial-value: #e7efff; }
@property --invert-bg { syntax: "<color>"; inherits: true; initial-value: #0a0c0e; }
@property --invert-text { syntax: "<color>"; inherits: true; initial-value: #fff; }
@property --good-text { syntax: "<color>"; inherits: true; initial-value: #067a06; }
@property --good-soft { syntax: "<color>"; inherits: true; initial-value: #e3f6e3; }
@property --warning-text { syntax: "<color>"; inherits: true; initial-value: #8a5a00; }
@property --warning-soft { syntax: "<color>"; inherits: true; initial-value: #fff3d6; }
@property --critical-text { syntax: "<color>"; inherits: true; initial-value: #b32626; }
@property --critical-soft { syntax: "<color>"; inherits: true; initial-value: #fde6e6; }
@property --grid { syntax: "<color>"; inherits: true; initial-value: #e1e0d9; }
@property --axis { syntax: "<color>"; inherits: true; initial-value: #c3c2b7; }

html.theme-anim {
  --theme-fade: 0.3s ease;
  transition: --bg var(--theme-fade), --bg-soft var(--theme-fade), --bg-tint var(--theme-fade),
    --surface var(--theme-fade), --surface-2 var(--theme-fade), --surface-3 var(--theme-fade),
    --line var(--theme-fade), --line-strong var(--theme-fade), --text var(--theme-fade), --text-2 var(--theme-fade),
    --muted var(--theme-fade), --accent var(--theme-fade), --accent-text var(--theme-fade), --accent-soft var(--theme-fade),
    --invert-bg var(--theme-fade), --invert-text var(--theme-fade), --good-text var(--theme-fade), --good-soft var(--theme-fade),
    --warning-text var(--theme-fade), --warning-soft var(--theme-fade), --critical-text var(--theme-fade),
    --critical-soft var(--theme-fade), --grid var(--theme-fade), --axis var(--theme-fade);
}
/* While the tokens ease, element-level transitions (hover colours etc.) would chase
   the moving values and lag — switch them off for that moment. */
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after { transition: none !important; }
/* …except the logo crossfade and the toggle's own morph. */
.logo-mark::before,
.logo-mark::after,
html.theme-anim .logo-mark::before,
html.theme-anim .logo-mark::after { transition: opacity 0.3s ease !important; }
html.theme-anim .theme-switch .ts-core,
html.theme-anim .theme-switch .ts-bite,
html.theme-anim .theme-switch .ts-rays { transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease !important; }
/* On always-dark surfaces */
.on-ink .theme-switch { color: var(--ink-text); }
.on-ink .theme-switch:hover { background: rgba(255, 255, 255, 0.1); }
.on-ink .lang-trigger { color: var(--ink-text); }
.on-ink .lang-trigger:hover, .on-ink .lang-menu.is-open .lang-trigger { background: rgba(255, 255, 255, 0.1); }

/* Logo: mark (assets/img/logo-mark.svg) + lowercase wordmark. */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.03em;
  text-transform: lowercase;
  color: var(--text);
}
/* Mark is the wavy "f" (176:160): violet on light, white (logo-mark-white.svg) on dark
   theme and on always-dark surfaces (footer, ink sections). */
/* Both versions are stacked and crossfaded via opacity, so a theme change is smooth. */
.logo-mark {
  position: relative;
  width: 35px;
  height: 32px;
  flex: none;
}
.logo-mark::before,
.logo-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/logo-mark.svg") center / contain no-repeat;
}
.logo-mark::after { background-image: url("../img/logo-mark-white.svg"); opacity: 0; }
:root[data-theme="dark"] .logo-mark::before,
.site-footer .logo-mark::before,
.on-ink .logo-mark::before { opacity: 0; }
:root[data-theme="dark"] .logo-mark::after,
.site-footer .logo-mark::after,
.on-ink .logo-mark::after { opacity: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-mark::before { opacity: 0; }
  :root:not([data-theme="light"]) .logo-mark::after { opacity: 1; }
}
.logo-mark > svg { display: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent-text);
  white-space: nowrap;
}

@media (max-width: 1024px) {
  :root { --gutter: 32px; --section: 72px; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; --section: 56px; }
  .btn { min-height: 50px; padding: 0 24px; font-size: 17px; }
  .btn-sm { min-height: 38px; padding: 0 12px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ===== Accent: brand violet (from the logo) =====
   Trial. To go back to the Sumsub blue (#1764ff) delete this whole block —
   the blue values above stay intact. */
:root {
  --accent: #5046e5;
  --accent-hover: #4338ca;
  --accent-btn: #5046e5;
  --accent-btn-hover: #4338ca;
  --accent-text: #5046e5;
  --accent-soft: #eeedfd;
  --bg-tint: #efeefe;
  --series-1: #5046e5;
  --series-2: #f27a2a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #7c74f0;
    --accent-hover: #958ef4;
    --accent-btn: #5046e5;
    --accent-btn-hover: #6159ee;
    --accent-text: #a9a4f7;
    --accent-soft: #1e1b4b;
    --bg-tint: #17153a;
    --series-1: #8b84f3;
    --series-2: #ff9a52;
  }
}
:root[data-theme="dark"] {
  --accent: #7c74f0;
  --accent-hover: #958ef4;
  --accent-btn: #5046e5;
  --accent-btn-hover: #6159ee;
  --accent-text: #a9a4f7;
  --accent-soft: #1e1b4b;
  --bg-tint: #17153a;
  --series-1: #8b84f3;
  --series-2: #ff9a52;
}
