/* =========================================================
   ТОКЕНЫ
   ========================================================= */
:root {
  --bg:          #F7F4EC;
  --bg-alt:      #EFEAD9;
  --bg-card:     #FFFFFF;
  --text:        #201C14;
  --text-muted:  #6B6252;
  --accent:      #33513F;   /* глубокий тёмно-зелёный — акцент для дат/цитат/CTA */
  --accent-soft: rgba(51, 81, 63, 0.08);
  --accent-light:#E0BE78;   /* светлое золото — для тёмных зон: hero и footer */
  --accent-contrast: #F7F4EC; /* цвет текста поверх тёмно-зелёных заливок */
  --sage:        #A6673F;   /* тёплая охра — вторичный акцент */
  --line:        rgba(32, 28, 20, 0.12);
  --line-strong: rgba(32, 28, 20, 0.24);

  /* тёмные зоны на светлой странице: hero (поверх фото) и footer */
  --dark-surface:      #16211A;
  --dark-surface-text: #EDE8D9;
  --dark-surface-muted:rgba(237, 232, 217, 0.68);
  --dark-surface-line: rgba(237, 232, 217, 0.16);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --header-h: 84px;
  --container: 1180px;
  --radius: 2px;
}

/* =========================================================
   RESET / BASE
   ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  max-width: 18ch;
  margin-bottom: 20px;
}

.section-lead {
  color: var(--text-muted);
  max-width: 56ch;
  font-size: 16px;
}

.section { padding: 120px 0; border-top: 1px solid var(--line); }
.section:nth-of-type(even) { background: var(--bg-alt); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn--primary:hover { transform: translateY(-2px); }
.btn--ghost {
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Появление секций при скролле */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  color: var(--dark-surface-text); /* пока хедер лежит поверх тёмного фото hero */
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.site-header.is-scrolled {
  background: rgba(247, 244, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom-color: var(--line);
  color: var(--text); /* дальше хедер лежит на светлом фоне страницы */
}

.header-inner {
  max-width: var(--container);
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 42px; height: 42px;
  border: 1px solid var(--accent-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--accent-light);
  flex-shrink: 0;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.site-header.is-scrolled .logo-mark { border-color: var(--accent); color: var(--accent); }

.logo-text {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.15;
}

.site-nav ul { display: flex; align-items: center; gap: 36px; }
.nav-link {
  font-size: 14px;
  color: var(--dark-surface-muted);
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}
.nav-link:hover { color: var(--dark-surface-text); }
.nav-link::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--accent-light);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--accent-light); }
.nav-link.is-active::after { transform: scaleX(1); }
.nav-link--cta {
  color: var(--accent-light);
  border: 1px solid var(--accent-light);
  padding: 8px 16px;
  border-radius: var(--radius);
}
.nav-link--cta::after { display: none; }

.site-header.is-scrolled .nav-link { color: var(--text-muted); }
.site-header.is-scrolled .nav-link:hover { color: var(--text); }
.site-header.is-scrolled .nav-link::after { background: var(--accent); }
.site-header.is-scrolled .nav-link.is-active { color: var(--accent); }
.site-header.is-scrolled .nav-link--cta { color: var(--accent); border-color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 32px;
  z-index: 110;
}
.nav-toggle span {
  height: 2px; width: 100%;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-photo { width: 100%; height: 100%; object-fit: cover; filter: grayscale(35%) contrast(1.05); }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,22,15,0.35) 0%, rgba(16,22,15,0.55) 55%, rgba(16,22,15,0.96) 100%);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--dark-surface-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--dark-surface-line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.6;
  mix-blend-mode: overlay;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px 96px;
  width: 100%;
  color: var(--dark-surface-text); /* фото остаётся тёмным даже в светлой теме */
}

.hero-content .eyebrow { color: var(--accent-light); }

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 10vw, 108px);
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.hero-subtitle {
  max-width: 46ch;
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--dark-surface-muted);
  margin-bottom: 36px;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-actions .btn--ghost { border-color: var(--dark-surface-line); color: var(--dark-surface-text); }
.hero-actions .btn--ghost:hover { border-color: var(--accent-light); color: var(--accent-light); }

.scroll-cue {
  position: absolute;
  right: 32px; bottom: 40px;
  z-index: 1;
  width: 1px; height: 64px;
  background: var(--dark-surface-line);
}
.scroll-cue span {
  position: absolute; top: 0; left: -2px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-light);
  animation: scrollcue 2.2s ease-in-out infinite;
}
@keyframes scrollcue {
  0% { top: 0; opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* =========================================================
   ИСТОРИЯ — таймлайн (сигнатурный элемент)
   ========================================================= */
.timeline {
  position: relative;
  margin-top: 64px;
  padding-left: 2px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 88px; top: 8px; bottom: 8px;
  width: 1px;
  background: var(--line-strong);
}
@media (max-width: 640px) {
  .timeline::before { left: 8px; }
}

.timeline-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.timeline-item:first-child { border-top: none; }

.timeline-year {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  position: relative;
}
.timeline-year::before {
  content: '';
  position: absolute;
  left: 84px; top: 4px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline-body h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
}
.timeline-body p { color: var(--text-muted); max-width: 62ch; }

@media (max-width: 640px) {
  .timeline-item { grid-template-columns: 1fr; gap: 10px; padding-left: 28px; }
  .timeline-year::before { left: 4px; }
}

/* =========================================================
   ДОСТИЖЕНИЯ
   ========================================================= */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 56px 0 72px;
}
.achievement-card {
  background: var(--bg-alt);
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.section:nth-of-type(odd) .achievement-card { background: var(--bg); }

.achievement-number {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 46px);
  color: var(--accent);
  line-height: 1;
}
.achievement-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.achievements-list { display: flex; flex-direction: column; gap: 24px; }
.achievements-list li {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
}
.achievements-list-photo {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}
.achievements-list h3 { font-family: var(--font-display); font-size: 17px; margin-bottom: 4px; }
.achievements-list p { color: var(--text-muted); font-size: 14px; }

@media (max-width: 860px) {
  .achievements-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   ОБО МНЕ / ЦИТАТЫ
   ========================================================= */
.about-inner {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 72px;
  align-items: start;
}
.about-photo {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  overflow: hidden;
  border: 1px solid var(--line);
}
.about-photo img { filter: grayscale(20%); }

.about-paragraph { color: var(--text-muted); margin-bottom: 32px; max-width: 60ch; }

.quote {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.1vw, 24px);
  line-height: 1.5;
  padding: 24px 0 24px 28px;
  border-left: 2px solid var(--accent);
  margin-bottom: 28px;
  color: var(--text);
}

@media (max-width: 860px) {
  .about-inner { grid-template-columns: 1fr; gap: 36px; }
  .about-photo { position: static; max-width: 320px; }
}

/* =========================================================
   ГАЛЕРЕЯ
   ========================================================= */
.gallery-track {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.gallery-item {
  flex: 0 0 auto;
  width: min(78vw, 420px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid var(--line);
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.05); }

.lightbox {
  position: fixed; inset: 0;
  background: rgba(10, 14, 9, 0.94);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  padding: 32px;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border: 1px solid var(--line-strong); }
.lightbox-close {
  position: absolute; top: 24px; right: 32px;
  font-size: 20px;
  color: var(--text);
}

/* =========================================================
   TELEGRAM
   ========================================================= */
.telegram-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.telegram-head .btn { flex-shrink: 0; }

.telegram-feed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.tg-post {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tg-post-head { display: flex; align-items: center; gap: 12px; }
.tg-post-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  flex-shrink: 0;
}
.tg-post-channel { display: block; font-size: 14px; font-weight: 600; }
.tg-post-date { display: block; font-size: 12px; color: var(--text-muted); }
.tg-post-text { font-size: 14px; color: var(--text-muted); }
.tg-post-image { border: 1px solid var(--line); }

@media (max-width: 860px) {
  .telegram-feed { grid-template-columns: 1fr; }
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--dark-surface);
  color: var(--dark-surface-text);
  border-top: 1px solid var(--dark-surface-line);
  padding: 80px 0 0;
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 56px;
}
.logo--footer { margin-bottom: 16px; }
.logo--footer .logo-mark { border-color: var(--accent-light); color: var(--accent-light); }
.footer-tagline { color: var(--dark-surface-muted); font-size: 14px; max-width: 32ch; margin-bottom: 20px; }
.footer-socials { display: flex; gap: 16px; }
.footer-socials a { font-size: 13px; color: var(--accent-light); border-bottom: 1px solid transparent; }
.footer-socials a:hover { border-color: var(--accent-light); }

.footer-heading {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dark-surface-muted);
  margin-bottom: 18px;
}
.footer-list { display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--dark-surface-text); }
.footer-list a:hover { color: var(--accent-light); }
.footer-list--mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--dark-surface-muted); line-height: 1.7; }

.footer-bottom {
  border-top: 1px solid var(--dark-surface-line);
  padding: 20px 32px;
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--dark-surface-muted);
}
.to-top { color: var(--dark-surface-muted); }
.to-top:hover { color: var(--accent-light); }

@media (max-width: 860px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* =========================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ ШАПКИ
   ========================================================= */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 340px);
    background: var(--bg-alt);
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 105;
    padding: 120px 40px 40px;
  }
  .site-nav.is-open { transform: translateX(0); }
  .site-nav ul { flex-direction: column; align-items: flex-start; gap: 24px; }
  .nav-link { font-size: 16px; }

  /* панель меню всегда светлая, поэтому текст в ней всегда тёмный —
     не зависит от того, поверх фото сейчас хедер или нет */
  .site-nav .nav-link { color: var(--text-muted); }
  .site-nav .nav-link:hover,
  .site-nav .nav-link.is-active { color: var(--accent); }
  .site-nav .nav-link::after { background: var(--accent); }
  .site-nav .nav-link--cta { color: var(--accent); border-color: var(--accent); }

  /* кнопка-бургер тоже должна быть видна на фото до скролла */
  .nav-toggle span { background: var(--dark-surface-text); }
  .site-header.is-scrolled .nav-toggle span { background: var(--text); }
  .nav-toggle[aria-expanded="true"] span { background: var(--text); }

  .hero-content { padding-bottom: 64px; }
  .scroll-cue { display: none; }
}

@media (max-width: 640px) {
  .section { padding: 80px 0; }
  .section-inner { padding: 0 20px; }
  .header-inner { padding: 0 20px; }
  .achievements-list li { flex-direction: column; align-items: flex-start; text-align: left; }
}