/* ==========================================================================
   Фундація майбутнього держави — стилі
   Концепція: «апертура» з референсу (вікно-фото, що розкривається зі скролом,
   великий текст у дужках, закріплені сцени) + ідентичність фундації:
   дерево з логотипу, синьо-жовтий «прапорний» перехід, шрифт Unbounded.
   Дві теми: «ніч» (темна, жовтий акцент) і «день» (світла, синій акцент).
   ========================================================================== */

/* ==========================================================================
   Лаб. 12: шрифти з власного домену замість Google Fonts — без окремого
   CSS-запиту на fonts.googleapis.com і з'єднань до двох сторонніх доменів.
   Файли — @fontsource (SIL OFL 1.1, див. assets/fonts/OFL-*.txt), лише кирилиця
   й латиниця; unicode-range — браузер вантажить тільки потрібний піднабір.
   font-display: swap — текст одразу видно системним шрифтом.
   ========================================================================== */
@font-face{font-family:'Unbounded';font-style:normal;font-weight:300;font-display:swap;src:url(../fonts/unbounded-cyrillic-300-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Unbounded';font-style:normal;font-weight:300;font-display:swap;src:url(../fonts/unbounded-latin-300-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Unbounded';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/unbounded-cyrillic-400-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Unbounded';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/unbounded-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Unbounded';font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/unbounded-cyrillic-500-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Unbounded';font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/unbounded-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Onest';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/onest-cyrillic-400-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Onest';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/onest-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Onest';font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/onest-cyrillic-500-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Onest';font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/onest-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Onest';font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/onest-cyrillic-600-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Onest';font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/onest-latin-600-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

/* ---------------- Tokens ---------------- */
:root {
  --brand-blue: #00469b;
  --brand-yellow: #fec301;
  --brand-navy: #01226b;

  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1320px;
  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 28px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --header-h: 76px;
}

/* «День» — основна тема: світлий холодний папір, синій акцент */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fb;
  --bg-2: #e7edf7;
  --bg-3: #d8e2f2;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: #ffffff;
  --ink: #071a45;
  --muted: #4b5a80;
  --line: rgba(7, 26, 69, 0.12);
  --line-strong: rgba(7, 26, 69, 0.3);
  --glass: rgba(255, 255, 255, 0.9);
  --glass-line: rgba(7, 26, 69, 0.1);
  --accent: #00469b;
  --accent-ink: #ffffff;
  --accent-2: #c79400;
  --tree-blue: #00469b;
  --tree-yellow: #f2b800;
  --ic-b: #d3e2fb;
  --ic-a: #fec301;
  --ic-l: #071a45;
  --orb-blue: rgba(0, 92, 210, 0.2);
  --orb-yellow: rgba(254, 195, 1, 0.3);
  --orb-sky: rgba(110, 170, 255, 0.28);
  --grid-dot: rgba(7, 26, 69, 0.13);
  --danger: #b4231a;
  --success: #12733d;
  --shadow: 0 30px 70px -34px rgba(7, 26, 69, 0.35);
}

/* «Ніч»: глибокий синій замість нейтрального чорного, жовте «світло» */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050f2c;
  --bg-2: #0a1a45;
  --bg-3: #10245a;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: #0c1d4b;
  --ink: #eef2fb;
  --muted: #9aa7c9;
  --line: rgba(238, 242, 251, 0.14);
  --line-strong: rgba(238, 242, 251, 0.32);
  --glass: rgba(10, 26, 69, 0.9);
  --glass-line: rgba(255, 255, 255, 0.14);
  --accent: #fec301;
  --accent-ink: #050f2c;
  --accent-2: #4d8bf0;
  --tree-blue: #3d7fe6;
  --tree-yellow: #fec301;
  --ic-b: #1b3c82;
  --ic-a: #fec301;
  --ic-l: #eef2fb;
  --orb-blue: rgba(0, 80, 200, 0.42);
  --orb-yellow: rgba(254, 195, 1, 0.13);
  --orb-sky: rgba(60, 120, 230, 0.26);
  --grid-dot: rgba(238, 242, 251, 0.1);
  --danger: #ff8a7a;
  --success: #7be0a5;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
}

/* ---------------- Base ---------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
}
html {
  background: var(--bg);
  transition: background-color 0.5s ease;
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: color 0.5s ease;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
::selection {
  background: var(--accent);
  color: var(--accent-ink);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.sr-only {
  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: fixed;
  top: 10px;
  left: 10px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s;
}
.skip-link:focus {
  transform: none;
}

/* ---------------- Type ---------------- */
.section {
  padding-block: clamp(48px, 5.5vw, 84px);
  position: relative;
}
.section-head {
  max-width: 760px;
}
/* Мітка секції в квадратних дужках — прийом з референсу */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 18px;
}
.section-tag::before,
.section-tag::after {
  content: "";
  width: 7px;
  height: 18px;
  border: 1px solid var(--line-strong);
}
.section-tag::before {
  border-right: 0;
}
.section-tag::after {
  border-left: 0;
}
/* Заголовки секцій: крупний широкий Unbounded, тісний трекінг;
   слова з'являються «з-під маски» по черзі, коли заголовок входить в екран */
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 4.9vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.sw {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}
.sw > span {
  display: inline-block;
  transition: transform 0.9s var(--ease-out);
  transition-delay: calc(var(--w, 0) * 55ms);
}
.js .split-title:not(.is-visible) .sw > span {
  transform: translateY(105%);
}
/* Шапка секції: заголовок ліворуч, пояснення праворуч по нижньому краю */
.head-split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 20px clamp(32px, 5vw, 80px);
  align-items: end;
  margin-bottom: clamp(32px, 4vw, 56px);
}
.head-split .section-subtitle {
  margin-top: 0;
}
.join__skip {
  margin-top: 16px;
}
.section-subtitle {
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 62ch;
}

/* Розбиття заголовків на рядки для появи «з-під маски» */
.split-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.split-line > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1s var(--ease-out);
  transition-delay: calc(var(--l, 0) * 90ms);
}
.is-visible .split-line > span,
.split-line.is-visible > span {
  transform: none;
}

/* ---------------- Buttons ---------------- */
.btn {
  --mx: 0px;
  --my: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1;
  white-space: nowrap;
  transform: translate(var(--mx), var(--my));
  transition: transform 0.35s var(--ease-out), background-color 0.3s, color 0.3s, border-color 0.3s;
  isolation: isolate;
  overflow: hidden;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform 0.45s var(--ease-out);
}
.btn:hover::before {
  transform: none;
}
.btn--sm {
  min-height: 42px;
  padding: 0 20px;
  font-size: 0.9rem;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  color: var(--bg);
}
.btn-outline {
  border: 1px solid var(--line-strong);
}
.btn-outline:hover {
  color: var(--bg);
  border-color: var(--ink);
}
.btn-glass {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}
.btn-glass::before {
  background: #fff;
}
.btn-glass:hover {
  color: #050f2c;
}
.btn-block {
  width: 100%;
}
.btn[disabled] {
  opacity: 0.6;
  pointer-events: none;
}
.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 3px;
  transition: background-size 0.4s var(--ease-out), color 0.3s;
}
.btn-text:hover {
  color: var(--accent);
  background-size: 0% 1px;
  background-position: 100% 100%;
}

/* ---------------- Preloader: дерево + синьо-жовта шторка ---------------- */
.preloader {
  display: none;
}
.js:not(.no-preloader) .preloader {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: var(--bg);
  animation: preloader-failsafe 0.01s 3.5s forwards;
}
.preloader__half {
  position: absolute;
  left: 0;
  right: 0;
  height: 50.5%;
  transition: transform 0.65s var(--ease-in-out);
}
.preloader__half--top {
  top: 0;
  background: var(--brand-blue);
  transform: translateY(-101%);
}
.preloader__half--bottom {
  bottom: 0;
  background: var(--brand-yellow);
  transform: translateY(101%);
}
.preloader.is-closing .preloader__half {
  transform: none;
}
.preloader.is-done {
  background: transparent;
}
.preloader.is-done .preloader__half--top {
  transform: translateY(-101%);
  transition-duration: 0.9s;
}
.preloader.is-done .preloader__half--bottom {
  transform: translateY(101%);
  transition-duration: 0.9s;
}
.preloader__core {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 18px;
  transition: opacity 0.3s;
}
.preloader.is-closing .preloader__core {
  opacity: 0;
}
.preloader__tree {
  display: block;
  width: clamp(120px, 18vw, 180px);
}
.preloader__count {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.preloader__count::before {
  content: "[ ";
}
.preloader__count::after {
  content: " ]";
}
@keyframes preloader-failsafe {
  to {
    visibility: hidden;
    opacity: 0;
  }
}

/* Дерево (вставляється JS) — малюється лініями */
.tree-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.tree-svg .t-blue,
.logo-svg .t-blue {
  color: var(--tree-blue);
}
.tree-svg .t-yellow,
.logo-svg .t-yellow {
  color: var(--tree-yellow);
}
.logo-svg .leaf {
  fill: currentColor;
}
.logo-tree g {
  stroke-width: 5.2;
}
.tree-svg path {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.tree-svg .leaf {
  fill: currentColor;
}
.tree-svg.is-drawing path {
  stroke-dashoffset: 1;
  animation: tree-draw 1.1s var(--ease-out) forwards;
  animation-delay: calc(var(--d, 0) * 70ms);
}
.tree-svg.is-drawing .leaf {
  fill-opacity: 0;
  animation: tree-draw 1s var(--ease-out) forwards, leaf-fill 0.6s ease forwards;
  animation-delay: calc(var(--d, 0) * 70ms), calc(500ms + var(--d, 0) * 70ms);
}
@keyframes tree-draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes leaf-fill {
  to {
    fill-opacity: 1;
  }
}

/* ---------------- Живий фон ---------------- */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}
/* Плями малюються маленькими й збільшуються через scale — текстура в 9 разів менша */
.orb {
  position: absolute;
  width: 19vmax;
  height: 19vmax;
  border-radius: 50%;
  will-change: transform;
  scale: 3;
}
.orb--blue {
  top: 0;
  left: 4vmax;
  background: radial-gradient(circle at center, var(--orb-blue) 0%, transparent 62%);
  animation: orb-a 26s ease-in-out infinite alternate;
}
.orb--yellow {
  bottom: 2vmax;
  right: 6vmax;
  background: radial-gradient(circle at center, var(--orb-yellow) 0%, transparent 62%);
  animation: orb-b 32s ease-in-out infinite alternate;
}
.orb--sky {
  top: 30vh;
  left: 40vw;
  width: 15vmax;
  height: 15vmax;
  background: radial-gradient(circle at center, var(--orb-sky) 0%, transparent 62%);
  animation: orb-c 38s ease-in-out infinite alternate;
}
@keyframes orb-a {
  to {
    transform: translate3d(28vw, 22vh, 0) scale(1.15);
  }
}
@keyframes orb-b {
  to {
    transform: translate3d(-30vw, -26vh, 0) scale(0.9);
  }
}
@keyframes orb-c {
  0% {
    transform: translate3d(-30vw, -10vh, 0);
  }
  100% {
    transform: translate3d(10vw, 20vh, 0) scale(1.2);
  }
}
/* Крапкова сітка, що згасає до країв */
.bg-grid {
  position: absolute;
  inset: -40px;
  background-image: radial-gradient(var(--grid-dot) 1.2px, transparent 1.3px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}
/* Листочки з логотипу повільно пливуть угору */
.bg-leaf {
  position: absolute;
  bottom: -60px;
  width: 22px;
  height: 34px;
  border-radius: 0 100% 0 100%;
  background: var(--tree-blue);
  opacity: 0;
  will-change: transform, opacity;
  animation: leaf-float 24s linear infinite;
}
.bg-leaf:nth-child(even) {
  background: var(--tree-yellow);
}
.bg-leaf--1 { left: 8%; animation-delay: 0s; }
.bg-leaf--2 { left: 24%; animation-delay: -7s; width: 16px; height: 24px; animation-duration: 28s; }
.bg-leaf--3 { left: 47%; animation-delay: -15s; animation-duration: 30s; }
.bg-leaf--4 { left: 66%; animation-delay: -3s; width: 14px; height: 22px; }
.bg-leaf--5 { left: 82%; animation-delay: -19s; animation-duration: 27s; }
.bg-leaf--6 { left: 93%; animation-delay: -11s; width: 18px; height: 28px; animation-duration: 33s; }
@keyframes leaf-float {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.32;
  }
  50% {
    transform: translate3d(40px, -55vh, 0) rotate(160deg);
  }
  90% {
    opacity: 0.32;
  }
  100% {
    transform: translate3d(-30px, -115vh, 0) rotate(320deg);
    opacity: 0;
  }
}

/* Під час скролу фон завмирає, анімації поза екраном — на паузі */
.is-scrolling .bg-scene > *,
.is-scrolling .marquee__track {
  animation-play-state: paused;
}
/* Анімації поза екраном — на паузі */
.is-offscreen,
.is-offscreen * {
  animation-play-state: paused !important;
}

/* ---------------- Scroll progress + cursor ---------------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1200;
  background: linear-gradient(90deg, var(--brand-blue) 0 50%, var(--brand-yellow) 50% 100%);
  transform-origin: 0 50%;
  transform: scaleX(var(--sp, 0));
  pointer-events: none;
}

.cursor {
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  .js .cursor {
    display: grid;
    place-items: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1300;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    pointer-events: none;
    transform: translate3d(-100px, -100px, 0);
    transition: width 0.4s var(--ease-out), height 0.4s var(--ease-out), margin 0.4s var(--ease-out),
      background-color 0.3s, opacity 0.3s;
    mix-blend-mode: normal;
  }
  .cursor.is-hidden {
    opacity: 0;
  }
  .cursor.is-label {
    width: 92px;
    height: 92px;
    margin: -46px 0 0 -46px;
    background: var(--accent);
  }
  .cursor__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-ink);
    opacity: 0;
    transition: opacity 0.2s;
  }
  .cursor.is-label .cursor__label {
    opacity: 1;
  }
  .cursor.is-link {
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    background: var(--accent);
  }
}

/* ---------------- Header ---------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 var(--gutter);
  transition: transform 0.5s var(--ease-out), background-color 0.4s;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transition: opacity 0.4s;
}
.site-header.is-solid:not(.on-photo)::before {
  opacity: 1;
}
.site-header.is-hidden {
  transform: translateY(-110%);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  color: var(--header-ink, var(--ink));
  transition: color 0.4s;
}
/* Векторний логотип: кільце й текст беруть колір теми (темні на світлій,
   світлі на темній), дерево — фірмові синій і жовтий */
.brand__logo {
  display: block;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
}
.brand__logo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.logo-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: var(--logo-ink, var(--ink));
}
.logo-svg text {
  fill: currentColor;
  font-family: var(--font-display);
  font-weight: 500;
}
.logo-svg .logo-ring {
  stroke: currentColor;
}
.logo-svg .tree-svg path {
  stroke-dasharray: none;
}
.brand:hover .logo-svg {
  animation: logo-spin 1.2s var(--ease-out);
}
@keyframes logo-spin {
  from {
    transform: rotate(-200deg);
  }
}
.site-header.on-photo .brand__logo {
  --logo-ink: #fff;
}
.footer-logo {
  display: block;
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
}
.brand__name {
  font-family: var(--font-display);
  font-size: 0.68rem;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: 0.01em;
}
/* Над розкритим фото шапка стає світлою в обох темах */
.site-header.on-photo {
  --header-ink: #fff;
}

.main-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: 0 10px 30px -18px rgba(7, 26, 69, 0.35);
}
.main-nav a {
  position: relative;
  z-index: 1;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  transition: color 0.3s;
}
.main-nav a.is-active {
  color: var(--accent-ink);
}
.main-nav__pill {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0;
  transform: translateX(var(--px, 0));
  width: var(--pw, 0);
  transition: transform 0.5s var(--ease-out), width 0.5s var(--ease-out), opacity 0.3s;
}
.main-nav.has-active .main-nav__pill {
  opacity: 1;
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lang-switch {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
}
.lang-switch button {
  min-width: 38px;
  height: 32px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  transition: background-color 0.3s, color 0.3s;
}
.lang-switch button.is-active {
  background: var(--ink);
  color: var(--bg);
}

/* Перемикач теми: сонце ↔ місяць */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  color: var(--ink);
  transition: transform 0.4s var(--ease-out);
}
.theme-toggle:hover {
  transform: rotate(-20deg) scale(1.06);
}
.theme-toggle svg {
  width: 20px;
  height: 20px;
  overflow: visible;
}
.theme-toggle__core {
  fill: currentColor;
  transition: r 0.5s var(--ease-out);
}
.theme-toggle__cut {
  transition: cx 0.5s var(--ease-out), cy 0.5s var(--ease-out);
}
.theme-toggle__rays {
  stroke: currentColor;
  stroke-width: 1.8;
  transform-origin: 12px 12px;
  transition: transform 0.5s var(--ease-out), opacity 0.3s;
}
/* Темна тема — місяць (виріз заходить у коло, промені ховаються) */
[data-theme="dark"] .theme-toggle__core {
  r: 8px;
}
[data-theme="dark"] .theme-toggle__cut {
  cx: 17px;
  cy: 7px;
}
[data-theme="dark"] .theme-toggle__rays {
  opacity: 0;
  transform: rotate(-60deg) scale(0.5);
}
[data-theme="light"] .theme-toggle__cut {
  cx: 30px;
  cy: -6px;
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-line);
}
.nav-toggle span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.6px;
  background: var(--ink);
  transition: transform 0.4s var(--ease-out);
}
.nav-toggle span:first-child {
  transform: translateY(-4px);
}
.nav-toggle span:last-child {
  transform: translateY(4px);
}
.nav-toggle[aria-expanded="true"] span:first-child {
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:last-child {
  transform: rotate(-45deg);
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 990;
  background: var(--bg);
  clip-path: circle(0 at calc(100% - 44px) 38px);
  transition: clip-path 0.7s var(--ease-in-out), visibility 0s 0.7s;
  visibility: hidden;
}
.mobile-nav.is-open {
  clip-path: circle(150% at calc(100% - 44px) 38px);
  visibility: visible;
  transition: clip-path 0.7s var(--ease-in-out), visibility 0s;
}
.mobile-nav__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: calc(var(--header-h) + 10px) var(--gutter) 40px;
}
.mobile-nav__inner > a {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 8vw, 2.4rem);
  font-weight: 400;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.mobile-nav__footer {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 28px;
}

/* ==========================================================================
   HERO — фото на весь екран
   Старт: фото відкривається шторкою знизу вгору й «наїжджає» з легкого
   збільшення; слова слогану виїжджають по черзі, факти — збоку.
   ========================================================================== */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
}
.hero__sticky {
  position: relative;
  height: 100%;
  overflow: hidden;
}
.hero__frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg-3);
}
/* Невеликий запас зверху — фото під час скролу їде вниз (паралакс).
   Чим менший запас, тим менше браузер збільшує фото — тим воно чіткіше */
.hero__media {
  position: absolute;
  inset: -6% 0 0 0;
  will-change: transform;
}
.hero__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.hero__slide.is-active {
  opacity: 1;
}
.hero__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
.hero__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 15, 44, 0.55) 0%, rgba(5, 15, 44, 0) 22%),
    linear-gradient(18deg, rgba(5, 15, 44, 0.92) 10%, rgba(5, 15, 44, 0.45) 46%, rgba(5, 15, 44, 0.05) 78%);
}
.js:not(.is-loaded) .hero__frame {
  clip-path: inset(100% 0 0 0);
}
.is-loaded .hero__frame {
  animation: hero-reveal 1.25s var(--ease-in-out) backwards;
}
/* Лаб. 12: без прелоадера (смартфон або повторний візит) Hero показуємо одразу з першим
   малюванням. Раніше кадр був прихований clip-path, доки app.js не виконається повністю,
   і LCP (постер відео) чекав на весь JavaScript. «Розкриття» лишилось продовженням прелоадера */
.js.no-preloader .hero__frame {
  clip-path: none;
  animation: none;
}
@keyframes hero-reveal {
  from {
    clip-path: inset(100% 0 0 0 round 0 0 48px 48px);
  }
  to {
    clip-path: inset(0 0 0 0 round 0);
  }
}
.is-loaded .hero__slide.is-active img {
  animation: hero-zoom 2.4s var(--ease-out) backwards;
}
@keyframes hero-zoom {
  from {
    scale: 1.08;
    filter: saturate(0.3) brightness(1.15);
  }
}

.hero__content {
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(48px, 10vh, 110px);
  max-width: 900px;
  color: #fff;
  will-change: transform, opacity;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.6vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero__title .sw > span {
  transition: transform 1s var(--ease-out);
  transition-delay: calc(0.75s + var(--w, 0) * 55ms);
}
.js:not(.is-loaded) .hero__title .sw > span {
  transform: translateY(110%);
}
.hero__subtitle {
  margin-top: 22px;
  max-width: 54ch;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  color: rgba(255, 255, 255, 0.86);
}
.hero__actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero__subtitle,
.hero__actions,
.hero__dots {
  transition: opacity 0.8s ease, transform 1s var(--ease-out);
}
.hero__subtitle {
  transition-delay: 1.2s;
}
.hero__actions {
  transition-delay: 1.35s;
}
.hero__dots {
  transition-delay: 1.6s;
}
.js:not(.is-loaded) .hero__subtitle,
.js:not(.is-loaded) .hero__actions,
.js:not(.is-loaded) .hero__dots {
  opacity: 0;
  transform: translateY(24px);
}

/* Факти — напівпрозорі «панелі» над фото */
.hero__widgets {
  position: absolute;
  z-index: 2;
  right: var(--gutter);
  top: calc(var(--header-h) + 4vh);
  display: grid;
  gap: 12px;
  width: min(270px, 26vw);
  color: #fff;
  will-change: transform, opacity;
}
.widget {
  padding: 16px 18px;
  border-radius: var(--radius-m);
  background: rgba(7, 22, 62, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: opacity 0.8s ease, transform 1s var(--ease-out);
  transition-delay: calc(1.25s + var(--i) * 120ms);
}
.js:not(.is-loaded) .widget {
  opacity: 0;
  transform: translateX(60px);
}
.widget__value {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--brand-yellow);
  font-variant-numeric: tabular-nums;
}
.widget__label {
  margin-top: 8px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.82);
}
.widget__bar {
  margin-top: 12px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}
.widget__bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-yellow));
  transform-origin: 0 50%;
  transition: transform 1.4s var(--ease-out);
  transition-delay: calc(1.6s + var(--i) * 120ms);
}
.js:not(.is-loaded) .widget__bar span {
  transform: scaleX(0);
}

.hero__dots {
  position: absolute;
  z-index: 2;
  right: var(--gutter);
  bottom: clamp(48px, 10vh, 110px);
  display: flex;
  gap: 8px;
}
.hero__dots button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
}
.hero__dots button::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  transition: background-color 0.3s, transform 0.3s;
}
.hero__dots button.is-active::after {
  background: var(--brand-yellow);
  border-color: var(--brand-yellow);
  transform: scale(1.3);
}
.hero__hint {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 22px;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  transition: opacity 0.4s;
}
.hero.is-scrolled .hero__hint,
.js:not(.is-loaded) .hero__hint {
  opacity: 0;
}
.hero__hint-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(rgba(255, 255, 255, 0.8), transparent);
  transform-origin: top;
  animation: hint 2s var(--ease-in-out) infinite;
}
@keyframes hint {
  0% {
    transform: scaleY(0);
  }
  50% {
    transform: scaleY(1);
    transform-origin: top;
  }
  51% {
    transform-origin: bottom;
  }
  100% {
    transform: scaleY(0);
    transform-origin: bottom;
  }
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
/* Одна велика фраза, коротке пояснення, цінності рядком і структура однією лінією */
.about__manifest {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.4vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  max-width: 19ch;
  text-wrap: balance;
}
/* Лаб. 12: «незапалені» слова — 0.55 замість 0.16. Lighthouse (axe): контраст 1,4:1;
   тепер ≥ 3,8:1 у світлій і ≥ 5,6:1 у темній темі — це WCAG AA для великого тексту (≥ 24 px),
   а ефект «загоряння» (0.55 → 1) лишається помітним. Колір не хардкодимо — працюють обидві теми */
.about__manifest .w {
  opacity: 0.55;
  transition: opacity 0.35s ease, color 0.35s;
}
.about__manifest .w.is-lit {
  opacity: 1;
}
.about__note {
  margin-top: 20px;
  max-width: 56ch;
  color: var(--muted);
  font-size: 1.04rem;
}
.values {
  margin-top: clamp(36px, 4.5vw, 64px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.values li {
  padding: 22px 22px 24px;
  border-radius: var(--radius-m);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s;
}
.values li:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}
.values h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.25;
}
.values .ic {
  display: block;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
}
.values p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.structure {
  margin-top: clamp(28px, 3.5vw, 48px);
  display: flex;
  align-items: center;
  gap: 24px 36px;
  flex-wrap: wrap;
}
.structure__label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}
.structure__flow {
  flex: 1 1 520px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  counter-reset: none;
}
.structure__flow li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 28px;
}
/* Стрілка між кроками */
.structure__flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-top: 1.5px solid var(--line-strong);
  border-right: 1.5px solid var(--line-strong);
  transform: translateY(-50%) rotate(45deg);
}
.structure__num {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.88rem;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.structure__flow h4 {
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.25;
}
.structure__flow p {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.35;
}

/* ==========================================================================
   DIRECTIONS — список із власними іконками
   Без закріпленого скролу: усі 8 напрямів видно одразу. На мишці над
   рядком з'являється фото, що пливе за курсором; іконка домальовується.
   ========================================================================== */
.dir-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}
.dir-list {
  border-top: 1px solid var(--line);
}
.dir {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 16px 16px;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
  cursor: default;
}
/* Активний рядок «заливається» білою карткою */
.dir::before {
  content: "";
  position: absolute;
  inset: 4px 0;
  z-index: -1;
  border-radius: 20px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.35s, transform 0.5s var(--ease-out);
}
.dir.is-active::before {
  opacity: 1;
  transform: none;
}
.dir__icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.6s var(--ease-out), background-color 0.3s;
}
.dir.is-active .dir__icon {
  transform: rotate(-6deg) scale(1.06);
}
.dir__icon .ic {
  width: 46px;
  height: 46px;
}
.dir__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.05rem, 1.55vw, 1.4rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  transition: transform 0.5s var(--ease-out), color 0.3s;
}
.dir.is-active .dir__title {
  transform: translateX(6px);
  color: var(--accent);
}
.dir__text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 52ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dir__thumb {
  display: none;
}
.dir__cta {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}
.dir__cta svg {
  width: 19px;
  height: 19px;
  transition: transform 0.5s var(--ease-out);
}
.dir.is-active .dir__cta,
.dir__cta:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.dir.is-active .dir__cta svg {
  transform: rotate(-45deg);
}

/* Закріплена картка з фото активного напряму */
.dir-stage {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}
.dir-stage__card {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: calc(100vh - var(--header-h) - 48px);
  width: 100%;
  border-radius: var(--radius-l);
  overflow: hidden;
  background: var(--bg-3);
  box-shadow: var(--shadow);
}
.dir-stage__media {
  position: absolute;
  inset: 0;
}
.dir-stage__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dir-stage__media img.is-entering {
  animation: stage-in 0.85s var(--ease-out) both;
}
@keyframes stage-in {
  from {
    clip-path: inset(100% 0 0 0 round 0);
    transform: scale(1.18);
  }
  to {
    clip-path: inset(0 0 0 0 round 0);
    transform: scale(1);
  }
}
.dir-stage__card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(5, 15, 44, 0.92) 0%, rgba(5, 15, 44, 0.35) 45%, rgba(5, 15, 44, 0) 70%);
  pointer-events: none;
}
.dir-stage__info {
  position: absolute;
  z-index: 2;
  left: 24px;
  right: 24px;
  bottom: 24px;
  color: #fff;
  display: grid;
  gap: 10px;
  justify-items: start;
}
.dir-stage__info > * {
  transition: opacity 0.3s, transform 0.5s var(--ease-out);
}
.dir-stage__info.is-swapping > * {
  opacity: 0;
  transform: translateY(12px);
}
.dir-stage__icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #fff;
  --ic-b: #d3e2fb;
  --ic-a: #fec301;
  --ic-l: #071a45;
}
.dir-stage__icon .ic {
  width: 42px;
  height: 42px;
}
.dir-stage__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  line-height: 1.15;
}
.dir-stage__text {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  max-width: 40ch;
}
.dir-stage__info .btn-primary {
  margin-top: 6px;
  background: var(--brand-yellow);
  color: #071a45;
}

/* Іконки: кольори з токенів теми + анімація «домальовування» */
.ic-b {
  fill: var(--ic-b);
  transition: fill 0.5s;
}
.ic-a {
  fill: var(--ic-a);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.6s var(--ease-out);
}
.ic-l {
  stroke: var(--ic-l);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transition: stroke 0.5s;
}
.dir.is-active .ic-a,
.values li:hover .ic-a {
  transform: scale(1.18) rotate(-8deg);
}
.dir.is-active .ic-l,
.values li:hover .ic-l {
  animation: ic-draw 0.9s var(--ease-out) both;
  animation-delay: calc(var(--k, 0) * 60ms);
}
/* Перша поява секції — іконки малюються по черзі */
.js .is-drawing-icons .ic-l {
  stroke-dashoffset: 1;
}
.js .is-drawing-icons.is-visible .ic-l {
  animation: ic-draw 1.2s var(--ease-out) forwards;
  animation-delay: calc(var(--row, 0) * 110ms + var(--k, 0) * 70ms);
}
@keyframes ic-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* ==========================================================================
   ПРАВОВА ДОПОМОГА — партнер «Вовк Родя та Партнери»
   ========================================================================== */
.legal-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr);
  gap: clamp(16px, 2vw, 24px);
  align-items: start;
}
/* Картка партнера — темно-синя, закріплюється поруч із послугами */
.legal-partner {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: clamp(24px, 2.6vw, 34px);
  border-radius: var(--radius-l);
  background: linear-gradient(160deg, #0a2a6e 0%, #071a45 70%);
  color: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}
.legal-partner::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -60px;
  z-index: -1;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 195, 1, 0.28), transparent 70%);
}
.legal-partner__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
  border-radius: 20px;
  background: #fff;
  --ic-b: #d3e2fb;
  --ic-a: #fec301;
  --ic-l: #071a45;
}
.legal-partner__icon .ic {
  width: 46px;
  height: 46px;
}
.legal-partner__kind {
  font-size: 0.88rem;
  color: var(--brand-yellow);
}
.legal-partner__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.legal-partner__text {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.98rem;
}
.legal-partner__cta {
  margin-top: 10px;
  background: var(--brand-yellow);
  color: #071a45;
}
.legal-partner__cta::before {
  background: #fff;
}
.legal-partner__cta:hover {
  color: #071a45;
}

.legal-services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.4vw, 16px);
  align-items: start;
}
.legal-card {
  border-radius: var(--radius-m);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: box-shadow 0.4s, border-color 0.3s;
}
.legal-card:hover {
  box-shadow: var(--shadow);
}
.legal-card[open] {
  border-color: var(--line-strong);
}
.legal-card__head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 24px;
  gap: 14px;
  align-items: start;
  padding: 20px 20px 14px;
  cursor: pointer;
  list-style: none;
}
.legal-card__head::-webkit-details-marker {
  display: none;
}
.legal-card__head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-m);
}
.legal-card__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}
.legal-card__icon .ic {
  width: 38px;
  height: 38px;
}
.legal-card__titles {
  display: grid;
  gap: 6px;
}
.legal-card__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--ink);
}
.legal-card__text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}
/* Шеврон: ⌄ → ⌃ */
.legal-card__chevron {
  width: 10px;
  height: 10px;
  margin: 8px auto 0;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.35s var(--ease-out);
}
.legal-card[open] .legal-card__chevron {
  transform: translateY(4px) rotate(-135deg);
}
.legal-card__list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 4px 20px 22px 86px;
}
.legal-card__list li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  font-size: 0.93rem;
  line-height: 1.45;
  color: var(--ink);
}
.legal-card__list svg {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--accent);
}
.legal-card[open] .legal-card__list {
  animation: step-in 0.45s var(--ease-out);
}

/* ==========================================================================
   TEAM — смуга карток, що розширюються
   ========================================================================== */

.team__strip {
  display: flex;
  gap: 12px;
  height: clamp(440px, 62vh, 600px);
}
.member {
  --rx: 0deg;
  --ry: 0deg;
  transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry));
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  border-radius: var(--radius-l);
  overflow: hidden;
  background: var(--bg-3);
  transition: flex-grow 0.8s var(--ease-out), transform 0.5s var(--ease-out);
  cursor: pointer;
}
.member.is-active {
  flex-grow: 2.6;
}
.js .team__strip .member {
  clip-path: inset(100% 0 0 0 round var(--radius-l));
}
.js .team__strip.is-visible .member {
  clip-path: inset(0 0 0 0 round var(--radius-l));
  transition: clip-path 1.1s var(--ease-out), flex-grow 0.8s var(--ease-out), transform 0.5s var(--ease-out);
}
.js .team__strip.is-visible .member:nth-child(2) { transition-delay: 0.1s, 0s, 0s; }
.js .team__strip.is-visible .member:nth-child(3) { transition-delay: 0.2s, 0s, 0s; }
.js .team__strip.is-visible .member:nth-child(4) { transition-delay: 0.3s, 0s, 0s; }
.member img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.85) contrast(1.05);
  transform: scale(1.06);
  transition: filter 0.8s, transform 1.2s var(--ease-out);
}
.member.is-active img {
  filter: none;
  transform: none;
}
.member::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(5, 15, 44, 0.92) 0%, rgba(5, 15, 44, 0.1) 55%);
}
.member__vertical {
  position: absolute;
  z-index: 2;
  left: 18px;
  bottom: 22px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: #fff;
  white-space: nowrap;
  transition: opacity 0.4s;
}
.member.is-active .member__vertical {
  opacity: 0;
}
.member__body {
  position: absolute;
  z-index: 2;
  left: 22px;
  right: 22px;
  bottom: 22px;
  color: #fff;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s, transform 0.6s var(--ease-out);
  min-width: 240px;
}
.member.is-active .member__body {
  opacity: 1;
  transform: none;
  transition-delay: 0.25s;
}
.member__body h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  line-height: 1.2;
}
.member__role {
  margin-top: 6px;
  color: var(--brand-yellow);
  font-size: 0.92rem;
}
.member__excerpt {
  margin-top: 12px;
  max-width: 46ch;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.78);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.member__open {
  margin-top: 14px;
  color: #fff;
  background-image: linear-gradient(var(--brand-yellow), var(--brand-yellow));
  font-size: 0.92rem;
}
.member__open:hover {
  color: var(--brand-yellow);
}

/* ==========================================================================
   JOIN — конструктор
   ========================================================================== */

.join-panel {
  margin-top: 0;
  padding: clamp(22px, 4vw, 52px);
  border-radius: var(--radius-l);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.progress-track {
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 34px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-yellow));
  transition: width 0.6s var(--ease-out);
}
.step {
  display: none;
}
.step.is-active {
  display: block;
  animation: step-in 0.6s var(--ease-out);
}
@keyframes step-in {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
}
.step-label {
  font-size: 0.88rem;
  color: var(--muted);
}
.step-title {
  margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.25rem, 2.4vw, 1.9rem);
  line-height: 1.2;
}
.option-list {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.option-list--2col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.option-card {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 20px 50px 20px 20px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  cursor: pointer;
  transition: border-color 0.3s, background-color 0.3s, transform 0.4s var(--ease-out);
}
.option-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}
.option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.option-card:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.option-card__title {
  font-weight: 600;
}
.option-card__text {
  font-size: 0.92rem;
  color: var(--muted);
}
.option-card__dot {
  position: absolute;
  top: 20px;
  right: 18px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.option-card.is-checked {
  border-color: var(--accent);
}
.option-card.is-checked .option-card__dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 4px var(--surface-strong);
}
.step-back {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.94rem;
}
.step-back:hover {
  color: var(--ink);
}
.result-box {
  margin-top: 22px;
  padding: 24px;
  border-radius: var(--radius-m);
  background: var(--bg-2);
  border-left: 3px solid var(--accent);
}
.result-box strong {
  color: var(--accent);
}
.result-impact {
  margin-top: 14px;
  font-weight: 600;
}
.result-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.cards-view__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px;
}
.cards-view__head h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
}
.scenario-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 24px;
  border-radius: var(--radius-m);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.scenario-card h4 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.1rem;
}
.scenario-card p {
  color: var(--muted);
  font-size: 0.94rem;
  margin-bottom: 8px;
}

/* ==========================================================================
   NEWS — секція на базі галереї лаб. 10 (стилі карток — lab10-gallery.css)
   ========================================================================== */
.round-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.4s var(--ease-out);
}
.round-btn svg {
  width: 20px;
  height: 20px;
}
.round-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: scale(1.06);
}
.gallery__note {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ==========================================================================
   JOIN — вкладки «Підібрати напрям» / «Порахувати свій час»
   ========================================================================== */
.join-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  max-width: 100%;
}
.join-tab {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  white-space: nowrap;
  transition: background-color 0.3s, color 0.3s;
}
.join-tab:hover {
  color: var(--ink);
}
.join-tab[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}
.calc-panel__title {
  margin-bottom: 20px;
  max-width: 60ch;
  font-size: 1.04rem;
  font-weight: 400;
  color: var(--muted);
}
.calc-panel:not([hidden]),
.join-panel:not([hidden]) {
  animation: step-in 0.5s var(--ease-out);
}

/* ==========================================================================
   CONTACT
   ========================================================================== */

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(40px, 6vw, 90px);
  align-items: start;
}
.contact__info {
  margin-top: 34px;
  display: grid;
  gap: 6px;
}
.contact__big {
  justify-self: start;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.1rem, 2.1vw, 1.7rem);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.5s var(--ease-out), color 0.3s;
  word-break: break-word;
}
.contact__big:hover {
  color: var(--accent);
  background-size: 100% 1px;
}
.contact__h {
  margin-top: 36px;
  font-size: 0.95rem;
  font-weight: 600;
}
.social-row {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}
.social-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  transition: background-color 0.3s, color 0.3s, transform 0.4s var(--ease-out), border-color 0.3s;
}
.social-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-4px) rotate(-8deg);
}
.social-row--sm .social-btn {
  width: 40px;
  height: 40px;
}
.legal-box {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
  display: grid;
  gap: 6px;
}
.legal-box h3 {
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 600;
}

.form {
  padding: clamp(22px, 3.4vw, 44px);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: grid;
  gap: 18px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.field {
  display: grid;
  gap: 8px;
}
.field label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
}
.field input,
.field select,
.field textarea,
.newsletter-form input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.field textarea {
  resize: vertical;
  min-height: 130px;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.newsletter-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field-error {
  display: none;
  font-size: 0.84rem;
  color: var(--danger);
}
.has-error .field-error {
  display: block;
}
.has-error input,
.has-error textarea {
  border-color: var(--danger);
}
.consent-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  font-size: 0.9rem;
  color: var(--muted);
}
.consent-row input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}
.consent-row.has-error label {
  color: var(--danger);
}
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-status {
  font-size: 0.92rem;
  min-height: 1.4em;
}
.form-status.success {
  color: var(--success);
}
.form-status.error {
  color: var(--danger);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
/* Контакти й футер — один суцільний блок: спільна «підкладка» із заокругленим верхом,
   біжучий рядок угорі, далі контакти з формою, логотип/підписка/розділи і копірайт */
.site-footer {
  position: relative;
  margin-top: clamp(24px, 3vw, 48px);
  padding-bottom: 30px;
  overflow: hidden;
  overflow: clip; /* clip, а не hidden: hidden ламає position: sticky форми всередині */
  border-radius: clamp(28px, 4vw, 56px) clamp(28px, 4vw, 56px) 0 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -30px 80px -60px rgba(7, 26, 69, 0.35);
}
.marquee {
  padding-block: clamp(24px, 3.4vw, 48px) clamp(12px, 2vw, 24px);
  overflow: hidden;
}
.site-footer .contact__grid {
  padding-block: clamp(24px, 3vw, 40px) clamp(40px, 5vw, 64px);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.marquee:hover .marquee__track {
  animation-play-state: paused;
}
.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: clamp(20px, 3vw, 46px);
  padding-right: clamp(20px, 3vw, 46px);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.4rem, 7.5vw, 7rem);
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.marquee__item:nth-child(even) {
  -webkit-text-stroke: 1px var(--ink);
  color: transparent;
}
.marquee__sep {
  width: clamp(28px, 4vw, 60px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--tree-blue) 0 50%, var(--tree-yellow) 50% 100%);
  flex: 0 0 auto;
  animation: spin 8s linear infinite;
}
@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.footer-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 40px;
  padding-block: clamp(28px, 3.5vw, 44px) 28px;
  border-top: 1px solid var(--line);
}
/* Розділи — двома колонками, щоб смуга була невисокою */
.footer-bar__links .footer-links {
  grid-template-columns: repeat(2, minmax(0, max-content));
  column-gap: 40px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.3;
}
.footer-brand small {
  display: block;
  font-family: var(--font-body);
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

.footer-h {
  margin-top: 32px;
  font-size: 0.95rem;
  font-weight: 600;
}
.footer-bar__links .footer-h {
  margin-top: 0;
}
.footer-p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}
.newsletter-form {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  max-width: 460px;
}
.newsletter-form input {
  min-height: 50px;
  border-radius: 999px;
  padding-inline: 20px;
}
.footer-links {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}
.footer-links a {
  color: var(--muted);
  transition: color 0.3s;
}
.footer-links a:hover {
  color: var(--accent);
}
/* Лаб. 12: на сенсорних екранах кожна зона дотику — не менше 48 × 48 px
   (рекомендація Google / Material; було 21–44 px, легко влучити в сусідній елемент).
   Для текстових кнопок зону збільшено полями, а підкреслення лишається під текстом. */
@media (pointer: coarse), (max-width: 860px) {
  .footer-links {
    gap: 0;
  }
  .footer-links a,
  .footer-bottom-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    min-width: 48px;
  }
  .theme-toggle,
  .nav-toggle,
  .social-row--sm .social-btn {
    width: 48px;
    height: 48px;
  }
  .brand,
  .skip-link {
    min-height: 48px;
  }
  .hero__dots {
    gap: 0;
  }
  .hero__dots button {
    width: 48px;
    height: 48px;
  }
  .dir__cta,
  .dir.is-active .dir__cta {
    align-items: center;
    min-height: 48px;
  }
  .btn-text,
  .contact__big {
    padding-block: 12px;
    background-origin: content-box;
    background-clip: content-box;
  }
  .consent-row label {
    min-height: 48px;
  }
  [data-volunteer-calc] input[type="range"] {
    height: 48px;
  }
  a.tw-min-h-\[44px\] {
    min-height: 48px;
  }
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-bottom-links {
  display: flex;
  gap: 20px;
}
.footer-bottom-links a:hover {
  color: var(--ink);
}

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.4s var(--ease-out);
}
.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* ---------------- Modal ---------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 9, 28, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0s 0.4s;
}
.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s;
}
.modal {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  width: min(980px, 100%);
  max-height: min(86vh, 760px);
  border-radius: var(--radius-l);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateY(40px) scale(0.96);
  transition: transform 0.6s var(--ease-out);
}
.modal-backdrop.is-open .modal {
  transform: none;
}
.modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.modal__content {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}
.modal__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 28px 16px;
  border-bottom: 1px solid var(--line);
}
.modal__head h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1.2;
}
.modal__head .role {
  margin-top: 6px;
  color: var(--accent);
  font-size: 0.94rem;
}
.modal__close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  transition: transform 0.4s var(--ease-out), background-color 0.3s;
}
.modal__close:hover {
  transform: rotate(90deg);
  background: var(--bg-2);
}
.modal__body {
  padding: 20px 28px 30px;
  overflow-y: auto;
  white-space: pre-line;
  color: var(--muted);
  font-size: 0.98rem;
}
body.modal-open {
  overflow: hidden;
}

/* ---------------- Reveal (лише кілька ключових блоків) ---------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: calc(var(--reveal-delay, 0) * 1ms);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------- Перемикання теми: коло-розкриття ---------------- */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-new(root) {
  z-index: 2;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .legal-grid {
    grid-template-columns: 1fr;
  }
  .legal-partner {
    position: relative;
    top: auto;
  }
  .main-nav {
    display: none;
  }
  .site-header {
    grid-template-columns: 1fr auto;
  }
  .nav-toggle {
    display: block;
  }
  .values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  :root {
    --header-h: 66px;
  }
  body {
    font-size: 16px;
  }
  .header-cta,
  .header-actions .lang-switch {
    display: none;
  }
  .brand__name {
    font-size: 0.62rem;
  }

  /* Hero на телефоні: фото займає верхню частину (так воно не збільшується
     в рази й лишається чітким), нижче — слоган на темно-синьому */
  .hero__frame {
    background: #071a45;
  }
  .hero__media {
    inset: 0 0 auto 0;
    height: 66%;
  }
  .hero__slide img {
    object-position: 50% 30%;
  }
  .hero__shade {
    background: linear-gradient(180deg, rgba(7, 26, 69, 0.55) 0%, rgba(7, 26, 69, 0) 24%, rgba(7, 26, 69, 0) 34%, #071a45 66%);
  }
  /* Hero: факти рядком угорі, слоган унизу */
  .hero__widgets {
    left: var(--gutter);
    right: var(--gutter);
    width: auto;
    top: calc(var(--header-h) + 10px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .widget {
    padding: 10px 12px;
  }
  .js:not(.is-loaded) .widget {
    transform: translateY(-20px);
  }
  .widget__value {
    font-size: 1.25rem;
  }
  .widget__label {
    font-size: 0.72rem;
    line-height: 1.3;
  }
  .widget__bar {
    display: none;
  }
  .hero__content {
    bottom: 70px;
  }
  .hero__dots {
    bottom: 18px;
    left: var(--gutter);
    right: auto;
  }
  .hero__hint {
    display: none;
  }

  .values li {
    padding: 16px;
  }
  .values .ic {
    width: 38px;
    height: 38px;
    margin-bottom: 10px;
  }
  .values h3 {
    font-size: 0.95rem;
  }
  .values p {
    font-size: 0.84rem;
  }
  .structure__flow {
    grid-template-columns: 1fr;
    gap: 14px;
    flex-basis: 100%;
  }
  .structure__flow li::after {
    display: none;
  }

  .head-split {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Правова допомога: картка партнера зверху, послуги — акордеоном */
  .legal-grid,
  .legal-services {
    grid-template-columns: 1fr;
  }
  .legal-partner {
    position: relative;
    top: auto;
  }
  .legal-card__head {
    grid-template-columns: 44px minmax(0, 1fr) 20px;
    gap: 12px;
    padding: 16px 16px 12px;
  }
  .legal-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }
  .legal-card__icon .ic {
    width: 32px;
    height: 32px;
  }
  .legal-card__list {
    padding: 2px 16px 18px 16px;
  }

  /* Напрями на телефоні: компактні рядки «іконка — назва й опис — стрілка»
     (раніше кожен рядок мав мініатюру й текстову кнопку «Долучитися до напряму» — 8 повторів) */
  .dir-wrap {
    grid-template-columns: 1fr;
  }
  .dir-stage {
    display: none;
  }
  .dir {
    grid-template-columns: 48px minmax(0, 1fr) 44px;
    gap: 14px;
    padding: 16px 2px;
    align-items: start;
  }
  .dir::before {
    display: none;
  }
  .dir__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }
  .dir__icon .ic {
    width: 34px;
    height: 34px;
  }
  .dir__title {
    font-size: 1rem;
  }
  .dir.is-active .dir__title {
    transform: none;
    color: inherit;
  }
  .dir__text {
    font-size: 0.88rem;
    -webkit-line-clamp: 3;
  }
  .dir__thumb {
    display: none;
  }
  .dir__cta,
  .dir.is-active .dir__cta {
    width: 44px;
    height: 44px;
    background: none;
    color: var(--accent);
    border-color: var(--line-strong);
  }
  .dir.is-active .dir__cta svg {
    transform: none;
  }

  /* Команда: горизонтальна прокрутка, всі картки розгорнуті */
  .team__strip {
    height: auto;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .team__strip::-webkit-scrollbar {
    display: none;
  }
  .member,
  .member.is-active {
    flex: 0 0 80vw;
    height: 480px;
    scroll-snap-align: center;
  }
  .member img {
    filter: none;
    transform: none;
  }
  .member__vertical {
    display: none;
  }
  .member__body {
    opacity: 1;
    transform: none;
    min-width: 0;
  }

  .option-list,
  .option-list--2col,
  .form-row,
  .contact__grid,
  .footer-bar {
    grid-template-columns: 1fr;
  }

  .join-tabs {
    display: flex;
  }
  .join-tab {
    flex: 1 1 0;
    padding: 0 10px;
    font-size: 0.86rem;
    white-space: normal;
    line-height: 1.2;
  }

  .modal {
    grid-template-columns: 1fr;
    grid-template-rows: 200px 1fr;
  }
  .modal__media img {
    object-position: 50% 25%;
  }
  .newsletter-form {
    flex-direction: column;
  }
}

@media (max-width: 860px) and (max-height: 640px) {
  .hero__subtitle {
    display: none;
  }
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js .preloader {
    display: none;
  }
  .marquee__track {
    animation: none;
  }
}

.reduced-motion .hero {
  height: 100vh;
  height: 100svh;
}
.dir__cta-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Десктоп: опис напряму показується лише в картці праворуч — список лишається чистим */
@media (min-width: 861px) {
  .dir .dir__text {
    display: none;
  }
  .dir {
    padding-block: 12px;
  }
}

/* Атрибут hidden має перемагати display компонентів (напр. .btn-text — inline-flex) */
.join__skip[hidden] {
  display: none;
}

/* Форма всередині футера — на білій картці, щоб виділялась на спільній підкладці */
.site-footer .form {
  background: var(--surface-strong);
}

@media (min-width: 861px) {
  /* Колонка тягнеться на всю висоту рядка, а форма в ній «їде» разом з екраном */
  .contact__side {
    align-self: stretch;
  }
  .contact__side .form {
    position: sticky;
    top: calc(var(--header-h) + 20px);
  }
}
