/* ==========================================================================
   АНКОМ — base: tokens, reset, typography, buttons, header, accessibility
   ========================================================================== */

:root {
  --section-y: 96px; /* vertical padding of content sections (72 < 1024, 64 < 768) */
  /* Surfaces */
  --bg: #252423;
  --bg-2: #2a2928;
  --bg-3: #302e2d;
  --stripe: #383634;
  --bg-deep: #151412; /* the drone chapter of the home story and its lens-to-lens dip (was pure #000: the toon outline vanished in it) */

  /* Lines */
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.1);
  --line-3: rgba(255, 255, 255, 0.14);
  --line-4: rgba(255, 255, 255, 0.2);

  /* Text */
  --text-hi: #f7f4ee;
  --text: #f3efe7;
  --text-2: #e5e0d6;
  --text-3: #c9c3b8;
  --muted: #a39c8f;
  --dim: #9a9488; /* design #6f6a60 lifted to meet WCAG AA (5.1:1) on --bg #252423 */

  /* Accent */
  --accent: #d9d4c8;
  --accent-soft: rgba(217, 212, 200, 0.12);
  --hot: #ff7a3d;
  --error: #ee6a66; /* ≥ 4.5:1 on --bg-2 */

  /* Light "paper" surface (anime.js reference) — reserved, not applied yet */
  --paper: #dad5d0;
  --paper-ink: #353432;

  /* Type */
  --font-display: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace; /* ui-monospace is Safari-only: Menlo covers Chrome/Firefox on macOS */

  /* Type scale: every font-size uses a token (display clamps, the logo lockup and the badge ring excepted).
     --fs-h1/--fs-h2 step down on phones. */
  --fs-2xs: 11px;   /* decorative mono only: readouts, HUD, loader, photo tags */
  --fs-xs: 12.5px;  /* floor for text people read or act on: labels, notes, legal links */
  --fs-sm: 13.5px;
  --fs-md: 15px;
  --fs-base: 16px;  /* running text */
  --fs-lg: 17px;
  --fs-xl: 19px;
  --fs-2xl: 22px;
  --fs-3xl: 26px;
  --fs-h2: 34px;
  --fs-h1: 42px;

  /* Layout */
  --container: 1600px;
  --gutter: 32px;
  --header-h: 72px;
  --radius: 2px;
  --ease-out: cubic-bezier(0.22, 0.9, 0.3, 1);

  /* camera-viewfinder corner marks for framed blocks (forms): 4 corners × 2 strokes, 16 px, 1.5 px */
  --viewfinder:
    linear-gradient(var(--accent), var(--accent)) top left / 16px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top left / 1.5px 16px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top right / 16px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top right / 1.5px 16px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom left / 16px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom left / 1.5px 16px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right / 16px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right / 1.5px 16px no-repeat;
}

@media (max-width: 1023.98px) {
  :root { --section-y: 72px; }
}
@media (max-width: 767.98px) {
  :root { --gutter: 20px; --header-h: 64px; --fs-h2: 28px; --fs-h1: 32px; --section-y: 64px; }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.5;
  overflow-x: hidden; /* Safari < 16 */
  /* clip, not hidden: with html.menu-open { overflow: hidden } a hidden body becomes its own scroll box, and the
     sticky header (with the open menu inside it) sticks to that box — i.e. flies off to the top of the page */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, iframe { display: block; max-width: 100%; }
h1, h2, h3, p, ul, figure { margin: 0; }
h1, h2, h3 { text-wrap: balance; } /* no lone last word in headings */
p, li, dd { text-wrap: pretty; }
ul { padding: 0; }
a { color: inherit; }
a[href^='tel:'], .nowrap { white-space: nowrap; } /* phone numbers never split at a hyphen */
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

::selection { background: var(--accent); color: var(--bg); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #45423f; border-radius: 6px; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-hi);
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--dim);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 28px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { background: var(--hot); }

.btn--ghost {
  background: transparent;
  border-color: var(--line-4);
  color: var(--text);
}
.btn--ghost:hover { background: transparent; border-color: var(--accent); color: var(--accent); }

.btn--sm { padding: 11px 20px; font-size: var(--fs-md); }
.btn--md { padding: 13px 22px; font-size: var(--fs-md); }
.btn--xl { padding: 18px 32px; font-size: var(--fs-2xl); }
.btn--block { width: 100%; }

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.2s, color 0.2s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }

/* ---------- Header («instrument scale»: mono nav, active item in [ ], tick scale + progress cursor) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(37, 36, 35, 0.96);
  border-bottom: 1px solid var(--line);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--header-h);
}

/* logo: «АнКОМ» with the iris for the О + «СЕРВІСНИЙ ЦЕНТР» (img/logo, docs/tools/build-logo.py). Every page carries
   the paths once, in the .sprite right after <body>; header, footer and the outlined words <use> them. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text);
}
.logo__img { display: block; width: auto; height: 40px; aspect-ratio: 487.8 / 164.1; fill: currentColor; }
.logo__sub { fill: var(--text-3); }
/* header: the iris is six sliding blades (sprite #iris-blade, as the preloader and the footer wordmark) clipped to the
   disc; at rest they sit at the logo's aperture (build-logo.py --preloader: logo slide), motion.css opens them from shut */
.logo__blade { transform: translate(5.69px, -21.25px); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}
.site-nav__links { display: flex; align-items: center; gap: 4px; }
.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  color: var(--text-3);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}
.site-nav__link::before,
.site-nav__link::after {
  content: '[';
  position: absolute;
  left: 2px;
  top: 7px;
  color: var(--hot);
  opacity: 0;
  transform: translate3d(4px, 0, 0);
  transition: opacity 0.2s, transform 0.2s;
}
.site-nav__link::after { content: ']'; left: auto; right: 2px; transform: translate3d(-4px, 0, 0); }
.site-nav__link:hover,
.site-nav__link.is-active,
.site-nav__link[aria-current='page'] { color: var(--text-hi); }
.site-nav__link.is-active::before,
.site-nav__link.is-active::after,
.site-nav__link[aria-current='page']::before,
.site-nav__link[aria-current='page']::after { opacity: 1; transform: none; }

.btn--hot { background: var(--hot); color: #1a1512; }
.btn--hot:hover { background: var(--accent); }
.btn--hot svg { flex-shrink: 0; }

/* mobile: phone icon + burger icon, both 44 px circles */
.site-header__call {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-4);
  border-radius: 50%;
  color: var(--hot);
}
.burger { /* icon-only, same 44 px circle as the phone button; label lives in aria-label */
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 1px solid var(--line-4);
  border-radius: 50%;
  color: var(--text);
}
.burger { transition: scale 0.16s cubic-bezier(0.22, 1, 0.36, 1); }
.burger:active { scale: 0.92; } /* press feedback */
.burger__lines { display: flex; flex-direction: column; gap: 5px; }
/* three bars → cross in two beats, like shutter blades: open — the bars meet in the middle (the centre one
   shrinks to a point), then both turn clockwise into a cross with a slight overshoot; close — the same way
   back: untwist first, then spread. Transitions (not keyframes), so a quick second tap reverses mid-way */
.burger__lines span {
  width: 18px;
  height: 1.5px;
  background: var(--text);
  transition: rotate 0.2s cubic-bezier(0.4, 0, 0.2, 1), translate 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.14s,
    scale 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.14s, opacity 0.1s linear 0.14s;
}
.burger[aria-expanded='true'] .burger__lines span {
  transition: translate 0.18s cubic-bezier(0.4, 0, 0.2, 1), scale 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.1s linear 0.1s, rotate 0.38s cubic-bezier(0.34, 1.45, 0.64, 1) 0.14s;
}
.burger[aria-expanded='true'] .burger__lines span:nth-child(1) { translate: 0 6.5px; rotate: 45deg; }
.burger[aria-expanded='true'] .burger__lines span:nth-child(2) { scale: 0 1; opacity: 0; }
.burger[aria-expanded='true'] .burger__lines span:nth-child(3) { translate: 0 -6.5px; rotate: 135deg; }
@media (prefers-reduced-motion: reduce) {
  .burger__lines span { transition-delay: 0s !important; } /* the a11y block zeroes durations; drop the beats too */
}

/* tick scale along the bottom edge + progress cursor */
.site-header__scale {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 10px;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--line-3) 0 1px, transparent 1px 12px) 0 5px / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, var(--line-4) 0 1px, transparent 1px 60px) 0 1px / 100% 9px no-repeat;
}
.site-header__cursor {
  position: absolute;
  left: -1px;
  top: -4px;
  width: 2px;
  height: 14px;
  background: var(--hot);
  pointer-events: none;
}
.site-header__readout {
  position: absolute;
  left: 8px;
  top: 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  white-space: nowrap;
  color: var(--dim);
  transition: opacity 0.15s;
}
.site-header__cursor.is-flipped .site-header__readout { left: auto; right: 8px; }

/* hover hints on the ticks (motion.js): lit tick + label «section · %» under the scale */
.site-header__probe {
  position: absolute;
  left: 0;
  top: 5px;
  width: 1px;
  height: 11px; /* from the tick down to the label */
  background: var(--text-hi);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.site-header__probe.is-major { top: 1px; height: 15px; }
.site-header__tip {
  position: absolute;
  left: 0;
  top: 16px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  max-width: 360px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-hi);
  background: var(--bg-3);
  border: 1px solid var(--line-4);
  border-radius: var(--radius);
  pointer-events: none;
  opacity: 0;
  translate: 0 -4px;
  transition: opacity 0.15s, translate 0.15s;
}
.site-header__tip-num { color: var(--hot); }
.site-header__tip-label { overflow: hidden; text-overflow: ellipsis; }
.site-header__tip-pct { color: var(--muted); }
.site-header__scale.is-probing .site-header__probe,
.site-header__scale.is-probing .site-header__tip { opacity: 1; translate: none; }
.site-header__scale.is-probing .site-header__readout { opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .site-header__scale { pointer-events: auto; }
  /* taller hit area, grown upward into the empty bottom of the bar (nothing below the header is covered) */
  .site-header__scale::before { content: ''; position: absolute; left: 0; right: 0; top: -5px; bottom: 0; }
}

.mobile-menu {
  max-height: calc(100vh - var(--header-h));
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.mobile-menu__inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 14px;
  padding-bottom: 26px;
}
.mobile-menu a:not(.btn) {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-xl);
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
/* the current page, as in the desktop nav: brightest text in orange [ ] (the brackets are silent for screen readers) */
.mobile-menu a[aria-current='page'] { gap: 8px; color: var(--text-hi); }
.mobile-menu a[aria-current='page']::before,
.mobile-menu a[aria-current='page']::after { font-family: var(--font-mono); font-weight: 400; line-height: 1; color: var(--hot); } /* line-height: the mono line box made the row 2 px taller */
.mobile-menu a[aria-current='page']::before { content: '['; content: '[' / ''; }
.mobile-menu a[aria-current='page']::after { content: ']'; content: ']' / ''; }
.mobile-menu .btn { margin-top: 18px; white-space: normal; }
/* page behind the open mobile menu: dimmed + blurred, a tap closes it (common.js). The one sanctioned
   backdrop-filter (rule 9 exception, 2026-09-28): the blur is static, only opacity fades. z-index just under the header. */
.menu-scrim {
  position: fixed;
  inset: 0;
  z-index: 59;
  background: rgba(20, 19, 18, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease-out), visibility 0s linear 0.25s;
}
.menu-scrim.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .menu-scrim { background: rgba(20, 19, 18, 0.86); }
}
html.menu-open { overflow: hidden; }
html.menu-open .site-header__scale { opacity: 0; }

@media (max-width: 1179.98px) {
  .site-nav { display: none; }
  .burger { display: inline-flex; }
  .site-header__call { display: inline-flex; margin-left: auto; }
  .site-header__readout { display: none; }
}
@media (min-width: 1180px) {
  .mobile-menu { display: none !important; }
}
@media (max-width: 767.98px) {
  /* the tagline would be ~7 px here: the wordmark alone, at the centre of the logo box */
  .site-header .logo__sub { display: none; }
  .site-header .logo__word { transform: translate(0, 30px); }
}

/* ---------- Accessibility ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.btn:focus-visible { outline-color: var(--hot); }

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