/* Оконный Гид — landing theme.
   Builds on the Melke design system tokens (../styles.css): same graphite
   ink, neutrals, type scale and spacing. We warm it up for the country /
   cottage character per the brief — a terracotta CTA accent and sand-tinted
   section surfaces — without touching the system files. */

@import url("../styles.css");

:root {
  /* Warm "загородный" accent (terracotta) — the conversion CTA color */
  --okg-terra-700: #a4501f;
  --okg-terra-600: #c2622e;
  --okg-terra-500: #d3793f;
  --okg-terra-100: #f7ece3;
  /* Тот же акцент, осветлённый для тёмных фонов: белый текст/графит дают
     контраст ≥ 4.5 (WCAG AA для мелкого текста). */
  --okg-terra-on-dark: #dd8a52;

  /* Warm forest support tone (trust / GOST / eco notes) */
  --okg-pine-700: #2f5d44;
  --okg-pine-600: #3a7355;
  --okg-pine-100: #e9f1ec;

  /* Warm sand neutral for section backgrounds */
  --okg-sand:   #f7f4ef;
  --okg-sand-2: #efe9e0;

  /* Re-point semantic action tokens to the warm accent.
     Кнопка чуть темнее декоративного акцента: белый текст на #b85a26
     даёт контраст 4.64 (WCAG AA), на #c2622e было 4.13 — не проходило. */
  --action-primary:       #b85a26;
  --action-primary-hover: var(--okg-terra-700);
  --action-primary-text:  #ffffff;

  /* Warm the section surface + focus ring */
  --surface-subtle: var(--okg-sand);
  --surface-fill:   var(--okg-sand-2);
  --shadow-focus:   0 0 0 3px rgba(194, 98, 46, 0.22);

  /* Header height (used for anchor scroll offset) */
  --header-h: 116px;
}

/* ===== Тема: Зелёный (лес/природа) — основной акцент зелёный ===== */
body[data-theme="green"] {
  --okg-terra-700: #245c3a;
  --okg-terra-600: #2f7d4e;
  --okg-terra-500: #3d9560;
  --okg-terra-100: #e7f2ec;
  --okg-pine-700:  #245c3a;
  --okg-pine-600:  #2f7d4e;
  --okg-pine-100:  #e7f2ec;
  --okg-sand:      #f3f6f4;
  --okg-sand-2:    #e7ece9;
  --action-primary:       var(--okg-terra-600);
  --action-primary-hover: var(--okg-terra-700);
  --surface-subtle: var(--okg-sand);
  --surface-fill:   var(--okg-sand-2);
  --shadow-focus:  0 0 0 3px rgba(47, 125, 78, 0.22);
}

/* ===== Тема: Зелёный + Голубой — зелёный основной, голубой второстепенный ===== */
body[data-theme="greenblue"] {
  --okg-terra-700: #245c3a;
  --okg-terra-600: #2f7d4e;
  --okg-terra-500: #3d9560;
  --okg-terra-100: #e7f2ec;
  --okg-pine-700:  #1f5f8b;   /* небесно-голубой как «воздух» */
  --okg-pine-600:  #2a80b9;
  --okg-pine-100:  #e8f2f9;
  --okg-sand:      #f2f6f7;
  --okg-sand-2:    #e6edef;
  --action-primary:       var(--okg-terra-600);
  --action-primary-hover: var(--okg-terra-700);
  --surface-subtle: var(--okg-sand);
  --surface-fill:   var(--okg-sand-2);
  --shadow-focus:  0 0 0 3px rgba(47, 125, 78, 0.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--surface-page); overflow-x: hidden; }

/* Anchor targets clear the sticky header */
[id] { scroll-margin-top: calc(var(--header-h) + 8px); }

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { font-family: var(--font-sans); }

.okg-container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}

.okg-section { padding-block: clamp(56px, 8vw, 104px); }

/* Появление блоков — ЧИСТО НА CSS и БЕЗ анимации прозрачности.
   Анимируется только сдвиг, поэтому даже если анимация не запустится
   или «замрёт» на первом кадре (заблокированные анимации, экономия
   энергии, вебвью), текст и формы остаются полностью читаемыми.
   Для лендинга это важнее, чем эффект фейда. */
.okg-rev { animation: okgUp .62s var(--ease); }
@keyframes okgUp { from { transform: translateY(20px); } to { transform: none; } }

/* Мобильные брейкпоинты */
@media (max-width: 720px) {
  /* Увеличенные зоны нажатия для мелких кнопок-чипов (створки и пр.) */
  .okg-tap { min-height: 44px; padding-inline: 14px !important; }
}

/* Reduced-motion: disable reveal transitions */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* ============================ Layout grids ============================ */
.okg-grid { display: grid; gap: 22px; }
.okg-grid-5 { grid-template-columns: repeat(5, 1fr); }
.okg-grid-4 { grid-template-columns: repeat(4, 1fr); }
.okg-grid-3 { grid-template-columns: repeat(3, 1fr); }
.okg-grid-2 { grid-template-columns: repeat(2, 1fr); }

.okg-hero-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 48px; align-items: center; }
.okg-split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.okg-contacts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: stretch; }
.okg-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.1fr; gap: 40px; }

.okg-show-mobile { display: none !important; }

/* Sticky header desktop nav */
.okg-nav { display: flex; gap: 22px; align-items: center; }

/* ============================ Tablet ============================ */
@media (max-width: 1040px) {
  .okg-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .okg-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .okg-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .okg-hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .okg-calc-grid { grid-template-columns: 1fr !important; }
  .okg-calc-grid > div:last-child { position: static !important; }
}

/* Compact header + floating contact bar kick in below 1024 so tablet
   widths don't crowd the nav/phone/CTA row. */
@media (max-width: 1024px) {
  .okg-show-desktop { display: none !important; }
  .okg-show-mobile { display: flex !important; }
  body { padding-bottom: 78px; } /* room for floating mobile bar */
}

/* ============================ Mobile ============================ */
@media (max-width: 720px) {
  :root { --header-h: 74px; }
  .okg-section { padding-block: clamp(44px, 9vw, 64px); }
  .okg-grid-5, .okg-grid-4, .okg-grid-3, .okg-grid-2,
  .okg-split, .okg-contacts-grid { grid-template-columns: 1fr; }
  .okg-split { gap: 28px; }

  /* Галерея работ — 2 колонки, не одна длинная лента */
  .okg-gallery { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }

  /* Футер — 2 колонки, логотип на всю ширину */
  .okg-footer-grid { grid-template-columns: 1fr 1fr; gap: 26px 24px; }
  .okg-footer-grid > *:first-child { grid-column: 1 / -1; }

  .okg-calc-config { grid-template-columns: 1fr !important; }
  .okg-calc-config > svg { max-width: 280px; margin-inline: auto; }
  .okg-calc-types { grid-template-columns: repeat(2, 1fr) !important; }
  .okg-calc-profiles { grid-template-columns: 1fr 1fr !important; }
  .okg-calc-addons { grid-template-columns: 1fr !important; }
  .okg-theme-switch { bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important; left: 12px !important; }
}

/* ============================ Small phones ============================ */
@media (max-width: 400px) {
  .okg-gallery { grid-template-columns: 1fr 1fr !important; }
  .okg-calc-profiles { grid-template-columns: 1fr !important; }
  .okg-footer-grid { grid-template-columns: 1fr; }
  .okg-footer-grid > *:first-child { grid-column: auto; }
}

/* ===================== Hero animated circles ===================== */
@keyframes okgSpin { to { transform: rotate(360deg); } }
@keyframes okgSpinRev { to { transform: rotate(-360deg); } }
@keyframes okgPulse { 0%, 100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes okgGrid { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }

.okg-hero-grid-anim {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(100deg, rgba(255,255,255,.5) 0%, rgba(255,255,255,.5) 1px, transparent 1px, transparent 4%);
  background-size: 200% 200%;
  opacity: .1;
  animation: okgGrid 40s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 30%, #000);
  mask-image: radial-gradient(ellipse at center, transparent 30%, #000);
}

/* ===================== Spotlight hover on cards ===================== */
.okg-spot { position: relative; }
.okg-spot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(194,98,46,.16), transparent 60%);
  opacity: 0; transition: opacity .35s var(--ease);
}
.okg-spot:hover::after { opacity: 1; }

.okg-spot-over { position: relative; }
.okg-spot-over::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.32), transparent 55%);
  mix-blend-mode: soft-light; opacity: 0; transition: opacity .35s var(--ease);
}
.okg-spot-over:hover::after { opacity: 1; }

@media (max-width: 1024px){:root{--okg-cookie-offset:90px}}
