/* =============================================
   MAINLER.RU — Global Design System
   Reset, tokens, typography, shared components
   ============================================= */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Colors */
  --primary: #E63312;
  --primary-dark: #B8280E;
  --primary-light: #FF4D2A;
  --black: #0A0A0A;
  --charcoal: #1A1A1A;
  --white: #FFFFFF;
  --off-white: #F7F7F7;
  --gold: #D4A853;
  --gray-300: #D1D1D1;
  --gray-500: #6B6B6B;
  --gray-700: #3A3A3A;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-heading: 'Space Grotesk', 'Arial', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
  --font-accent: 'Caveat', cursive;

  /* Spacing */
  --section-padding: clamp(60px, 10vw, 120px);
  --container-max: 1320px;
  --container-padding: clamp(16px, 4vw, 40px);

  /* Nav */
  --nav-height: 80px;
  --nav-height-scrolled: 64px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.15);
  --shadow-glow: 0 0 40px rgba(230,51,18,0.3);
}

/* --- Modern Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: auto; /* Lenis handles smooth scroll */
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--black);
  background: var(--white);
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* --- Preloader --- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}

.preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader__logo {
  width: 120px;
  height: auto;
  animation: preloaderPulse 1.2s ease-in-out infinite;
}

@keyframes preloaderPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1); }
}

/* --- Scroll Progress Bar --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  z-index: 9999;
  transition: none;
}

/* --- Typography --- */
.font-display {
  font-family: var(--font-display);
  font-weight: 700;
}

.font-heading {
  font-family: var(--font-heading);
}

.font-accent {
  font-family: var(--font-accent);
}

h1, .h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2, .h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h3, .h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  line-height: 1.25;
}

h4, .h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  line-height: 1.3;
}

p {
  font-size: clamp(0.95rem, 1.1vw, 1.125rem);
  line-height: 1.7;
  color: var(--gray-500);
}

.text-large {
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  line-height: 1.6;
}

.text-small {
  font-size: 0.875rem;
  line-height: 1.5;
}

.text-accent {
  font-family: var(--font-accent);
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  color: var(--gold);
}

.text-red { color: var(--primary); }
.text-gold { color: var(--gold); }
.text-white { color: var(--white); }
.text-gray { color: var(--gray-500); }

.text-center { text-align: center; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.08em; }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container--narrow {
  max-width: 900px;
}

.container--wide {
  max-width: 1600px;
}

.section {
  padding-block: var(--section-padding);
  position: relative;
}

.section--dark {
  background: var(--black);
  color: var(--white);
}

.section--dark p {
  color: var(--gray-300);
}

.section--charcoal {
  background: var(--charcoal);
  color: var(--white);
}

.section--charcoal p {
  color: var(--gray-300);
}

.section--offwhite {
  background: var(--off-white);
}

.section--red {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
}

.section--red p {
  color: rgba(255,255,255,0.85);
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid {
  display: grid;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 5000;
  transition: height 0.4s var(--ease-out), background 0.4s var(--ease-out), box-shadow 0.3s;
  display: flex;
  align-items: center;
}

.nav.scrolled {
  height: var(--nav-height-scrolled);
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 20px rgba(0,0,0,0.3);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 5001;
}

.nav__logo img {
  height: 40px;
  width: auto;
}

.nav__logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--white);
  letter-spacing: 0.05em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 36px);
}

.nav__link {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  transition: color 0.3s;
  position: relative;
  white-space: nowrap;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s var(--ease-out);
}

.nav__link:hover {
  color: var(--white);
}

.nav__link:hover::after {
  width: 100%;
}

.nav__phone {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--white);
  white-space: nowrap;
  transition: color 0.3s;
}

.nav__phone:hover {
  color: var(--primary-light);
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  z-index: 5001;
  padding: 8px;
  cursor: pointer;
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
  border-radius: 2px;
}

.nav__hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav__hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.nav__mobile {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 5000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-out), visibility 0.4s;
}

.nav__mobile.open {
  opacity: 1;
  visibility: visible;
}

.nav__mobile .nav__link {
  font-size: 1.4rem;
  color: rgba(255,255,255,0.85);
}

.nav__mobile .nav__phone {
  font-size: 1.2rem;
  margin-top: 20px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 36px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background 0.3s;
  white-space: nowrap;
  cursor: pointer;
  border: none;
}

.btn:hover {
  transform: scale(1.05);
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  box-shadow: 0 4px 20px rgba(230,51,18,0.3);
}

.btn--primary:hover {
  box-shadow: 0 8px 35px rgba(230,51,18,0.45);
}

.btn--outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.3);
}

.btn--outline:hover {
  border-color: var(--white);
  background: rgba(255,255,255,0.05);
}

.btn--white {
  background: var(--white);
  color: var(--black);
}

.btn--white:hover {
  box-shadow: var(--shadow-lg);
}

.btn--dark {
  background: var(--charcoal);
  color: var(--white);
}

.btn--whatsapp {
  background: #25D366;
  color: var(--white);
}

.btn--whatsapp:hover {
  background: #20BD5A;
  box-shadow: 0 8px 30px rgba(37,211,102,0.35);
}

.btn--sm {
  padding: 10px 24px;
  font-size: 0.85rem;
}

.btn--lg {
  padding: 18px 48px;
  font-size: 1.05rem;
}

/* --- Cards --- */
.card {
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
}

/* Glass card (on dark backgrounds) */
.card--glass {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card--glass:hover {
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

/* Light card */
.card--light {
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.card--light:hover {
  box-shadow: var(--shadow-md);
}

.card__body {
  padding: clamp(20px, 3vw, 36px);
}

.card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  color: var(--primary);
}

.card__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1rem, 1.2vw, 1.2rem);
  margin-bottom: 8px;
}

.card__text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--gray-500);
}

.section--dark .card__text,
.section--charcoal .card__text {
  color: var(--gray-300);
}

/* --- Hero Common --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--white);
}

.hero__video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10,10,10,0.7) 0%,
    rgba(10,10,10,0.5) 40%,
    rgba(10,10,10,0.8) 100%
  );
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  padding: 0 var(--container-padding);
}

.hero__label {
  font-family: var(--font-accent);
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  color: var(--gold);
  margin-bottom: 16px;
  display: inline-block;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 1.05;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero__title em {
  font-style: italic;
  color: var(--primary-light);
}

.hero__subtitle {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  color: rgba(255,255,255,0.75);
  margin-bottom: 32px;
  max-width: 600px;
  margin-inline: auto;
}

.hero__stats {
  display: flex;
  gap: clamp(24px, 4vw, 60px);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 40px;
}

.hero__stat {
  text-align: center;
}

.hero__stat-number {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: var(--white);
  line-height: 1;
}

.hero__stat-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-top: 6px;
}

/* Scroll Indicator */
.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.3);
  position: relative;
  overflow: hidden;
}

.hero__scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--white);
  animation: scrollLine 1.5s ease-in-out infinite;
}

@keyframes scrollLine {
  0% { top: -100%; }
  100% { top: 100%; }
}

/* --- WhatsApp FAB --- */
.whatsapp-fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 4000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
  animation: fabPulse 2s ease-in-out infinite;
}

.whatsapp-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(37,211,102,0.5);
  animation: none;
}

.whatsapp-fab svg {
  width: 28px;
  height: 28px;
  fill: var(--white);
}

@keyframes fabPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* --- Section Title --- */
.section-header {
  text-align: center;
  max-width: 700px;
  margin-inline: auto;
  margin-bottom: clamp(40px, 6vw, 80px);
}

.section-header__label {
  font-family: var(--font-accent);
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  color: var(--gold);
  margin-bottom: 12px;
  display: inline-block;
}

.section-header__title {
  margin-bottom: 16px;
}

.section-header__text {
  max-width: 550px;
  margin-inline: auto;
}

/* --- Footer --- */
.footer {
  background: var(--black);
  color: var(--white);
  padding: 60px 0 30px;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 40px;
}

.footer__logo img {
  height: 36px;
  width: auto;
  margin-bottom: 12px;
}

.footer__text {
  font-size: 0.85rem;
  color: var(--gray-500);
  max-width: 300px;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__link {
  font-size: 0.9rem;
  color: var(--gray-500);
  transition: color 0.3s;
}

.footer__link:hover {
  color: var(--white);
}

.footer__apps {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.footer__app-badge {
  height: 40px;
  width: auto;
  border-radius: 8px;
  transition: transform 0.3s;
}

.footer__app-badge:hover {
  transform: scale(1.05);
}

.footer__bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__copyright {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.footer__policy {
  font-size: 0.8rem;
  color: var(--gray-500);
  transition: color 0.3s;
}

.footer__policy:hover {
  color: var(--primary-light);
}

/* --- Stat Counter --- */
.stat-counter {
  text-align: center;
}

.stat-counter__number {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
  color: var(--primary);
}

.section--dark .stat-counter__number {
  color: var(--white);
}

.stat-counter__label {
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-top: 8px;
}

.section--dark .stat-counter__label {
  color: var(--gray-300);
}

/* --- Contacts Section --- */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.contact-item__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(230,51,18,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}

.section--dark .contact-item__icon {
  background: rgba(255,255,255,0.08);
  color: var(--primary-light);
}

.contact-item__icon svg {
  width: 22px;
  height: 22px;
}

.contact-item__label {
  font-size: 0.8rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.contact-item__value {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.05rem;
  transition: color 0.3s;
}

a.contact-item__value:hover {
  color: var(--primary);
}

/* --- Utility --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.overflow-hidden {
  overflow: hidden;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .nav__links {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }

  .nav__mobile {
    display: flex;
  }
}

@media (max-width: 768px) {
  .hero__stats {
    flex-direction: column;
    gap: 20px;
  }

  .footer__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer__text {
    max-width: 100%;
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  .whatsapp-fab {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .whatsapp-fab {
    animation: none;
  }

  .hero__scroll-line::after {
    animation: none;
  }
}
