/* ===== Reset & base ===== */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #16201a;
  background: #f6f8f7;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 350px; width: 100%; height: auto; }

:root{
  --sea-glass:#dfeee7;
  --hedge:#2f5b46;
  --foam:#ffffff;
  --sand:#e9e3d7;
  --ink:#16201a;
  --mist:#8aa69a;
  --accent:#6b9f86;
  --shadow: 0 10px 28px rgba(18, 41, 33, .12);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --header-h: 72px;
}

/* Local fonts */
@font-face{
  font-family: "Inter";
  src: url("../fonts/Inter-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face{
  font-family: "Inter";
  src: url("../fonts/Inter-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face{
  font-family: "Merriweather";
  src: url("../fonts/Merriweather-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face{
  font-family: "Merriweather";
  src: url("../fonts/Merriweather-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* Containers & utilities */
.container {
  max-width: 1200px;
  padding-inline: 20px;
  margin-inline: auto;
}

.visually-hidden {
  position: absolute!important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -40px;
  background: var(--ink); color: var(--foam);
  padding: 8px 12px; border-radius: 8px; text-decoration: none;
  transition: transform .2s ease;
}
.skip-link:focus { top: 12px; }

/* ===== Header ===== */
.site-header{
  position: fixed; inset: 0 0 auto 0; height: var(--header-h);
  background: linear-gradient(180deg, #fbfffd 0%, #f5faf7 100%);
  border-bottom: 1px solid #e2efe8;
  z-index: 1000;
  backdrop-filter: blur(6px);
}
.header-inner{
  height: 100%; display: flex;
  align-items: center; justify-content: space-between; gap: 12px;
}
.brand{
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--ink); text-decoration: none;
}
.brand-mark{
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--sea-glass); color: var(--hedge);
  font-weight: 700; box-shadow: var(--shadow);
}
.brand-text{ font-weight: 700; letter-spacing: .2px; }
.brand-sub{ display:block; font-weight:400; font-size:.8rem; color: var(--mist); }

/* Nav */
.nav-toggle{
  display: none; border: 0; background: transparent; cursor: pointer;
}
.nav-toggle .nav-toggle-bar{
  display:block; width: 26px; height: 2px; background: var(--hedge); margin:6px 0; border-radius:2px;
}
.site-nav .nav-list{
  display:flex; align-items:center; gap: 20px; list-style:none; margin:0; padding:0;
}
.site-nav a{
  text-decoration:none; color: var(--hedge); padding: 8px 10px; border-radius: 10px;
  transition: transform .2s ease, background-color .2s ease;
}
.site-nav a:hover{ background: var(--sea-glass); transform: translateY(-2px); }
.site-nav a[aria-current="page"]{ background: #e9f6ef; font-weight:700; }

/* ===== Layout spacing ===== */
main { padding-top: calc(var(--header-h) + 24px); }
.section { padding: clamp(48px, 7vw, 96px) 0; }

/* ===== Cards & motion ===== */
.card{
  background: var(--foam);
  border: 1px solid #ecf3ef;
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover{ transform: translateY(-6px); box-shadow: 0 14px 32px rgba(18,41,33,.16); }
.card figcaption{ font-size: .95rem; color:#254338; margin-top: 10px; }

/* Reveal on scroll */
.reveal{ opacity: 0; transform: translateY(18px); }
.reveal.is-visible{ opacity: 1; transform: none; transition: opacity .6s ease, transform .6s ease; }

/* Prefer-reduced-motion */
@media (prefers-reduced-motion: reduce){
  * { animation: none !important; transition: none !important; }
}

/* ===== Footer ===== */
.site-footer{
  margin-top: 36px; border-top: 1px solid #e2efe8; background: #fbfffd;
}
.footer-inner{ padding: 24px 20px; color: #335a49; }

/* ===== Responsive ===== */
@media (max-width: 1024px){
  .brand-sub{ display:none; }
}
@media (max-width: 860px){
  .nav-toggle{ display: inline-block; }
  .site-nav{
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: #ffffff; border-bottom: 1px solid #e2efe8;
    transform-origin: top; transform: scaleY(0); transition: transform .2s ease;
  }
  .site-nav.open{ transform: scaleY(1); }
  .site-nav .nav-list{ flex-direction: column; align-items: stretch; padding: 12px 16px; }
  .site-nav a{ padding: 12px 14px; }
}
@media (max-width: 480px){
  .brand-mark{ width: 36px; height: 36px; }
  :root{ --header-h: 66px; }
}
/* ===== Footer actions (legal buttons) ===== */
.footer-actions{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #d7e7df;
  background: #ffffff;
  color: var(--hedge);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}
.btn:hover{
  background: #f4fbf8;
  transform: translateY(-2px);
}
.btn:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-ghost{
  background: #ffffff;
  border-color: #d7e7df;
}

/* Responsive: stack on very small screens */
@media (max-width: 420px){
  .footer-actions{ flex-direction: column; }
  .btn{ width: 100%; }
}
/* ===== Header (pages-only layout) additions ===== */
/* Центруем меню, бургер — фиксируем справа */
.header-inner{
  position: relative;
  justify-content: center;        /* меню по центру */
}

.nav-toggle{
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

/* На десктопе — только меню по центру */
@media (min-width: 861px){
  .nav-toggle{ display: none; }   /* скрыть бургер */
  .site-nav{ position: static; transform: none !important; }
  .site-nav .nav-list{ flex-direction: row; }
}

/* На мобильных — выпадающее меню на всю ширину */
@media (max-width: 860px){
  .site-nav{
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: #ffffff;
    border-bottom: 1px solid #e2efe8;
    transform-origin: top;
    transform: scaleY(0);
    transition: transform .2s ease;
  }
  .site-nav.open{ transform: scaleY(1); }
  .site-nav .nav-list{
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
  }
}
/* ===== Brand title (left-side, text-only) ===== */
.brand-title{
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--hedge);
  text-decoration: none;
  white-space: nowrap;
}
.brand-title:hover{ text-decoration: underline; }
.brand-title:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Сетка: бренд слева, меню по центру, бургер справа */
.header-inner{
  position: relative;
  justify-content: center; /* меню по центру */
}
.nav-toggle{
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

/* Адаптив: на очень узких экранах уменьшаем/усекаем */
@media (max-width: 520px){
  .brand-title{
    max-width: 52vw;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .95rem;
  }
}

/* Десктоп — бургер скрыт, меню статично по центру */
@media (min-width: 861px){
  .nav-toggle{ display: none; }
  .site-nav{ position: static; transform: none !important; }
  .site-nav .nav-list{ flex-direction: row; }
}

/* Мобилка — выпадающее меню */
@media (max-width: 860px){
  .site-nav{
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: #ffffff;
    border-bottom: 1px solid #e2efe8;
    transform-origin: top;
    transform: scaleY(0);
    transition: transform .2s ease;
  }
  .site-nav.open{ transform: scaleY(1); }
  .site-nav .nav-list{
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
  }
}
