:root {
  --navy: #618873;
  --navy-dark: #618873;
  --navy-light: #89a897;
  --accent: #618873;
  --heading: #3a5245;
  --bg: #f4f7f4;
  --card: #ffffff;
  --border: #dce5dc;
  --text: #22303c;
  --text-muted: #5b6b78;
  --radius: 8px;
  --shadow: 0 4px 16px rgba(51, 71, 58, 0.1);
  --max-width: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

section[id] { scroll-margin-top: 130px; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

h1, h2, h3 {
  color: var(--heading);
  font-weight: 700;
  margin: 0 0 16px;
}

h2 { font-size: 30px; }
h3 { font-size: 20px; }

.h2-accent {
  border-bottom: 3px solid var(--accent);
  padding-bottom: 2px;
}
.stages__title .h2-accent { border-bottom-color: rgba(255, 255, 255, 0.85); }

p { margin: 0 0 12px; color: var(--text-muted); }

a { color: var(--heading); text-decoration: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 72px 0; }
.section h2 { text-align: center; margin-bottom: 40px; }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy-dark);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 118px;
  padding: 8px 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.logo__img { height: 102px; width: auto; display: block; }
.logo__fallback { color: #fff; }
.nav { display: flex; gap: 28px; }
.nav a {
  color: #dbe8dc;
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s;
}
.nav a:hover { color: #ffffff; }
.burger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 39px;
  cursor: pointer;
  margin-right: 8px;
}

/* Hero */
.hero {
  background-image: linear-gradient(135deg, rgba(58, 82, 69, 0.55), rgba(97, 136, 115, 0.45)), url('/images/hero.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  padding: 190px 0 160px;
  text-align: center;
}
.hero__inner h1 {
  color: #fff;
  font-size: 40px;
  max-width: 780px;
  margin: 0 auto 18px;
}
.hero__inner p {
  color: #d7e6d9;
  font-size: 18px;
  margin-bottom: 32px;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, background 0.2s ease;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--navy-light); transform: translateY(-1px); }
.btn--secondary {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--border);
}
.btn--secondary:hover { background: #eef2f5; }
.btn--danger { background: #b3413c; color: #fff; }
.btn--danger:hover { background: #c94f49; }
.btn--small { padding: 8px 16px; font-size: 13px; }

/* About */
.about { background: var(--card); }
.about .container { max-width: var(--max-width); }
.about__inner {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 44px;
  align-items: flex-start;
}
.about__text h2 { text-align: left; margin-bottom: 18px; }
.about__portrait {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
.about__portrait-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}
.about__portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.about__portrait img.loaded { opacity: 1; }
.about__quote {
  margin: 0 0 10px;
  padding: 0 0 0 18px;
  border-left: 3px solid var(--accent);
  font-size: 21px;
  line-height: 1.45;
  font-style: italic;
  color: var(--heading);
}
.about__quote-author {
  margin: 0 0 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.about__quote-author::before { content: '— '; }
.about__description {
  font-size: 15px;
  line-height: 1.6;
  text-align: left;
  margin-bottom: 14px;
}
.about__tagline {
  font-size: 15px;
  font-weight: 600;
  color: var(--heading);
  margin: 0;
}
@media (max-width: 860px) {
  .about__inner { grid-template-columns: 1fr; }
  .about__portrait { order: -1; max-width: 320px; margin: 0 auto; }
}

/* Advantages */
.advantages { background: var(--navy-dark); }
.advantages__title { color: #fff; text-align: center; margin-bottom: 12px; }
.advantages__title .h2-accent { border-bottom-color: rgba(255, 255, 255, 0.85); }
.advantages__subtitle {
  color: #cfe0d4;
  text-align: center;
  font-size: 15px;
  margin: 0 0 40px;
}
.advantages__list {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 6px 32px;
}
.advantage-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 14px 18px 0;
  border-bottom: 1px solid var(--border);
}
.advantage-row:nth-last-child(-n+2) { border-bottom: none; }
.advantage-row__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.advantage-row p { margin: 0; font-size: 14px; color: var(--text); line-height: 1.45; }

@media (max-width: 860px) {
  .advantages__list { grid-template-columns: 1fr; padding: 6px 24px; }
  .advantage-row:nth-last-child(-n+2) { border-bottom: 1px solid var(--border); }
  .advantage-row:last-child { border-bottom: none; }
}

/* Services */
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.service-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.service-card h3 { margin-bottom: 10px; }
.service-card p { margin: 0; font-size: 14px; }

/* Stages carousel */
.stages {
  background: var(--navy-dark);
  color: #fff;
}
.stages__title {
  color: #fff;
  text-align: center;
  margin-bottom: 36px;
}
.stages__carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}
.stages__track {
  display: flex;
  transition: transform 0.4s ease;
}
.stage__slide {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 36px;
  align-items: center;
  min-height: 320px;
}
.stage__photo {
  height: 100%;
  min-height: 260px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
}
.stage__photo img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  display: block;
}
.stage__text { padding: 20px 24px 20px 0; }
.stage__number {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #cfe0d4;
  margin-bottom: 10px;
}
.stage__text h3 { color: #fff; font-size: 22px; margin-bottom: 10px; }
.stage__text p { color: #d7e6d9; font-size: 15px; margin: 0; white-space: pre-line; }

.stages__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.stages__arrow:hover { background: rgba(255, 255, 255, 0.28); }
.stages__arrow--prev { left: 8px; }
.stages__arrow--next { right: 8px; }

.stages__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}
.stages__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  cursor: pointer;
  padding: 0;
}
.stages__dot.active { background: #fff; }

@media (max-width: 860px) {
  .stage__slide { grid-template-columns: 1fr; min-height: 0; }
  .stage__photo { min-height: 200px; }
  .stage__photo img { min-height: 200px; }
  .stage__text { padding: 16px 0 0; }

  .stages__carousel {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 16px;
  }
  .stages__track { grid-column: 1 / -1; grid-row: 1; }
  .stages__arrow {
    position: static;
    transform: none;
    grid-row: 2;
    width: 34px;
    height: 34px;
    background: #fff;
    color: var(--heading);
    font-size: 17px;
  }
  .stages__arrow:hover { background: #fff; }
  .stages__arrow--prev { grid-column: 1; justify-self: start; }
  .stages__arrow--next { grid-column: 3; justify-self: end; }
  .stages__dots { grid-column: 2; grid-row: 2; margin-top: 0; }
}

/* Portfolio */
.portfolio__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}
.filter-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.filter-btn:hover { border-color: var(--accent); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.portfolio-card__category {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}
.portfolio__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.portfolio-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.portfolio-card__img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  cursor: pointer;
  display: block;
  background: var(--navy-light);
}
.portfolio-card__body { padding: 18px 20px; }
.portfolio-card__body h3 { font-size: 17px; margin-bottom: 6px; }
.portfolio-card__body p { font-size: 14px; margin: 0; }

/* Contact */
.contact { background: var(--card); }
.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.contact__info p { font-size: 15px; color: var(--text); margin-bottom: 8px; }
.contact__social { display: flex; gap: 12px; margin-top: 18px; }
.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--navy-dark);
  color: #fff;
  transition: background 0.2s ease, transform 0.15s ease;
}
.social-icon:hover { background: var(--accent); transform: translateY(-2px); }
.social-icon.hidden { display: none; }
.contact__form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.contact__form input,
.contact__form textarea {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
.contact__form textarea { min-height: 90px; resize: vertical; }
.form-status { font-size: 14px; margin-top: 10px; }
.form-status--ok { color: #1e7a3d; }
.form-status--err { color: #b3413c; }

/* Footer */
.footer {
  background: var(--navy-dark);
  color: #b8ccb9;
  padding: 26px 0;
  text-align: center;
  font-size: 14px;
}
.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.footer__admin-link { color: #8fab92; font-size: 13px; }
.footer__admin-link:hover { color: #b8ccb9; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(11, 34, 51, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.lightbox.hidden { display: none; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: 6px; }
.lightbox__close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
}
.lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 101;
}
.lightbox__arrow:hover { background: rgba(255, 255, 255, 0.28); }
.lightbox__arrow--prev { left: 16px; }
.lightbox__arrow--next { right: 16px; }
.lightbox__arrow.hidden { display: none; }
.lightbox__counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 12px;
  border-radius: 12px;
}

@media (max-width: 640px) {
  .lightbox__arrow { width: 38px; height: 38px; font-size: 20px; }
  .lightbox__arrow--prev { left: 6px; }
  .lightbox__arrow--next { right: 6px; }
}

.empty-note { color: var(--text-muted); text-align: center; font-size: 14px; }

@media (max-width: 860px) {
  .services__grid, .portfolio__grid, .advantages__grid { grid-template-columns: repeat(2, 1fr); }
  .contact__inner { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav { position: fixed; top: 118px; left: 0; right: 0; background: var(--navy-dark);
    flex-direction: column; padding: 16px 24px; gap: 16px; transform: translateY(-150%);
    transition: transform 0.25s ease; }
  .nav.open { transform: translateY(0); }
  .burger { display: block; }
  .services__grid, .portfolio__grid, .advantages__grid { grid-template-columns: 1fr; }
  .hero__inner h1 { font-size: 28px; }
  .hero { padding: 110px 0 90px; }
  .section { padding: 52px 0; }
}
