/*
 * Gotdata — базовые стили сайта.
 * Все значения берутся из css/tokens.css; литералов цвета и размера здесь нет.
 */

/* ---------- Сброс ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--type-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img,
svg,
video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

main:focus {
  outline: none;
}

/* ---------- Служебное ---------- */
.skip-link {
  position: absolute;
  left: var(--space-lg);
  top: -100px;
  z-index: 100;
  padding: var(--space-sm) var(--space-lg);
  background: var(--ink);
  color: var(--ink-inverse);
  border-radius: var(--radius-control);
  transition: top var(--duration-enter) var(--easing-enter);
}

.skip-link:focus {
  top: var(--space-lg);
}

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

/* ---------- Раскладка ---------- */
.container {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--space-xl);
}

.container--narrow {
  max-width: var(--measure-narrow);
}

.section {
  padding-block: var(--space-section);
}

.section--tight {
  padding-block: var(--space-xxxl);
}

.section--muted {
  background: var(--surface);
}

.stack > * + * {
  margin-top: var(--space-lg);
}

.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

@media (max-width: 900px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Типографика ---------- */
.eyebrow {
  font-size: var(--type-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.h-hero {
  font-size: clamp(var(--type-display), 5vw, var(--type-hero));
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.h-display {
  font-size: clamp(var(--type-title), 4vw, var(--type-display));
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.h-title {
  font-size: var(--type-title);
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.h-subhead {
  font-size: var(--type-subhead);
  line-height: 1.3;
  font-weight: 600;
}

.h-heading {
  font-size: var(--type-heading);
  line-height: 1.35;
  font-weight: 600;
}

.lead {
  font-size: var(--type-subhead);
  line-height: 1.5;
  color: var(--ink-muted);
}

.muted {
  color: var(--ink-muted);
}

.small {
  font-size: var(--type-label);
}

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  font-weight: 650;
  font-size: var(--type-heading);
  letter-spacing: -0.01em;
}

.brand__mark {
  width: 32px;
  height: 32px;
  /* Знак — родной ассет приложения: он сам несёт скругление Apple, обрезать его не нужно. */
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-left: auto;
}

.nav__link {
  font-size: var(--type-body);
  color: var(--ink-muted);
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  transition: color var(--duration-fade) var(--easing-standard),
    border-color var(--duration-fade) var(--easing-standard);
}

.nav__link:hover {
  color: var(--ink);
}

.nav__link[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.burger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
}

@media (max-width: 860px) {
  .nav--desktop,
  .header-actions .btn--desktop {
    display: none;
  }

  .burger {
    display: inline-flex;
    margin-left: auto;
  }
}

/* ---------- Диалоги ---------- */
.dialog {
  width: min(560px, calc(100vw - 2 * var(--space-xl)));
  padding: var(--space-xxl);
  border: 1px solid var(--border);
  border-radius: var(--radius-sheet);
  background: var(--background);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgb(20 22 26 / 50%);
}

.dialog--menu {
  width: min(360px, calc(100vw - 2 * var(--space-xl)));
  margin: 72px var(--space-xl) auto auto;
}

.dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.dialog__close {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  flex: none;
}

.menu-list {
  display: grid;
  gap: var(--space-xs);
}

.menu-list a {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-control);
}

.menu-list a:hover,
.menu-list a[aria-current="page"] {
  background: var(--surface);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 52px;
  padding: var(--space-md) var(--space-xxl);
  border-radius: var(--radius-control);
  font-size: var(--type-body);
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform var(--duration-press) var(--easing-standard),
    opacity var(--duration-press) var(--easing-standard),
    background-color var(--duration-fade) var(--easing-standard);
}

.btn:active {
  transform: scale(var(--press-scale));
  opacity: var(--press-opacity);
}

.btn--primary {
  background: var(--navy-700);
  color: var(--ink-inverse);
}

.btn--primary:hover {
  background: var(--navy-800);
}

.btn--secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  padding-inline: var(--space-lg);
}

.btn--sm {
  min-height: 40px;
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--type-label);
}

.btn--block {
  width: 100%;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 1;
  cursor: not-allowed;
  color: var(--ink-muted);
  background: var(--surface-strong);
  border-color: var(--border);
}

/* ---------- Карточки и блоки ---------- */
.card {
  padding: var(--space-xxl);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--background);
}

.card--muted {
  background: var(--surface);
  border-color: transparent;
}

.card--dark {
  background: var(--navy-900);
  border-color: transparent;
  color: var(--ink-inverse);
}

.card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  display: grid;
  place-items: center;
  margin-bottom: var(--space-lg);
}

.card--dark .card__icon {
  background: var(--navy-700);
}

.tick-list {
  display: grid;
  gap: var(--space-md);
}

.tick-list li {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.tick-list li::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: radial-gradient(circle at center, var(--ink) 0 4px, transparent 4px);
}

.card--dark .tick-list li::before {
  border-color: var(--navy-500);
  background: radial-gradient(circle at center, var(--ink-inverse) 0 4px, transparent 4px);
}

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--space-section) var(--space-section);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-section);
  align-items: center;
}

@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-xxxl);
  }
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-xxl);
}

.hero__points {
  display: grid;
  gap: var(--space-sm);
  margin-top: var(--space-xxl);
}

.hero__point {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  color: var(--ink-muted);
}

/* ---------- Метрики ---------- */
.metric {
  padding: var(--space-xxl);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.metric__value {
  font-size: clamp(var(--type-display), 4vw, var(--type-hero));
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.metric__label {
  margin-top: var(--space-md);
  color: var(--ink-muted);
}

/* ---------- Клиенты ---------- */
.clients {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-md);
}

.client {
  display: grid;
  place-items: center;
  min-height: 84px;
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: var(--type-label);
  color: var(--ink-muted);
  text-align: center;
}

/* ---------- Слот под скриншот ---------- */
.shot {
  margin: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--navy-900);
}

.shot__media {
  position: relative;
  aspect-ratio: 9 / 19.5;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--navy-900), var(--navy-700));
  color: var(--ink-inverse);
}

.shot--wide .shot__media {
  aspect-ratio: 16 / 10;
}

.shot__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot__placeholder {
  display: grid;
  gap: var(--space-md);
  justify-items: center;
  text-align: center;
  padding: var(--space-xl);
  color: var(--navy-200);
  font-size: var(--type-label);
}

.shot__placeholder img {
  width: 64px;
  height: 64px;
}

.shot__hint {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--type-caption);
  color: var(--navy-300);
  padding: var(--space-xs) var(--space-sm);
  border: 1px dashed var(--navy-500);
  border-radius: var(--radius-xs);
}

.shot__caption {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--type-label);
  color: var(--ink-muted);
  background: var(--background);
  border-top: 1px solid var(--border);
}

/* ---------- Бейджи магазинов ---------- */
.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.store-badge {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52px;
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-control);
  border: 1px dashed var(--border-strong);
  color: var(--ink-muted);
  background: var(--surface);
}

.store-badge strong {
  color: var(--ink);
  font-size: var(--type-body);
}

.store-badge span {
  font-size: var(--type-caption);
}

/* ---------- Форма ---------- */
.form {
  display: grid;
  gap: var(--space-lg);
}

.field {
  display: grid;
  gap: var(--space-sm);
}

.field__label {
  font-size: var(--type-label);
  font-weight: 600;
  color: var(--ink-muted);
}

.field__input,
.field__textarea {
  width: 100%;
  min-height: 52px;
  padding: var(--space-md) var(--space-lg);
  font: inherit;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
}

.field__textarea {
  min-height: 104px;
  resize: vertical;
}

.field__input:focus-visible,
.field__textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  background: var(--background);
}

.field--invalid .field__input,
.field--invalid .field__textarea {
  border-color: var(--state-invalid);
}

.field__error {
  font-size: var(--type-label);
  color: var(--state-invalid);
}

.field__hint {
  font-size: var(--type-label);
  color: var(--ink-muted);
}

.consent {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  font-size: var(--type-label);
  color: var(--ink-muted);
}

.consent input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex: none;
}

.consent a,
.link {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.form__note {
  font-size: var(--type-label);
  color: var(--ink-muted);
}

.form-message {
  padding: var(--space-lg);
  border-radius: var(--radius-control);
  font-size: var(--type-body);
}

.form-message--success {
  background: var(--surface);
  border: 1px solid var(--state-valid);
}

.form-message--error {
  background: var(--surface);
  border: 1px solid var(--state-invalid);
}

.form-message--info {
  background: var(--surface);
  border: 1px solid var(--border-strong);
}

/* ---------- Юридические документы ---------- */
.legal {
  font-size: var(--type-body);
  color: var(--ink);
}

.legal h2 {
  font-size: var(--type-subhead);
  margin-top: var(--space-xxxl);
  margin-bottom: var(--space-md);
}

.legal h3 {
  font-size: var(--type-heading);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.legal p,
.legal li {
  margin-bottom: var(--space-md);
  color: var(--ink);
}

.legal ol {
  list-style: decimal;
  padding-left: var(--space-xl);
  display: grid;
  gap: var(--space-sm);
}

.legal ul {
  list-style: disc;
  padding-left: var(--space-xl);
  display: grid;
  gap: var(--space-xs);
}

.legal__meta {
  color: var(--ink-muted);
  font-size: var(--type-label);
}

/* ---------- Подвал ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: var(--space-section);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-xxl);
}

@media (max-width: 760px) {
  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

.footer-title {
  font-weight: 650;
}

.footer-list {
  display: grid;
  gap: var(--space-sm);
}

.footer-list a:hover {
  text-decoration: underline;
}

.footer-legal {
  margin-top: var(--space-xxl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  font-size: var(--type-label);
  color: var(--ink-muted);
  display: grid;
  gap: var(--space-xs);
}

/* ---------- Появление страницы ---------- */
.page-enter {
  animation: page-enter var(--duration-enter) var(--easing-enter);
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 404 ---------- */
.empty-state {
  text-align: center;
  padding-block: var(--space-section);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .page-enter {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
  }
}
