/* ============================================================
   MarkOS — Core design system
   Strict black/white base, per-product accent, Helvetica Neue
   ============================================================ */

:root {
  /* Base palette (TZ 2.2) */
  --ink: #111111;
  --bg: #FFFFFF;
  --gray-bg: #F2F2F4;
  --gray-text: #6B6B6B;
  --line: #D9D9D9;
  --ink-90: #1d1d1d;
  --ink-70: #3a3a3a;

  /* Accent — neutral by default (TZ: общие страницы — только базовая палитра).
     Product pages override --accent on <html data-edition="..."> */
  --accent: #111111;
  --accent-ink: #ffffff;       /* text on accent fill */
  --accent-tint: rgba(17,17,17,.06);

  /* Type */
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Radii (TZ 2.5: 8–12px) */
  --r: 10px;
  --r-sm: 8px;
  --r-lg: 14px;

  /* Layout */
  --maxw: 1240px;
  --gutter: 32px;
  --header-h: 72px;

  /* Motion */
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* Per-product accent themes — sampled from official brand logos */
[data-edition="erp"]   { --accent:#2C5CFC; --accent-tint:rgba(44,92,252,.08); }
[data-edition="wms"]   { --accent:#11B57C; --accent-tint:rgba(17,181,124,.09); }
[data-edition="pos"]   { --accent:#FF5A1F; --accent-tint:rgba(255,90,31,.09); }
[data-edition="b2b"]   { --accent:#7A23F7; --accent-tint:rgba(122,35,247,.08); }
[data-edition="srm"]   { --accent:#0C8B96; --accent-tint:rgba(12,139,150,.09); }
[data-edition="mp"]    { --accent:#F4186A; --accent-tint:rgba(244,24,106,.08); }
[data-edition="trace"] { --accent:#DC5A14; --accent-tint:rgba(220,90,20,.09); }
[data-edition="bi"]    { --accent:#18A6FB; --accent-tint:rgba(24,166,251,.09); }

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 56px); }
html, body { overflow-x: hidden; }
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { list-style: none; padding: 0; }
input, textarea, select, button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gray-text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow--accent { color: var(--accent); }
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: currentColor;
  opacity: .55;
}
.eyebrow.no-rule::before { display: none; }

h1, .h1 { font-size: clamp(2.4rem, 5.2vw, 4.1rem); line-height: 1.04; font-weight: 700; letter-spacing: -.022em; text-wrap: balance; }
h2, .h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); line-height: 1.08; font-weight: 700; letter-spacing: -.018em; text-wrap: balance; }
h3, .h3 { font-size: clamp(1.2rem, 1.8vw, 1.5rem); line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.32rem); line-height: 1.5; color: var(--ink-70); font-weight: 400; }
.muted { color: var(--gray-text); }
.caption { font-size: 13px; color: var(--gray-text); }
strong, b { font-weight: 700; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 8vw, 116px); }
.section--tight { padding-block: clamp(48px, 5vw, 72px); }
.section--gray { background: var(--gray-bg); }
.section--ink { background: var(--ink); color: #fff; }
.section-head { max-width: 780px; margin-bottom: 48px; }
.section-head .lead { margin-top: 18px; }
.divider { height: 1px; background: var(--line); border: 0; }

.grid { display: grid; gap: 24px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

.stack-sm > * + * { margin-top: 10px; }
.stack > * + * { margin-top: 18px; }
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 26px;
  border-radius: var(--r-sm);
  font-size: 15px; font-weight: 600; letter-spacing: .005em;
  border: 1px solid transparent;
  transition: transform .18s var(--ease), background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #000; }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { filter: brightness(.93); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--ghost-accent { background: transparent; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.btn--ghost-accent:hover { border-color: var(--accent); background: var(--accent-tint); }
.btn--lg { padding: 17px 32px; font-size: 16px; }
.btn--sm { padding: 10px 18px; font-size: 14px; }
.btn--block { width: 100%; }
.btn--on-ink { background: #fff; color: var(--ink); }
.btn--on-ink:hover { background: #f0f0f0; }
.btn--ghost-on-ink { background: transparent; color: #fff; border-color: rgba(255,255,255,.32); }
.btn--ghost-on-ink:hover { border-color: #fff; }

.textlink {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 600; font-size: 15px;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: gap .18s var(--ease);
}
.textlink svg { width: 15px; height: 15px; transition: transform .18s var(--ease); }
.textlink:hover svg { transform: translateX(3px); }

/* ---------- Hexagon mark ---------- */
/* ---------- Hexagon mark (legacy plain hex, e.g. map) ---------- */
.hex {
  position: relative;
  display: inline-grid; place-items: center;
  color: var(--accent);
}
.hex svg { width: 100%; height: 100%; display: block; }
.hex .hex-label {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-weight: 700; letter-spacing: .01em;
  color: currentColor;
}

/* ---------- Hexagon + product icon ---------- */
.hexmark { position: relative; display: inline-block; line-height: 0; color: var(--accent); aspect-ratio: 120 / 132; }
.hexmark-bg { width: 100%; height: 100%; display: block; }
.hexmark-icon { position: absolute; left: 50%; top: 50%; width: 50%; height: 50%; transform: translate(-50%, -52%); }

/* ---------- Wordmark MARK⏻S ---------- */
.wm { display: inline-flex; align-items: center; font-weight: 350; letter-spacing: .055em; line-height: 1; white-space: nowrap; font-feature-settings: "kern" 1; }
.wm-mark, .wm-s { font-weight: 350; }
.wm-pwr-wrap { display: inline-flex; align-items: center; }
.wm-pwr { width: .82em; height: .82em; margin: 0 .01em -.02em .03em; }
@supports (font-variation-settings: normal) { .wm { font-weight: 300; } }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 13px; }
.logo .hexmark { width: 39px; flex-shrink: 0; }
.logo .hex { width: 34px; height: 38px; }
.logo-wm { display: flex; flex-direction: column; gap: 3px; }
.logo .wm { font-size: 21px; }
.logo-img {
  display: block;
  width: 176px;
  height: 48px;
  object-fit: contain;
  object-position: left center;
}
.logo-img--product { width: 176px; }
.logo-label { font-size: 10px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
.logo--platform .wm { font-size: 23px; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-bar { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.header-bar .logo { flex-shrink: 0; }
.prodnav { display: flex; align-items: center; gap: 2px; margin-inline: auto; }
.prodnav a {
  font-size: 13.5px; font-weight: 600; letter-spacing: .02em;
  padding: 8px 12px; border-radius: 7px; color: var(--ink-70);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.prodnav a:hover { background: var(--gray-bg); color: var(--ink); }
.prodnav a.is-active { color: var(--accent); background: var(--accent-tint); }
.header-contacts { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.header-phone { display: flex; flex-direction: column; line-height: 1.1; }
.header-phone .lbl { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-text); }
.header-phone .num { font-size: 14px; font-weight: 600; }
.header-phone .num:hover { color: var(--accent); }
.header-cta { flex-shrink: 0; }
.burger { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 9px; background: #fff; place-items: center; }
.burger span { display: block; width: 18px; height: 2px; background: var(--ink); position: relative; transition: .2s var(--ease); }
.burger span::before, .burger span::after { content:""; position:absolute; left:0; width:18px; height:2px; background:var(--ink); transition:.2s var(--ease); }
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }
body.menu-open .burger span { background: transparent; }
body.menu-open .burger span::before { top: 0; transform: rotate(45deg); }
body.menu-open .burger span::after { top: 0; transform: rotate(-45deg); }

/* Sub-nav (product anchor menu, TZ 3.2) */
.subnav {
  position: sticky; top: var(--header-h); z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.subnav-bar { display: flex; align-items: center; gap: 6px; height: 56px; overflow-x: auto; scrollbar-width: none; }
.subnav-bar::-webkit-scrollbar { display: none; }
.subnav-bar a {
  font-size: 14px; font-weight: 600; color: var(--gray-text);
  padding: 8px 14px; border-radius: 7px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.subnav-bar a:hover { color: var(--ink); }
.subnav-bar a.is-active { color: var(--accent); background: var(--accent-tint); }
.subnav-bar a.btn--accent { color: var(--accent-ink); background: var(--accent); }
.subnav-bar a.btn--accent:hover { color: var(--accent-ink); }
.subnav-bar .subnav-cta { margin-left: auto; }

/* Mobile drawer */
.drawer { position: fixed; inset: var(--header-h) 0 0; z-index: 55; width: 100%; max-width: 100vw; background: #fff; clip-path: inset(0 0 0 100%); transition: clip-path .28s var(--ease), visibility 0s linear .28s; overflow-y: auto; padding: 24px var(--gutter) 60px; display: flex; flex-direction: column; gap: 6px; visibility: hidden; pointer-events: none; }
body.menu-open .drawer { clip-path: inset(0); visibility: visible; pointer-events: auto; transition-delay: 0s; }
.drawer .drawer-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gray-text); margin: 18px 0 6px; }
.drawer a.drawer-prod { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 17px; }
.drawer a.drawer-prod .dot { width: 9px; height: 9px; border-radius: 50%; }
.drawer .drawer-contacts { margin-top: 22px; display: grid; gap: 10px; }

/* ============================================================
   FOOTER (TZ 3.3 — dark)
   ============================================================ */
.site-footer { background: var(--ink); color: #fff; padding-block: 72px 36px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.14); }
.footer-brand .logo-name { color: #fff; }
.footer-brand .logo-sub { color: rgba(255,255,255,.55); }
.footer-brand p { color: rgba(255,255,255,.6); font-size: 14px; margin-top: 18px; max-width: 30ch; }
.footer-col h4 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-bottom: 16px; font-weight: 700; }
.footer-col ul { display: grid; gap: 11px; }
.footer-col a { font-size: 14.5px; color: rgba(255,255,255,.78); transition: color .15s; }
.footer-col a:hover { color: #fff; }
.footer-col .muted-line { color: rgba(255,255,255,.5); font-size: 14px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-top: 28px; flex-wrap: wrap; }
.footer-bottom .copy { font-size: 13px; color: rgba(255,255,255,.5); }
.footer-legal { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-legal a { font-size: 13px; color: rgba(255,255,255,.6); }
.footer-legal a:hover { color: #fff; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; display: grid; place-items: center; color: #fff; transition: .15s; }
.footer-social a:hover { background: #fff; color: var(--ink); }
.footer-acc-toggle { display: none; }

/* ---------- Scroll reveal ---------- */
.reveal { transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal-on .reveal { opacity: 0; transform: translateY(22px); }
.reveal-on .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal-on .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .prodnav { display: none; }
  .header-contacts .header-phone.support { display: none; }
}
@media (max-width: 900px) {
  :root { --gutter: 22px; }
  .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 30px 24px; }
}
@media (max-width: 820px) {
  .burger { display: grid; }
  .header-contacts { display: none; }
  .header-cta.desktop-only { display: none; }
  .prodnav { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 0; padding-bottom: 8px; }
  .footer-col { border-top: 1px solid rgba(255,255,255,.14); }
  .footer-col h4 { margin: 0; padding: 18px 0; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
  .footer-col h4::after { content: "+"; font-size: 18px; }
  .footer-col.open h4::after { content: "–"; }
  .footer-col ul { display: none; padding-bottom: 18px; }
  .footer-col.open ul { display: grid; }
  .footer-brand { padding-bottom: 18px; }
}
.desktop-only { }
@media (min-width: 821px) { .mobile-only { display: none !important; } }
