/* ==========================================================================
   СнабКонтроль — сайт-презентация по макету Stitch «SnabControl: Landing Page».
   Дизайн-система Logistics-Tech Portal: primary #003EC7, поверхности #F7F9FB,
   скругления 8/12, Inter + JetBrains Mono + Material Symbols (локально).
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-Medium-latin.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Material Symbols Outlined";
  src: url("fonts/MaterialSymbolsLanding.woff2?v=2") format("woff2");
  font-weight: 100 700;
  font-display: block;
}

:root {
  --bg: #F7F9FB;            /* surface макета лендинга */
  --bg-low: #F0F2F5;        /* surface-container-low */
  --bg-container: #ECEEF0;  /* surface-container */
  --surface: #FFFFFF;
  --line: #C3C5D9;
  --line-soft: #DDE0E4;
  --text: #191B25;
  --text-2: #434656;
  --muted: #5C6370;
  --accent: #003EC7;
  --accent-hover: #0052FF;
  --accent-soft: rgba(0, 62, 199, .08);
  --accent-fixed: #DDE1FF;
  --danger: #BA1A1A;
  --danger-bg: #FFDAD6;
  --ok: #0B6B3A;
  --ok-bg: #D9F2E4;
  --r: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --shadow: 0 1px 2px rgba(25,27,37,.05), 0 8px 24px rgba(25,27,37,.07);
  --shadow-lift: 0 2px 4px rgba(25,27,37,.06), 0 16px 40px rgba(0,62,199,.12);
  --font: Inter, "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --wrap: 1200px;
  --nav-bg: rgba(247, 249, 251, .9);
  --grid-line: rgba(0, 62, 199, .05);
  --focus-ring: rgba(0, 62, 199, .18);
  --accent-ink: #FFFFFF;
  color-scheme: light;
}

/* Тёмная тема — палитра совпадает с тёмной темой приложения (theme.css) */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E0F14;
  --bg-low: #121319;
  --bg-container: #121212;
  --surface: #1E293B;
  --line: #737688;
  --line-soft: #2E303A;
  --text: #F0EFFE;
  --text-2: #C3C5D9;
  --muted: #A3A6BA;
  --accent: #B7C4FF;          /* inverse-primary — читаемый синий на тёмном */
  --accent-hover: #DDE1FF;
  --accent-soft: rgba(183, 196, 255, .14);
  --accent-fixed: rgba(183, 196, 255, .22);
  --accent-ink: #001452;
  --danger: #FFB4AB;
  --danger-bg: rgba(255, 180, 171, .16);
  --ok: #8FD8AF;
  --ok-bg: rgba(143, 216, 175, .16);
  --nav-bg: rgba(14, 15, 20, .85);
  --grid-line: rgba(183, 196, 255, .07);
  --focus-ring: rgba(183, 196, 255, .3);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.45);
  --shadow-lift: 0 2px 4px rgba(0,0,0,.35), 0 16px 40px rgba(0,0,0,.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

.msym {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  display: inline-block;
  font-variation-settings: "FILL" 0, "wght" 400;
  user-select: none;
  flex: none;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- шапка (в макете: полупрозрачная, blur, fixed) ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.site-nav.scrolled { border-color: var(--line-soft); box-shadow: 0 1px 2px rgba(25,27,37,.05); }

.site-nav .bar {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

.wm { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.wm .msym { color: var(--accent); font-size: 26px; }
.wm b { color: var(--accent); font-weight: 700; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 16px; }

.nav-links a {
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  border-radius: var(--r);
}

.nav-links a:hover { color: var(--text); background: var(--accent-soft); }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); }

.nav-cta { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 22px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.btn:hover { background: var(--bg-low); }

.btn.primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn.big { min-height: 54px; padding: 14px 30px; font-size: 16px; border-radius: 12px; }

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-btn .msym { font-size: 20px; }
.theme-btn .sun { display: none; }
html[data-theme="dark"] .theme-btn .sun { display: inline-block; }
html[data-theme="dark"] .theme-btn .moon { display: none; }

.burger { display: none; margin-left: auto; width: 44px; height: 44px; align-items: center; justify-content: center; background: none; border: 0; color: var(--text); cursor: pointer; }

/* ---------- хиро ---------- */
.hero { padding: 148px 0 72px; position: relative; overflow: hidden; }

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 70% 20%, #000 0%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 20%, #000 0%, transparent 65%);
  pointer-events: none;
}

.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: center; }

.hero h1 {
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: 20px;
}

.hero h1 b { color: var(--accent); font-weight: 800; }

.hero .sub { font-size: 19px; line-height: 30px; color: var(--text-2); max-width: 560px; margin-bottom: 30px; }

.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-note { margin-top: 16px; font-size: 13px; color: var(--muted); }
.hero-note a { color: var(--accent); font-weight: 600; text-decoration: none; }
.hero-note a:hover { text-decoration: underline; }
.hero-note code { font-family: var(--mono); font-size: 12px; background: var(--bg-container); border: 1px solid var(--line-soft); border-radius: 6px; padding: 2px 7px; }

/* Плавающая карточка статуса — как в макете */
.hero-visual { position: relative; min-height: 320px; }

.hero-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: 22px;
}

.hero-card .row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--bg-container); }
.hero-card .row:last-child { border-bottom: 0; }
.hero-card .num { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.hero-card .grow { flex: 1; min-width: 0; }
.hero-card .t { font-size: 14px; font-weight: 600; }
.hero-card .s { font-size: 12px; color: var(--muted); }

.float-chip {
  position: absolute;
  right: -8px;
  top: -22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ok);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: floaty 5s ease-in-out infinite;
}

.float-chip .msym { font-size: 18px; color: var(--ok); }

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---------- чипы статусов ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 12px; font-weight: 600; border-radius: 8px; }
.chip.ok { color: var(--ok); background: var(--ok-bg); }
.chip.bad { color: var(--danger); background: var(--danger-bg); }
.chip.info { color: var(--accent); background: var(--accent-fixed); }

/* ---------- секции ---------- */
.section { padding: 84px 0; }
.section.tint { background: var(--bg-low); }
.section.deep { background: var(--bg-container); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.section h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; margin-bottom: 14px; }
.section .lead { font-size: 18px; line-height: 28px; color: var(--text-2); max-width: 640px; }
.section-head { margin-bottom: 44px; }
.section-head.center { text-align: center; }
.section-head.center .lead { margin: 0 auto; }

/* ---------- сетки карточек ---------- */
.cards { display: grid; gap: 20px; }
.cards.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 26px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: rgba(0,62,199,.25); }

.card .ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 16px;
}

.card .ic .msym { font-size: 24px; }
.card h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.card p { font-size: 15px; line-height: 23px; color: var(--text-2); }

/* ---------- «Где груз?»: хаос против контура ---------- */
.duel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

.duel-col { border-radius: var(--r-xl); padding: 28px; border: 1px solid var(--line-soft); background: var(--surface); }
.duel-col.bad { border-color: rgba(186,26,26,.25); background: linear-gradient(180deg, rgba(186,26,26,.04), transparent 60%), var(--surface); }
.duel-col.good { border-color: rgba(0,62,199,.3); background: linear-gradient(180deg, rgba(0,62,199,.05), transparent 60%), var(--surface); box-shadow: var(--shadow); }

.duel-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; margin-bottom: 18px; }
html[data-theme="dark"] .duel-col.bad { border-color: rgba(255,180,171,.35); background: linear-gradient(180deg, rgba(255,180,171,.07), transparent 60%), var(--surface); }
html[data-theme="dark"] .duel-col.good { border-color: rgba(183,196,255,.4); background: linear-gradient(180deg, rgba(183,196,255,.09), transparent 60%), var(--surface); }
.duel-col.bad .duel-tag { color: var(--danger); }
.duel-col.good .duel-tag { color: var(--accent); }

.duel-item { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--bg-container); }
.duel-item .msym { font-size: 22px; margin-top: 2px; }
.duel-col.bad .duel-item .msym { color: var(--danger); }
.duel-col.good .duel-item .msym { color: var(--accent); }
.duel-item b { display: block; font-size: 16px; margin-bottom: 3px; }
.duel-item p { font-size: 14px; line-height: 21px; color: var(--text-2); }

/* ---------- шаги (QR-приёмка) ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: step; }

.step { position: relative; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 26px; }

.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 12px;
}

.step .msym { font-size: 28px; color: var(--accent); margin-bottom: 12px; }
.step b { display: block; font-size: 17px; margin-bottom: 6px; }
.step p { font-size: 14px; line-height: 21px; color: var(--text-2); }

/* ---------- мокап чата ИИ ---------- */
.ai-duo { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 44px; align-items: center; }

.chat-mock {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-mock .head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--bg-container); }
.chat-mock .head .msym { color: var(--accent); }
.chat-mock .head b { font-size: 14px; }
.chat-mock .head span { font-size: 12px; color: var(--muted); display: block; }
.chat-mock .body { padding: 18px; display: grid; gap: 12px; }

.bub { max-width: 90%; padding: 10px 14px; font-size: 13.5px; line-height: 20px; border-radius: 12px; opacity: 0; transform: translateY(8px); }
.bub.user { justify-self: end; color: var(--accent-ink); background: var(--accent); border-top-right-radius: 2px; }
.bub.bot { justify-self: start; color: var(--text); background: var(--bg-low); border: 1px solid var(--line-soft); border-top-left-radius: 2px; }

.reveal.on .bub { animation: bub-in .5s ease forwards; }
.reveal.on .bub:nth-child(2) { animation-delay: .35s; }
.reveal.on .bub:nth-child(3) { animation-delay: .7s; }

@keyframes bub-in { to { opacity: 1; transform: translateY(0); } }

.mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
.mini-table th { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); }
.mini-table td { padding: 6px 8px; border-bottom: 1px solid var(--bg-container); color: var(--text-2); }
.mini-table td:first-child { font-family: var(--mono); color: var(--accent); font-size: 12px; }
.mini-table tr:last-child td { border-bottom: 0; }

/* ---------- полоса цифр ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; text-align: center; }

.stat { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 34px 22px; }
.stat b { display: block; font-size: 46px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; color: var(--accent); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 15px; color: var(--text-2); }
.stat b span { font-size: inherit; color: inherit; }

/* ---------- тарифы ---------- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }

.plan { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-xl); padding: 30px; }
.plan.hot { border-color: var(--accent); box-shadow: var(--shadow-lift); }

.plan .flag {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
  white-space: nowrap;
}

.plan h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.plan .price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.plan .price b { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.plan .price span { font-size: 15px; color: var(--muted); }
.plan .note { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.plan ul { list-style: none; display: grid; gap: 10px; margin-bottom: 24px; }
.plan li { display: flex; gap: 10px; font-size: 14.5px; color: var(--text-2); }
.plan li .msym { font-size: 18px; color: var(--accent); margin-top: 2px; }
.plan .btn { margin-top: auto; width: 100%; }

/* ---------- CTA + форма ---------- */
.cta-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 44px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: 44px;
}

.trust { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--bg-container); }
.trust .msym { color: var(--accent); font-size: 24px; }
.trust b { display: block; font-size: 15px; margin-bottom: 2px; }
.trust p { font-size: 13.5px; line-height: 20px; color: var(--text-2); }

.form-grid { display: grid; gap: 14px; }
.form-grid label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.form-grid input {
  min-height: 48px;
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.form-grid input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.form-note { font-size: 12px; color: var(--muted); }

/* ---------- подвал ---------- */
.site-footer { background: var(--bg-container); border-top: 1px solid var(--line-soft); padding: 44px 0; margin-top: 40px; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-start; }
.site-footer .muted { font-size: 13.5px; color: var(--muted); margin-top: 8px; max-width: 380px; }
.site-footer nav { display: grid; gap: 8px; }
.site-footer nav b { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.site-footer nav a { font-size: 14.5px; color: var(--text-2); text-decoration: none; }
.site-footer nav a:hover { color: var(--accent); }
.site-footer .fine { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); }

/* ---------- анимации появления ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.on { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .float-chip { animation: none; }
  .reveal.on .bub { animation-duration: .01s; animation-delay: 0s; }
  .card:hover, .btn.primary:hover { transform: none; }
}

/* ---------- телефон ---------- */
@media (max-width: 900px) {
  .hero .wrap, .ai-duo, .cta-panel { grid-template-columns: minmax(0, 1fr); }
  .cards.c2, .cards.c3, .steps, .stats, .plans, .duel { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 120px 0 48px; }
  .hero-visual { min-height: 0; }
  .section { padding: 56px 0; }
  .nav-links, .nav-cta .btn:not(.primary) { display: none; }
  .burger { display: inline-flex; }
  .site-nav .menu-open-links {
    position: fixed; top: 64px; left: 0; right: 0;
    display: grid; gap: 4px;
    padding: 14px 20px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line-soft);
    box-shadow: var(--shadow);
  }

  /* Атрибут hidden должен побеждать display:grid — иначе меню открыто всегда */
  .site-nav .menu-open-links[hidden] { display: none; }

  .site-nav .bar { height: 64px; gap: 12px; }
  .nav-cta { display: none; }
  .theme-btn { margin-left: auto; }
  .burger { margin-left: 0; }
  .plan .price b { font-size: 30px; }
  .hero h1 { font-size: clamp(30px, 8.6vw, 38px); }
  .section h2 { font-size: clamp(26px, 7vw, 32px); }
  .menu-open-links a { padding: 12px 14px; font-size: 16px; font-weight: 600; color: var(--text); text-decoration: none; border-radius: 10px; }
  .menu-open-links a:hover, .menu-open-links a.active { background: var(--accent-soft); color: var(--accent); }
  .plan.hot { order: -1; }
  .cta-panel { padding: 26px; }
}
