/* ============================================
   Окна 8эйт — Design System
   ============================================ */

:root {
  --bg: #ffffff;
  --bg-warm: #f5f3ef;
  --surface: #ffffff;
  --ink: #131211;
  --ink-2: #38332e;
  --ink-3: #6e675f;
  --ink-4: #a8a299;
  --border: #d9d3c8;
  --border-soft: #e5e0d6;
  --accent: #4a4744;
  --accent-hover: #2a2826;
  --accent-soft: rgba(74, 71, 68, 0.08);
  --accent-rgb: 74,71,68;
  --shadow-sm: 0 1px 2px rgba(20, 18, 16, 0.04), 0 2px 8px rgba(20, 18, 16, 0.04);
  --shadow-md: 0 8px 32px rgba(20, 18, 16, 0.08);
  --shadow-lg: 0 24px 60px rgba(20, 18, 16, 0.12);
  --radius-sm: 2px;
  --radius-md: 6px;
  --radius-lg: 16px;
  --container: 1480px;
  --motion: 1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* ============================================
   Typography scale
   ============================================ */
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-3);
}
.eyebrow.accent { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
  text-wrap: balance;
}

.display {
  font-size: clamp(48px, 8vw, 128px);
  font-weight: 300;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.h1 { font-size: clamp(40px, 5.6vw, 88px); font-weight: 300; letter-spacing: -0.035em; }
.h2 { font-size: clamp(32px, 4vw, 60px); font-weight: 300; letter-spacing: -0.03em; }
.h3 { font-size: clamp(22px, 2vw, 32px); font-weight: 400; letter-spacing: -0.02em; }
.h4 { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }

.lead {
  font-size: clamp(17px, 1.4vw, 22px);
  line-height: 1.45;
  color: var(--ink-2);
  font-weight: 400;
  text-wrap: pretty;
}

.muted { color: var(--ink-3); }
.italic { font-style: italic; font-family: 'Cormorant Garamond', serif; font-weight: 400; }

/* ============================================
   Layout
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
}
.container-wide { max-width: 1720px; margin: 0 auto; padding: 0 40px; }

section { padding: 120px 0; position: relative; }
section.tight { padding: 80px 0; }

@media (max-width: 768px) {
  .container, .container-wide { padding: 0 20px; }
  section { padding: 72px 0; }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(var(--accent-rgb),0.25); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { background: var(--ink-2); transform: translateY(-2px); }

.btn svg { transition: transform 0.3s; }
.btn:hover svg { transform: translateX(4px); }

/* arrow link */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
  transition: gap 0.3s, color 0.3s;
}
.arrow-link:hover { gap: 16px; color: var(--accent); border-color: var(--accent); }

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.4s, backdrop-filter 0.4s, padding 0.4s, border-color 0.4s, color 0.4s;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  /* Светлый полупрозрачный фон, всегда виден */
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  color: var(--ink);
}
.nav .wordmark,
.nav .wordmark .wm-text,
.nav .nav-phone {
  color: var(--ink);
}
.nav .nav-links a {
  color: var(--ink-2);
}
.nav .nav-links a:hover,
.nav .nav-links a.active {
  color: var(--ink);
}
.nav.scrolled {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  padding: 14px 40px;
  border-bottom-color: var(--border-soft);
  color: var(--ink);
}
.nav.scrolled .wordmark,
.nav.scrolled .wordmark .wm-text,
.nav.scrolled .nav-phone {
  color: var(--ink);
}
.nav.scrolled .nav-links a {
  color: var(--ink-2);
}
.nav.scrolled .nav-links a:hover,
.nav.scrolled .nav-links a.active {
  color: var(--ink);
}

/* ===== Левый блок шапки: wordmark + gswitch ===== */
.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ===== Wordmark (единый знак на всех сайтах) ===== */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.06em;
  line-height: 1;
  text-decoration: none;
}
.wordmark .wm-inf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 22px;
}
.wordmark .wm-inf svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.wordmark .wm-inf svg path {
  stroke-dasharray: 220;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.4s cubic-bezier(.7,0,.2,1);
}
.wordmark:hover .wm-inf svg path {
  animation: infTrace 1.6s cubic-bezier(.7,0,.2,1);
}
@keyframes infTrace {
  0% { stroke-dashoffset: 220; }
  100% { stroke-dashoffset: 0; }
}
.wordmark .wm-text {
  letter-spacing: 0.16em;
  font-weight: 400;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  position: relative;
  padding: 4px 0;
  transition: color 0.2s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--ink); }

/* ===== Group switcher (∞ Группа dropdown) ===== */
.gswitch {
  position: relative;
  display: inline-block;
}
.gs-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-soft);
  background: transparent;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color .25s, background .25s, color .25s;
}
.gs-trigger:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.gs-mark {
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
  transition: color .25s;
}
.gs-trigger:hover .gs-mark { color: #fff; }
.gs-label { letter-spacing: 0.08em; }
.gs-chev {
  opacity: 0.6;
  transition: transform .3s, opacity .25s;
}
.gswitch.open .gs-chev { transform: rotate(180deg); }
.gs-trigger:hover .gs-chev { opacity: 1; }

.gs-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 340px;
  background: #fff;
  border: 1px solid var(--border-soft);
  box-shadow: 0 16px 40px -10px rgba(0,0,0,0.12);
  padding: 12px;
  z-index: 200;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.gswitch.open .gs-pop {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.gs-pop[hidden] { display: block; }  /* мы управляем через .open + opacity */

.gs-pop-head {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 6px 10px 10px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 6px;
}
.gs-list {
  display: flex;
  flex-direction: column;
}
.gs-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  text-decoration: none;
  color: var(--ink);
  transition: background .2s;
  border-radius: 4px;
}
.gs-item:not(.is-current):hover {
  background: var(--bg-warm);
}
.gs-item.is-current {
  background: var(--bg-warm);
  cursor: default;
  pointer-events: none;
}
.gs-ix {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}
.gs-item.is-current .gs-ix { color: var(--ink); }
.gs-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gs-name {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-transform: uppercase;
}
.gs-sub {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.gs-go {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  transition: border-color .25s, background .25s, color .25s, transform .25s;
}
.gs-item:hover .gs-go {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  transform: rotate(-45deg);
}
.gs-here {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 4px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
}

/* На мобиле gswitch в шапке не показываем — есть отдельный блок в оверлее */
@media (max-width: 980px) {
  .gswitch { display: none; }
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-phone {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-phone-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #2da66f;
  box-shadow: 0 0 0 0 rgba(45,166,111,0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(45,166,111,0.6); }
  70% { box-shadow: 0 0 0 8px rgba(45,166,111,0); }
  100% { box-shadow: 0 0 0 0 rgba(45,166,111,0); }
}
.nav-burger {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  color: inherit;
}
.nav-burger span {
  display: block;
  position: absolute;
  left: 8px;
  width: 24px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s, opacity 0.3s, top 0.3s;
}
.nav-burger span:nth-child(1) { top: 13px; }
.nav-burger span:nth-child(2) { top: 19px; }
.nav-burger span:nth-child(3) { top: 25px; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* Mobile overlay */
.nav-mobile {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-mobile.open {
  opacity: 1;
  pointer-events: auto;
}
.nav-mobile-inner {
  width: 100%;
  max-width: 360px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.nav-mobile-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  margin: 0;
}
.nav-mobile-links a {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 300;
  color: var(--ink);
  text-decoration: none;
  padding: 10px 0;
  letter-spacing: -0.02em;
  transition: color 0.2s;
}
.nav-mobile-links a:hover,
.nav-mobile-links a.active {
  color: var(--accent);
}
.nav-mobile-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}
.nmg-head {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.nmg-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--border-soft);
}
.nmg-item:last-child { border-bottom: none; }
.nmg-item.is-current {
  color: var(--ink-3);
  pointer-events: none;
}
.nmg-name {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
}
.nmg-sub {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 400;
  margin-left: 8px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.nav-mobile-contacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}
.nav-mobile-phone {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  color: var(--ink);
  font-weight: 400;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-mobile-email {
  font-size: 15px;
  color: var(--ink-2);
  text-decoration: none;
  margin-top: 4px;
}
.nav-mobile-cta {
  align-self: flex-start;
  margin-top: 8px;
}

body.nav-open { overflow: hidden; }

@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-phone span { display: none; }
  .nav-phone { display: none; }
  .nav-cta { display: none; }
  .nav-burger { display: block; }
  .nav, .nav.scrolled { padding: 14px 20px; }
}

/* ============================================
   Reveal animation utility
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(calc(30px * var(--motion)));
  transition: opacity 0.9s cubic-bezier(0.22,1,0.36,1), transform 0.9s cubic-bezier(0.22,1,0.36,1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  * { animation: none !important; transition-duration: 0.01ms !important; }
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--ink);
  color: var(--bg);
  padding: 100px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 60px;
  padding-bottom: 80px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer h4 {
  color: rgba(255,255,255,0.5);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 24px;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.footer-links a { color: rgba(255,255,255,0.85); font-size: 15px; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }
.footer-brand {
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}
.footer-brand .logo-mark {
  display: block;
  flex-shrink: 0;
}
.footer-brand .lbl {
  font-size: 32px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 300;
  line-height: 1;
}
.footer-tagline { font-size: 15px; color: rgba(255,255,255,0.6); max-width: 280px; line-height: 1.5; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 32px;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-brand .logo-mark { width: 48px; height: 24px; }
  .footer-brand .lbl { font-size: 24px; }
  .footer-bottom { flex-direction: column; gap: 12px; }
}
