/* ==========================================================================
   ООО «АЙТИ ГРУП» — стили сайта
   Токены → база → шапка → hero → секции → форма → подвал → утилиты
   Поддержка светлой/тёмной темы: [data-theme] + prefers-color-scheme
   ========================================================================== */

/* ---------- Шрифт (self-hosted Inter, variable) ---------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/inter-var-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/inter-var-latin.woff2") format("woff2");
  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+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Токены ---------- */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f5f7fa;
  --card: #ffffff;
  --brand: #5b8fa8;
  --brand-deep: #3b82f6;
  --btn-from: #4a7d96;
  --btn-to: #2563eb;
  --link: #2b6cb0;
  --ink: #1e293b;
  --muted: #4a5568;
  --line: #e2e8f0;
  --danger: #9b2c2c;
  --shadow-sm: 0 1px 2px rgb(30 41 59 / 6%);
  --shadow-md: 0 10px 30px -12px rgb(30 41 59 / 18%);
  --header-h: 4.75rem;
  --container: 1120px;
  --radius: 0.875rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #101a2c;
  --card: #131e33;
  --brand: #7fb0c9;
  --brand-deep: #60a5fa;
  --btn-from: #3d6a83;
  --btn-to: #1d4ed8;
  --link: #7fb9ee;
  --ink: #e5edf7;
  --muted: #9fb0c7;
  --line: #2b4066;
  --danger: #f87171;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
  --shadow-md: 0 12px 32px -12px rgb(0 0 0 / 55%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1220;
    --surface: #101a2c;
    --card: #131e33;
    --brand: #7fb0c9;
    --brand-deep: #60a5fa;
    --btn-from: #3d6a83;
    --btn-to: #1d4ed8;
    --link: #7fb9ee;
    --ink: #e5edf7;
    --muted: #9fb0c7;
    --line: #2b4066;
    --danger: #f87171;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-md: 0 12px 32px -12px rgb(0 0 0 / 55%);
  }
}

/* ---------- База ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

a,
button,
summary {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

::selection {
  background: color-mix(in srgb, var(--brand-deep) 25%, transparent);
}

:focus-visible {
  outline: 2px solid var(--brand-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  z-index: 30;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

main {
  flex: 1;
}

#top,
#services,
#stack,
#process,
#portfolio,
#faq,
#contact {
  scroll-margin-top: var(--header-h);
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.6rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 160ms, box-shadow 160ms, background-color 160ms, color 160ms, border-color 160ms;
}

.btn--primary {
  background: linear-gradient(120deg, var(--btn-from), var(--btn-to) 55%, var(--btn-from) 110%);
  background-size: 180% 100%;
  background-position: 0% 0%;
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background-position: 85% 0%;
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--primary:active {
  transform: none;
}

.btn--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--brand);
  color: var(--link);
}

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .site-header {
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}

.site-header.is-scrolled {
  border-bottom-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  box-shadow: var(--shadow-sm);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.logo-link {
  display: block;
  width: 10.5rem;
  flex-shrink: 0;
  /* у PNG-логотипа белый фон — оформляем его «чипом», чтобы на тёмной
     теме он выглядел аккуратно, а на светлой не отличался от фона */
  padding: 0.35rem 0.5rem;
  border-radius: 0.6rem;
  background: #ffffff;
  transition: opacity 200ms;
}

.logo-link:hover {
  opacity: 0.85;
}

.logo {
  display: block;
  width: 100%;
  height: auto;
}

.burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--bg);
  transition: border-color 200ms;
}

.burger:hover,
body.nav-open .burger {
  border-color: var(--brand);
}

.burger-bar {
  display: block;
  width: 1.25rem;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: transparent;
  color: var(--ink);
  transition: border-color 200ms, color 200ms;
}

.theme-toggle:hover {
  border-color: var(--brand);
  color: var(--link);
}

.theme-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-icon-moon {
    display: none;
  }
}

.site-nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

body.nav-open {
  overflow: hidden;
}

body.nav-open .site-nav {
  display: flex;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-list a {
  display: block;
  padding: 0.65rem 0.75rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: background-color 200ms, box-shadow 200ms;
}

.nav-list a:hover {
  background: var(--surface);
  box-shadow: inset 0 -2px 0 var(--brand);
}

.nav-cta {
  min-height: 2.6rem;
}

@media (min-width: 768px) {
  .burger {
    display: none;
  }

  .site-nav,
  body.nav-open .site-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .nav-list {
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
  }

  .nav-list a {
    padding: 0.5rem 0.7rem;
    font-size: 0.975rem;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 3.5rem 0 4rem;
  background:
    radial-gradient(38rem 24rem at 85% 10%, color-mix(in srgb, var(--brand-deep) 9%, transparent), transparent 70%),
    radial-gradient(30rem 20rem at 0% 100%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%),
    var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.75rem;
  color: var(--link);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--btn-from), var(--btn-to));
}

.grad-text {
  background: linear-gradient(110deg, var(--btn-to) 0%, #3b82f6 45%, #0ea5e9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  margin: 0 0 1rem;
  max-width: 15em;
  font-size: clamp(1.95rem, 1.25rem + 2.6vw, 3.1rem);
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lead {
  margin: 0 0 1.5rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.125rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.hero-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.925rem;
}

.hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.hero-facts svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--brand-deep);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-visual {
  max-width: 34rem;
  justify-self: center;
  width: 100%;
}

.illus {
  display: block;
  width: 100%;
  height: auto;
  animation: illus-float 7s ease-in-out infinite;
}

@keyframes illus-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.illus-glow {
  fill: var(--brand);
  opacity: 0.08;
}

.illus-card {
  fill: var(--card);
  stroke: var(--line);
  stroke-width: 1.5;
}

.illus-pill {
  fill: var(--surface);
}

.illus-side {
  fill: var(--surface);
  stroke: var(--line);
  stroke-width: 1;
}

.illus-tile {
  fill: var(--surface);
  stroke: var(--line);
  stroke-width: 1;
}

.illus-bar {
  fill: var(--line);
}

.illus-bar-strong {
  fill: color-mix(in srgb, var(--muted) 45%, transparent);
}

.illus-avatar {
  fill: var(--line);
}

.illus-line {
  stroke: var(--line);
  stroke-width: 1.5;
}

.illus-btn-text {
  fill: rgb(255 255 255 / 85%);
}

.illus-code {
  font-family: "Inter", monospace;
  font-size: 18px;
  font-weight: 700;
  fill: var(--brand-deep);
}

.illus-spark circle {
  fill: var(--brand);
  opacity: 0.55;
}

/* В тёмной теме иллюстрация читается чуть ярче */
:root[data-theme="dark"] .illus-card {
  stroke: #3a5887;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .illus-card {
    stroke: #3a5887;
  }
}

/* ---------- Секции ---------- */

.band {
  padding: 3.75rem 0;
}

.band-alt {
  background: var(--surface);
}

.band h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.55rem, 1.25rem + 1.1vw, 2.1rem);
  font-weight: 720;
  line-height: 1.18;
  letter-spacing: -0.015em;
}

.card-grid,
.stack-list,
.steps,
.work-grid {
  list-style: none;
  margin: 0;
  padding: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  padding: 1.4rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms, box-shadow 180ms, border-color 180ms;
}

/* Градиентная линия, «прорисовывающаяся» сверху при наведении */
.card::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 1.25rem;
  right: 1.25rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--btn-from), var(--btn-to));
  transform: scaleX(0);
  transition: transform 240ms ease;
}

.card:hover::after {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  box-shadow: var(--shadow-md);
}

.card h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 650;
  line-height: 1.3;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.975rem;
}

.card-link {
  margin-top: auto;
  padding-top: 0.5rem;
  font-weight: 650;
  font-size: 0.95rem;
  text-decoration: none;
}

.card-link .arrow {
  display: inline-block;
  margin-left: 0.3rem;
  transition: transform 180ms;
}

.card-link:hover .arrow {
  transform: translateX(3px);
}

.icon {
  display: block;
  width: 44px;
  height: 44px;
  padding: 10px;
  color: var(--brand-deep);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--brand-deep) 16%, transparent),
    color-mix(in srgb, var(--brand) 8%, transparent)
  );
  border-radius: 0.85rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stack-list li {
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color 180ms, transform 180ms;
}

.stack-list li:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  counter-reset: step;
}

.steps li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  padding: 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  transition: border-color 180ms;
}

.steps li:hover {
  border-color: var(--brand);
}

.step-num {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--btn-from), var(--btn-to));
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
}

/* ---------- Портфолио ---------- */

.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0 0 1.75rem;
}

.work-card {
  min-width: 0;
  padding: 1.4rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms, box-shadow 180ms, border-color 180ms;
}

.work-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  box-shadow: var(--shadow-md);
}

.work-card h3 {
  margin: 0.85rem 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 650;
}

.work-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.975rem;
}

.work-thumb {
  fill: var(--surface);
  stroke: var(--brand-deep);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- FAQ ---------- */

.faq-wrap .lead {
  margin-bottom: 1.75rem;
}

.faq-list {
  max-width: 46rem;
  display: grid;
  gap: 0.6rem;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  overflow: hidden;
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  font-weight: 650;
  list-style: none;
  transition: background-color 160ms;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary:hover {
  background: var(--surface);
}

.faq-mark {
  position: relative;
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
}

.faq-mark::before,
.faq-mark::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-deep);
  transition: transform 200ms;
}

.faq-mark::after {
  transform: rotate(90deg);
}

.faq-item[open] .faq-mark::after {
  transform: rotate(0deg);
}

.faq-item p {
  margin: 0;
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
}

/* ---------- Контакты и форма ---------- */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 1rem;
  max-width: 36rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.field label {
  font-weight: 650;
}

.field input,
.field textarea {
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  transition: border-color 180ms, box-shadow 180ms;
}

.field input:hover,
.field textarea:hover {
  border-color: var(--brand);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--brand-deep);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-deep) 18%, transparent);
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.875rem;
}

.field-check {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.field-check input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.2rem 0 0;
  accent-color: var(--btn-to);
}

.field-check label {
  font-weight: 500;
  font-size: 0.95rem;
}

.field-check .field-error {
  grid-column: 2;
}

/* Honeypot: вне экрана, но доступен ботам */
.hp-field {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.submit {
  width: 100%;
}

.submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.form-note {
  margin: 1rem 0 0;
  max-width: 36rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--brand);
  border-radius: 0.75rem;
  background: var(--card);
  color: var(--ink);
}

.form-note-error {
  border-color: var(--danger);
  color: var(--danger);
}

.form-note-error a {
  color: var(--danger);
}

.contact-aside {
  min-width: 0;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.contact-aside h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.contact-aside p {
  margin: 0 0 0.5rem;
}

.contact-aside a {
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

.contact-aside a:hover {
  color: var(--link);
}

.contact-legal {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 0.7rem;
}

.contact-legal dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-legal dd {
  margin: 0.15rem 0 0;
  font-size: 0.925rem;
  line-height: 1.45;
}

.contact-note {
  margin-top: 0.9rem !important;
  color: var(--muted);
  font-size: 0.925rem !important;
}

/* ---------- Подвал ---------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 2.75rem 0 1.5rem;
  color: var(--muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

.footer-title {
  margin: 0 0 0.6rem;
  color: var(--ink);
  font-weight: 700;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.footer-links a {
  color: var(--ink);
  text-decoration: none;
  transition: color 180ms;
}

.footer-links a:hover {
  color: var(--link);
  box-shadow: inset 0 -2px 0 var(--brand);
}

.footer-brand .logo-link {
  width: 9rem;
}

.footer-brand p {
  margin: 0.85rem 0 0;
  max-width: 24rem;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.footer-legal p {
  margin: 0;
  font-size: 0.925rem;
}

/* ---------- Плавающие элементы ---------- */

.to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 15;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-weight: 650;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 200ms, transform 200ms, border-color 200ms;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.to-top:hover {
  border-color: var(--brand);
}

.cookie-bar {
  position: fixed;
  z-index: 25;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 40rem;
  padding: 0.9rem 1.05rem;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.cookie-bar p {
  margin: 0;
  flex: 1 1 14rem;
}

body:has(#cookie-bar:not([hidden])) .to-top {
  bottom: 8rem;
}

/* ---------- Анимации появления ---------- */

.motion .reveal {
  opacity: 0;
  transform: translateY(0.75rem);
}

.motion .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 300ms, transform 300ms;
}

/* ---------- Юридические страницы ---------- */

.legal h2 {
  margin: 2rem 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.legal p,
.legal ul {
  max-width: 42rem;
}

.legal ul {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

.legal li + li {
  margin-top: 0.35rem;
}

/* ---------- Адаптив ---------- */

@media (min-width: 640px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .submit {
    width: auto;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding: 4.5rem 0 5rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 3rem;
  }

  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .work-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .contact-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 0.7fr);
  }

  .footer-grid {
    grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Reduced motion ---------- */

@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;
  }

  .reveal,
  .motion .reveal {
    opacity: 1;
    transform: none;
  }
}
