/* =========================================================================
   Reveal on scroll
   ========================================================================= */

/* Приховуємо тільки якщо JS увімкнений — інакше контент лишається видимим. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

.js [data-reveal="left"]  { transform: translateX(-30px); }
.js [data-reveal="right"] { transform: translateX(30px); }
.js [data-reveal="scale"] { transform: scale(.94); }
.js [data-reveal="blur"]  { filter: blur(14px); transform: none; transition: opacity .9s var(--ease-out), filter .9s var(--ease-out); }
.js [data-reveal="blur"].is-in { filter: blur(0); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* Послідовна поява дітей */
.js [data-stagger] > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.js [data-stagger].is-in > * { opacity: 1; transform: none; }

/* Заголовок, що «наводиться на різкість» — метафора клініки */
.js .focus-in {
  filter: blur(10px);
  opacity: .25;
  letter-spacing: .04em;
  transition: filter 1.1s var(--ease-out), opacity 1.1s var(--ease-out), letter-spacing 1.1s var(--ease-out);
}
.js .focus-in.is-in { filter: blur(0); opacity: 1; letter-spacing: -.02em; }

/* Порядкова поява слів заголовка */
.reveal-words span { display: inline-block; overflow: hidden; vertical-align: bottom; }
.reveal-words i { display: inline-block; font-style: inherit; transition: transform .9s var(--ease-out); transition-delay: calc(var(--i, 0) * 65ms); }
.js .reveal-words i {
  transform: translateY(105%);
  transition: transform .9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 65ms);
}
.js .reveal-words.is-in i { transform: none; }

/* =========================================================================
   Секційні прикраси
   ========================================================================= */

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
.glow--brand { background: radial-gradient(circle, rgba(246,196,187,.45), transparent 68%); }
.glow--jade  { background: radial-gradient(circle, rgba(178,223,214,.42), transparent 68%); }
.glow--amber { background: radial-gradient(circle, rgba(250,235,209,.55), transparent 68%); }

.rel { position: relative; z-index: 1; }

/* Хвиляста роздільна лінія */
.wave { display: block; width: 100%; height: clamp(40px, 5vw, 92px); }
.wave path { fill: currentColor; }

/* =========================================================================
   CTA-смуга
   ========================================================================= */

.cta {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: linear-gradient(128deg, var(--brand-700), var(--brand-600) 45%, var(--brand-800));
  color: var(--text-invert);
  padding: clamp(40px, 5vw, 80px) clamp(28px, 4vw, 72px);
  isolation: isolate;
}
.cta::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 90% at 12% 8%, rgba(255,255,255,.2), transparent 60%),
    radial-gradient(50% 80% at 92% 100%, rgba(255,230,174,.28), transparent 62%);
}
.cta::after {
  content: "";
  position: absolute; right: -110px; top: -110px; width: 460px; height: 460px; z-index: -1;
  border: 1.5px solid rgba(255,255,255,.16);
  border-radius: 50%;
  box-shadow: inset 0 0 0 60px rgba(255,255,255,.05);
}
.cta__inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(28px, 4vw, 64px); align-items: center; }
@media (max-width: 900px) { .cta__inner { grid-template-columns: minmax(0, 1fr); } }
.cta__title { font-family: var(--font-display); font-size: var(--fs-52); line-height: 1.1; font-weight: 500; letter-spacing: -.018em; }
.cta__text { margin-top: var(--s-20); font-size: var(--fs-20); line-height: 1.6; color: rgba(255,248,245,.86); max-width: 58ch; }
.cta__actions { display: flex; flex-wrap: wrap; gap: var(--s-16); }
.cta .eyebrow { color: rgba(255,248,245,.8); }

.cta--jade { background: linear-gradient(128deg, var(--jade-700), var(--jade-600) 48%, var(--jade-900)); }
.cta--ink  { background: linear-gradient(128deg, #2A1E1B, var(--ink-900) 55%, #120C0B); }

/* =========================================================================
   Page hero (внутрішні сторінки)
   ========================================================================= */

.page-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(48px, 5vw, 88px) clamp(40px, 4.5vw, 72px);
  background: color-mix(in srgb, var(--cream) 60%, white 40%);
  border-bottom: 1px solid var(--line);
}
.page-hero--wash { background: color-mix(in srgb, var(--brand-050) 60%, white 40%); }
.page-hero--jade { background: color-mix(in srgb, var(--jade-050) 60%, white 40%); }
.page-hero__inner { position: relative; z-index: 1; display: grid; gap: var(--s-24); max-width: 900px; }
.page-hero__title { font-family: var(--font-display); font-size: var(--fs-68); line-height: 1.06; font-weight: 500; letter-spacing: -.022em; }
.page-hero--split .page-hero__inner { max-width: none; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 4vw, 72px); align-items: center; }
@media (max-width: 900px) { .page-hero--split .page-hero__inner { grid-template-columns: minmax(0, 1fr); } }

.crumbs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: var(--fs-14); color: var(--text-muted); line-height: 1.4; }
.crumbs a { transition: color var(--dur) var(--ease-out); }
.crumbs a:hover { color: var(--brand-700); }
.crumbs svg { width: 9px; height: 9px; color: var(--ink-300); flex: none; }
.crumbs span[aria-current] { color: var(--ink-800); font-weight: 600; }

/* =========================================================================
   Sticky sub-nav (сторінки послуг)
   ========================================================================= */

.subnav {
  position: sticky;
  top: var(--header-h);
  z-index: 60;
  background: rgba(255,253,252,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.subnav__inner { display: flex; align-items: center; gap: var(--s-8); overflow-x: auto; scrollbar-width: none; min-height: 66px; }
.subnav__inner::-webkit-scrollbar { display: none; }
.subnav__link {
  padding: 11px 17px;
  border-radius: var(--r-pill);
  font-size: var(--fs-16);
  font-weight: 600;
  color: var(--ink-600);
  white-space: nowrap;
  line-height: 1.35;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.subnav__link:hover { background: color-mix(in srgb, var(--ink-050) 60%, white 40%); color: var(--ink-900); }
.subnav__link.is-active { background: var(--brand-600); color: #fff; }

/* Прогрес читання */
.readbar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
  background: transparent; pointer-events: none;
}
.readbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-500), var(--amber-500)); transition: width .1s linear; }

/* =========================================================================
   Ecosystem — інтерактивна схема
   ========================================================================= */

.eco { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 4vw, 72px); align-items: center; }
@media (max-width: 900px) { .eco { grid-template-columns: minmax(0, 1fr); } }
.eco__stage { position: relative; aspect-ratio: 1; max-width: 520px; margin-inline: auto; width: 100%; }
.eco__core {
  position: absolute; inset: 32%;
  display: grid; place-items: center; text-align: center;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--brand-600), var(--brand-800));
  color: #fff;
  box-shadow: var(--shadow-brand);
  font-family: var(--font-display);
  font-size: var(--fs-22);
  line-height: 1.2;
  padding: var(--s-16);
}
.eco__ring { position: absolute; inset: 0; border: 1.5px dashed var(--line-brand); border-radius: 50%; animation: spin 90s linear infinite; }
.eco__ring--2 { inset: 14%; border-style: solid; border-color: var(--line); animation-duration: 130s; animation-direction: reverse; }
.eco__node {
  position: absolute;
  width: 96px; height: 96px;
  margin: -48px 0 0 -48px;
  display: grid; place-items: center; gap: 4px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: center;
  padding: 8px;
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.eco__node svg { width: 26px; height: 26px; color: var(--brand-600); transition: color var(--dur) var(--ease-out); }
.eco__node span { font-size: var(--fs-14); font-weight: 600; line-height: 1.15; color: var(--ink-700); }
.eco__node:hover, .eco__node.is-active { transform: scale(1.1); border-color: var(--brand-600); box-shadow: var(--shadow-md); background: color-mix(in srgb, var(--brand-050) 60%, white 40%); }
.eco__node.is-active svg { color: var(--brand-700); }
.eco__panel { min-height: 180px; }
.eco__panel-title { font-family: var(--font-display); font-size: var(--fs-32); line-height: 1.2; font-weight: 500; margin-bottom: var(--s-16); letter-spacing: -.012em; }
@media (max-width: 620px) {
  .eco__node { width: 78px; height: 78px; margin: -39px 0 0 -39px; }
  .eco__node svg { width: 20px; height: 20px; }
}

/* =========================================================================
   Спліт «текст + медіа»
   ========================================================================= */

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 5vw, 88px); align-items: center; }
.split--wide-media { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.split--rev > :first-child { order: 2; }
@media (max-width: 900px) { .split, .split--wide-media { grid-template-columns: minmax(0, 1fr); } .split--rev > :first-child { order: 0; } }

.media-frame { position: relative; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); background: color-mix(in srgb, var(--sand) 60%, white 40%); }
.media-frame img { width: 100%; height: 100%; object-fit: cover; }
.media-frame--tall { aspect-ratio: 4/5; }
.media-frame--wide { aspect-ratio: 16/10; }
.media-frame--arch { border-radius: 240px 240px var(--r-lg) var(--r-lg); }

.media-stack { position: relative; }
.media-stack__back {
  position: absolute; right: -18px; bottom: -18px; width: 62%;
  border-radius: var(--r-md); overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 6px solid var(--paper);
}
@media (max-width: 620px) { .media-stack__back { display: none; } }

/* =========================================================================
   Contacts
   ========================================================================= */

.contact-tile {
  display: grid; gap: var(--s-12);
  padding: var(--s-32);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #ffffff;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.contact-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand-200); }
.contact-tile__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 17px; background: color-mix(in srgb, var(--brand-050) 60%, white 40%); color: var(--brand-600); }
.contact-tile__icon svg { width: 25px; height: 25px; }
.contact-tile__label { font-size: var(--fs-14); letter-spacing: var(--tracking-wide); text-transform: none; color: var(--text-soft); font-weight: 700; line-height: 1.4; }
.contact-tile__value { font-size: var(--fs-20); font-weight: 600; color: var(--ink-900); line-height: 1.4; }
.contact-tile__note { font-size: var(--fs-15); color: var(--text-muted); line-height: 1.5; }

.map-frame { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-md); background: color-mix(in srgb, var(--sand) 60%, white 40%); }
.map-frame iframe { display: block; width: 100%; height: clamp(320px, 42vw, 520px); border: 0; }

/* =========================================================================
   Pagination
   ========================================================================= */

.pager { display: flex; align-items: center; justify-content: center; gap: var(--s-8); flex-wrap: wrap; margin-top: clamp(40px, 4vw, 64px); }
.pager a, .pager span {
  display: grid; place-items: center;
  min-width: 50px; height: 50px; padding-inline: 15px;
  border: 1.5px solid var(--line); border-radius: var(--r-pill);
  font-size: var(--fs-16); font-weight: 600; line-height: 1;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.pager a:hover { border-color: var(--brand-500); color: var(--brand-700); background: color-mix(in srgb, var(--brand-050) 60%, white 40%); }
.pager .is-current { background: var(--ink-900); color: var(--text-invert); border-color: var(--ink-900); }
.pager .is-disabled { opacity: .38; }
.pager svg { width: 13px; height: 13px; }

/* =========================================================================
   Плаваюча кнопка запису (моб.)
   ========================================================================= */

.fab {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 80;
  display: none;
  box-shadow: var(--shadow-brand);
}
@media (max-width: 720px) { .fab { display: inline-flex; } }

/* =========================================================================
   Друк і зменшена анімація
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js [data-reveal], .js [data-stagger] > * { opacity: 1 !important; transform: none !important; filter: none !important; }
  .js .focus-in { filter: none; opacity: 1; letter-spacing: -.02em; }
  .js .reveal-words i { transform: none; }
}

@media print {
  .header, .footer, .fab, .subnav, .drawer, .cta { display: none !important; }
  body { background: #ffffff; }
  .section { padding-block: 24px; }
}
