/* Климат Эксперт — motion & polish (une-com inspired) */

:root {
  --color-primary: #0b3a6e;
  --color-primary-deep: #00244c;
  --color-accent: #c62828;
  --color-surface: #f7f5f2;
  --color-text: #1a1a1a;
  --color-muted: #5c5c5c;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 5rem;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  overflow-x: hidden;
}

/* ——— Header ——— */
.site-header {
  transition: background-color 0.4s var(--ease-out),
    box-shadow 0.4s var(--ease-out),
    backdrop-filter 0.4s var(--ease-out);
}

.site-header.is-scrolled {
  background-color: #fbf9f6;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.site-header {
  background-color: #fbf9f6;
}

.site-logo {
  display: flex;
  align-items: center;
  height: 2.75rem;
}

.site-logo img {
  height: 100%;
  width: auto;
  max-width: 11.5rem;
  display: block;
  object-fit: contain;
}

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.08);
  will-change: transform;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      105deg,
      rgba(0, 24, 48, 0.62) 0%,
      rgba(0, 24, 48, 0.28) 48%,
      rgba(0, 20, 40, 0.18) 100%
    ),
    linear-gradient(180deg, rgba(0, 20, 40, 0.2) 0%, transparent 40%, rgba(0, 16, 32, 0.55) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 3rem 0 4rem;
}

.hero-brand {
  opacity: 0;
  transform: translateY(24px);
}

.hero-title-line {
  display: block;
  overflow: hidden;
}

.hero-title-line > span {
  display: block;
  opacity: 0;
  transform: translateY(110%);
}

.hero-sub,
.hero-cta {
  opacity: 0;
  transform: translateY(28px);
}

.hero.is-ready .hero-media img {
  animation: heroKenBurns 18s var(--ease-out) forwards;
}

@keyframes heroKenBurns {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

.scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scroll-hint-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.8), transparent);
  animation: scrollPulse 1.8s ease-in-out infinite;
}

/* ——— Split hero ——— */
.split-hero {
  align-items: stretch;
  padding-top: 0;
  background: var(--color-surface);
}

.split-pane {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
  outline: none;
  transition: flex-grow 0.95s var(--ease-out);
}

.split-pane + .split-pane {
  box-shadow: -1px 0 0 rgba(27, 28, 26, 0.14);
}

.split-hero.has-open .split-pane {
  flex-grow: 0.62;
}

.split-hero.has-open .split-pane.is-open {
  flex-grow: 1.55;
}

.split-pane:focus-visible {
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

.split-pane__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.split-pane__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transform: scale(1.08);
  will-change: transform;
}

.split-pane--hum .split-pane__media img {
  object-position: 28% 42%;
}

.split-pane.is-open.is-ready .split-pane__media img {
  animation: heroKenBurns 18s var(--ease-out) forwards;
}

.split-pane__veil {
  position: absolute;
  inset: 0;
  transition: opacity 0.7s var(--ease-out);
}

.split-pane__veil--dark {
  z-index: 1;
  opacity: 0;
  background:
    linear-gradient(
      105deg,
      rgba(0, 24, 48, 0.66) 0%,
      rgba(0, 24, 48, 0.34) 52%,
      rgba(0, 20, 40, 0.22) 100%
    ),
    linear-gradient(180deg, rgba(0, 20, 40, 0.18) 0%, transparent 42%, rgba(0, 16, 32, 0.5) 100%);
}

.split-pane__veil--light {
  z-index: 2;
  background: rgba(247, 245, 242, 0.78);
}

.split-pane--hum .split-pane__veil--light {
  background: rgba(251, 249, 246, 0.5);
}

.split-pane.is-open .split-pane__veil--light {
  opacity: 0;
}

.split-pane.is-open .split-pane__veil--dark {
  opacity: 1;
}

.split-pane__face {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6.5rem 1.25rem 3rem;
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.7s var(--ease-out);
}

.split-pane.is-open .split-pane__face {
  opacity: 0;
  transform: translateY(-18px);
}

.split-hero.has-open .split-pane:not(.is-open) .split-pane__face {
  transform: scale(0.92);
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.split-pane__index {
  font-family: Manrope, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.split-pane__title {
  font-family: Manrope, sans-serif;
  font-size: clamp(2.15rem, 3.6vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--color-text);
}

.split-pane__rule {
  width: 2.5rem;
  height: 1px;
  margin: 1.35rem 0 0.9rem;
  background: rgba(27, 28, 26, 0.28);
}

.split-pane__body {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6.5rem 1.5rem 3rem;
  pointer-events: none;
}

.split-pane.is-open .split-pane__body {
  pointer-events: auto;
}

.split-hero .scroll-hint {
  color: rgba(27, 28, 26, 0.55);
  pointer-events: none;
  transition: opacity 0.45s var(--ease-out);
}

.split-hero .scroll-hint-line {
  background: linear-gradient(to bottom, rgba(27, 28, 26, 0.55), transparent);
}

.split-hero.is-hint .scroll-hint {
  opacity: 1;
}

.split-hero.has-open .scroll-hint {
  opacity: 0;
}

@media (max-width: 767px) {
  .split-hero {
    flex-direction: column;
  }

  .split-pane {
    flex: none;
    width: 100%;
    min-height: 50vh;
    min-height: 50dvh;
  }

  .split-hero.has-open .split-pane {
    min-height: 28vh;
    min-height: 28dvh;
  }

  .split-hero.has-open .split-pane.is-open {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .split-pane + .split-pane {
    box-shadow: 0 -1px 0 rgba(27, 28, 26, 0.14);
  }

  .split-pane__title {
    font-size: clamp(2.5rem, 12vw, 3.5rem);
  }

  .split-hero .scroll-hint {
    display: none;
  }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.35; transform: scaleY(0.7); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

/* ——— Designer grilles ——— */
.grilles {
  position: relative;
  min-height: 92vh;
  min-height: 92dvh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
}

.grilles__media,
.grilles__overlay {
  position: absolute;
  inset: 0;
}

.grilles__media {
  overflow: hidden;
}

.grilles__shift {
  position: absolute;
  inset: -7%;
  transition: transform 1.1s var(--ease-out);
  will-change: transform;
}

.grilles__shift img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  transform: scale(1.08);
  will-change: transform;
}

.grilles.is-ready .grilles__shift img {
  animation: heroKenBurns 18s var(--ease-out) forwards;
}

.grilles__overlay {
  background:
    linear-gradient(180deg, rgba(12, 14, 16, 0.05) 0%, rgba(12, 14, 16, 0.08) 38%, rgba(12, 14, 16, 0.78) 100%),
    linear-gradient(90deg, rgba(12, 14, 16, 0.45) 0%, rgba(12, 14, 16, 0.12) 55%, transparent 100%);
}

.grilles__content {
  position: relative;
  z-index: 1;
  padding-top: 6rem;
  padding-bottom: 4.5rem;
}

.grilles__points {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 56rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.grilles__points li {
  font-family: Manrope, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}

@media (min-width: 768px) {
  .grilles__points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
  }
}

.plan .grilles__shift img {
  object-position: 68% 46%;
}

.plan .grilles__overlay {
  background:
    linear-gradient(180deg, rgba(8, 16, 28, 0.06) 0%, rgba(8, 16, 28, 0.1) 40%, rgba(8, 16, 28, 0.8) 100%),
    linear-gradient(100deg, rgba(8, 16, 28, 0.5) 0%, rgba(8, 16, 28, 0.18) 48%, rgba(8, 16, 28, 0.04) 100%);
}

/* ——— Reveal on scroll ——— */
.reveal {
  opacity: 0;
  transform: translateY(56px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
  will-change: opacity, transform;
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

.reveal-fade {
  opacity: 0;
  transition: opacity 0.8s var(--ease-out);
}

.reveal-fade.is-in {
  opacity: 1;
}

.reveal-scale {
  opacity: 0;
  transform: scale(1.06);
  transition:
    opacity 1s var(--ease-out),
    transform 1.2s var(--ease-out);
}

.reveal-scale.is-in {
  opacity: 1;
  transform: scale(1);
}

/* ——— Gallery ——— */
.gallery-track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-card {
  scroll-snap-align: center;
  flex-shrink: 0;
  width: min(22rem, 85vw);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid rgba(195, 198, 209, 0.35);
  transition: transform 0.45s var(--ease-out);
}

.gallery-card:hover {
  transform: translateY(-4px);
}

.gallery-card img {
  width: 100%;
  height: 16rem;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}

.gallery-card:hover img {
  transform: scale(1.06);
}

/* ——— FAQ ——— */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s var(--ease-out), opacity 0.3s ease;
}

.faq-item.active .faq-answer {
  max-height: 320px;
  opacity: 1;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-icon {
  transition: transform 0.3s var(--ease-out);
}

/* ——— Mobile menu ——— */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 36, 76, 0.96);
  display: flex;
  flex-direction: column;
  padding: 6rem 2rem 2rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out), visibility 0.35s;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu a {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.mobile-menu.is-open a {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu.is-open a:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu.is-open a:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu.is-open a:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu.is-open a:nth-child(4) { transition-delay: 0.2s; }
.mobile-menu.is-open a:nth-child(5) { transition-delay: 0.25s; }
.mobile-menu.is-open a:nth-child(6) { transition-delay: 0.3s; }
.mobile-menu.is-open a:nth-child(7) { transition-delay: 0.35s; }
.mobile-menu.is-open a:nth-child(8) { transition-delay: 0.4s; }
.mobile-menu.is-open a:nth-child(9) { transition-delay: 0.45s; }

/* ——— Sticky mobile CTA ——— */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(251, 249, 246, 0.95);
  border-top: 1px solid rgba(195, 198, 209, 0.4);
  backdrop-filter: blur(10px);
  transform: translateY(110%);
  transition: transform 0.4s var(--ease-out);
}

.sticky-cta.is-visible {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .sticky-cta { display: none; }
}

/* ——— Buttons ——— */
.btn-primary {
  background-color: var(--color-accent);
  color: #fff;
  transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.btn-primary:hover {
  background-color: #a51f1f;
  box-shadow: 0 8px 24px rgba(198, 40, 40, 0.28);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-ghost-light {
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.btn-ghost-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* utility */
.bg-custom-surface { background-color: var(--color-surface); }
.bg-custom-primary { background-color: var(--color-primary); }
.bg-custom-accent { background-color: var(--color-accent); }
.text-custom-primary { color: var(--color-primary); }
.text-custom-accent { color: var(--color-accent); }

/* ——— Legal / article prose ——— */
.legal-prose h1 {
  font-family: Manrope, sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-primary-deep);
  margin-bottom: 1.5rem;
}

.legal-prose h2 {
  font-family: Manrope, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 2rem 0 0.75rem;
}

.legal-prose h3 {
  font-family: Manrope, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
}

.legal-prose p,
.legal-prose li {
  color: var(--color-muted);
  line-height: 1.7;
  margin-bottom: 0.85rem;
}

.legal-prose ul,
.legal-prose ol {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.legal-prose ul { list-style: disc; }
.legal-prose ol { list-style: decimal; }

.legal-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 1.25rem 0;
}

.legal-prose th,
.legal-prose td {
  border: 1px solid rgba(195, 198, 209, 0.5);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.legal-prose th {
  background: #f5f3f0;
  font-weight: 600;
  color: var(--color-text);
}

.legal-prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ——— Cookie banner ——— */
.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
  max-width: 40rem;
  margin: 0 auto;
}

.cookie-banner__inner {
  background: #fff;
  border: 1px solid rgba(195, 198, 209, 0.55);
  border-radius: 1rem;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 16px 40px rgba(0, 36, 76, 0.14);
}

.cookie-banner__inner p {
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.5;
  margin-bottom: 0.85rem;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ——— Consent checkbox ——— */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  text-align: left;
}

.consent-row input {
  margin-top: 0.2rem;
  accent-color: var(--color-primary);
}

.consent-row label {
  font-size: 0.75rem;
  color: var(--color-muted);
  line-height: 1.45;
}

.lead-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.lead-status {
  color: var(--color-muted);
}

.lead-status.is-error {
  color: #9f1c1f;
}

.lead-status.is-ok {
  color: #0b3a6e;
}

/* ——— Articles grid ——— */
.article-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(195, 198, 209, 0.35);
  transition: opacity 0.25s ease;
}

.article-card:hover {
  opacity: 0.85;
}

.article-card h3 {
  font-family: Manrope, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.65rem;
  line-height: 1.35;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.social-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--color-primary);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.social-chip:hover {
  border-bottom-color: var(--color-accent);
}
