/* =====================
   VARIABLES & RESET
   ===================== */
:root {
  --blue:       #2E7BC4;
  --blue-light: #5BB8D4;
  --blue-dark:  #1A3A5C;
  --gray:       #6B7280;
  --gray-light: #F5F7FA;
  --white:      #FFFFFF;
  --text:       #1A1A1A;
  --radius:     8px;
  --shadow:     0 4px 20px rgba(30,58,92,0.12);
  --transition: 0.25s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  line-height: 1.6;
}

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

/* =====================
   HEADER
   ===================== */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: #f0f2f5;
  border-bottom: 2px solid transparent;
  transition: box-shadow var(--transition), border-color var(--transition);
}
#header.scrolled {
  box-shadow: var(--shadow);
  border-color: var(--blue-light);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo-wrap { display: flex; align-items: center; text-decoration: none; }
.logo-img { height: 52px; width: auto; }

#main-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
}
#main-nav a {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--blue-dark);
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
#main-nav a:hover,
#main-nav a.active {
  background: var(--blue);
  color: var(--white);
}


.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 26px; height: 3px;
  background: var(--blue-dark);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* =====================
   HERO
   ===================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, var(--blue-light) 100%);
  padding-top: 72px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-overlay { display: none; }

.hero-content {
  position: relative;
  text-align: center;
  padding: 60px 24px;
}
.hero-logo-clip {
  margin: 0 auto 32px;
  width: fit-content;
}
.hero-logo {
  width: min(320px, 75vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.3));
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(255,255,255,0.88);
  max-width: 600px;
  margin: 0 auto 36px;
}

/* =====================
   BUTTONS
   ===================== */
.btn-primary {
  display: inline-block;
  padding: 14px 36px;
  background: var(--white);
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 50px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  background: var(--gray-light);
}

/* =====================
   SECTIONS
   ===================== */
.section { padding: 80px 0; }
.section-light { background: var(--gray-light); }
.section-dark { background: var(--blue-dark); }
.section-blue { background: var(--blue); }

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--blue-dark);
  text-align: center;
  margin-bottom: 12px;
  position: relative;
  padding-bottom: 20px;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 60px; height: 4px;
  background: var(--blue);
  border-radius: 2px;
}
.section-dark .section-title,
.section-blue .section-title,
.section-title.white { color: var(--white); }
.section-dark .section-title::after,
.section-blue .section-title::after { background: var(--blue-light); }

.section-sub {
  text-align: center;
  color: var(--gray);
  margin-bottom: 48px;
  font-size: 1.05rem;
}
.section-dark .section-sub { color: rgba(255,255,255,0.75); }

/* =====================
   SERVICES
   ===================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.service-card {
  background: var(--white);
  border-radius: 12px;
  padding: 36px 28px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  border-top: 4px solid var(--blue);
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(30,58,92,0.18);
}
.service-icon { font-size: 2.5rem; margin-bottom: 16px; }
.service-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 10px;
}
.service-card p { color: var(--gray); font-size: 0.95rem; }

/* =====================
   REFERENCES
   ===================== */
.references-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.ref-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 28px;
  position: relative;
  transition: background var(--transition), transform var(--transition);
  cursor: pointer;
}
.ref-card:hover { background: rgba(255,255,255,0.13); transform: translateY(-3px); }
.ref-card:focus-visible {
  outline: 2px solid var(--blue-light);
  outline-offset: 3px;
}
.ref-year {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--blue-light);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.ref-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
}
.ref-card p { color: rgba(255,255,255,0.7); font-size: 0.9rem; }

/* Reference gallery thumbnails */
.ref-gallery {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ref-thumb {
  width: calc(20% - 5px);
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255,255,255,0.1);
  flex-shrink: 0;
  position: relative;
  pointer-events: none;
}
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-thumb-more {
  position: absolute;
  inset: 0;
  background: rgba(10,20,40,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 6px;
}
.ref-more-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue-light);
  letter-spacing: 0.3px;
}

/* Reference detail modal */
#ref-detail {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#ref-detail.open { display: flex; }
.rd-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,20,40,0.85);
}
.rd-inner {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 16px 60px rgba(0,0,0,0.4);
}
.rd-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--gray-light);
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.rd-close:hover { background: #dde3ee; }
.rd-year {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--blue);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.rd-inner h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  font-weight: 800;
  color: var(--blue-dark);
  margin-bottom: 16px;
}
#rd-desc {
  color: var(--gray);
  font-size: 0.98rem;
  line-height: 1.75;
  margin-bottom: 28px;
}
.rd-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.rd-thumb {
  aspect-ratio: 1;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: var(--gray-light);
  transition: transform var(--transition), box-shadow var(--transition);
}
.rd-thumb:hover { transform: scale(1.04); box-shadow: 0 4px 16px rgba(0,0,0,0.18); }
.rd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 600px) {
  .rd-inner { padding: 28px 20px; }
  .rd-gallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* Lightbox */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
#lightbox.open { display: flex; }

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,20,40,0.92);
}
.lb-inner {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 1100px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
#lb-img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 8px 60px rgba(0,0,0,0.6);
}
.lb-meta {
  display: flex;
  justify-content: space-between;
  width: 100%;
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  padding: 0 4px;
}
.lb-close {
  position: fixed;
  top: 20px; right: 24px;
  z-index: 2;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background var(--transition);
}
.lb-close:hover { background: rgba(255,255,255,0.25); }

.lb-arrow {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  z-index: 2;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 52px; height: 52px;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  transition: background var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.lb-arrow:hover { background: rgba(255,255,255,0.22); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

@media (max-width: 600px) {
  .lb-arrow { width: 40px; height: 40px; font-size: 1.5rem; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
}

/* =====================
   NEWS
   ===================== */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 760px;
  margin: 0 auto;
}
.news-item {
  background: var(--white);
  border-radius: 12px;
  padding: 28px 32px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--blue);
  transition: transform var(--transition);
}
.news-item:hover { transform: translateX(4px); }
.news-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}
.news-item h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 8px;
}
.news-item p { color: var(--gray); font-size: 0.95rem; }

/* =====================
   CONTACT
   ===================== */
.kontakt-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}
.kontakt-info h2 { text-align: left; }
.kontakt-info h2::after { left: 0; transform: none; }
.kontakt-details { margin-top: 32px; display: flex; flex-direction: column; gap: 20px; }
.kontakt-item {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
}
.kontakt-item .icon { font-size: 1.4rem; flex-shrink: 0; }

.kontakt-form {
  background: var(--white);
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.kontakt-form h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 4px;
}
.kontakt-form input,
.kontakt-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #dde3ee;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition);
  background: var(--gray-light);
}
.kontakt-form input:focus,
.kontakt-form textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--white);
}
.kontakt-form .btn-primary {
  background: var(--blue);
  color: var(--white);
  text-align: center;
  margin-top: 4px;
}
.kontakt-form .btn-primary:hover { background: var(--blue-dark); }

/* =====================
   FOOTER
   ===================== */
.footer {
  background: var(--blue-dark);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-logo { height: 40px; filter: brightness(0) invert(1); opacity: 0.8; }
.footer p { color: rgba(255,255,255,0.6); font-size: 0.9rem; }
.admin-link {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  transition: color var(--transition);
}
.admin-link:hover { color: rgba(255,255,255,0.8); }

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  #main-nav {
    display: none;
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    border-top: 2px solid var(--blue-light);
  }
  #main-nav.open { display: block; }
  #main-nav ul { flex-direction: column; gap: 0; padding: 8px 0; }
  #main-nav a { border-radius: 0; padding: 14px 24px; }

  .hero-logo { height: 80px; }

  .kontakt-wrap { grid-template-columns: 1fr; gap: 40px; }
  .kontakt-info h2::after { left: 50%; transform: translateX(-50%); }
  .kontakt-info h2 { text-align: center; }
  .kontakt-details { align-items: center; }

  .footer-inner { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
  .section { padding: 56px 0; }
  .services-grid { grid-template-columns: 1fr; }
  .references-grid { grid-template-columns: 1fr; }
}
