:root {
  --bg: #faf8f4;
  --bg-accent: #f5f3ef;
  --bg-light: #fefcf8;
  --text-main: #2d3a2d;
  --text-soft: #6b7a6b;
  --green-dark: #4a5d4a;
  --green-medium: #6b8a6b;
  --green-light: #a8c5a8;
  --green-pale: #e8f0e8;
  --border-soft: #dde5dd;
  --shadow-soft: 0 18px 45px rgba(45, 58, 45, 0.08);
  --radius-xl: 32px;
  --radius-l: 24px;
  --radius-pill: 999px;
  --safe-inline: 20px;
  --touch-min: 44px;
}

@media (max-width: 520px) {
  :root {
    --radius-xl: 24px;
    --radius-l: 20px;
    --safe-inline: 16px;
  }
}

/* Общие анимации появления для всех страниц */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: var(--bg);
  background-image: url('back.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  position: relative;
}

@media (max-width: 520px) {
  body {
    background-attachment: scroll;
    background-size: cover;
    background-position: center center;
  }
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.72);
  z-index: -1;
  pointer-events: none;
}

/* Фон для страниц кроме главной: backsecond.png + сильное затемнение */
body.subpage-bg {
  background-image: url('backsecond.png');
}

body.subpage-bg::before {
  background: rgba(0, 0, 0, 0.75);
}

.page {
  max-width: 100%;
  width: 100%;
  margin: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Длинный полуквадрат сверху посередине */
.top-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 727px;
  max-width: 85%;
  margin: 32px auto 0;
  padding: 14px 28px;
  gap: 150px;
  background: rgba(254, 252, 248, 0.95);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px rgba(45, 58, 45, 0.1);
  position: relative;
  z-index: 10;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(254, 252, 248, 0.95);
  border-radius: var(--radius-pill);
  padding: 4px;
  flex-shrink: 0;
  width: 80px;
  justify-content: center;
}

.lang-btn {
  font-size: 14px;
  font-weight: 500;
  font-family: "Montserrat Alternates", sans-serif;
  color: var(--text-soft);
  background: transparent;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.lang-btn:hover {
  color: var(--green-dark);
}

.lang-btn.active {
  background: var(--green-dark);
  color: rgba(254, 252, 248, 0.95);
  font-weight: 600;
}

.lang-btn.active:hover {
  color: rgba(254, 252, 248, 0.95);
  background: var(--green-medium);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 17px;
  flex-shrink: 0;
}

.nav-link {
  text-decoration: none;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 400;
  font-family: "Montserrat Alternates", sans-serif;
  padding: 6px 12px;
  transition: color 0.2s ease;
  display: inline-block;
  line-height: 1;
  cursor: pointer;
  position: relative;
  z-index: 11;
  pointer-events: auto;
  white-space: nowrap;
  width: 90px;
  text-align: center;
  box-sizing: border-box;
}

.nav-link:hover {
  color: #3a4d3a;
  font-weight: 600;
}

.nav-link:active {
  color: var(--green-dark);
}

.nav-link:focus {
  outline: none;
}

/* Центральная секция с заголовком */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  margin-top: -25vh;
  padding: 0 24px;
  gap: 20px;
}

.hero-title {
  font-size: clamp(52px, 9vw, 96px);
  font-weight: 700;
  font-family: "Cormorant Garamond", serif;
  color: var(--green-dark);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  text-shadow: 0 2px 8px rgb(254 252 248), 0 0 20px rgba(254, 252, 248, 0.5);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

.hero-subtitle {
  font-size: clamp(18px, 2.5vw, 24px);
  font-size: 20px;
  font-family: "Montserrat Alternates", sans-serif;
  color: #f0f5f0;
  line-height: 1.6;
  max-width: 600px;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(254, 252, 248, 0.3);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.15s forwards;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.3s forwards;
}

.btn-primary,
a.btn-primary {
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--green-dark);
  color: rgba(254, 252, 248, 0.95);
  font-size: 15px;
  font-weight: 500;
  font-family: "Montserrat Alternates", sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease, transform 0.15s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary:hover {
  background: var(--green-medium);
  transform: translateY(-1px);
}

.btn-secondary,
a.btn-secondary {
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--green-dark);
  background: rgba(254, 252, 248, 0.98);
  color: var(--green-dark);
  font-size: 15px;
  font-weight: 500;
  font-family: "Montserrat Alternates", sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-secondary:hover {
  background: var(--green-pale);
  border-color: var(--green-medium);
  transform: translateY(-1px);
}


/* Адаптивность */
/* Планшет и узкий экран */
@media (max-width: 860px) {
  .top-nav {
    width: 94%;
    padding: 16px 24px;
    margin: 20px auto 0;
    gap: 24px;
  }

  .nav-menu {
    gap: 12px;
  }

  .nav-link {
    font-size: 14px;
    padding: 8px 10px;
    min-width: auto;
    width: auto;
  }

  .hero-section {
    margin-top: -15vh;
    padding: 0 20px;
    gap: 18px;
  }

  .hero-title {
    font-size: clamp(40px, 10vw, 64px);
  }

  .hero-subtitle {
    font-size: 17px;
  }
}

/* Мобильные — меню как на компьютере, только компактнее */
@media (max-width: 520px) {
  .top-nav {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    margin: 12px auto 0;
    width: calc(100% - var(--safe-inline) * 2);
    max-width: none;
    border-radius: var(--radius-l);
  }

  .nav-menu {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 8px;
  }

  .nav-link {
    font-size: 12px;
    padding: 6px 8px;
    min-width: auto;
    width: auto;
    background: none;
    border-radius: 0;
  }

  .nav-link:hover {
    background: transparent;
    color: #3a4d3a;
    font-weight: 600;
  }

  .lang-switcher {
    align-self: center;
    width: 68px;
    padding: 2px;
  }

  .lang-btn {
    font-size: 11px;
    padding: 4px 10px;
    min-height: 28px;
  }

  .hero-section {
    margin-top: -8vh;
    padding: 0 var(--safe-inline);
    gap: 16px;
  }

  .hero-title {
    font-size: clamp(32px, 11vw, 44px);
    line-height: 1.15;
  }

  .hero-subtitle {
    font-size: 15px;
    line-height: 1.55;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    gap: 12px;
    margin-top: 12px;
  }

  .btn-primary,
  a.btn-primary,
  .btn-secondary,
  a.btn-secondary {
    width: 100%;
    min-height: var(--touch-min);
    padding: 14px 24px;
    font-size: 15px;
  }
}

/* Очень маленькие экраны */
@media (max-width: 380px) {
  .hero-title {
    font-size: 28px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .nav-link {
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* Футер */
.footer {
  width: 100%;
  padding: 48px 24px 24px;
  text-align: center;
  margin-top: auto;
}

.footer-text {
  font-size: 14px;
  font-weight: 400;
  font-family: "Montserrat Alternates", sans-serif;
  color: rgba(254, 252, 248, 0.8);
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

@media (max-width: 520px) {
  .footer {
    padding: 32px var(--safe-inline) 20px;
  }

  .footer-text {
    font-size: 13px;
  }
}
