/* Editorial v5 — композиция, шум, шейдер под палитру, без правки разметки */

html {
  overflow-x: clip;
}

body {
  letter-spacing: 0.01em;
}

/* Лёгкий зерновой слой поверх вуали */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

body > main,
body > .site-footer {
  z-index: 2;
}

.shader-bg {
  filter: hue-rotate(312deg) saturate(1.25) contrast(1.05);
  opacity: 0.1;
}

html.theme-light.has-shader-bg .shader-bg {
  opacity: 0.22;
}

.page-bg {
  background-image:
    radial-gradient(ellipse 130% 90% at 0% 0%, var(--page-bg-1), transparent 58%),
    radial-gradient(ellipse 100% 80% at 100% 10%, var(--page-bg-2), transparent 55%),
    radial-gradient(ellipse 110% 70% at 50% 100%, var(--page-bg-3), transparent 48%),
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--bg) 48%, transparent) 0%,
      color-mix(in srgb, var(--bg) 40%, transparent) 50%,
      color-mix(in srgb, var(--bg) 55%, transparent) 100%
    ),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 88px,
      rgba(255, 255, 255, 0.02) 88px,
      rgba(255, 255, 255, 0.02) 89px
    );
}

html.theme-light .page-bg {
  background-image:
    radial-gradient(ellipse 120% 85% at 5% 0%, var(--page-bg-1), transparent 55%),
    radial-gradient(ellipse 95% 75% at 100% 8%, var(--page-bg-2), transparent 50%),
    radial-gradient(ellipse 100% 60% at 50% 100%, var(--page-bg-3), transparent 44%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 96px,
      rgba(26, 20, 16, 0.035) 96px,
      rgba(26, 20, 16, 0.035) 97px
    );
}

.site-header {
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: none;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--header-bg) 92%, transparent) 0%,
    color-mix(in srgb, var(--header-bg) 75%, transparent) 100%
  );
}

.logo {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: clamp(0.88rem, 1.9vw, 1.08rem);
  font-weight: 700;
  font-variation-settings: "SOFT" 40, "WONK" 1;
}

.logo span {
  font-weight: 800;
}

.nav-desktop a:not(.btn) {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  padding-bottom: 0.15rem;
}

.nav-desktop a:not(.btn):hover {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.btn {
  border-radius: var(--radius);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent-dim);
  box-shadow:
    var(--shadow-inset),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 10px 36px var(--accent-glow);
  filter: none;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  border-radius: var(--radius);
}

.flow-section {
  padding: clamp(3.25rem, 7vw, 5.5rem) 0;
}

.flow-section--rail {
  background: linear-gradient(
    105deg,
    color-mix(in srgb, var(--bg-elevated) 88%, var(--accent)) 0%,
    var(--bg) 38%,
    var(--bg) 100%
  );
  border-block: 1px solid var(--border);
  border-left: 4px solid var(--accent);
}

.flow-kicker {
  border-radius: var(--radius);
  letter-spacing: 0.16em;
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--bg-card) 70%, transparent);
  color: var(--accent-hover);
}

.flow-open__main h1 {
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-variation-settings: "SOFT" 55, "WONK" 1;
}

.flow-open__lede {
  max-width: 52ch;
  font-size: 1.12rem;
}

.flow-open__rail {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card), var(--shadow-inset);
}

.flow-bent__cell {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  transform: none;
}

.flow-bent__cell:hover {
  transform: translateY(-3px) rotate(-0.35deg);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong));
}

.flow-h2 {
  letter-spacing: -0.03em;
  border-left: 4px solid var(--accent);
  padding-left: 0.85rem;
}

.flow-matrix__row {
  border-radius: var(--radius);
}

.flow-matrix__symptom,
.flow-matrix__fix {
  border-radius: var(--radius);
}

.flow-brief-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card-hover);
}

.site-footer {
  border-top: 2px solid var(--border-strong);
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 100%);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: reduce) {
  main > section {
    animation: none !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  main > section {
    animation: ed-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  main > section:nth-child(1) {
    animation-delay: 0.02s;
  }
  main > section:nth-child(2) {
    animation-delay: 0.06s;
  }
  main > section:nth-child(3) {
    animation-delay: 0.1s;
  }
  main > section:nth-child(4) {
    animation-delay: 0.14s;
  }
  main > section:nth-child(5) {
    animation-delay: 0.18s;
  }
  main > section:nth-child(6) {
    animation-delay: 0.22s;
  }
  main > section:nth-child(7) {
    animation-delay: 0.26s;
  }
  main > section:nth-child(8) {
    animation-delay: 0.3s;
  }

  @keyframes ed-rise {
    from {
      opacity: 0;
      transform: translateY(18px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (min-width: 1100px) {
  .container {
    max-width: 76rem;
    padding-left: max(2.75rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
  }
}

html.theme-light .site-header {
  border-bottom-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow: 0 1px 0 rgba(26, 20, 16, 0.05);
}

html {
  font-optical-sizing: auto;
}
