/* ===========================
   ZenerMont s.r.o. — Custom Styles
   Design: Dark & Premium / Industrial
   =========================== */

:root {
  --primary: #e8a825;
  --secondary: #1a1a1a;
  --dark: #111114;
  --light: #f5f5f0;
  --surface: #1e1f24;
  --border: #2a2d35;
}

/* === Base === */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

::selection {
  background: rgba(232, 168, 37, 0.3);
  color: #fff;
}

body {
  overflow-x: hidden;
}

/* Contain GSAP slide animations within sections */
#about_1,
#services_1,
#gallery_1,
#contact_1,
#cta_1 {
  overflow-x: hidden;
}

/* === Navbar === */
nav {
  background: transparent;
}

nav.scrolled {
  background: rgba(17, 17, 20, 0.95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link:hover::after {
  width: 100%;
}

.mobile-nav-link {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  font-size: 1.125rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: color 0.3s ease, padding-left 0.3s ease;
}

.mobile-nav-link:hover {
  color: var(--primary);
  padding-left: 0.5rem;
}

/* === Hero === */
.hero-bg {
  transition: transform 8s ease;
}

#hero_1:hover .hero-bg {
  transform: scale(1.03);
}

/* === Stats Cards === */
.stat-card {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* === Service Row === */
.service-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.service-row.reverse {
  direction: rtl;
}

.service-row.reverse > * {
  direction: ltr;
}

.service-number {
  font-family: 'Archivo', sans-serif;
  font-size: 5rem;
  font-weight: 900;
  color: rgba(232, 168, 37, 0.08);
  line-height: 1;
  margin-bottom: -0.5rem;
}

.service-row .service-image {
  aspect-ratio: 4/3;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}

.service-row .service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.service-row .service-image:hover img {
  transform: scale(1.05);
}

.service-row .service-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(232, 168, 37, 0.1);
  border: 1px solid rgba(232, 168, 37, 0.2);
  border-radius: 0.75rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

@media (max-width: 1023px) {
  .service-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .service-row.reverse {
    direction: ltr;
  }
  .service-number {
    font-size: 3rem;
  }
}

/* === Gallery === */
.gallery-item {
  aspect-ratio: 1;
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 1px solid var(--border);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-item .gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(17, 17, 20, 0.8) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay span {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Make first two gallery items larger */
.gallery-item:nth-child(1) {
  grid-column: span 2;
  aspect-ratio: 2/1;
}

.gallery-item:nth-child(5) {
  grid-column: span 2;
  aspect-ratio: 2/1;
}

@media (max-width: 767px) {
  .gallery-item:nth-child(1),
  .gallery-item:nth-child(5) {
    grid-column: span 2;
  }
}

/* === Contact === */
.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 1rem;
  background: var(--dark);
  border: 1px solid var(--border);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.contact-card:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

.contact-card-icon {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(232, 168, 37, 0.1);
  border-radius: 0.75rem;
  color: var(--primary);
}

/* === Form === */
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 168, 37, 0.1);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-group .error-msg {
  font-size: 0.8rem;
  color: #f87171;
  margin-top: 0.375rem;
  display: none;
}

.form-group.has-error input,
.form-group.has-error textarea {
  border-color: #f87171;
}

.form-group.has-error .error-msg {
  display: block;
}

.form-submit {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: var(--dark);
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(232, 168, 37, 0.2);
}

.form-submit:active {
  transform: translateY(0);
}

/* === Footer === */
.footer-link {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.9rem;
  transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-link:hover {
  color: var(--primary);
  padding-left: 4px;
}

/* === Scroll Top === */
#scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#scroll-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(232, 168, 37, 0.3);
}

/* === Decorative Accents === */
.accent-line {
  width: 3rem;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

/* === 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;
  }
}

/* === Misc === */
img {
  -webkit-user-drag: none;
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Subtle grain overlay on dark sections */
#hero_1::after,
#cta_1::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* =============================================
   RESPONSIVE FIXES
   ============================================= */

/* === Small phones ≤ 480px === */
@media (max-width: 480px) {
  .stat-card {
    padding: 1rem 0.5rem;
  }

  .stat-value {
    font-size: 1.75rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .service-content {
    padding: 0 0.25rem;
  }

  .service-row {
    gap: 1rem;
  }

  .gallery-item:nth-child(1),
  .gallery-item:nth-child(5) {
    grid-column: span 2;
    aspect-ratio: 16/9;
  }

  .contact-card {
    padding: 1rem;
    gap: 0.75rem;
  }
}

/* === Very small screens < 350px === */
@media (max-width: 349px) {
  /* Tighten all container padding */
  .max-w-7xl,
  .max-w-4xl,
  .max-w-3xl {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Nav */
  #nav_1 > div {
    height: 3.5rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .nav-logo {
    font-size: 1.25rem !important;
  }

  /* Hero */
  #hero_1 h1 {
    font-size: 2rem !important;
    line-height: 1.15;
  }

  #hero_1 p {
    font-size: 0.95rem !important;
  }

  .hero-ctas {
    flex-direction: column !important;
    width: 100%;
  }

  .hero-ctas a {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
  }

  /* About stats: 1 column */
  #about-stats {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .stat-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    text-align: left;
  }

  .stat-value {
    font-size: 1.5rem;
    margin-bottom: 0;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  /* About image */
  .about-image .aspect-\[4\/3\] {
    max-height: 240px;
  }

  /* Service rows */
  .service-number {
    font-size: 2.25rem;
  }

  .service-row h3 {
    font-size: 1.1rem !important;
  }

  .service-content {
    padding: 0;
  }

  /* Contact */
  #contact_1 .bg-dark {
    padding: 1.25rem !important;
  }

  .contact-card span,
  .contact-card a {
    word-break: break-all;
  }

  /* CTA banner */
  #cta_1 h2 {
    font-size: 1.5rem !important;
  }

  #cta_1 a {
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
  }

  /* Floating buttons closer to edge */
  #scroll-top {
    right: 0.75rem;
    bottom: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
  }

  .phone-float {
    left: 0.75rem;
    bottom: 0.75rem;
    width: 3rem;
    height: 3rem;
  }

  .phone-float svg {
    width: 22px;
    height: 22px;
  }

  /* Footer */
  #footer_1 .grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  /* Section padding */
  #about_1,
  #services_1,
  #gallery_1,
  #contact_1,
  #cta_1 {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  #footer_1 {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
}

/* === General mobile polish (≤ 768px) === */
@media (max-width: 768px) {
  /* Reduce section padding on mobile */
  #about_1,
  #services_1,
  #gallery_1,
  #contact_1 {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  #cta_1 {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  /* About decorative elements - hide to prevent overflow */
  .about-image .absolute {
    display: none;
  }

  /* Gallery grid 2 cols on mobile */
  #gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem;
  }

  .gallery-item {
    border-radius: 0.5rem;
  }

  /* Contact map */
  #contact-map {
    height: 200px !important;
  }

  /* Footer */
  #footer_1 .grid {
    grid-template-columns: 1fr !important;
  }
}