/* Upscale.kz — Light theme, soft modern style */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap&subset=latin,cyrillic');

:root {
  --bg: #f5f6f8;
  --bg-card: #ffffff;
  --bg-soft: #f0f2f5;
  --text: #1a1d21;
  --text-muted: #5c6370;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --border: #e2e6eb;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.04), 0 4px 24px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.08), 0 16px 48px rgba(0, 0, 0, 0.06);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-lg: 24px;
  --font: 'Manrope', -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
}

body > .footer {
  flex-shrink: 0;
}

img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 2560px; margin: 0 auto; padding: 0 24px; }

/* Navbar — light */
.navbar {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0 !important;
}

.navbar .navbar-brand img { height: 40px; }

.nav-link {
  font-weight: 500 !important;
  color: var(--text) !important;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--accent) !important;
  background: rgba(59, 130, 246, 0.08);
}

.navbar-toggler {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%231a1d21' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.navbar-collapse { margin-top: 1rem; }
@media (min-width: 992px) { .navbar-collapse { margin-top: 0; } }

/* Hero */
.hero-section {
  padding: 7rem 0 4rem;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.hero-title {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-desc {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 580px;
  margin: 1rem auto 0;
}

/* Buttons — soft */
.brutal-btn, .btn {
  font-weight: 600 !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: var(--radius-sm) !important;
  transition: all 0.2s ease !important;
  border: none !important;
}

.brutal-btn-primary, .btn-primary {
  background: var(--accent) !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.brutal-btn-primary:hover, .btn-primary:hover {
  background: var(--accent-hover) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.brutal-btn-outline, .btn-outline {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border: 2px solid var(--border) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: var(--shadow) !important;
}

.brutal-btn-outline:hover, .btn-outline:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: rgba(59, 130, 246, 0.06) !important;
}

/* Hero stats — такая же ширина и стиль как marquee */
.hero-stats {
  padding: 2rem 24px;
  margin-top: 2.5rem;
}

.stats-container {
  max-width: 1920px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.stats-container .row {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Мобильная вёрстка блока статистики */
@media (max-width: 767px) {
  .hero-stats {
    padding: 1.25rem 16px;
    margin-top: 1.5rem;
  }

  .stats-container {
    padding: 1rem 1rem;
    border-radius: var(--radius);
  }

  .stats-container .row {
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .stats-container .col-6,
  .stats-container .col-md-3 {
    width: 100%;
    max-width: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    flex: 0 0 auto;
  }

  .stats-container .stat-value {
    flex-shrink: 0;
    font-size: 1.5rem;
    min-width: 5ch;
  }

  .stats-container .stat-label {
    font-size: 0.85rem;
    margin-top: 0;
    flex: 1;
  }
}

/* Marquee — бесконечная бегущая строка */
.marquee-section {
  padding: 1.5rem 0;
  user-select: none;
}

.marquee-container {
  width: 100%;
  overflow: hidden;
}

.marquee-wrapper {
  overflow: hidden;
  width: 100%;
}

.marquee {
  display: flex;
  width: max-content;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  animation: marquee 50s linear infinite;
  will-change: transform;
}

.marquee__track {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 2rem;
}

.marquee__item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  max-width: 120px;
}

.marquee__item img {
  height: 56px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  opacity: 0.75;
}

/* 2 копии трека — бесшовный цикл при translateX(-50%) */
@keyframes marquee {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* Portfolio — cards with image, grayscale → color + zoom */
.portfolio-section {
  padding: 1.5rem 0 5rem;
  background: var(--bg);
}

.portfolio-section .section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.portfolio-section .section-intro {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.portfolio-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  background: var(--bg-card);
}

.portfolio-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.portfolio-card__img-wrap {
  overflow: hidden;
  aspect-ratio: 4/3;
}

.portfolio-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.portfolio-card:hover .portfolio-card__img-wrap img {
  transform: scale(1.06);
}

.portfolio-card__content {
  padding: 1.25rem 1.5rem;
}

.portfolio-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.portfolio-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Scale section */
.scale-section {
  padding: 5rem 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.scale-section .container {
  max-width: 1200px;
}

.scale-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

.scale-text {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.scale-screenshots {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  min-height: 200px;
}

.screenshots-strip {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  overflow-x: auto;
  flex-wrap: wrap;
}

.screenshots-strip img {
  height: 280px;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.screenshots-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Services */
.services {
  padding: 4rem 0 1rem;
  background: var(--bg);
}

.services .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.services .section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.services .section-intro {
  margin-bottom: 2.5rem;
}

.services-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 0;
}

.service-item {
  padding: 1.5rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.service-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.service-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.service-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.services-benefits-title {
  margin-bottom: 0.5rem;
}

.section-intro {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.services-webkul-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.service-webkul-card {
  padding: 1.5rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.service-webkul-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.service-webkul-card .service-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.service-webkul-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.service-webkul-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Contacts */
.contacts {
  padding: 5rem 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.contacts h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.brutal-form, .contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.brutal-form input,
.brutal-form textarea,
.contact-form input,
.contact-form textarea {
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.brutal-form input:focus,
.brutal-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.contacts__phone {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
}

.contacts-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 2.5rem 0;
}

.contacts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 2.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  min-width: 200px;
}

.contacts-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.contacts-logo {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.contacts-logo img {
  width: 180px;
  height: auto;
  opacity: 0.9;
}

@media (max-width: 576px) {
  .contacts-btn {
    width: 100%;
    min-width: auto;
    padding: 1rem 1.5rem;
  }
}

/* Footer */
.footer {
  padding: 2rem;
  background: var(--text);
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

.footer p { font-size: 0.9rem; }

/* Popup */
#contact-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: 0.2s;
}

#contact-popup.open {
  opacity: 1;
  visibility: visible;
}

#contact-popup .popup__overlay {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

#contact-popup .popup__content {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius);
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-hover);
}

.popup__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.popup__close:hover { color: var(--text); }

#contact-popup h3 {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.popup__buttons { display: flex; flex-direction: column; gap: 0.75rem; }

/* Project page styles */
.project-page {
  padding-top: 6rem;
  padding-bottom: 4rem;
  background: var(--bg);
}

.project-page .container {
  background: var(--bg-card);
  padding: 3rem 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.project-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  background: var(--accent);
  color: white;
  font-weight: 600;
  border-radius: var(--radius-sm);
  margin-right: 0.75rem;
  margin-bottom: 0.75rem;
}

.project-links a:hover {
  background: var(--accent-hover);
}

.project-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 1.5rem 0;
}

.back-link {
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.5rem;
  display: inline-block;
}

.back-link:hover { color: var(--accent-hover); }

.project-hero-img {
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}

.project-hero-img img {
  display: block;
  width: 100%;
  min-height: 420px;
  max-height: 720px;
  height: 65vh;
  object-fit: cover;
}

.project-tech {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* Screenshots gallery */
.screenshots-gallery {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.screenshots-gallery .swiper-slide {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.screenshots-gallery .swiper-slide img {
  max-height: 400px;
  object-fit: contain;
}

.screenshots-gallery .swiper-button-next,
.screenshots-gallery .swiper-button-prev { color: var(--text); }
.screenshots-gallery .swiper-pagination-bullet-active { background: var(--accent); }

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: 0.2s;
}

.lightbox-overlay.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--bg-card);
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 2001;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.lightbox-close:hover { background: var(--bg); }

/* Legacy header for project pages */
body .header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

body .header .logo img { height: 36px; }
body .header .nav { display: flex; gap: 1rem; }
body .header .nav a { color: var(--text); font-weight: 500; }
body .header .nav a:hover { color: var(--accent); }
