/* ------------------------------------------------------------------
   Фонд Святителей земли русской — стили
   Палитра и типографика из брендбука: чёрный / золото / крем,
   инскрипционные капители (Forum) + русский гротеск (Golos Text).
------------------------------------------------------------------- */

:root {
  --ink-0: #0b0a09;
  --ink-1: #121211;
  --ink-2: #1b1916;
  --gold: #b7965e;
  --gold-hi: #e2c98b;
  --gold-lo: #6e5938;
  --paper: #f8f6f0;
  --paper-2: #ece7db;
  --umber: #35312b;
  --stone: #7e776c;
  --line-ink: rgba(183, 150, 94, 0.22);
  --line-paper: rgba(53, 49, 43, 0.16);

  --display: 'Forum', 'Times New Roman', Georgia, serif;
  --text: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --pad: clamp(20px, 4vw, 64px);
  --nav-h: 84px;
  --max: 1440px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

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

html {
  font-size: clamp(16px, 0.95vw + 11px, 18px);
  background: var(--ink-1);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink-1);
  color: var(--paper);
  font-family: var(--text);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body.menu-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip {
  position: absolute;
  left: -999px;
  top: 10px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--ink-1);
  text-decoration: none;
  font-weight: 600;
}
.skip:focus { left: 10px; }

/* ---------- Типографика ---------- */

.h2 {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.02;
  font-size: clamp(2.1rem, 4.4vw, 4.2rem);
  margin: 0;
}

.lead {
  font-size: clamp(1.05rem, 1.25vw, 1.35rem);
  line-height: 1.45;
  max-width: 34ch;
  color: var(--stone);
  margin: 1.4rem 0 0;
}
.lead--ink { color: rgba(248, 246, 240, 0.72); }

.inscription {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  font-size: clamp(1.35rem, 2.5vw, 2.35rem);
  line-height: 1.25;
  margin: clamp(80px, 10vw, 160px) auto 0;
}
.paper .inscription { color: var(--ink-1); }

/* строка для reveal: обрезаем только по вертикали, оставляя место хвостам Д/Ц/Щ */
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}
.line > span { display: block; will-change: transform; }

/* ---------- Кнопки и ссылки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 30px;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--gold);
  border-radius: 0;
  background: transparent;
  transition: background 0.35s, color 0.35s, border-color 0.35s;
}
.btn--gold { background: var(--gold); color: var(--ink-1); }
.btn--gold:hover { background: var(--gold-hi); border-color: var(--gold-hi); }
.btn--ghost { color: var(--gold-hi); }
.btn--ghost:hover { background: var(--gold); color: var(--ink-1); }
.btn:disabled { opacity: 0.6; cursor: default; }

.link {
  color: var(--gold-hi);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
}
.link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(1);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
.link:hover::after { transform: scaleX(0); transform-origin: right; }

/* ---------- Навигация ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--nav-h);
  transition: background 0.5s, border-color 0.5s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(18, 18, 17, 0.74);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  border-color: var(--line-ink);
}
.nav__inner {
  height: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--paper);
  text-decoration: none;
}
.brand__slot {
  display: block;
  width: 58px;
  aspect-ratio: 1800 / 990;
  flex: none;
}
.brand__name {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--gold-hi);
}

.nav__links { display: flex; gap: clamp(18px, 2.4vw, 40px); }
.nav__links a {
  color: rgba(248, 246, 240, 0.78);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
  padding: 6px 0;
  transition: color 0.3s;
}
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease-out);
}
.nav__links a:hover { color: var(--paper); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav.is-light.is-scrolled {
  background: rgba(248, 246, 240, 0.84);
  border-color: var(--line-paper);
}
.nav.is-light .nav__links a { color: rgba(53, 49, 43, 0.78); }
.nav.is-light .nav__links a:hover { color: var(--ink-1); }
.nav.is-light .brand__name { color: var(--gold-lo); }
.nav.is-light .burger span { background: var(--gold-lo); }

.nav__actions { display: flex; align-items: center; gap: 14px; }
.nav .btn { min-height: 42px; padding: 0 20px; font-size: 0.74rem; }

.burger {
  display: none;
  width: 44px; height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.burger span {
  position: absolute;
  left: 10px; right: 10px;
  height: 1px;
  background: var(--gold-hi);
  transition: transform 0.4s var(--ease-out), top 0.4s var(--ease-out);
}
.burger span:nth-child(1) { top: 18px; }
.burger span:nth-child(2) { top: 26px; }
.burger.is-open span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.burger.is-open span:nth-child(2) { top: 22px; transform: rotate(-45deg); }

.menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: var(--ink-0);
  display: grid;
  align-content: center;
  padding: calc(var(--nav-h) + 20px) var(--pad) 40px;
}
.menu[hidden] { display: none; }
.menu__links { display: grid; }
.menu__links a {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 1.1;
  color: var(--paper);
  text-decoration: none;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-ink);
}
.menu__tag {
  margin: 36px 0 0;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.72rem;
  color: var(--stone);
}

/* ---------- Орнамент (летающий слой) ---------- */

.orn-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  transition: opacity 0.3s;
}
body.menu-open .orn-layer { opacity: 0; }
.orn {
  position: absolute;
  top: 0; left: 0;
  width: 100px;
  transform-origin: 0 0;
  will-change: transform;
  opacity: 0;
}
.is-measured .orn { opacity: 1; }
.orn__img { width: 100%; height: auto; }
.orn__shine {
  position: absolute;
  inset: 0;
  -webkit-mask: url('../assets/img/ornament-1800.webp') center / contain no-repeat;
  mask: url('../assets/img/ornament-1800.webp') center / contain no-repeat;
  background: linear-gradient(112deg, transparent 38%, rgba(255, 244, 214, 0.95) 50%, transparent 62%);
  background-size: 320% 100%;
  background-position: 130% 0;
  mix-blend-mode: screen;
  opacity: 0;
}

/* Статичные копии орнамента — для reduced-motion и без JS */
.orn-static { width: 100%; height: auto; }
.reduced .orn-layer, .no-js .orn-layer { display: none; }
.js:not(.reduced) .orn-static { display: none; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-top: var(--nav-h);
  overflow: hidden;
  background:
    radial-gradient(60% 46% at 50% 36%, #201c16 0%, rgba(32, 28, 22, 0) 70%),
    linear-gradient(180deg, var(--ink-1) 0%, var(--ink-0) 100%);
}
.hero__dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 8svh;
}
.hero__orn-space {
  --orn-h: clamp(150px, min(33svh, 34vw), 360px);
  height: var(--orn-h);
  width: calc(var(--orn-h) * 1800 / 990);
  margin-bottom: clamp(20px, 4svh, 44px);
}
.hero__tag {
  margin: 0 0 clamp(14px, 2svh, 22px);
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: clamp(0.66rem, 0.8vw, 0.8rem);
  color: var(--gold);
}
.hero__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.02;
  font-size: clamp(1.9rem, 7vw, 6.4rem);
  color: var(--paper);
}
.hero__lead {
  max-width: 52ch;
  margin: clamp(20px, 3svh, 32px) 0 0;
  font-size: clamp(1rem, 1.15vw, 1.2rem);
  line-height: 1.5;
  color: rgba(248, 246, 240, 0.74);
}
.hero__cta {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: clamp(26px, 4svh, 40px);
  flex-wrap: wrap;
  justify-content: center;
}
.hero__counter {
  position: absolute;
  left: var(--pad);
  bottom: 28px;
  font-family: var(--display);
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 1px;
  height: 56px;
  background: rgba(183, 150, 94, 0.25);
  overflow: hidden;
}
.hero__scroll span {
  position: absolute;
  left: 0; top: -40%;
  width: 1px; height: 40%;
  background: var(--gold-hi);
  animation: cue 2.2s var(--ease-inout) infinite;
}
@keyframes cue { to { top: 100%; } }

/* Стартовые состояния для анимаций (только при работающем JS) */
.js:not(.reduced) [data-intro] { opacity: 0; }
.js:not(.reduced) .hero__title .line > span,
.js:not(.reduced) .reveal .line > span,
.js:not(.reduced) .pillar__name .line > span { transform: translateY(112%); }
.js:not(.reduced) .role { opacity: 0; }
.js:not(.reduced) .hero__scroll { opacity: 0; }
.js:not(.reduced) .orn__img { clip-path: inset(0 100% 0 0); }
.reduced .hero__counter { display: none; }

/* ---------- Бумага ---------- */

.paper {
  position: relative;
  background: var(--paper);
  color: var(--umber);
}
.paper::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
.paper > * { position: relative; }

/* ---------- Зачем мы ---------- */

.mission { padding-block: clamp(96px, 12vw, 180px); }
.mission__grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.mission__intro {
  position: sticky;
  top: calc(var(--nav-h) + 28px);
}
.mission__intro .h2 { color: var(--ink-1); }
.mission__list {
  position: relative;
  display: grid;
  padding-block: 12px;
}
.thread {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.thread path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  opacity: 0.75;
}
.pillar {
  position: relative;
  padding: clamp(26px, 3.2vw, 44px) 0 clamp(26px, 3.2vw, 44px) clamp(24px, 4vw, 64px);
  border-top: 1px solid var(--line-paper);
}
.pillar:last-child { border-bottom: 1px solid var(--line-paper); }
.pillar__name {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: clamp(2.3rem, 5.4vw, 5.2rem);
  line-height: 1;
  color: var(--ink-1);
}
.pillar__tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 0;
  color: var(--stone);
  font-size: 1rem;
}
.pillar__tags li { display: inline-flex; align-items: center; }
.pillar__tags li + li::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  margin: 0 18px;
  background: var(--gold);
  transform: rotate(45deg);
}

/* ---------- Ценности (лента) ---------- */

.values {
  border-top: 1px solid var(--line-ink);
  border-bottom: 1px solid var(--line-ink);
  padding: 28px 0;
  overflow: hidden;
  background: var(--ink-1);
}
.marquee {
  display: flex;
  width: max-content;
  animation: marquee 70s linear infinite;
}
.marquee__track {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}
.marquee__track li {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 clamp(28px, 4vw, 64px);
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.95rem;
  color: var(--gold-hi);
  white-space: nowrap;
}
.marquee__track svg {
  width: 34px; height: 34px;
  flex: none;
  stroke: var(--gold);
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Заголовки секций ---------- */

.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: end;
  margin-bottom: clamp(44px, 6vw, 88px);
}
.section-head .lead { margin-top: 0; justify-self: end; }
.section-head--center {
  grid-template-columns: 1fr;
  text-align: center;
  justify-items: center;
}
.section-head--center .lead { justify-self: center; }

/* ---------- Инициативы ---------- */

.init { padding-block: clamp(96px, 12vw, 180px); background: var(--ink-1); }
.init__grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.init__stage {
  position: sticky;
  top: calc(var(--nav-h) + 28px);
}
.init__stage-art {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line-ink);
  background: radial-gradient(90% 90% at 25% 15%, #24201a 0%, var(--ink-0) 70%);
}
.init__stage-art img {
  position: absolute;
  width: 190%;
  max-width: none;
  height: auto;
  left: var(--x, -20%);
  top: var(--y, -10%);
  opacity: 0.55;
  transition: left 1.1s var(--ease-out), top 1.1s var(--ease-out);
}
.init__stage-text {
  margin: 26px 0 0;
  max-width: 40ch;
  min-height: 4.6em;
  font-size: 1.06rem;
  color: rgba(248, 246, 240, 0.78);
}
.init__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-ink);
}
.init__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: baseline;
  width: 100%;
  padding: clamp(22px, 2.6vw, 34px) 0;
  border: 0;
  border-bottom: 1px solid var(--line-ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: rgba(248, 246, 240, 0.5);
  position: relative;
  transition: color 0.4s, padding-left 0.5s var(--ease-out);
}
.init__row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.5s var(--ease-out);
}
.init__item.is-active .init__row { color: var(--paper); padding-left: 34px; }
.init__item.is-active .init__row::before { width: 20px; }
.init__name {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: clamp(1.5rem, 2.6vw, 2.5rem);
  line-height: 1.05;
}
.init__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 0;
  max-width: 26ch;
  font-size: 0.85rem;
  color: var(--stone);
  text-align: right;
}
.init__tags span { display: inline-flex; align-items: center; }
.init__tags span + span::before {
  content: '';
  display: inline-block;
  width: 4px; height: 4px;
  margin: 0 12px;
  background: var(--gold);
  transform: rotate(45deg);
}
.init__desc {
  display: none;
  margin: 0;
  padding: 18px 0 26px;
  color: rgba(248, 246, 240, 0.72);
  border-bottom: 1px solid var(--line-ink);
}

/* ---------- Люди ---------- */

.people { padding-block: clamp(96px, 12vw, 180px); }
.people .h2 { color: var(--ink-1); }
.roles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-left: 1px solid var(--line-paper);
}
.role {
  position: relative;
  padding: 30px clamp(18px, 2.4vw, 36px) 44px;
  border-right: 1px solid var(--line-paper);
  border-top: 1px solid var(--line-paper);
  border-bottom: 1px solid var(--line-paper);
}
.role::before {
  content: '';
  position: absolute;
  top: -1px; left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 1s var(--ease-out);
}
.role.is-in::before { width: 100%; }
.role h3 {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: clamp(1.45rem, 2.2vw, 2.1rem);
  line-height: 1.05;
  color: var(--ink-1);
}
.role p { margin: 0; color: var(--stone); }

/* ---------- Эндаумент ---------- */

.endow {
  position: relative;
  padding-block: clamp(96px, 12vw, 180px);
  border-top: 1px solid var(--line-ink);
  background:
    radial-gradient(42% 55% at 74% 42%, rgba(183, 150, 94, 0.11) 0%, rgba(183, 150, 94, 0) 70%),
    var(--ink-1);
}
.endow__grid {
  display: grid;
  grid-template-columns: 6fr 6fr;
  gap: clamp(40px, 7vw, 120px);
  align-items: start;
}
.endow__intro { position: sticky; top: calc(var(--nav-h) + 28px); }
.endow__intro .lead { max-width: 42ch; }
.endow__def {
  margin-top: clamp(32px, 4vw, 56px);
  padding-top: 24px;
  border-top: 1px solid var(--line-ink);
  max-width: 48ch;
}
.endow__def h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  color: var(--gold);
}
.endow__def p { margin: 0; color: var(--stone); font-size: 0.95rem; line-height: 1.6; }

.flow {
  --flow-pad: clamp(48px, 5vw, 72px);
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 6px 0 6px var(--flow-pad);
  position: relative;
  display: grid;
  gap: clamp(36px, 4.5vw, 64px);
}
.flow__line {
  position: absolute;
  top: 0; bottom: 0; left: 11px;
  width: 2px;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.flow__line path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  opacity: 0.8;
}
.flow__step { position: relative; counter-increment: step; }
.flow__step::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--flow-pad) + 6px);
  top: 0.35em;
  width: 12px; height: 12px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--ink-1);
}
.flow__step--capital::before {
  width: 20px; height: 20px;
  left: calc(-1 * var(--flow-pad) + 2px);
  top: 0.15em;
  border-color: var(--gold-hi);
  box-shadow: 0 0 0 6px rgba(183, 150, 94, 0.14), 0 0 26px rgba(226, 201, 139, 0.35);
}
.flow__num {
  display: block;
  margin-bottom: 8px;
  font-family: var(--display);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  color: var(--gold);
}
.flow__num::before { content: counter(step, upper-roman); }
.flow__step h3 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: clamp(1.4rem, 2.1vw, 2rem);
  line-height: 1.05;
  color: var(--paper);
}
.flow__step--capital h3 { color: var(--gold-hi); }
.flow__step p { margin: 0; max-width: 42ch; color: rgba(248, 246, 240, 0.72); }
.js:not(.reduced) .flow__step { opacity: 0; }

/* ---------- Присоединяйтесь ---------- */

.join {
  position: relative;
  padding-block: clamp(120px, 15vw, 220px);
  overflow: hidden;
  background: var(--ink-0);
}
.join__bg {
  position: absolute;
  inset: -12% 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.join__bg img {
  width: min(120vw, 1400px);
  height: auto;
  max-width: none;
  opacity: 0.11;
}
.join .wrap { position: relative; }
.doors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-ink);
  border: 1px solid var(--line-ink);
}
.door {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 340px;
  padding: clamp(28px, 3.4vw, 48px);
  background: rgba(18, 18, 17, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: color 0.5s;
}
.door::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0;
  background: var(--gold);
  transition: height 0.55s var(--ease-out);
  z-index: -1;
}
.door:hover::after, .door:focus-within::after { height: 100%; }
.door h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: clamp(1.6rem, 2.4vw, 2.3rem);
  line-height: 1.05;
  color: var(--gold-hi);
  transition: color 0.5s;
}
.door p {
  margin: 0;
  flex: 1;
  color: rgba(248, 246, 240, 0.72);
  transition: color 0.5s;
}
.door .btn { align-self: flex-start; }
.door:hover h3, .door:focus-within h3 { color: var(--ink-1); }
.door:hover p, .door:focus-within p { color: rgba(18, 18, 17, 0.8); }
.door:hover .btn--ghost, .door:focus-within .btn--ghost {
  border-color: var(--ink-1);
  color: var(--ink-1);
}
.door:hover .btn--ghost:hover { background: var(--ink-1); color: var(--gold-hi); }

/* ---------- Футер ---------- */

.footer {
  border-top: 1px solid var(--line-ink);
  padding: clamp(56px, 7vw, 96px) 0 36px;
  background: var(--ink-1);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.footer__orn { width: 124px; height: auto; opacity: 0.9; }
.footer__name {
  margin: 20px 0 8px;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--gold-hi);
}
.footer__tag {
  margin: 0;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.68rem;
  color: var(--stone);
}
.footer__note {
  margin: 18px 0 0;
  max-width: 34ch;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--stone);
}
.footer__nav { display: grid; gap: 14px; align-content: start; justify-items: start; }
.footer__nav a, .footer__link {
  color: rgba(248, 246, 240, 0.72);
  text-decoration: none;
  transition: color 0.3s;
}
.footer__link {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.footer__nav a:hover, .footer__link:hover { color: var(--gold-hi); }
.footer__copy {
  grid-column: 1 / -1;
  margin: 40px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line-ink);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--stone);
  font-size: 0.85rem;
}

/* ---------- Модальная форма ---------- */

.modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(540px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--line-ink);
  background: var(--ink-1);
  color: var(--paper);
  overflow: auto;
}
.modal::backdrop {
  background: rgba(11, 10, 9, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal__close {
  position: absolute;
  top: 12px; right: 12px;
  width: 44px; height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--stone);
  transition: color 0.3s;
}
.modal__close:hover { color: var(--gold-hi); }
.modal__close svg { width: 22px; height: 22px; margin: auto; stroke: currentColor; fill: none; stroke-width: 1.4; }
.form, .form__done {
  display: grid;
  gap: 20px;
  padding: clamp(28px, 4vw, 44px);
}
.form__done[hidden], .form[hidden] { display: none; }
.form__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 1.8rem;
  line-height: 1.05;
  color: var(--gold-hi);
}
.form__sub { margin: -8px 0 0; color: var(--stone); }
.form label {
  display: grid;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--stone);
}
.form input, .form textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--paper);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(183, 150, 94, 0.4);
  border-radius: 0;
  padding: 10px 0;
  outline: none;
  resize: vertical;
  transition: border-color 0.3s;
}
.form input:focus, .form textarea:focus { border-bottom-color: var(--gold-hi); }
.form input::placeholder { color: rgba(126, 119, 108, 0.7); }
.form .btn { justify-self: start; margin-top: 6px; }
.form__note { margin: 0; font-size: 0.78rem; color: var(--stone); }

/* ---------- Адаптив ---------- */

@media (max-width: 1024px) {
  .mission__grid, .init__grid, .endow__grid { grid-template-columns: 1fr; }
  .mission__intro, .init__stage, .endow__intro { position: static; }
  .mission__intro { margin-bottom: 24px; }
  .endow__intro { margin-bottom: 40px; }
}

@media (max-width: 900px) {
  :root { --nav-h: 72px; }
  .nav__links { display: none; }
  .burger { display: block; }
  .brand__slot { width: 46px; }
  .section-head { grid-template-columns: 1fr; align-items: start; }
  .section-head .lead { justify-self: start; }
  .init__stage { display: none; }
  .init__row { grid-template-columns: 1fr; gap: 10px; }
  .init__tags { justify-content: flex-start; text-align: left; max-width: none; }
  .init__item.is-active .init__row { padding-left: 0; color: rgba(248, 246, 240, 0.86); }
  .init__item.is-active .init__row::before { width: 0; }
  .init__item.is-open .init__row { color: var(--paper); border-bottom-color: transparent; }
  .init__item.is-open .init__desc { display: block; }
  .roles { grid-template-columns: repeat(2, 1fr); }
  .doors { grid-template-columns: 1fr; }
  .door { min-height: 0; }
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .hero__title { letter-spacing: 0.035em; }
}

@media (max-width: 560px) {
  .roles { grid-template-columns: 1fr; }
  .hero__cta { flex-direction: column; gap: 20px; }
  .brand__name { font-size: 0.6rem; }
  .nav .btn { padding: 0 14px; font-size: 0.68rem; }
  .hero__counter { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee, .hero__scroll span { animation: none; }
  .hero__scroll { display: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
