/* REC: TACTICAL — base layer: fonts, tokens, reset, typography, controls */

@font-face {
  font-family: "VCR OSD Mono";
  src: url("../fonts/vcr-osd-mono.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;

  /* surfaces */
  --bg: #07080a;
  --bg-section: #080a0c;
  --bg-footer: #050709;
  --bg-card: #0d1014;
  --bg-raise: #11151a;
  --bg-hover: #161a20;
  --bg-glass: rgba(7, 8, 10, 0.82);
  --glass-blur: blur(8px);

  /* lines */
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.2);
  --line-strong: rgba(255, 255, 255, 0.38);
  --chip: rgba(255, 255, 255, 0.045); /* the one fill for small borderless chips: tags, payment methods, badges */

  /* text */
  --text: #eef0f2;
  --text-2: #a3aab3;
  --text-3: #7d8590;
  --text-4: #757c87; /* the dimmest text still reads at 4.5:1 on the page and on cards */
  --head: #d4dae2;
  --head-hero: #ffffff;
  --text-photo: #c9d2dc;

  /* buttons */
  --btn: #e8eaed;
  --btn-hover: #ffffff;
  --btn-text: #111316;

  /* the only accent */
  --accent: #f2b84b;
  --accent-bg: rgba(242, 184, 75, 0.08);
  --accent-line: rgba(242, 184, 75, 0.35);

  /* states (muted on purpose) */
  --rec: #e0372b;
  --ok: #8fc79b;
  --ok-bg: rgba(143, 199, 155, 0.1);
  --err: #ef7a6f;
  --err-bg: rgba(239, 122, 111, 0.1);

  --r-1: 3px;
  --r-2: 5px;
  --r-3: 7px;
  --r-4: 10px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.16s;
  --t: 0.22s;

  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-osd: "VCR OSD Mono", "Inter", ui-monospace, monospace;

  --container: 1440px;
  --gutter: 56px;
  --header-h: 68px;
  --section-y: 112px;

  --shadow-pop: 0 24px 60px rgba(0, 0, 0, 0.55);
  --text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
}

@media (max-width: 1100px) {
  :root { --gutter: 32px; --section-y: 96px; }
}
@media (max-width: 680px) {
  :root { --gutter: 20px; --header-h: 60px; --section-y: 72px; }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent; /* no grey flash on tap: controls answer with their own hover/focus states */
  scroll-padding-top: calc(var(--header-h) + 12px);
  background: var(--bg);
}
html:not(.lenis) { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
.i18n-wait body { opacity: 0; }
body { transition: opacity 0.2s ease; }

img, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
a[href^="mailto:"] { white-space: nowrap; } /* an address never breaks at its hyphen */
h1, h2, h3, h4, h5, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
::selection { background: rgba(232, 234, 237, 0.9); color: #0b0d10; }

/* scrollbar */
html { scrollbar-color: rgba(255, 255, 255, 0.16) #060709; scrollbar-width: thin; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #060709; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 3px; }
@media (hover: hover) { ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); } }

:focus { outline: none; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: var(--r-2); }

/* cross-document transitions (Chromium) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.28s; }

/* ---------- layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 3000;
  padding: 10px 16px; border-radius: var(--r-3);
  background: var(--btn); color: var(--btn-text); font-weight: 600;
  transition: top var(--t) var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- typography ---------- */
.osd {
  font-family: var(--font-osd);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.title-xl, .title-l, .title-m, .title-s {
  font-family: var(--font-osd);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--head-hero);
  -webkit-text-stroke: 1px currentColor;
  paint-order: stroke fill;
  text-shadow: var(--title-shadow, none);
  overflow-wrap: break-word;
  hyphens: manual;
  text-wrap: balance;
}
.title-xl { font-size: clamp(42px, 5.2vw, 72px); line-height: 0.95; }
.title-l  { font-size: clamp(32px, 3.4vw, 48px); line-height: 1; }
.title-m  { font-size: clamp(24px, 2.2vw, 30px); line-height: 1.05; }
.title-s  { font-size: 18px; line-height: 1.15; -webkit-text-stroke-width: 0.6px; }
.title-inner { color: var(--head); }
html[lang="zh"] .title-xl,
html[lang="zh"] .title-l,
html[lang="zh"] .title-m,
html[lang="zh"] .title-s {
  -webkit-text-stroke: 0;
  letter-spacing: 0.02em;
  line-height: 1.15;
}
html[lang="zh"] .tagline,
html[lang="zh"] .label { letter-spacing: 0.08em; }

.tagline {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-osd);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7b8390;
}
.tagline::after {
  content: "";
  width: 48px; height: 1px;
  background: rgba(255, 255, 255, 0.25);
}
.label {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-osd); font-size: 13px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-2);
}
.label::after { content: ""; width: 42px; height: 1px; background: rgba(255, 255, 255, 0.22); }
.label--plain::after { display: none; }

.lead { font-size: 16.5px; line-height: 1.55; color: var(--text-2); }
.lead strong { color: var(--text); font-weight: 600; }
.text { font-size: 15px; line-height: 1.62; color: var(--text-photo); }
.muted { color: var(--text-3); }
.small { font-size: 13px; line-height: 1.5; color: var(--text-3); }
.num-gap { display: inline-block; width: 0.3em; }
.tnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* horizontal scrollers (REC.edgeFade): an edge fades only while more content hides behind it */
[data-fade] { --fade: 40px; }
[data-fade].is-fade-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--fade)), transparent); mask-image: linear-gradient(to right, #000 calc(100% - var(--fade)), transparent); }
[data-fade].is-fade-start { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - var(--fade)), transparent); mask-image: linear-gradient(to left, #000 calc(100% - var(--fade)), transparent); }
[data-fade].is-fade-start.is-fade-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent); mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent); }

/* ---------- icons ---------- */
.icon {
  width: 18px; height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--brand { fill: currentColor; stroke: none; }
.icon--sm { width: 15px; height: 15px; }
.icon--xs { width: 12px; height: 12px; }
.icon--lg { width: 22px; height: 22px; }

/* ---------- buttons ---------- */
.btn {
  --h: 50px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--h);
  padding: 0 24px;
  border-radius: var(--r-3);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  transition: background-color var(--t) ease, border-color var(--t) ease, color var(--t) ease, opacity var(--t) ease;
}
.btn .icon { width: 18px; height: 18px; }
.btn--primary { background: var(--btn); color: var(--btn-text); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45); }
@media (hover: hover) { .btn--primary:hover { background: var(--btn-hover); } }
.btn--secondary { border-color: var(--btn); color: var(--text); }
@media (hover: hover) { .btn--secondary:hover { background: rgba(232, 234, 237, 0.08); border-color: #fff; color: #fff; } }
.btn--outline { border-color: rgba(255, 255, 255, 0.16); color: var(--text-2); font-weight: 500; }
@media (hover: hover) { .btn--outline:hover { border-color: var(--line-strong); color: #fff; } }
.btn--ghost { --h: 38px; padding: 0 12px; color: var(--text-2); font-weight: 500; }
@media (hover: hover) { .btn--ghost:hover { color: #fff; } }
.btn--danger { border-color: rgba(239, 122, 111, 0.35); color: var(--err); }
@media (hover: hover) { .btn--danger:hover { background: var(--err-bg); border-color: var(--err); } }
.btn--sm { --h: 40px; padding: 0 16px; font-size: 14px; gap: 8px; }
.btn--sm .icon { width: 16px; height: 16px; }
.btn--xs { --h: 32px; padding: 0 12px; font-size: 13px; gap: 7px; border-radius: var(--r-2); }
.btn--xs .icon { width: 14px; height: 14px; }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn[aria-busy="true"] { color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--btn-text) transparent var(--btn-text) transparent;
  animation: spin 0.7s linear infinite;
}
.btn--secondary[aria-busy="true"]::after, .btn--outline[aria-busy="true"]::after, .btn--ghost[aria-busy="true"]::after { border-color: #fff transparent #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: var(--r-3);
  color: var(--text-2);
  transition: color var(--t) ease, background-color var(--t) ease;
}
@media (hover: hover) { .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.06); } }
.icon-btn--line { border: 1px solid rgba(255, 255, 255, 0.14); }
@media (hover: hover) { .icon-btn--line:hover { border-color: var(--line-strong); } }

.link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--t) ease, color var(--t) ease;
}
@media (hover: hover) { .link:hover { text-decoration-color: #fff; color: #fff; } }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 500; font-size: 14px; transition: color var(--t) ease; }
@media (hover: hover) { .link-arrow:hover { color: #fff; } }
.link-arrow .icon { width: 15px; height: 15px; transition: transform var(--t) var(--ease); }
@media (hover: hover) { .link-arrow:hover .icon { transform: translateX(3px); } }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; align-content: start; } /* in a grid row a field must not stretch: label and input keep their place when a neighbour shows an error */
.field__label { font-size: 13px; font-weight: 500; color: var(--text-2); display: flex; justify-content: space-between; gap: 12px; }
.field__hint { font-size: 12.5px; color: var(--text-4); }
.field__error { font-size: 12.5px; color: var(--err); min-height: 0; }
.input, .select, .textarea {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: var(--r-3);
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 15px;
  transition: border-color var(--t) ease, background-color var(--t) ease;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
@media (hover: hover) { .input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); } }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.04); outline: none; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: rgba(239, 122, 111, 0.7); }
/* browser autofill keeps the dark field instead of its light-yellow tint */
.input:-webkit-autofill, .input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text); caret-color: var(--text);
  box-shadow: inset 0 0 0 100px #111317;
  transition: background-color 600000s 0s, color 600000s 0s;
}
@media (hover: hover) { .input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--text); caret-color: var(--text);
  box-shadow: inset 0 0 0 100px #111317;
  transition: background-color 600000s 0s, color 600000s 0s;
} }
.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23a3aab3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.select option { background: #0f1216; color: var(--text); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 48px; }
.input-group .icon-btn { position: absolute; right: 4px; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.45; color: var(--text-2); cursor: pointer; }
.check input {
  appearance: none; flex: none;
  width: 18px; height: 18px; margin: 1px 0 0;
  border-radius: 4px; border: 1px solid var(--line-3);
  background: transparent; display: grid; place-content: center;
  transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease;
  cursor: pointer;
}
.check input::after {
  content: ""; width: 10px; height: 6px;
  border: 2px solid var(--btn-text); border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform var(--t-fast) var(--ease);
}
.check input:checked { background: var(--btn); border-color: var(--btn); }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 3px rgba(239, 122, 111, 0.16); }
.check + .field__error { margin-top: -6px; padding-left: 28px; }
.check a { color: var(--text); text-decoration: underline; text-decoration-color: rgba(255,255,255,.3); text-underline-offset: 3px; }

/* segmented radio group */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-3); border: 1px solid var(--line-2); background: rgba(255,255,255,.02); }
.seg__btn, .seg label {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px; border-radius: var(--r-2);
  font-size: 13.5px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap;
  transition: background-color var(--t) ease, color var(--t) ease;
}
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
@media (hover: hover) { .seg__btn:hover, .seg label:hover { color: #fff; } }
.seg__btn[aria-pressed="true"], .seg__btn[aria-selected="true"], .seg label:has(input:checked) { background: rgba(255, 255, 255, 0.09); color: #fff; }
.seg label:has(input:focus-visible) { outline: 2px solid #fff; outline-offset: 1px; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px;
  border-radius: var(--r-2);
  background: var(--chip); /* chips have no outline — a darker fill only */
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--text-2); white-space: nowrap;
}
.badge .icon { width: 13px; height: 13px; }
.badge--solid { background: var(--btn); color: var(--btn-text); }
.badge--ok { color: var(--ok); background: var(--ok-bg); }
.badge--err { color: var(--err); background: var(--err-bg); }
.badge--accent { color: var(--accent); background: var(--accent-bg); }
.badge--osd { font-family: var(--font-osd); font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; }
.badge--tint .icon { color: rgb(var(--tint)); } /* a profile badge named on a chip keeps its emblem colour */

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot--rec { background: var(--rec); box-shadow: 0 0 8px rgba(224, 55, 43, 0.7); animation: rec-blink 1.6s steps(1) infinite; }
.dot--ok { background: var(--ok); box-shadow: 0 0 8px rgba(143, 199, 155, 0.55); }
.dot--off { background: var(--text-4); }
@keyframes rec-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.15; } }

.kbd { font-family: var(--font-osd); font-size: 12px; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--text-2); }

hr.sep { border: 0; height: 1px; background: var(--line); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
