:root {
  --ink: #1b2430;
  --ink-soft: #4a5568;
  --paper: #ffffff;
  --paper-soft: #f6f7fb;
  --line: #e4e7ee;
  --primary: #1f3a5f;
  --primary-dark: #142943;
  --accent: #e08a2b;
  --accent-dark: #c5731a;
  --success: #2f8f5b;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(27, 36, 48, 0.08);
  --shadow-lg: 0 16px 40px rgba(27, 36, 48, 0.14);
  --container: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); text-align: center; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: inherit; text-decoration: none; }
ul { padding: 0; margin: 0; list-style: none; }

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

.section-lead {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
  font-size: 1.05rem;
}

section { padding: 5rem 0; }
section:nth-of-type(even) { background: var(--paper-soft); }

/* Buttons */
.btn {
  display: inline-block;
  padding: .8rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { position: relative; overflow: hidden; background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(224,138,43,.35); }
.btn--primary:hover { background: var(--accent-dark); }
.btn--primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg);
  transition: left .5s ease;
}
.btn--primary:hover::after { left: 130%; }
.btn--ghost { background: transparent; color: var(--primary); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--primary); }
.btn--outline { background: transparent; color: var(--primary); border-color: var(--primary); display: block; text-align: center; margin-top: 1.5rem; }
.btn--outline:hover { background: var(--primary); color: #fff; }
.btn--lg { padding: 1rem 2.2rem; font-size: 1.05rem; }
.btn--header { padding: .6rem 1.3rem; font-size: .9rem; }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s ease;
}
.header.is-scrolled { box-shadow: 0 4px 20px rgba(27,36,48,.1); }
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: .9rem;
  padding-bottom: .9rem;
  transition: padding .25s ease;
}
.header.is-scrolled .header__inner { padding-top: .55rem; padding-bottom: .55rem; }
.logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo span { font-size: .68rem; font-weight: 500; color: var(--ink-soft); }
.nav { display: flex; gap: 1.6rem; margin-left: auto; }
.nav a {
  position: relative;
  font-size: .93rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding-bottom: 2px;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav a:hover { color: var(--primary); }
.nav a:hover::after,
.nav a.is-active::after { transform: scaleX(1); }
.nav a.is-active { color: var(--primary); }
.burger { display: none; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
  background: var(--paper);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  z-index: 0;
  pointer-events: none;
}
.hero::before {
  width: 480px;
  height: 480px;
  top: -220px;
  right: -120px;
  background: radial-gradient(circle, rgba(224,138,43,.22), transparent 70%);
  animation: auroraDrift 18s ease-in-out infinite alternate;
}
.hero::after {
  width: 420px;
  height: 420px;
  bottom: -200px;
  left: -140px;
  background: radial-gradient(circle, rgba(31,58,95,.18), transparent 70%);
  animation: auroraDrift 22s ease-in-out infinite alternate-reverse;
}
@keyframes auroraDrift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 30px) scale(1.15); }
}
.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
  align-items: center;
}
.eyebrow {
  color: var(--accent-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .8rem;
  margin-bottom: .8rem;
}
.hero__lead { font-size: 1.1rem; }
.hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero__stats {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
}
.stat { display: flex; flex-direction: column; }
.stat__num { font-size: 2.1rem; font-weight: 800; color: var(--primary); }
.stat__label { color: var(--ink-soft); font-size: .92rem; }

/* Pains */
.pains__grid, .cases__grid, .services__grid, .pricing__grid {
  display: grid;
  gap: 1.5rem;
}
.pains__grid { grid-template-columns: repeat(4, 1fr); }
.pain-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  transition: transform .3s ease, box-shadow .3s ease;
}
.pain-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.pain-card:hover .pain-card__icon { transform: scale(1.15) rotate(-4deg); }
.pain-card__icon { font-size: 1.8rem; margin-bottom: .6rem; display: inline-block; transition: transform .3s ease; }
.pain-card p { margin: 0; font-size: .92rem; }

/* Cases */
.cases__grid { grid-template-columns: repeat(3, 1fr); }
.case-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .3s ease, box-shadow .3s ease;
}
.case-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.case-card__tag {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: .3rem .7rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  align-self: flex-start;
}
.case-card__row { display: flex; flex-direction: column; gap: .9rem; margin-bottom: 1rem; }
.case-card__label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.case-card__row p { margin: .2rem 0 0; font-size: .92rem; }
.case-card__result {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  font-size: .95rem;
  color: var(--success);
}
.case-card__result strong { color: var(--success); }

/* Services */
.services__grid { grid-template-columns: repeat(4, 1fr); }
.service-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease, box-shadow .3s ease;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.service-card__desc { font-size: .9rem; flex-grow: 1; }
.service-card__price {
  font-weight: 700;
  color: var(--primary);
  font-size: .92rem;
  border-top: 1px solid var(--line);
  padding-top: .8rem;
  margin-top: .4rem;
}

/* Pricing */
.pricing__grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
@property --border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
.price-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .3s ease, box-shadow .3s ease;
}
.price-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.price-card--featured {
  border: 2px solid var(--accent);
  background:
    linear-gradient(var(--paper), var(--paper)) padding-box,
    conic-gradient(from var(--border-angle), var(--accent), var(--primary), var(--accent)) border-box;
  box-shadow: var(--shadow-lg);
  transform: scale(1.03);
  animation: rotateBorder 5s linear infinite;
}
.price-card--featured:hover { transform: scale(1.03) translateY(-6px); }
@keyframes rotateBorder {
  to { --border-angle: 360deg; }
}
.price-card--featured.is-muted {
  border: 1px solid var(--line);
  background: var(--paper);
  animation: none;
}
.price-card.is-selected {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgba(224,138,43,.14), var(--shadow-lg);
}
.price-card.is-selected::after {
  content: "✓ Выбрано";
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: .25rem .6rem;
  border-radius: 999px;
}
.price-card__badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: .3rem .9rem;
  border-radius: 999px;
}
.price-card__for { font-size: .88rem; min-height: 2.6em; }
.price-card__price { font-size: 2rem; font-weight: 800; color: var(--primary); margin-bottom: 1rem; }
.price-card__list { flex-grow: 1; margin-bottom: 1rem; }
.price-card__list li {
  font-size: .9rem;
  padding: .35rem 0 .35rem 1.4rem;
  position: relative;
  color: var(--ink-soft);
}
.price-card__list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}
.price-card__value { font-size: .85rem; font-style: italic; color: var(--ink-soft); }

/* About */
.about__hero {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 3.5rem;
  align-items: center;
  margin-bottom: 3.5rem;
}
.about__photo {
  position: relative;
  margin: 0;
  border-radius: 20px;
  padding: 6px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  box-shadow: var(--shadow-lg);
}
.about__photo::before {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: -1;
  border-radius: 30px;
  background: radial-gradient(circle at 50% 40%, rgba(224,138,43,.28), transparent 70%);
  filter: blur(24px);
}
.about__photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 15px;
  transition: transform .4s ease;
}
.about__photo:hover img { transform: scale(1.02); }
.about__hero h2 { text-align: left; margin-top: .4rem; }
.about__intro { margin: 0 0 1rem; }
.about__hero-text .about__intro:last-child { margin-bottom: 0; }
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.timeline li {
  padding: .8rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .93rem;
  color: var(--ink-soft);
}
.timeline li:last-child { border-bottom: none; }
.timeline__date { display: block; font-weight: 700; color: var(--primary); font-size: .85rem; margin-bottom: .2rem; }
.cert-list li {
  font-size: .9rem;
  padding: .3rem 0 .3rem 1.4rem;
  position: relative;
  color: var(--ink-soft);
}
.cert-list li::before {
  content: "◆";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: .7rem;
  top: .5rem;
}

/* Final CTA */
.final-cta { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; }
.final-cta h2 { color: #fff; }
.final-cta__inner { text-align: center; max-width: 620px; }
.final-cta p { color: rgba(255,255,255,.85); }
.final-cta__consent { font-size: .8rem; margin-top: 1rem; color: rgba(255,255,255,.6); }
.final-cta__contacts { margin-top: 2rem; font-size: 1.05rem; font-weight: 600; }
.final-cta__contacts a:hover { text-decoration: underline; }
.final-cta__contacts span { margin: 0 .8rem; opacity: .5; }

/* Footer */
.footer { padding: 2rem 0; text-align: center; }
.footer p { font-size: .82rem; margin: 0; }

/* Modal — tariff request form */
.modal { display: none; }
.modal.is-open {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 41, 67, .55);
  backdrop-filter: blur(4px);
}
.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  background: var(--paper);
  border-radius: 18px;
  padding: 2.2rem;
  box-shadow: var(--shadow-lg);
  animation: modalPop .28s ease;
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.modal__close {
  position: absolute;
  top: .9rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--paper-soft);
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.modal__close:hover { background: var(--line); color: var(--ink); }
.modal__title { margin-bottom: .4rem; padding-right: 2rem; }
.modal__subtitle { font-size: .92rem; margin-bottom: 1.4rem; }
.modal__form label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1rem;
}
.modal__form input,
.modal__form textarea {
  display: block;
  width: 100%;
  margin-top: .35rem;
  padding: .7rem .9rem;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.modal__form input::placeholder,
.modal__form textarea::placeholder { color: #9aa3b2; }
.modal__form input:focus,
.modal__form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224,138,43,.15);
}
.modal__form input.is-invalid,
.modal__form textarea.is-invalid {
  border-color: #d64545;
  box-shadow: 0 0 0 3px rgba(214,69,69,.12);
}
.modal__form textarea { resize: vertical; }
.modal__submit { width: 100%; margin-top: .3rem; }
.modal__success { font-size: .95rem; color: var(--success); margin: 0; }
.modal__error { font-size: .9rem; color: #d64545; margin: .8rem 0 0; }
body.modal-open { overflow: hidden; }

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  z-index: 200;
  transition: width .1s linear;
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .3s ease, transform .3s ease, background .2s ease;
  z-index: 150;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-dark); }

/* Scroll-reveal */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

.pains__grid > *:nth-child(1), .cases__grid > *:nth-child(1), .services__grid > *:nth-child(1) { transition-delay: .05s; }
.pains__grid > *:nth-child(2), .cases__grid > *:nth-child(2), .services__grid > *:nth-child(2) { transition-delay: .12s; }
.pains__grid > *:nth-child(3), .cases__grid > *:nth-child(3), .services__grid > *:nth-child(3) { transition-delay: .19s; }
.pains__grid > *:nth-child(4), .services__grid > *:nth-child(4) { transition-delay: .26s; }
.services__grid > *:nth-child(5) { transition-delay: .33s; }
.services__grid > *:nth-child(6) { transition-delay: .4s; }
.services__grid > *:nth-child(7) { transition-delay: .47s; }
.services__grid > *:nth-child(8) { transition-delay: .54s; }
.pricing__grid > *:nth-child(1) { transition-delay: .05s; }
.pricing__grid > *:nth-child(2) { transition-delay: .15s; }
.pricing__grid > *:nth-child(3) { transition-delay: .25s; }
.about__grid > *:nth-child(1) { transition-delay: .05s; }
.about__grid > *:nth-child(2) { transition-delay: .15s; }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 1024px) {
  .pains__grid, .services__grid { grid-template-columns: repeat(2, 1fr); }
  .cases__grid, .pricing__grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  .price-card--featured { transform: none; }
  .hero__inner { grid-template-columns: 1fr; }
  .about__hero { grid-template-columns: 1fr; gap: 2rem; justify-items: center; text-align: center; }
  .about__photo { max-width: 340px; }
  .about__hero h2 { text-align: center; }
  .about__hero-text .eyebrow { text-align: center; }
  .about__grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 768px) {
  section { padding: 3.5rem 0; }
  .nav { display: none; }
  .burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
  }
  .burger span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
  .header__inner { flex-wrap: wrap; }
  .btn--header { order: 2; }
  .nav.is-open {
    display: flex;
    flex-direction: column;
    width: 100%;
    order: 3;
    gap: 0;
    margin-top: 1rem;
    border-top: 1px solid var(--line);
  }
  .nav.is-open a { padding: .9rem 0; border-bottom: 1px solid var(--line); }
  .burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger.is-open span:nth-child(2) { opacity: 0; }
  .burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .pains__grid, .services__grid { grid-template-columns: 1fr; }
  .hero__cta { flex-direction: column; }
  .hero__cta .btn { text-align: center; }
}
