/* =========================
   ESSENTIAL CSS VARIABLES
   ========================= */
:root {
  /* We'll keep just a few essential variables */
  --color-primary: #FF4B4B; /* Main accent color */
  --color-primary-dark: #EB5A53; /* Darker accent */
  --color-text: #333; /* Main text color */
  --color-text-light: #666; /* Secondary text */
  --color-text-lighter: #999; /* Tertiary text */
  --color-background: #fff; /* Page background */
  --color-background-alt: #F5F5F5; /* Section background */
  --color-background-dark: #D9D9D9; /* Hero background */
  --color-border: rgba(0, 0, 0, 0.05); /* Subtle borders */
  --transition-base: 0.3s ease;
}

/* =========================
   FONT FACE DEFINITIONS
   ========================= */
@font-face {
  font-family: 'Open Sans';
  src: url('fonts/open-sans-v40-cyrillic_latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('fonts/open-sans-v40-cyrillic_latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('fonts/open-sans-v40-cyrillic_latin-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('fonts/open-sans-v40-cyrillic_latin-300.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('fonts/open-sans-v40-cyrillic_latin-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('fonts/open-sans-v40-cyrillic_latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('fonts/open-sans-v40-cyrillic_latin-800.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* =========================
   GLOBAL RESET & BASE STYLES
   ========================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  /* Prevent scroll bounce on all devices */
  overscroll-behavior: none !important;
}
body {
  min-height: 100vh;
  font-family: 'Open Sans', sans-serif; /* Direct font family instead of var */
  color: #333; /* Direct color instead of var */
  background: #F5F5F5; /* Direct background color instead of var */
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
input, button, textarea, select { font: inherit; }

/* =========================
   LAYOUT CONTAINER
   ========================= */
.container {
  max-width: 71.25rem; /* 1140px - Direct value instead of var */
  margin: 0 auto;
  padding: 0 2.5rem; /* Direct padding instead of var */
}

/* =========================
   HEADER & NAVIGATION
   ========================= */
.site-header {
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  background: #fff; /* Direct color instead of var */
  border-bottom: 1px solid rgba(0, 0, 0, 0.05); /* Direct color instead of var */
  min-height: 45px;
}
.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}
.nav-content {
  display: flex;
  align-items: center;
  gap: 2rem; /* Direct value instead of var(--space-xl) */
}
.nav-links {
  display: flex;
  gap: 2rem; /* Direct value instead of var(--space-xl) */
  list-style: none;
  padding-bottom: 0.30rem; /* Align with bottom of logo */
}
.nav-links a {
  color: #333; /* Direct color instead of var */
  text-decoration: none;
  font-size: 0.813rem; /* Direct size instead of var(--font-size-sm) */
  transition: color 0.3s ease; /* Direct transition instead of var */
}
.nav-links a:hover { color: #FF4B4B; } /* Direct color instead of var */
.language-selector { display: flex; align-items: center; margin-left: 10px; }
.lang-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 22px; font-size: 0.7rem;
  background: #D9D9D9; /* Direct color instead of var */
  color: #333; /* Direct color instead of var */
  border: none; border-radius: 4px; cursor: pointer;
  transition: background-color 0.3s ease; /* Direct transition instead of var */
}
.lang-toggle,
.lang-toggle.active,
.lang-toggle:hover,
.lang-toggle:focus {
  background: #D9D9D9; /* Direct color instead of var */
  color: #333; /* Direct color instead of var */
}
.lang-toggle .lang-text { display: inline; }

/* =========================
   HERO SECTION
   ========================= */
.hero {
  padding: 50px 0 45px;
  background: #D9D9D9; /* Direct color instead of var */
  margin-top: 0;
}
.hero-content { display: flex; justify-content: space-between; align-items: center; gap: 3rem; } /* Direct gap instead of var */
.hero-text { flex: 1; }
.hero h1 {
  font-size: 3.125rem; /* Direct size instead of var */
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  margin-bottom: 0.75rem; /* Direct margin instead of var */
}
.hero h2 {
  font-size: 3.125rem; /* Direct size instead of var */
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
  margin-bottom: 1.5rem; /* Direct margin instead of var */
}
.tagline {
  color: #FF4B4B; /* Direct color instead of var */
  font-size: 1.75rem; /* Direct size instead of var */
  line-height: 1.3;
  font-weight: 500;
}
.hero-image-container { flex: 0 0 320px; width: 320px; height: 320px; margin: 0; }
.hero-image-container img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; } /* Direct border-radius instead of var */

/* =========================
   PORTFOLIO SECTION
   ========================= */
.portfolio { background: #F5F5F5; position: relative; } /* Direct color instead of var */
.portfolio-nav { background: #F5F5F5; } /* Direct color instead of var */
.portfolio-nav-content { display: flex; justify-content: flex-end; max-width: calc(71.25rem - 90px); margin: 0 auto; } /* Direct max-width instead of var */
.portfolio-btn {
  display: flex; justify-content: center; align-items: center;
  width: 140px; height: 54px;
  background: #999; /* Direct color instead of var */
  color: #fff; /* Direct color instead of var */
  border: none; border-radius: 0 0 1rem 1rem; /* Direct border-radius instead of var */
  cursor: pointer; transition: background-color 0.3s ease; /* Direct transition instead of var */
}
.portfolio-btn.active { background-color: #EB5A53; } /* Direct color instead of var */

/* Portfolio block transition effect - only on desktop */
@media (min-width: 577px) {
  .portfolio-block {
    transition: opacity 0.4s ease;
  }
  
  .portfolio-block.print-block {
    display: none;
  }
}

/* Portfolio grid: 3 columns on desktop, flex row on mobile */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem; /* Direct gap instead of var */
  padding: 1.5rem 0; /* Direct padding instead of var */
  scroll-behavior: smooth;
  position: relative;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}

/* Set initial state for portfolio blocks */
.portfolio-block {
  opacity: 1;
}
.portfolio-item {
  aspect-ratio: 1 / 1;
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  background: none; box-shadow: none; border-radius: 0; padding: 0; margin: 0;
}
.portfolio-image {
  width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; display: block; margin: 0 auto; border-radius: 0;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.portfolio-item:hover .portfolio-image { transform: scale(1.06); }

/* Carousel controls (arrows and dots) */
.portfolio-controls { display: flex; justify-content: center; align-items: center; gap: 1.5rem; margin: 0.5rem 0 1rem; } /* Direct gap instead of var */
.portfolio-arrow {
  width: 40px; height: 40px; background: transparent; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; position: relative; /* Direct transition instead of var */
}
.portfolio-arrow span {
  display: block; width: 10px; height: 10px; border-top: 2px solid #333; border-left: 2px solid #333; transition: border-color 0.3s ease; /* Direct colors and transition instead of var */
}
.portfolio-arrow.prev span { transform: rotate(-45deg); margin-left: 3px; }
.portfolio-arrow.next span { transform: rotate(135deg); margin-right: 3px; }
.portfolio-dots { display: flex; gap: 8px; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #999; cursor: pointer; transition: transform 0.3s ease, background-color 0.3s ease; } /* Direct background and transitions instead of var */
.dot.active { background: #FF4B4B; transform: scale(1.25); } /* Direct color instead of var */
.dot:hover { background: #EB5A53; } /* Direct color instead of var */

/* Simple portfolio popup styling */
.portfolio-hover-popup-bottom .popup-header,
.portfolio-preview-info-bottom .popup-header {
  font-weight: 600;
  margin-bottom: 0.2em;
}

.portfolio-hover-popup-bottom .popup-desc,
.portfolio-preview-info-bottom .popup-desc {
  font-size: 0.9em;
  line-height: 1.4;
}

.portfolio-hover-popup-bottom .popup-link,
.portfolio-preview-info-bottom .popup-link {
  color: #fff;
  text-decoration: underline;
  font-weight: 600;
}

.portfolio-preview-info-bottom {
  background: rgba(60,60,65,0.75);
  color: #fff;
  padding: 0.7em 1em;
  width: 100%;
  text-align: center;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  margin: 0;
}

/* Simple portfolio popups */
.portfolio-item {
  position: relative;
}

.portfolio-hover-popup-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(60,60,65,0.75);
  color: #fff;
  border-radius: 4px;
  padding: 0.8em 1em;
  z-index: 10;
  font-family: 'Open Sans', sans-serif;
}

/* =========================
   RATES/SERVICES SECTION
   ========================= */
.rates { padding: 3rem 0; background: #fff; } /* Direct padding and background instead of var */
.services-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem; margin-top: 2rem; } /* Direct gap and margin instead of var */
.service-card { text-align: center; padding: 1rem; } /* Direct padding instead of var */
.service-icon { width: 100%; max-width: 180px; height: auto; margin: 0 auto 1.5rem; } /* Direct margin instead of var */
.service-card h3 { margin-bottom: 1rem; font-size: 1.125rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; } /* Direct margin and font-size instead of var */
.service-card .description { margin-bottom: 16px; font-size: 15px; color: #666; line-height: 1.6; font-weight: 400; } /* Direct color instead of var */
.service-card .price { font-size: 15px; color: #333; font-weight: 600; letter-spacing: 0.5px; } /* Direct color instead of var */

/* =========================
   ABOUT SECTION
   ========================= */
.about { padding: 3rem 0; background: #F5F5F5; } /* Direct padding and background instead of var */
.text-block { max-width: 71.25rem; margin-bottom: 1.5rem; text-align: justify; } /* Direct max-width and margin instead of var */
.text-block h2 { font-size: 1.75rem; font-weight: 700; text-transform: uppercase; margin-bottom: 0.75rem; } /* Direct font-size and margin instead of var */
.text-block p { margin-bottom: 1rem; line-height: 1.6; } /* Direct margin instead of var */
.text-block p:last-child { margin-bottom: 0; }

/* =========================
   FOOTER
   ========================= */
.site-footer {
  padding: 0rem 0 1.5rem 0;
  background-color: #fff; /* Direct color instead of var */
  /* border-top: 1px solid rgba(0, 0, 0, 0.05); */ /* Direct color instead of var */
}
.footer-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; } /* Direct margin instead of var */
.footer-slogan { font-size: 1.5rem; line-height: 1.5; color: #FF4B4B; font-weight: 500; max-width: 80%; letter-spacing: 0.02em; } /* Direct color instead of var */
.social-links { display: flex; align-items: center; gap: 2rem; min-width: 120px; } /* Direct gap instead of var */
.social-link { display: flex; align-items: center; justify-content: center; transition: transform 0.3s ease; background: none; } /* Direct transition instead of var */
.social-link:hover { transform: scale(1.1); }
.social-icon { width: 48px; height: 48px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem; /* Direct padding instead of var */
  /* border-top: 1px solid rgba(0, 0, 0, 0.05); */ /* Direct color instead of var */
  margin-top: 1rem; /* Direct margin instead of var */
  width: 100%;
}
.footer-logo { flex: 0 0 auto; width: 160px; height: 40px; display: block; }
.footer-logo img { width: 160px; height: auto; display: block; }
.footer-info { text-align: right; line-height: 1.4; font-size: 14px; color: #333; } /* Direct color instead of var */

/* =========================
   RESPONSIVE DESIGN
   ========================= */
@media (max-width: 768px) {
  .footer-top, .footer-bottom { flex-direction: column; gap: 1.5rem; text-align: center; } /* Direct gap instead of var */
  .footer-slogan { max-width: 100%; margin-bottom: 1.5rem; } /* Direct margin instead of var */
  .social-links { justify-content: center; flex-direction: row; gap: 2rem; } /* Direct gap instead of var */
  .footer-info { text-align: center; margin-top: 1rem; } /* Direct margin instead of var */
  .nav-wrapper {
    min-height: 44px;
  }
}
@media (max-width: 75em) {
  .container { padding: 0 1.5rem; } /* Direct padding instead of modifying root var */
  .services-grid { gap: 1rem; } /* Direct gap instead of var */
}
@media (max-width: 62em) {
  .hero h1, .hero h2 { font-size: 2.5rem; } /* Direct font-size instead of modifying root var */
  .hero-content { flex-direction: column; text-align: center; }
  .services-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; } /* Direct gap instead of var */
}
@media (max-width: 48em) {
  .container { padding: 0 1rem; } /* Direct padding instead of modifying root var */
  .hero h1, .hero h2 { font-size: 2rem; } /* Direct font-size instead of modifying root var */
  .tagline { font-size: 1.5rem; } /* Direct font-size instead of var */
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-content { gap: 1rem; } /* Direct gap instead of var */
  .nav-links { gap: 1rem; } /* Direct gap instead of var */
}
@media (max-width: 36em) {
  html, body {
    overscroll-behavior: none !important;
  }
  .rates { overflow-x: hidden; }
  .services-grid { grid-template-columns: 1fr; gap: 2rem; padding: 0 20px; max-width: 100%; } /* Direct gap instead of var */
  .service-card { max-width: 400px; margin: 0 auto; border-radius: 1rem; box-shadow: 0 2px 12px rgba(0,0,0,0.07); background: #fff; padding: 1.5rem; } /* Direct border-radius and padding instead of var */
  .portfolio-content { flex-direction: column; gap: 2rem; } /* Direct gap instead of var */
  .portfolio-block { width: 100%; }
  .portfolio-grid {
    display: flex; flex-direction: row; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; gap: 1.5rem; padding: 1.5rem 0; max-width: 100vw; /* Direct gap and padding instead of var */
    -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior-x: contain;
  }
  .portfolio-grid::-webkit-scrollbar { display: none; }
  .portfolio-item { min-width: 80vw; max-width: 90vw; flex: 0 0 auto; scroll-snap-align: start; }
  .portfolio-item:last-child { margin-right: 1.5rem; } /* Direct margin instead of var */
  .print-block, .web-block, .print-text, .web-text { display: block !important; }
  .portfolio-nav { display: none; }
  .social-links { flex-direction: row; gap: 2.5rem; justify-content: center; width: 100%; }
  .social-icon { width: 54px; height: 54px; }
  .portfolio { margin-top: 1rem; padding-top: 1.5rem; }
  .hero { margin-bottom: 2.5rem; }
  .container { padding-left: 1.75rem; padding-right: 1.75rem; width: 100%; }
  .text-block, .hero-text, .about-content, .portfolio-content, .rates .text-block, .services-grid { padding-left: 0; padding-right: 0; }
  .text-block, .about-content, .portfolio-content .text-block, .rates .text-block { width: 100%; max-width: 100%; }
  .services-grid { padding: 0; width: 100%; }
  .service-card { width: 100%; max-width: 100%; box-sizing: border-box; }
  .portfolio-item { min-width: 75vw; max-width: 85vw; }
  .footer-top, .footer-bottom { width: 100%; max-width: 100%; }
  .portfolio-controls { margin-top: 0; }
  .portfolio-arrow { width: 36px; height: 36px; }
}
@media (max-width: 576px) {
  .portfolio-image { transition: none !important; }
  .portfolio-item:hover .portfolio-image { transform: none !important; }
  .portfolio-controls { display: flex; justify-content: center; align-items: center; gap: 1.5rem; margin: 0.5rem 0 1.5rem; } /* Direct gap instead of var */
  
  /* Ensure all portfolio blocks are visible on mobile */
  .portfolio-block {
    display: block !important;
    opacity: 1 !important;
  }
  
  .portfolio-block.print-block {
    display: block !important;
  }
}
@media (min-width: 577px) {
  .portfolio-controls { display: none; }
  .portfolio-grid { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 1.25rem !important; padding: 1.5rem 0 !important; overflow-x: unset !important; overflow-y: unset !important; scroll-snap-type: none !important; } /* Direct gap and padding instead of var */
  .portfolio-item { min-width: 0 !important; max-width: 100% !important; flex: unset !important; scroll-snap-align: unset !important; margin-bottom: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: none !important; padding: 0 !important; margin: 0 !important; }
  
  /* Allow desktop transition effect */
  .portfolio-block {
    transition: opacity 0.4s ease;
  }
}

main { padding-top: 40px; background: #F5F5F5; } /* Direct background instead of var */

.logo img {
  width: 160px !important;
  height: 40px !important;
  display: block;
  padding-right: 0.75rem;
}

/* =========================
   LANGUAGE SPECIFIC STYLES (RUSSIAN)
   ========================= */
/* Improved CSS-only hyphenation for Russian text blocks */
html[lang="ru"] .text-block p {
  /* Better word break and hyphenation specifically for paragraphs */
  word-break: normal;
  overflow-wrap: break-word;
  text-align: justify; /* Better justified text for Russian paragraphs */
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphenate-limit-chars: 6 3 3; /* Minimum word length: 6, min chars before break: 3, min chars after break: 3 */
}

/* Russian-specific styles for service descriptions */
html[lang="ru"] .service-card .description {
  word-break: normal;
  overflow-wrap: break-word;
  text-align: center;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
}

/* Russian-specific styles for portfolio hover popups */
html[lang="ru"] .portfolio-hover-popup-bottom .popup-desc {
  word-break: normal;
  overflow-wrap: break-word;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
}

/* Russian-specific styles for portfolio preview popups */
html[lang="ru"] .portfolio-preview-info-bottom .popup-desc {
  word-break: normal;
  overflow-wrap: break-word;
  text-align: center;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
}

html[lang="ru"] .nav-links {
  gap: 1.7rem; /* Smaller gap for Russian menu items since they're longer */
}

html[lang="ru"] .nav-links a {
  font-size: 0.78rem; /* Slightly smaller font for Russian navigation */
  letter-spacing: -0.02em; /* Tighter letter spacing for Russian text */
}

html[lang="ru"] .hero h1 {
  font-size: 2.9rem; /* Slightly smaller for Russian which has longer words */
  letter-spacing: -0.01em;
}

html[lang="ru"] .hero h2 {
  font-size: 2.9rem; /* Slightly smaller for Russian */
  letter-spacing: -0.01em;
}

html[lang="ru"] .tagline {
  font-size: 1.6rem; /* Smaller size for Russian tagline */
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* Mobile adjustments for Russian version */
@media (max-width: 62em) {
  html[lang="ru"] .hero h1,
  html[lang="ru"] .hero h2 {
    font-size: 2.3rem; /* Smaller heading on medium screens */
  }
}

@media (max-width: 48em) {
  html[lang="ru"] .nav-links {
    gap: 0.8rem; /* Even smaller gap on mobile */
  }
  
  html[lang="ru"] .hero h1,
  html[lang="ru"] .hero h2 {
    font-size: 1.9rem; /* Smaller heading on small screens */
  }
  
  html[lang="ru"] .tagline {
    font-size: 1.4rem; /* Smaller tagline on small screens */
  }
}

@media (max-width: 36em) {
  html[lang="ru"] .hero h1,
  html[lang="ru"] .hero h2 {
    font-size: 1.75rem; /* Even smaller on very small screens */
  }
}
