/* Vermia Dent — общая основа всех семи концептов.
   Шесть цветов, один акцент, два радиуса, шаг 4px, один easing. */

:root {
  --bg: #f3f6fa;          /* холодный «лабораторный» белый, не #fff */
  --ink: #0b1d35;         /* текст — глубокий синий, не чёрный */
  --muted: #56677f;       /* второстепенный текст, 5.3:1 на --bg */
  --line: #d5dfea;        /* границы и сетки */
  --sky: #8db4ff;         /* голубой: линии, свечения, никогда не текст */
  --accent: #1f57e7;      /* единственный акцент, белый текст на нём 5.9:1 */
  --accent-hover: #1746c2;

  --tint: color-mix(in srgb, var(--accent) 9%, var(--bg));
  --glass: color-mix(in srgb, #fff 72%, transparent);

  --font: "General Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  /* шкала: 13 · 15 · 18 · 24 · 40 · 64 · 96 */
  --fs-label: 13px;
  --fs-small: 15px;
  --fs-body: 18px;
  --fs-lead: 24px;
  --fs-h2: 40px;
  --fs-h1: clamp(40px, 6.2vw, 96px);

  --r: 12px;
  --r-pill: 999px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --t-fast: 150ms;
  --t: 240ms;

  --gutter: clamp(16px, 4vw, 64px);
  --pill-h: 56px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.025em; line-height: 1.02; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

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

.ic { width: 1.1em; height: 1.1em; flex: none; }

.mono {
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

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

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px;
  border-radius: var(--r-pill);
  font-size: var(--fs-small); font-weight: 500; letter-spacing: 0.005em;
  white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease), transform var(--t) var(--ease);
}
.btn .ic { transition: transform var(--t) var(--ease); }
.btn:hover .ic { transform: translateX(3px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { border: 1px solid var(--line); color: var(--ink); background: color-mix(in srgb, #fff 50%, transparent); }
.btn--ghost:hover { border-color: var(--ink); }

/* ---------- таблетка-хедер ---------- */

.pill {
  position: fixed; z-index: 50;
  top: 16px; left: 50%;
  translate: -50% 0;
  width: max-content; max-width: calc(100vw - 32px);
  border-radius: calc(var(--pill-h) / 2);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  transition: border-radius var(--t) var(--ease);
}
.pill.is-open { border-radius: 16px; }

.pill__bar {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  height: var(--pill-h); padding: 0 6px 0 20px;
}

.pill__brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 17px; letter-spacing: -0.01em;
  padding-right: 8px; white-space: nowrap;
}
.pill__mark {
  width: 10px; height: 18px; border-radius: var(--r-pill);
  background: var(--accent);
  box-shadow: inset 0 -9px 0 color-mix(in srgb, #fff 55%, var(--accent));
}
.pill__brand b { font-weight: 400; color: var(--muted); }

.pill__collapsible {
  display: flex; align-items: center; gap: 8px;
  max-width: 760px; overflow: hidden;
  transition: max-width 520ms var(--ease), opacity var(--t) var(--ease);
}
.pill.is-compact:not(.is-open) .pill__collapsible { max-width: 0; opacity: 0; }

.pill__nav { position: relative; display: flex; align-items: center; }
.pill__nav a {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; height: 44px; padding: 0 14px;
  font-size: var(--fs-small); font-weight: 500; color: var(--muted); white-space: nowrap;
  transition: color var(--t-fast) var(--ease);
}
.pill__nav a:hover { color: var(--ink); }
.pill__hl {
  /* подсветка — полоса во всю навигацию, видимый кусок вырезается clip-path: без пересчёта раскладки */
  --l: 0px; --r: 100%;
  position: absolute; top: 6px; left: 0; right: 0; height: 32px;
  background: var(--tint);
  clip-path: inset(0 var(--r) 0 var(--l) round 16px);
  opacity: 0; pointer-events: none;
  transition: clip-path 380ms var(--ease), opacity var(--t) var(--ease);
}

.pill__langs { display: flex; align-items: center; padding: 0 8px; border-left: 1px solid var(--line); }
.pill__langs button {
  display: inline-grid; place-items: center; min-width: 32px; height: 44px;
  font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.04em;
  transition: color var(--t-fast) var(--ease);
}
.pill__langs button:hover { color: var(--ink); }
.pill__langs button[aria-pressed="true"] { color: var(--accent); font-weight: 500; }

.pill__slot:empty { display: none; }
.pill__slot { display: flex; align-items: center; }

.pill__cta {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: var(--r-pill);
  background: var(--accent); color: #fff; font-size: var(--fs-small); font-weight: 500;
  white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease);
}
.pill__cta:hover { background: var(--accent-hover); }
.pill__cta .ic { transition: transform var(--t) var(--ease); }
.pill.is-open .pill__cta .ic { transform: rotate(45deg); }

.pill__burger { display: none; width: 44px; height: 44px; place-items: center; border-radius: var(--r-pill); }
.pill__burger .ic { width: 22px; height: 22px; }

.pill__progress {
  position: absolute; left: 24px; right: 24px; bottom: -1px; height: 2px;
  border-radius: 2px; overflow: hidden; pointer-events: none;
}
.pill__progress i {
  display: block; height: 100%; width: 100%;
  background: var(--accent); transform-origin: left; transform: scaleX(0);
}

/* панель, в которую раскрывается таблетка */
.pill__panel {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 420ms var(--ease);
}
.pill.is-open .pill__panel { grid-template-rows: 1fr; }
.pill__panel-inner { overflow: hidden; min-height: 0; }
.pill__panel-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  padding: 16px 24px 24px; border-top: 1px solid var(--line); margin: 0 6px;
  opacity: 0; transform: translateY(-8px);
  transition: opacity var(--t) var(--ease), transform 420ms var(--ease);
}
.pill.is-open .pill__panel-grid { opacity: 1; transform: none; transition-delay: 120ms; }
.pill__panel h3 { font-size: var(--fs-small); font-weight: 600; letter-spacing: 0; margin-bottom: 8px; }
.pill__panel p { font-size: var(--fs-small); color: var(--muted); line-height: 1.5; }
.pill__phones { display: grid; gap: 4px; margin-bottom: 12px; }
.pill__phones a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px;
  font-size: var(--fs-body); font-weight: 500; font-variant-numeric: tabular-nums;
}
.pill__phones a:hover { color: var(--accent); }
.pill__addr { display: flex; gap: 8px; align-items: flex-start; }
.pill__addr .ic { margin-top: 3px; color: var(--accent); }
.pill__send p { margin-bottom: 16px; }
.pill__send .btn { min-height: 44px; }
.pill__free { margin-top: 12px; color: var(--accent); }
.pill__mobile-nav { display: none; }

@media (max-width: 1080px) {
  .pill__nav a { padding: 0 10px; }
}
@media (max-width: 900px) {
  .pill__nav { display: none; }
}

/* на телефоне таблетка уходит вниз, под большой палец */
@media (max-width: 760px) {
  .pill {
    top: auto; bottom: 12px; left: 12px; right: 12px; translate: none;
    width: auto; max-width: none;
    display: flex; flex-direction: column-reverse;
  }
  .pill__bar { padding: 0 6px 0 16px; gap: 4px; }
  .pill__collapsible { display: none; }
  .pill__slot { display: none; }
  .pill__brand { font-size: 16px; padding-right: 0; margin-right: auto; }
  .pill__burger { display: inline-grid; }
  .pill__cta { padding: 0 16px; }
  .pill__cta .pill__cta-long { display: none; }
  .pill__progress { top: -1px; bottom: auto; }
  .pill__panel-grid {
    grid-template-columns: 1fr; gap: 24px; border-top: 0; border-bottom: 1px solid var(--line);
    padding: 24px 16px 16px; max-height: 70svh; overflow-y: auto;
  }
  .pill__mobile-nav { display: grid; gap: 4px; }
  .pill__mobile-nav a { font-size: var(--fs-lead); font-weight: 500; min-height: 44px; display: flex; align-items: center; }
  .pill__mobile-langs { display: flex; gap: 8px; margin-top: 8px; }
  .pill__mobile-langs button {
    min-width: 48px; height: 44px; border-radius: var(--r-pill); border: 1px solid var(--line);
    font-family: var(--mono); font-size: 13px;
  }
  .pill__mobile-langs button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
}
@media (min-width: 761px) {
  .pill__cta .pill__cta-short { display: none; }
  .pill__mobile-langs { display: none; }
}

/* ---------- переключатель концептов (служебный, для показа) ---------- */

.concepts {
  position: fixed; z-index: 40; left: 16px; bottom: 16px;
  display: flex; align-items: center; gap: 4px;
  padding: 4px; border-radius: var(--r-pill);
  background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.concepts a {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  border-radius: var(--r-pill); color: var(--muted);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.concepts a:hover { background: var(--tint); color: var(--ink); }
.concepts .concepts__arrow { width: 36px; padding: 0; justify-content: center; }
.concepts b { color: var(--ink); font-weight: 500; }
.is-clean .concepts { display: none; }
@media (max-width: 760px) {
  .concepts { top: 12px; bottom: auto; left: 12px; }
  .concepts .concepts__all { display: none; }
}

/* ---------- то, что ниже первого экрана ---------- */

.after {
  position: relative; z-index: 2;
  padding: 96px var(--gutter) 160px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.after__head {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: end;
  margin-bottom: 48px;
}
.after__head h2 { font-size: var(--fs-h2); }
.after__head p { color: var(--muted); max-width: 44ch; }
.after__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.after__list li { border-bottom: 1px solid var(--line); }
.after__list a {
  position: relative;
  display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 16px;
  min-height: 72px; font-size: var(--fs-lead); font-weight: 500; letter-spacing: -0.01em;
}
.after__list a::before {
  content: ""; position: absolute; inset: 0; background: var(--tint);
  transform: scaleY(0); transform-origin: bottom; z-index: -1;
  transition: transform var(--t) var(--ease);
}
.after__list a:hover::before { transform: scaleY(1); }
.after__list .mono { color: var(--muted); padding-left: 8px; }
.after__list .ic { color: var(--accent); margin-right: 8px; transition: transform var(--t) var(--ease); }
.after__list a:hover .ic { transform: translateX(4px); }
.after__foot {
  display: flex; flex-wrap: wrap; gap: 8px 32px; margin-top: 48px; color: var(--muted);
}
@media (max-width: 760px) {
  .after { padding: 64px 16px 120px; }
  .after__head { grid-template-columns: 1fr; gap: 16px; }
  .after__head h2 { font-size: 32px; }
  .after__list a { grid-template-columns: 40px 1fr auto; font-size: var(--fs-body); min-height: 60px; }
}

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