/* ==========================================================================
   R4 Edge — corporate website styles
   Light, restrained, self-contained. No external resources.
   ========================================================================== */

:root {
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff4ff;

  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --surface: #ffffff;

  --text: #0f172a;
  --text-muted: #334155;
  --text-subtle: #64748b;

  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 14px;

  --container: 1120px;
  --header-h: 68px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
}

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

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

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   Language switching
   -------------------------------------------------------------------------- */

html[data-lang="ru"] .lang-en {
  display: none;
}

html[data-lang="en"] .lang-ru {
  display: none;
}

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 80px 0;
}

.section--alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 680px;
  margin-bottom: 44px;
}

.section-head--tight {
  margin-bottom: 24px;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: 32px;
  margin-bottom: 14px;
}

.lead {
  color: var(--text-muted);
  font-size: 17px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  padding: 13px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-xs);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--text);
}

.brand svg {
  flex: none;
}

.nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-list a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
}

.nav-list a:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 8px;
}

/* Language toggle */
.lang-toggle {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.lang-toggle button {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-subtle);
  background: transparent;
  border: 0;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-toggle button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}

.lang-toggle button:hover {
  color: var(--accent);
}

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: 76px 0 72px;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 780px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 620px;
  margin-bottom: 30px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.hero-stat strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.hero-stat span {
  font-size: 14px;
  color: var(--text-subtle);
}

/* --------------------------------------------------------------------------
   Services
   -------------------------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

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

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 18px;
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.card p {
  color: var(--text-muted);
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   Metrics band
   -------------------------------------------------------------------------- */

.metrics {
  background: var(--text);
  color: #ffffff;
}

.metrics .section {
  padding: 62px 20px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}

.metric strong {
  display: block;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: #ffffff;
}

.metric span {
  font-size: 14px;
  color: #cbd5e1;
}

/* --------------------------------------------------------------------------
   Process
   -------------------------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  counter-reset: step;
}

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

.step-num {
  display: inline-block;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

.step h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.step p {
  color: var(--text-muted);
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text p + p {
  margin-top: 16px;
}

.about-text p {
  color: var(--text-muted);
  font-size: 16px;
}

.facts {
  display: grid;
  gap: 14px;
}

.fact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
}

.fact strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.fact span {
  font-size: 14px;
  color: var(--text-subtle);
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 44px;
  align-items: start;
}

.contact-info h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.contact-info > p {
  color: var(--text-muted);
  margin-bottom: 26px;
}

.contact-list {
  display: grid;
  gap: 18px;
}

.contact-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.contact-item svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-top: 2px;
}

.contact-item dt {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin-bottom: 2px;
}

.contact-item dd {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.contact-item dd a {
  color: var(--text);
}

.contact-item dd a:hover {
  color: var(--accent);
}

/* Form */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}

.field input,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  min-height: 128px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-note {
  font-size: 13px;
  color: var(--text-subtle);
  margin-top: 12px;
}

.form-success {
  display: none;
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid #c7d7fb;
  color: var(--accent-hover);
  font-size: 15px;
  font-weight: 500;
}

.form-success.is-visible {
  display: block;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 44px 0 32px;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.footer-nav a {
  font-size: 15px;
  color: var(--text-muted);
}

.footer-nav a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-subtle);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

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

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

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

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }
}

@media (max-width: 760px) {
  .section {
    padding: 60px 0;
  }

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

  .header-actions {
    order: 2;
    margin-left: 0;
  }

  .nav {
    order: 4;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-left: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 10px 20px 18px;
    display: none;
  }

  .nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav-list a {
    padding: 12px 10px;
    font-size: 16px;
  }

  .header-actions .btn--primary {
    display: none;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 16px;
  }

  .cards,
  .steps {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 56px 0 52px;
  }

  .hero-cta .btn {
    flex: 1 1 100%;
  }

  .hero-stats {
    gap: 22px;
  }

  .form-card {
    padding: 22px 18px;
  }

  .footer-top {
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

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

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