/* ═══════════════════════════════════════════════════════════════
   OLEKSANDRA STYLE — спільна дизайн-система, концепція «Червона деталь»
   Нейтральна база (льон, камінь, чорнило) + одна червона деталь
   на екран — як сумка на фото Олександри.
   Токени, типографіка, кнопки, меню, футер — для всіх сторінок.
   Головна додає css/home.css, внутрішні сторінки — css/pages.css,
   тест «ДНК Стилю» — css/dna-test.css.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Токени ─────────────────────────────────────────────────── */
:root {
  --linen: #F2EEE7;
  --linen-hi: #F8F5F0;
  --stone-100: #E7E2D9;
  --stone-300: #CFC7BA;
  --stone-500: #8E8A83;
  --ink-soft: #5B564F;
  --ink: #1A1816;
  --night: #12100E;
  --night-2: #1D1A17;
  /* Бордо з попереднього сайту — фон темних глав (запис, футер, «Стиль під ключ»).
     Фільм лишається чорним: саме відео знято на чорному тлі. */
  --wine: #5E1126;
  --wine-deep: #4A0D1E;
  --on-night: #F2EEE7;
  --on-night-soft: rgba(242, 238, 231, 0.68);
  --rouge: #9E1B22;
  --rouge-hi: #B4232B;
  --gold: #C9A86A;

  --hair: rgba(26, 24, 22, 0.14);
  --hair-strong: rgba(26, 24, 22, 0.3);
  --hair-night: rgba(242, 238, 231, 0.16);

  /* Noto Serif Display — висококонтрастна антиква з кирилицею
     (Fraunces, що стояв раніше, кирилиці не має). */
  --serif: 'Noto Serif Display', 'Times New Roman', serif;
  --sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --gutter: clamp(20px, 4vw, 56px);
  --max: 1400px;
  --nav-h: 64px;
  --section: clamp(5.5rem, 11vw, 10rem);
}
@media (min-width: 1024px) {
  :root { --nav-h: 78px; }
}

/* ─── База ───────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Прибираємо системну синю підсвітку при тапі на мобільних —
     стан натискання показують власні ефекти елементів */
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
  background: var(--linen);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }
em { font-style: italic; }

::selection { background: var(--rouge); color: var(--linen); }

:focus-visible {
  outline: 1px solid var(--rouge);
  outline-offset: 4px;
}

.booking :focus-visible,
.footer :focus-visible { outline-color: var(--gold); }

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

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

.section {
  position: relative;
  padding-block: var(--section);
}

/* Зернистість поверх сторінки — відчуття паперу чи тканини */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1500;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ─── Типографіка ────────────────────────────────────────────── */
.h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.5rem, 5.6vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.h2 em { font-weight: 300; }

/* Рубрика з журнальною нумерацією: «01 — Про мене» */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: clamp(1.4rem, 2.5vw, 2rem);
}
.eyebrow__num {
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.eyebrow__num::after {
  content: '';
  display: inline-block;
  width: 2.2rem;
  height: 1px;
  margin-left: 0.9rem;
  vertical-align: middle;
  background: currentColor;
  opacity: 0.6;
}
.eyebrow--night { color: var(--on-night); }
.eyebrow--night .eyebrow__num { color: var(--gold); }

/* ─── Кнопки та посилання ────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1.15rem 1.9rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 0;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.5s var(--ease), background-color 0.5s var(--ease);
}
.btn svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  transition: transform 0.6s var(--ease);
}
.btn:hover svg { transform: translateX(4px); }
/* На вузьких екранах довгі написи («Безкоштовна ознайомча консультація»)
   переносяться, а не розпирають колонку ширше за екран */
@media (max-width: 559px) {
  .btn { white-space: normal; text-align: center; }
}

/* Кнопка запису — бордо, як блок «Послуги». Наведення — рівна зміна кольору всієї кнопки */
.btn--rouge {
  background: var(--wine);
  color: var(--linen);
}
.btn--rouge:hover { background: var(--ink); }

.btn--light {
  background: var(--linen);
  color: var(--wine);
}
.btn--light:hover { background: var(--gold); }

.btn--ink {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.btn--ink:hover { background: var(--ink); color: var(--linen); }

/* Текстове посилання з лінією, що перемальовується при наведенні */
.link-line {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding-block: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}
.link-line::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform-origin: right;
  transition: transform 0.6s var(--ease);
}
.link-line:hover::after {
  animation: line-redraw 0.9s var(--ease);
}
.link-line svg { width: 16px; height: 16px; transition: transform 0.6s var(--ease); }
.link-line:hover svg { transform: translateY(3px); }
@keyframes line-redraw {
  0%   { transform: scaleX(1); transform-origin: right; }
  45%  { transform: scaleX(0); transform-origin: right; }
  46%  { transform: scaleX(0); transform-origin: left; }
  100% { transform: scaleX(1); transform-origin: left; }
}

/* ═══════════════════════════════════════════════════════════════
   НАВІГАЦІЯ
   ═══════════════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--nav-h);
  color: var(--ink);
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease),
              box-shadow 0.5s var(--ease), transform 0.5s var(--ease);
}
.nav.is-scrolled {
  background: rgba(242, 238, 231, 0.88);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 1px 0 var(--hair);
}
/* Над темними главами (фільм, запис, футер) меню темніє разом зі сторінкою */
.nav.is-night { color: var(--on-night); }
.nav.is-night.is-scrolled {
  background: rgba(18, 16, 14, 0.82);
  box-shadow: 0 1px 0 var(--hair-night);
}
.nav.is-night[data-tone="wine"].is-scrolled { background: rgba(94, 17, 38, 0.88); }
.nav.is-night .nav__cta:hover { background: var(--linen); color: var(--wine); box-shadow: inset 0 0 0 1px var(--linen); }
.nav.is-night .nav__cta:hover::before { background: var(--wine); }
.nav.is-hidden { transform: translateY(-100%); }

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-inline: var(--gutter);
}

.nav__links { display: none; }
.nav__links a {
  position: relative;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding-block: 0.3rem;
}
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav__logo {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.12rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  /* розрядка додає хвіст праворуч — компенсуємо, щоб знак стояв по центру */
  margin-right: -0.34em;
  white-space: nowrap;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__cta {
  display: none;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.75rem 1.2rem;
  box-shadow: inset 0 0 0 1px currentColor;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.nav__cta::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--rouge);
}
.nav__cta:hover {
  background: var(--wine);
  color: var(--linen);
  box-shadow: inset 0 0 0 1px var(--wine);
}
.nav__cta:hover::before { background: var(--linen); }

/* Бургер — дві тонкі лінії, що складаються в хрестик */
.nav__burger {
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px;
}
.nav__burger span {
  position: absolute;
  left: 10px;
  width: 24px;
  height: 1px;
  background: currentColor;
  transition: transform 0.5s var(--ease), opacity 0.3s var(--ease), top 0.5s var(--ease);
}
.nav__burger span:nth-child(1) { top: 18px; }
.nav__burger span:nth-child(2) { display: none; }
.nav__burger span:nth-child(3) { top: 25px; }
.nav__burger.is-active span:nth-child(1) { top: 21.5px; transform: rotate(45deg); }
.nav__burger.is-active span:nth-child(3) { top: 21.5px; transform: rotate(-45deg); }

@media (min-width: 1024px) {
  .nav__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }
  .nav__links { display: flex; gap: 2.2rem; }
  .nav__right { justify-self: end; }
  .nav__cta { display: inline-flex; }
  .nav__burger { display: none; }
  .nav__logo { font-size: 1.2rem; }
}

/* Мобільне меню */
.nav__mobile {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: calc(var(--nav-h) + 2rem) var(--gutter) 2rem;
  background: var(--linen);
  counter-reset: menu;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
  overflow-y: auto;
}
.nav__mobile.is-open { opacity: 1; visibility: visible; }
.nav__mobile a {
  counter-increment: menu;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--hair);
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.9rem, 8.5vw, 2.6rem);
  line-height: 1.1;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease);
}
.nav__mobile a::before {
  content: '0' counter(menu);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  min-width: 1.8rem;
}
.nav__mobile.is-open a { opacity: 1; transform: none; }
.nav__mobile.is-open a:nth-child(2) { transition-delay: 0.05s; }
.nav__mobile.is-open a:nth-child(3) { transition-delay: 0.1s; }
.nav__mobile.is-open a:nth-child(4) { transition-delay: 0.15s; }
.nav__mobile.is-open a:nth-child(5) { transition-delay: 0.2s; }
.nav__mobile.is-open a:nth-child(6) { transition-delay: 0.25s; }
.nav__mobile a:last-child {
  margin-top: auto;
  justify-content: center;
  padding: 1.15rem 1.5rem;
  border: 0;
  background: var(--wine);
  color: var(--linen);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.nav__mobile a:last-child::before { content: none; }
@media (max-height: 620px) {
  .nav__mobile a { padding: 0.55rem 0; font-size: 1.6rem; }
  .nav__mobile a:last-child { margin-top: 1.2rem; }
}

/* ═══════════════════════════════════════════════════════════════
   ПОЯВА ПРИ ПРОКРУТЦІ (класи ставить js/main.js)
   ═══════════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1.2s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.40s; }

/* Фото відкривається шторкою, а не просто з'являється */
.reveal-frame { position: relative; overflow: hidden; }
.reveal-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--frame-cover, var(--linen));
  transform-origin: top;
  transition: transform 1.3s var(--ease-io);
  pointer-events: none;
}
.is-photo-visible .reveal-frame::after,
.reveal-frame.is-visible::after { transform: scaleY(0); }
.reveal-frame img {
  transform: scale(1.12);
  transition: transform 2.2s var(--ease);
}
.is-photo-visible .reveal-frame img,
.reveal-frame.is-visible img { transform: scale(1); }

/* ═══════════════════════════════════════════════════════════════
   ФУТЕР — фінальний акорд
   ═══════════════════════════════════════════════════════════════ */
.footer {
  background: var(--wine);
  color: var(--on-night);
  padding-top: clamp(4rem, 8vw, 6.5rem);
  overflow: hidden;
}
.footer__top {
  display: grid;
  gap: 3rem;
  padding-bottom: clamp(3rem, 6vw, 4.5rem);
}
.footer__tagline {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  line-height: 1.25;
  max-width: 22ch;
  margin-bottom: 1.8rem;
}
.footer__tagline em { color: var(--gold); }
.footer h5 {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.2rem;
}
.footer__nav ul { display: grid; gap: 0.65rem; }
.footer__nav a,
.footer__contact-item {
  font-size: 0.95rem;
  color: var(--on-night-soft);
  transition: color 0.3s var(--ease);
}
.footer__nav a:hover,
a.footer__contact-item:hover { color: var(--on-night); }
.footer__contact-list {
  display: grid;
  gap: 0.75rem;
  font-style: normal;
}
.footer__contact-item {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.footer__contact-item svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--gold); }
.footer__socials { display: flex; gap: 0.6rem; margin-top: 1.6rem; }
.footer__social-link {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px var(--hair-night);
  transition: background-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.footer__social-link svg { width: 18px; height: 18px; }
.footer__social-link:hover { background: var(--linen); color: var(--wine); box-shadow: inset 0 0 0 1px var(--linen); }

/* Гігантський словесний знак на всю ширину. SVG з textLength
   гарантує точну посадку по ширині незалежно від метрик шрифту. */
.footer__mark {
  display: block;
  width: 100%;
  margin-bottom: -0.4vw;
  /* Приглушений льон (~78%) — щоб великий напис не сліпив на бордо */
  color: rgba(242, 238, 231, 0.78);
}
.footer__mark text {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: -0.02em;
}
/* Червона точка на бордо не видна — на темній главі деталь стає золотою */
.footer__mark .footer__dot { fill: var(--gold); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem 2rem;
  padding: 1.6rem 0 2rem;
  border-top: 1px solid var(--hair-night);
  font-size: 0.8rem;
  color: var(--on-night-soft);
}
.footer__bottom strong { font-weight: 500; color: var(--on-night); }
.footer__legal { display: flex; gap: 1.6rem; }
.footer__legal a:hover { color: var(--on-night); }

@media (min-width: 768px) {
  .footer__top { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1fr); }
}

/* ─── Службове: завіса відновлення прокрутки та прогрес ───────── */
.restore-curtain {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: var(--linen);
}
.restore-curtain[hidden] { display: none; }
.restore-curtain.is-done {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
/* Поки завіса опущена, сцену завантаження не граємо — інакше вона пройде за завісою */
.is-restoring .hero * { animation: none !important; }

.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  z-index: 2000;
  height: 2px;
  width: 0;
  background: var(--rouge);
  pointer-events: none;
}

/* ─── Зменшений рух ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .reveal-frame::after { display: none; }
  .reveal-frame img { transform: none; }
}
