/* SoftRain — общие стили сайта.
   Токены совпадают с дизайн-системой SoftRain (claude.ai/artifact/VRfSKEux57aoRDF5JWzACj).
   Шрифты подключаются на каждой странице: Source Serif 4 (600), Onest (400/500/600), JetBrains Mono (400/500). */

:root {
  --surface: #f6f5f1;
  --surface-raised: #ffffff;
  --surface-sunken: #ecebe5;
  --surface-inverse: #0f1c24;
  --ink: #0f1c24;
  --ink-muted: #4a5963;
  --ink-inverse: #f6f5f1;
  --ink-inverse-muted: #a9b8c0;
  --line: #d8d6ce;
  --line-strong: #8a8f86;
  --rain: #0a6f8f;
  --rain-strong: #085a74;
  --on-rain: #ffffff;
  --rain-soft: #dcecf1;
  --rain-light: #4cc3e6;
  --sun: #e2a822;
  --on-sun: #0f1c24;
  --success: #1f7a4d;
  --danger: #b3261e;
  --focus: #0a6f8f;

  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: Onest, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px;
  --space-8: 32px; --space-12: 48px; --space-16: 64px; --space-24: 112px;
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 16px; --radius-pill: 999px;
  --shadow-hover: 0 12px 32px -12px rgba(15, 28, 36, .18);
  --container: 1200px;
  --nav-height: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + 16px); }
body {
  font-family: var(--font-sans); font-size: 16px; line-height: 26px;
  color: var(--ink); background: var(--surface);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--rain); }
a:hover { color: var(--rain-strong); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; }

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-12); }
.section { padding: var(--space-24) 0; }
.section--sunken { background: var(--surface-sunken); }

/* ===== Типографика ===== */
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--rain);
}
.display {
  font-family: var(--font-display); font-size: 64px; line-height: 68px; font-weight: 600;
  letter-spacing: -.02em;
}
.display em, .h1 em { font-style: normal; color: var(--rain); }
.h1 { font-family: var(--font-display); font-size: 44px; line-height: 50px; font-weight: 600; letter-spacing: -.015em; }
.h2 { font-family: var(--font-display); font-size: 34px; line-height: 40px; font-weight: 600; letter-spacing: -.01em; }
.h3 { font-family: var(--font-display); font-size: 22px; line-height: 28px; font-weight: 600; }
.lead { font-size: 19px; line-height: 30px; color: var(--ink-muted); }
.muted { color: var(--ink-muted); }
.mono { font-family: var(--font-mono); }

/* Заголовок секции: слева надзаголовок и h2, справа вводная фраза */
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-8);
  margin-bottom: var(--space-12);
}
.section-head .h2 { margin-top: var(--space-3); }
.section-head .lead { max-width: 440px; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font: 600 16px/24px var(--font-sans); padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md); border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: background .15s ease-out, border-color .15s ease-out, color .15s ease-out;
}
.btn .arrow { font-family: var(--font-mono); }
.btn-primary { background: var(--rain); color: var(--on-rain); }
.btn-primary:hover { background: var(--rain-strong); color: var(--on-rain); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--rain); padding-left: 0; padding-right: 0; }
.btn-ghost:hover { color: var(--rain-strong); text-decoration: underline; text-underline-offset: 4px; }
.btn-inverse { background: var(--ink-inverse); color: var(--surface-inverse); }
.btn-inverse:hover { background: #ffffff; color: var(--surface-inverse); }

/* ===== Теги ===== */
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag {
  display: inline-flex; align-items: center; font: 400 13px/20px var(--font-mono);
  padding: 2px var(--space-2); border-radius: var(--radius-sm); background: var(--rain-soft); color: var(--ink);
}
.tag--outline { background: transparent; border: 1px solid var(--line); color: var(--ink-muted); }
.tag--sun { background: var(--sun); color: var(--on-sun); font-weight: 500; }
.tag--ok { background: transparent; border: 1px solid var(--success); color: var(--success); font-weight: 500; }

/* ===== Навигация ===== */
.nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-height);
  background: var(--surface); border-bottom: 1px solid var(--line);
  transition: background .2s ease-out;
}
.nav.scrolled { background: var(--surface-raised); }
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); }
.nav-logo { display: flex; align-items: center; flex-shrink: 0; }
.nav-logo img { height: 36px; width: auto; }
.nav-links { display: flex; gap: var(--space-6); list-style: none; }
.nav-links a { color: var(--ink-muted); text-decoration: none; font-size: 15px; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: var(--space-4); }
.nav-right .btn { padding: var(--space-2) var(--space-4); font-size: 15px; }
.lang-switch { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-pill); }
.lang-switch button {
  font: 500 12px/16px var(--font-mono); padding: 4px 10px; border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--ink-muted); cursor: pointer;
}
.lang-switch button.active { background: var(--ink); color: var(--surface); }
.nav-back { color: var(--ink-muted); text-decoration: none; font-size: 15px; }
.nav-back:hover { color: var(--ink); }
.menu-toggle {
  display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: transparent; cursor: pointer; align-items: center; justify-content: center;
}
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
  display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 1px; position: relative; content: '';
}
.menu-toggle span::before { position: absolute; top: -6px; }
.menu-toggle span::after { position: absolute; top: 6px; }

/* ===== Карточки ===== */
.card {
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-8); display: flex; flex-direction: column; gap: var(--space-4);
  transition: transform .2s ease-out, box-shadow .2s ease-out;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card p { color: var(--ink-muted); }
.card-num {
  font: 500 12px/16px var(--font-mono); letter-spacing: .08em; color: var(--ink-muted);
  display: flex; justify-content: space-between; gap: var(--space-4); text-transform: uppercase;
}
.list {
  list-style: none; padding-top: var(--space-4); border-top: 1px solid var(--line);
  display: grid; gap: var(--space-2); font-size: 14px; line-height: 22px;
}
.list li { display: flex; gap: var(--space-2); }
.list li::before { content: "—"; color: var(--rain); font-family: var(--font-mono); flex-shrink: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }

/* ===== Цифры ===== */
.stat { display: flex; flex-direction: column; gap: var(--space-1); padding-left: var(--space-4); border-left: 1px solid var(--line-strong); }
.stat-value { font: 500 44px/48px var(--font-mono); letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-value--accent { color: var(--rain); }
.stat-label { font-size: 14px; line-height: 22px; color: var(--ink-muted); }

/* ===== Кейс ===== */
.case {
  display: grid; grid-template-columns: 1.2fr 1fr; background: var(--surface-raised);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  color: inherit; text-decoration: none; transition: transform .2s ease-out, box-shadow .2s ease-out;
}
a.case:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); color: inherit; }
.case-body { padding: var(--space-8); display: flex; flex-direction: column; gap: var(--space-4); }
.case-body p { color: var(--ink-muted); }
.case-client {
  font: 500 12px/16px var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-muted); display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap;
}
.case-facts { background: var(--rain-soft); padding: var(--space-8); display: grid; align-content: center; gap: var(--space-6); }
.case-link { color: var(--rain); font-weight: 600; display: inline-flex; gap: var(--space-2); }
.case-link .arrow { font-family: var(--font-mono); }

/* ===== Инверсный блок (контакты) ===== */
.cta {
  background: var(--surface-inverse); color: var(--ink-inverse); border-radius: var(--radius-lg);
  padding: var(--space-12); display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--space-12);
}
.cta .h2 { color: var(--ink-inverse); margin-top: var(--space-3); }
.cta .eyebrow { color: var(--ink-inverse-muted); }
.cta p { color: var(--ink-inverse-muted); margin-top: var(--space-3); }
.cta-contacts { display: grid; gap: var(--space-3); margin-top: var(--space-8); font: 400 15px/22px var(--font-mono); }
.cta-contacts a {
  color: var(--ink-inverse); text-decoration: none; border-bottom: 1px solid rgba(169, 184, 192, .4);
  padding-bottom: var(--space-2); display: flex; justify-content: space-between; gap: var(--space-4);
}
.cta-contacts a:hover { border-bottom-color: var(--ink-inverse); color: #fff; }
.cta :focus-visible { outline-color: var(--rain-light); }

/* ===== Поля формы ===== */
.field { display: grid; gap: var(--space-2); }
.field label { font-size: 14px; font-weight: 500; }
.input {
  width: 100%; font: 400 16px/24px var(--font-sans); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink);
}
.input::placeholder { color: #7b858c; }
.input:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.cta .input[aria-invalid="true"] { border-color: #f2857c; }
textarea.input { resize: vertical; min-height: 96px; }
.cta .input { background: rgba(246, 245, 241, .06); border-color: rgba(169, 184, 192, .5); color: var(--ink-inverse); }
.cta .input::placeholder { color: #8d9ca4; }
.cta .input:focus { outline-color: var(--rain-light); border-color: var(--rain-light); }
.form-status { font-size: 14px; min-height: 22px; }
.form-status.error { color: var(--danger); }
.form-status.success { color: var(--success); }
.cta .form-status.error { color: #f2857c; }
.cta .form-status.success { color: #5fc28d; }

/* ===== Подвал ===== */
.footer { border-top: 1px solid var(--line); padding: var(--space-8) 0; color: var(--ink-muted); font-size: 14px; }
.footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.footer a { color: var(--ink-muted); }
.footer a:hover { color: var(--ink); }

/* ===== Мотив «дождь» ===== */
.rain-art { width: 100%; height: auto; }
.rain-art .soft { fill: var(--rain-soft); }
.rain-art .rain { fill: var(--rain); }
.rain-art .sun { fill: var(--sun); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .card:hover, a.case:hover { transform: none; }
}

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .display { font-size: 52px; line-height: 56px; }
}

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: var(--nav-height); left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--surface-raised); border-bottom: 1px solid var(--line);
    padding: var(--space-2) var(--space-4) var(--space-4);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: var(--space-3) 0; font-size: 17px; border-bottom: 1px solid var(--line); }
  .nav-right .btn { display: none; }
  .case, .cta { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: var(--space-4); }
}

@media (max-width: 640px) {
  .wrap { padding: 0 var(--space-4); }
  .section { padding: var(--space-16) 0; }
  .grid-3 { grid-template-columns: 1fr; gap: var(--space-4); }
  .display { font-size: 40px; line-height: 44px; }
  .h1 { font-size: 32px; line-height: 38px; }
  .h2 { font-size: 28px; line-height: 34px; }
  .lead { font-size: 17px; line-height: 27px; }
  .card, .case-body, .case-facts { padding: var(--space-6); }
  .cta { padding: var(--space-8) var(--space-6); gap: var(--space-8); }
  .stat-value { font-size: 36px; line-height: 40px; }
  .case-facts { grid-template-columns: repeat(3, 1fr); gap: var(--space-4); padding: var(--space-6) var(--space-4); }
  .case-facts .stat { padding-left: var(--space-3); }
  .case-facts .stat-value { font-size: 28px; line-height: 32px; }
}
