/* ============================================================
   SEDONA BODYWORK — DESIGN SYSTEM v2.2 · "Deep Strata"
   Сайт как разрез красной скалы: секции — пласты, услуги — керны,
   на дне разреза — ночь Dark Sky City и бронирование.
   v1.3 — после жюри Awwwards: жесты масштаба, сумерки, живой рельс.
   Роли цветов жёстко закреплены (см. docs/design/design-system.md).
   ============================================================ */

/* ---------- Fonts (self-hosted, variable) ---------- */
@font-face {
  font-family: 'Hepta Slab';
  src: url('/assets/design/fonts/hepta.woff2') format('woff2-variations');
  font-weight: 1 900;
  font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('/assets/design/fonts/literata.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('/assets/design/fonts/literata-italic.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Azeret Mono';
  src: url('/assets/design/fonts/azeret.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}
/* Метрические фолбэки: гасим прыжок строк при swap */
@font-face {
  font-family: 'Literata-fb';
  src: local('Georgia');
  size-adjust: 104%; ascent-override: 92%; descent-override: 25%; line-gap-override: 0%;
}
@font-face {
  font-family: 'Hepta-fb';
  src: local('Rockwell'), local('Georgia');
  size-adjust: 97%; ascent-override: 95%; descent-override: 24%; line-gap-override: 0%;
}
@font-face {
  font-family: 'Azeret-fb';
  src: local('Courier New');
  size-adjust: 96%; ascent-override: 90%; descent-override: 22%; line-gap-override: 0%;
}

/* ---------- Tokens ---------- */
:root {
  /* Палитра «Deep Strata» */
  --cream:   #F6EFE6;  /* фон страницы; текст на CTA и ночном пласте */
  --sand:    #EFE3D2;  /* поверхности: керны, цитаты, чередование секций */
  --varnish: #2B211B;  /* основной текст (AAA); линия бурения */
  --shale:   #6B5A4C;  /* вторичный текст, границы инпутов (AA) */
  --schnebly:#9C3F21;  /* акцент: ссылки, цены, активные линии, focus-ring */
  --oxide:   #7E2D14;  /* заливка ТОЛЬКО у CTA */
  --oxide-hover: #66230F;
  --oxide-active: #581E0D;
  --sage:    #53644B;  /* теги, чек-листы, success */
  --line:    #DCCBB5;  /* декоративные линии напластования (не текст, не UI) */
  --midnight:#241C16;  /* единственный тёмный пласт: Sound Bath, футер */
  --brass:   #D98E32;  /* ссылки/акценты ТОЛЬКО на midnight */
  --night-surface: #2F2620;
  --night-border:  #4A3C30;
  --dusk-umber: #3E2A20;   /* слой сумеречного скола */

  /* Типографика */
  --font-display: 'Hepta Slab', 'Hepta-fb', 'Rockwell', serif;
  --font-body: 'Literata', 'Literata-fb', Georgia, serif;
  --font-mono: 'Azeret Mono', 'Azeret-fb', 'Courier New', monospace;
  --text-base: 1rem;
  --lh-body: 1.65;
  --measure: 66ch;
  --measure-intro: 52ch;

  /* Кегли */
  --h1: clamp(2.6rem, 6.5vw, 4.75rem);
  --h1-hero: clamp(2.6rem, 7vw, 6rem);  /* только hero главной */
  --h3-card: 1.35rem;                   /* заголовки карточек-кернов */
  --h2: clamp(2rem, 4vw, 3.25rem);
  --h3: clamp(1.5rem, 2vw, 1.75rem);
  --h4: 1.25rem;
  --lead: 1.26rem;
  --small: 0.875rem;

  /* Mono-шкала (единый регистр описи) */
  --mono-xs: 0.68rem;   /* brand-sub, rail-label, tag */
  --mono-s:  0.75rem;   /* ярлыки, ephemeris, цены, footer-strip */
  --mono-m:  0.85rem;   /* footer-nap, bar-call */
  --mono-l:  0.95rem;   /* header-tel */
  --label: var(--mono-s);

  /* Пространство (модуль 8) */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem;  --s-6: 2rem;   --s-7: 3rem;    --s-8: 4rem;
  --s-9: 6rem;    --s-10: 8rem;

  --container: 74rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  /* Форма: «каменный срез», не пилюля */
  --radius: 2px;

  /* Единый низкий угол света — направленные тени */
  --shadow-rest:  4px 2px 10px rgba(43, 33, 27, 0.08);
  --shadow-lift:  9px 4px 22px rgba(43, 33, 27, 0.14);

  /* Моушен */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --t-fast: 200ms;
  --t-med: 550ms;
  --t-header: 250ms;
  --t-bar: 300ms;
  --t-gong: 800ms;

  /* Хедер */
  --header-h: 84px;
  --header-h-condensed: 64px;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: 18px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h-condensed) + var(--s-4));
  -webkit-text-size-adjust: 100%;
}
/* scroll-padding-top на html покрывает якоря; дублирующий [id] scroll-margin складывался с ним (166px посадки) */
@media (min-width: 64rem) { html { font-size: 19px; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 150ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 150ms !important;
  }
}
/* Точечные reduce-гарды («только opacity») — в конце файла, чтобы каскад их не съел */

body {
  margin: 0;
  font-family: var(--font-body);
  font-optical-sizing: auto;
  font-size: var(--text-base);
  line-height: var(--lh-body);
  color: var(--varnish);
  background: var(--cream);
  position: relative;
}
/* Минеральное зерно (без blend: дёшево для композитинга) */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 2147483000;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0 0 var(--s-4);
  color: var(--varnish);
  text-wrap: balance;
}
h1 { font-size: var(--h1); font-weight: 750; line-height: 1.05; letter-spacing: -0.01em; max-width: 16ch; }
h2 { font-size: var(--h2); font-weight: 650; line-height: 1.12; letter-spacing: -0.008em; }
h3 { font-size: var(--h3); font-weight: 600; line-height: 1.2; letter-spacing: -0.004em; }
h4 { font-size: var(--h4); font-weight: 600; line-height: 1.3; }

p { margin: 0 0 var(--s-4); max-width: var(--measure); text-wrap: pretty; }
.lead { font-size: var(--lead); font-weight: 500; line-height: 1.55; max-width: var(--measure-intro); }
.intro { max-width: var(--measure-intro); }
small, .small { font-size: var(--small); line-height: 1.5; }
.muted { color: var(--shale); }
.nowrap { white-space: nowrap; }

/* Вертикальный ритм секций (вместо инлайновых margin-top) */
.stratum h3:not(:first-child) { margin-top: var(--s-8); }
.stratum h3 + .specimen-grid,
.stratum h3 + form,
.stratum h3 + .cluster,
.stratum h3 + .testimonial { margin-top: var(--s-5); }

/* Mono-ярлык описи */
.label {
  font-family: var(--font-mono);
  font-weight: 480;
  font-size: var(--label);
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--shale);
}
.label--framed {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-1) var(--s-2);
}

/* Ссылки: «осадок» нарастает по ходу движения, уходит в ту же сторону */
a { color: var(--schnebly); text-decoration: none; }
.prose a, .link {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 100% 100%;
  background-size: 0 1px;
  transition: background-size var(--t-fast) var(--ease-out);
  padding-bottom: 1px;
}
.prose a:hover, .link:hover { background-position: 0 100%; background-size: 100% 3px; }
/* В текстовом потоке ссылка различима не только цветом (WCAG 1.4.1):
   в покое — приглушённый осадок 1px, hover его доращивает.
   Правило системное: и .prose, и явный .link */
.prose a, .link {
  background-image: linear-gradient(color-mix(in srgb, currentColor 55%, transparent), color-mix(in srgb, currentColor 55%, transparent));
  background-size: 100% 1px;
}
.prose a:hover, .link:hover {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 3px;
}

:focus-visible {
  outline: 2px solid var(--schnebly);
  outline-offset: 2px;
  border-radius: var(--radius);
}
.stratum--night :focus-visible,
.site-footer :focus-visible { outline-color: var(--brass); }

.skip-link {
  position: absolute; left: var(--s-4); top: var(--s-2);
  z-index: 200;
  background: var(--varnish); color: var(--cream);
  padding: var(--s-2) var(--s-4); border-radius: var(--radius);
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

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

/* Двойная линия напластования */
.rule {
  border: 0;
  height: 5px;
  margin: var(--s-6) 0;
  background:
    linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 4px / 100% 1px no-repeat;
}

/* ---------- Секции-пласты ---------- */
.stratum { position: relative; padding-block: var(--s-9); }
.stratum--cream { background: var(--cream); }
.stratum--sand  { background: var(--sand); box-shadow: inset 0 1px 0 rgba(43, 33, 27, 0.07); }
.stratum--flush { padding-top: var(--s-7); }
.stratum--night { background: var(--midnight); color: var(--cream); }
.stratum--night { box-shadow: inset 0 1px 0 rgba(217, 142, 50, 0.35); } /* последний свет на скале */
.stratum--night h1, .stratum--night h2, .stratum--night h3, .stratum--night h4 { color: var(--cream); }
.stratum--night p { color: color-mix(in srgb, var(--cream) 90%, var(--midnight)); }
.stratum--night .muted { color: color-mix(in srgb, var(--cream) 72%, var(--midnight)); }
.stratum--night a, .stratum--night .link { color: var(--brass); }
.stratum--night .label { color: color-mix(in srgb, var(--cream) 65%, var(--midnight)); }
.stratum--night .label--framed { border-color: var(--night-border); }
.stratum--night .stratum-num { color: var(--cream); }
.stratum--tight { padding-top: var(--s-8); }

.stratum-num {
  position: absolute;
  top: var(--s-4);
  right: var(--gutter);
  font-family: var(--font-display);
  font-weight: 150;
  font-size: clamp(6rem, 14vw, 13rem);
  line-height: 1;
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
}
@media (max-resolution: 1.5dppx) { .stratum-num { font-weight: 200; } }

/* Стратовые дивайдеры: скол породы. Максимум один на вьюпорт */
/* overflow: clip (с hidden-фолбэком) — hidden делал обёртку scroll-контейнером и убивал view()-таймлайн svg */
.strata-divider { display: block; width: 100%; height: clamp(88px, 9vw, 140px); overflow: hidden; overflow: clip; }
.strata-divider svg { display: block; width: 100%; height: calc(100% + 24px); margin-top: -12px; }
.strata-divider--dusk { height: clamp(96px, 10vw, 150px); background: var(--sand); }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .strata-divider svg {
      animation: shear linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }
    @keyframes shear { from { transform: translateY(-12px); } to { transform: translateY(12px); } }
  }
}

/* ---------- Хедер ----------
   Надёжность: солидный фон по умолчанию (работает без JS);
   прозрачность поверх hero — только как enhancement через scroll-timeline. */
.site-header {
  position: sticky; top: calc(var(--header-h-condensed) - var(--header-h)); z-index: 100;
  height: var(--header-h);
  display: flex; align-items: flex-end;
  background: var(--cream); /* непрозрачный: контент не просвечивает сквозь планку */
  box-shadow: inset 0 -1px 0 var(--line), inset 0 -5px 0 -4px var(--line);
  transition: background-color var(--t-header) var(--ease-out), box-shadow var(--t-header) var(--ease-out);
}
@supports (animation-timeline: scroll(root)) {
  .site-header {
    background: transparent;
    box-shadow: none;
    animation: condense linear both;
    animation-timeline: scroll(root);
    animation-range: 0 96px;
  }
  @keyframes condense {
    to {
      background-color: var(--cream);
      box-shadow: inset 0 -1px 0 var(--line), inset 0 -5px 0 -4px var(--line);
    }
  }
}
.site-header .container {
  display: flex; align-items: center; gap: var(--s-6); width: 100%;
  height: var(--header-h-condensed);
}
.brand { display: flex; flex-direction: column; gap: 2px; color: var(--varnish); }
.brand-word {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.15rem; letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}
.brand-sub {
  font-family: var(--font-mono); font-size: var(--mono-xs); font-weight: 450;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--shale);
}
.site-nav { display: flex; gap: var(--s-5); margin-inline: auto; }
.site-nav a {
  font-family: var(--font-body); font-weight: 500; font-size: 0.95rem;
  color: var(--varnish);
  background-image: linear-gradient(var(--schnebly), var(--schnebly));
  background-repeat: no-repeat; background-position: 100% 100%; background-size: 0 2px;
  transition: background-size var(--t-fast) var(--ease-out);
  padding-bottom: 3px;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { background-position: 0 100%; background-size: 100% 2px; }
.header-tel {
  font-family: var(--font-mono); font-weight: 600; font-size: var(--mono-l);
  color: var(--varnish); white-space: nowrap;
}

.btn-label-short { display: none; }

/* Burger: две линии напластования */
.nav-toggle {
  display: none;
  flex: 0 0 48px;
  width: 48px; height: 48px;
  background: transparent; border: 0; cursor: pointer;
  border-radius: var(--radius);
  position: relative;
}
.nav-toggle span {
  position: absolute; left: 12px; right: 12px; height: 2px;
  background: var(--varnish);
  transition: transform var(--t-fast) var(--ease-out);
}
.nav-toggle span:nth-child(1) { top: 20px; }
.nav-toggle span:nth-child(2) { top: 27px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--cream);
  box-shadow: inset 0 1px 0 var(--line), 0 12px 24px rgba(43, 33, 27, 0.1);
  padding: var(--s-4) var(--gutter) var(--s-5);
  flex-direction: column; gap: var(--s-1);
  opacity: 0; translate: 0 -8px;
  transition: opacity var(--t-fast) var(--ease-out), translate var(--t-fast) var(--ease-out),
              display var(--t-fast) allow-discrete;
}
.mobile-nav.is-open {
  display: flex; opacity: 1; translate: 0 0;
  @starting-style { opacity: 0; translate: 0 -8px; }
}
.mobile-nav a {
  font-family: var(--font-body); font-weight: 500; font-size: 1.05rem;
  color: var(--varnish);
  padding: var(--s-3) 0;
  min-height: 48px; display: flex; align-items: center;
  border-bottom: 1px solid var(--line);
}
.mobile-nav a:last-child { border-bottom: 0; }
@media (min-width: 68.75rem) { .mobile-nav { display: none !important; } }

/* Единый брейкпоинт мобильных сигнатур: 68.75rem (rail / booking-bar / burger-хедер) */
@media (max-width: 68.749rem) {
  .site-nav, .header-tel { display: none; }
  .nav-toggle { display: block; }
  .site-header {
    top: 0; height: var(--header-h-condensed);
    align-items: center;
    background: color-mix(in srgb, var(--cream) 97%, transparent);
    box-shadow: inset 0 -1px 0 var(--line), inset 0 -5px 0 -4px var(--line);
    animation: none;
  }
  .site-header .container { gap: var(--s-3); }
  .brand { margin-right: auto; }
  .brand-word { font-size: 0.95rem; white-space: nowrap; }
  .brand-sub { display: none; }
  .site-header .btn {
    min-height: 48px; padding: 0 var(--s-4);
    font-size: 0.9rem; white-space: nowrap;
    margin-left: 0 !important;
  }
  .site-header .btn .arrow { display: none; }
  .btn-label-full { display: none; }
  .btn-label-short { display: inline; }
}
/* Планшет: телефон остаётся в шапке (аудитория звонит); тап-цель 44px */
@media (min-width: 48rem) and (max-width: 68.749rem) {
  .header-tel { display: inline-flex; align-items: center; min-height: 44px; margin-left: auto; }
  .brand { margin-right: 0; }
}
/* Узкий десктоп 1100–1280: уплотнённая шапка, без переносов */
@media (min-width: 68.75rem) and (max-width: 79.999rem) {
  .site-header .container { gap: var(--s-4); }
  .site-nav { gap: var(--s-4); }
  .site-nav a { font-size: 0.9rem; }
  .brand-sub { display: none; }
  .site-header .btn { padding: 0 var(--s-4); font-size: 0.9rem; }
  .header-tel { font-size: var(--mono-m); }
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-5);
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  line-height: 1;
  border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
  position: relative; overflow: visible;
}
.btn .arrow { display: inline-flex; transition: transform var(--t-fast) var(--ease-out); }
.btn .arrow svg { display: block; }
.btn:hover .arrow { transform: translateX(4px); }
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--oxide); color: var(--cream); }
.btn--primary:hover { background: var(--oxide-hover); }
.btn--primary:active { background: var(--oxide-active); }

.btn--ghost { background: transparent; color: var(--varnish); border-color: var(--varnish); }
.btn--ghost:hover { background: var(--varnish); color: var(--cream); }

/* Ночной primary: максимальный контраст страницы (~14:1) */
.btn--night { background: var(--cream); color: var(--midnight); }
.btn--night:hover { background: color-mix(in srgb, var(--cream) 92%, white); }
/* Генерик .stratum--night a (0,1,1) не должен перекрашивать кнопку в латунь */
.stratum--night .btn--night, .stratum--night .btn--night:hover { color: var(--midnight); }
.stratum--night .btn--ghost { color: var(--cream); border-color: var(--brass); }
.stratum--night .btn--ghost:hover { background: var(--brass); color: var(--midnight); }

/* Волна гонга: изолинии, двойное кольцо, fire-and-forget */
.gong-ring {
  position: absolute; left: 50%; top: 50%;
  width: 100%; aspect-ratio: 1;
  translate: -50% -50%;
  border: 1.5px solid var(--oxide);
  border-radius: 50%;
  pointer-events: none;
  /* both: кольцо скрыто и в фазе delay второго удара */
  animation: gong var(--t-gong) var(--ease-out) both;
}
.stratum--night .gong-ring, .booking-bar .gong-ring, .site-footer .gong-ring { border-color: var(--brass); }
@keyframes gong {
  from { transform: scale(0.4); opacity: var(--ring-o, 0.4); }
  to   { transform: scale(2.6); opacity: 0; }
}

/* ---------- Керн-карточка услуги (specimen) ---------- */
.specimen {
  position: relative;
  border-radius: var(--radius);
  padding: var(--s-5);
  box-shadow: var(--shadow-rest);
  transition: transform var(--t-fast) var(--ease-out);
  /* Левое ребро — колонка слоёв: карточка читается как керн из скважины */
  border-left: 8px solid transparent;
  background:
    linear-gradient(var(--sand), var(--sand)) padding-box,
    linear-gradient(180deg,
      color-mix(in srgb, var(--line) 80%, var(--shale)) 0 30%,
      var(--schnebly) 30% 55%,
      var(--shale) 55% 78%,
      var(--midnight) 78% 100%) border-box;
}
.specimen::before {           /* верхняя линия страты 2px → 4px hover */
  content: '';
  position: absolute; top: 0; left: -8px; right: 0;
  height: 2px; background: var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  transition: height var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out);
}
.specimen::after {            /* lift-тень кроссфейдом: composite-only ховер */
  content: '';
  position: absolute; inset: 0; border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  opacity: 0; transition: opacity var(--t-fast) var(--ease-out);
  pointer-events: none;
}
.specimen:hover { transform: translateY(-2px); }
.specimen:hover::after { opacity: 1; }
.specimen:hover::before { height: 4px; background: var(--schnebly); }
.specimen .label { margin-bottom: var(--s-3); display: inline-block; font-size: var(--label); /* держим токен против утечки .specimen p */ }
.specimen h3 { font-size: var(--h3-card); margin-bottom: var(--s-2); margin-top: 0 !important; }
.specimen h3 a { color: inherit; }
/* Stretched link: вся карточка — тап-цель */
.specimen h3 a::after { content: ''; position: absolute; inset: 0; }
.specimen .cluster { position: relative; z-index: 1; }
.specimen p { font-size: 0.95rem; margin-bottom: var(--s-4); }
.specimen-price {
  font-family: var(--font-mono); font-weight: 500; font-size: var(--mono-s);
  letter-spacing: 0.04em; color: var(--schnebly);
  font-variant-numeric: tabular-nums;
}
.specimen-grid {
  display: grid; gap: var(--s-5);
  grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); /* ≤324px: колонка сжимается, не рвёт вьюпорт */
}
/* Цены на общей линейке: subgrid с фолбэком */
@supports (grid-template-rows: subgrid) {
  .specimen-grid > .specimen { display: grid; grid-template-rows: subgrid; grid-row: span 5; align-content: start; } /* +фото-ряд */
  .specimen-grid > .specimen .cluster { align-self: end; }
}
@supports not (grid-template-rows: subgrid) {
  .specimen-grid > .specimen { display: flex; flex-direction: column; }
  .specimen-grid > .specimen .cluster { margin-top: auto; }
}
/* Статичный образец (палитра): без ложного affordance */
.specimen--static:hover { transform: none; }
.specimen--static:hover::after { opacity: 0; }
.specimen--static:hover::before { height: 2px; background: var(--line); }
/* Ночной керн */
.specimen--night {
  background:
    linear-gradient(var(--night-surface), var(--night-surface)) padding-box,
    linear-gradient(180deg,
      var(--night-border) 0 30%,
      var(--brass) 30% 55%,
      var(--dusk-umber) 55% 78%,
      var(--midnight) 78% 100%) border-box;
  box-shadow: none;
}
.specimen--night h3, .specimen--night h3 a { color: var(--cream); }
.specimen--night p { color: color-mix(in srgb, var(--cream) 80%, var(--midnight)); }
.specimen--night .specimen-price { color: var(--brass); }
.specimen--night::before { background: var(--night-border); left: -8px; }
.specimen--night:hover::before { background: var(--brass); }
.specimen--night::after { display: none; }

/* Тег модальности */
.tag {
  display: inline-block;
  font-family: var(--font-mono); font-weight: 480; font-size: var(--mono-xs);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--sage); border: 1px solid var(--sage);
  border-radius: var(--radius); padding: 2px var(--s-2);
}

/* Рейтинг в языке описи */
.rating { display: inline-flex; align-items: baseline; gap: var(--s-2); }
.rating-stars { color: var(--schnebly); letter-spacing: 0.12em; }
.stratum--night .rating-stars, .site-footer .rating-stars { color: var(--brass); }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: var(--s-2); margin-bottom: var(--s-5); }
.field-label {
  font-family: var(--font-mono); font-weight: 480; font-size: var(--label);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--shale);
  transition: color var(--t-fast) var(--ease-out);
}
.field:has(:focus-visible) .field-label { color: var(--schnebly); }
.input, .textarea, .select {
  font-family: var(--font-body); font-size: 1rem; color: var(--varnish);
  background: var(--cream);
  border: 1px solid var(--shale); border-radius: var(--radius);
  padding: var(--s-3) var(--s-4);
  min-height: 48px;
  transition: border-color var(--t-fast) var(--ease-out);
  width: 100%;
}
.textarea { min-height: 8rem; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--shale); opacity: 1; font-style: italic; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--varnish); }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible {
  outline: 2px solid var(--schnebly); outline-offset: 2px; border-color: var(--schnebly);
}
.field.has-error .input, .field.has-error .textarea { border-color: var(--schnebly); }
.field-error {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--small); color: var(--schnebly);
}
.field-error::before { content: '⚠'; font-size: 0.9em; }
/* Тёмная спека форм (ночной пласт — точка финального бронирования) */
.stratum--night .input, .stratum--night .textarea, .stratum--night .select {
  background: var(--night-surface); color: var(--cream); border-color: var(--night-border);
}
.stratum--night .input::placeholder, .stratum--night .textarea::placeholder {
  color: color-mix(in srgb, var(--cream) 55%, var(--midnight));
}
.stratum--night .input:hover, .stratum--night .textarea:hover { border-color: var(--brass); }
.stratum--night .input:focus-visible, .stratum--night .textarea:focus-visible {
  outline-color: var(--brass); border-color: var(--brass);
}
.stratum--night .field-label { color: color-mix(in srgb, var(--cream) 70%, var(--midnight)); }
.stratum--night .field:has(:focus-visible) .field-label { color: var(--brass); }
.stratum--night .field-error { color: var(--brass); }

/* ---------- Отзыв ---------- */
.testimonial {
  background: var(--sand); border-radius: var(--radius);
  padding: var(--s-6);
  margin: 0;
  position: relative;
  box-shadow: var(--shadow-rest);
  max-width: 44rem;
}
figure.sketch, figure.photo-duotone { margin: 0; }
.testimonial::before {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0;
  width: 3px; background: var(--schnebly);
  border-radius: var(--radius) 0 0 var(--radius);
}
.testimonial blockquote { margin: 0 0 var(--s-4); font-style: italic; font-size: 1.05rem; }
.testimonial cite {
  font-style: normal; font-family: var(--font-mono); font-weight: 480;
  font-size: var(--label); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--shale);
}

/* ---------- Ночной пласт ---------- */
.constellations { position: absolute; inset: 0; pointer-events: none; overflow: hidden; overflow: clip; }
.constellations svg { position: absolute; opacity: 0.8; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .constellations svg {
      opacity: 0;
      animation: star-rise linear both;
      animation-timeline: view();
      animation-range: entry 20% entry 70%;
    }
    @keyframes star-rise { to { opacity: 0.8; } }
  }
}
.ephemeris,
.stratum--night p.ephemeris,
.site-footer p.ephemeris {
  font-family: var(--font-mono); font-weight: 450; font-size: var(--mono-s);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--cream) 65%, var(--midnight));
}
.night-grid { position: relative; }
@media (min-width: 64rem) {
  .night-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--s-7); align-items: start; }
}

/* ---------- Фото: дуотон varnish→oxide ---------- */
.photo-duotone {
  position: relative; overflow: hidden; border-radius: var(--radius);
}
.photo-duotone img {
  display: block; width: 100%; height: auto;
  filter: grayscale(1) contrast(1.05) brightness(0.98);
}
.photo-duotone::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(43, 33, 27, 0.85), rgba(126, 45, 20, 0.55));
  mix-blend-mode: color;
  pointer-events: none;
}
.photo-duotone figcaption,
.photo-caption {
  font-family: var(--font-mono); font-weight: 450; font-size: var(--mono-xs);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--shale);
  margin-top: var(--s-2);
}

/* Полевые зарисовки: 1.5px stroke, журнал геодезиста */
.sketch { color: var(--shale); }
.sketch svg { display: block; }
.stratum--night .sketch { color: color-mix(in srgb, var(--cream) 60%, var(--midnight)); }

/* ---------- Футер: самый глубокий пласт и паспорт бизнеса (E-E-A-T) ---------- */
.site-footer {
  background: var(--midnight); color: var(--cream);
  position: relative;
  padding-block: var(--s-9) var(--s-6);
  overflow: hidden;
}
.site-footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 4px; background: var(--oxide);
}
.site-footer p { color: color-mix(in srgb, var(--cream) 90%, var(--midnight)); }
.site-footer a { color: var(--brass); }
.footer-grid {
  display: grid; gap: var(--s-7) var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  position: relative; z-index: 1;
}
@media (min-width: 64rem) {
  .footer-grid { grid-template-columns: 1.1fr 1fr 1.5fr 0.8fr; }
}
.footer-col-title {
  font-family: var(--font-mono); font-weight: 480; font-size: var(--label);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--cream) 65%, var(--midnight));
  margin: 0 0 var(--s-4);
  padding-bottom: var(--s-2);
  background:
    linear-gradient(var(--night-border), var(--night-border)) 0 100% / 3rem 1px no-repeat;
}
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li {
  margin: 0;
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3);
}
.footer-links a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 0.92rem;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat; background-position: 100% calc(100% - 8px); background-size: 0 1px;
  transition: background-size var(--t-fast) var(--ease-out);
}
.footer-links a:hover { background-position: 0 calc(100% - 8px); background-size: 100% 1px; }
.footer-links .price {
  font-family: var(--font-mono); font-size: var(--mono-s); font-weight: 450;
  color: color-mix(in srgb, var(--cream) 55%, var(--midnight));
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.footer-nap { font-family: var(--font-mono); font-weight: 450; font-size: var(--mono-m); line-height: 1.9; font-style: normal; }
.footer-nap .tel { font-size: 1.05rem; font-weight: 600; }
.footer-nap a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--brass) 45%, transparent);
  text-underline-offset: 3px;
}
.social-links { display: flex; gap: var(--s-2); margin-top: var(--s-4); }
.social-links a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--night-border); border-radius: var(--radius);
  color: var(--brass);
  transition: border-color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out);
}
.social-links a:hover { border-color: var(--brass); background: rgba(217, 142, 50, 0.08); }
.social-links svg { display: block; }
.footer-strip {
  margin-top: var(--s-8);
  padding-top: var(--s-4);
  border-top: 1px solid color-mix(in srgb, var(--cream) 12%, var(--midnight));
  display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6);
  font-family: var(--font-mono); font-weight: 450; font-size: var(--mono-s);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--cream) 60%, var(--midnight));
  position: relative; z-index: 1;
}
.footer-strip strong { color: color-mix(in srgb, var(--cream) 85%, var(--midnight)); font-weight: 500; }
.footer-elev {
  position: absolute; bottom: var(--s-8); right: var(--gutter);
  font-family: var(--font-display); font-weight: 150;
  font-size: clamp(4rem, 8vw, 9rem); line-height: 1;
  opacity: 0.08; pointer-events: none; user-select: none;
  white-space: nowrap;
}
.footer-legal {
  margin-top: var(--s-8); padding-top: var(--s-4);
  padding-inline-end: var(--s-9);
  border-top: 1px solid color-mix(in srgb, var(--cream) 18%, var(--midnight));
  display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between;
  font-size: var(--small);
  color: color-mix(in srgb, var(--cream) 65%, var(--midnight));
  position: relative; z-index: 1;
}
.footer-brand { color: var(--cream); font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.tel-note { font-size: var(--mono-xs); white-space: nowrap; }

/* ---------- Hero: колонна керна (жест первого экрана) ---------- */
#s-hero h1 { font-size: var(--h1-hero); }
.hero-core { display: none; }
/* Единый брейкпоинт сигнатур 68.75rem: в 1024–1099 живёт мобильный бар, двойной стратиграфии нет */
@media (min-width: 68.75rem) {
  .hero-core {
    display: flex; flex-direction: column;
    position: absolute; top: var(--s-6); bottom: var(--s-6); right: var(--gutter);
    width: 88px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-rest);
  }
  .hero-core a {
    flex-grow: var(--depth, 1);
    background: color-mix(in srgb, var(--layer, var(--sand)) 90%, var(--varnish));
    box-shadow: inset 0 1px 0 rgba(43, 33, 27, 0.18);
    position: relative;
  }
  .hero-core .core-mark { padding-inline: var(--s-2); background: var(--cream); }
  .hero-core a:hover::after,
  .hero-core a:focus-visible::after {
    content: attr(data-label);
    position: absolute; right: calc(100% + 10px); top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono); font-weight: 480; font-size: var(--mono-xs);
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--varnish); background: var(--cream);
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 2px 8px; white-space: nowrap;
  }
  .core-mark {
    font-family: var(--font-mono); font-weight: 480; font-size: var(--mono-xs);
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--shale);
    padding: var(--s-1) 0;
    white-space: nowrap;
  }
}

/* ---------- Керн-навигатор (Core Sample Rail) ---------- */
.core-rail { display: none; }
@media (min-width: 68.75rem) {
  .core-rail {
    display: flex; flex-direction: column;
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 12px; z-index: 110; /* выше sticky-хедера: он перехватывал клики по верхним сегментам */
    box-shadow: inset 1px 0 0 rgba(43, 33, 27, 0.18); /* волосяная левая грань колонки */
  }
  @media (prefers-reduced-motion: no-preference) {
    .core-rail { transform-origin: top; animation: rail-grow 600ms var(--ease-out) 300ms backwards; }
    @keyframes rail-grow { from { transform: scaleY(0); } }
  }
  .core-rail a {
    display: block; position: relative;
    flex-grow: var(--depth, 1);
    /* подмес varnish, как у hero-core: cream-сегменты видимы на cream-фоне */
    background: color-mix(in srgb, var(--layer, var(--sand)) 88%, var(--varnish));
    box-shadow: inset 0 1px 0 rgba(43, 33, 27, 0.28);
    transition: width var(--t-fast) var(--ease-out);
    width: 12px; align-self: flex-end;
    outline-offset: -2px;
  }
  .core-rail a::before { content: ''; position: absolute; inset: 0 0 0 -16px; }
  .core-rail a[aria-current] { width: 20px; }
  .core-rail a .rail-label {
    position: absolute; right: 26px; top: 50%;
    transform: translateY(-50%) translateX(6px);
    font-family: var(--font-mono); font-weight: 480; font-size: var(--mono-xs);
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--varnish); background: var(--cream);
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 2px 8px; white-space: nowrap;
    opacity: 0; transition: opacity var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
    pointer-events: none;
  }
  .core-rail a:hover .rail-label,
  .core-rail a:focus-visible .rail-label { opacity: 1; transform: translateY(-50%) translateX(0); }
  /* линия бурения */
  .core-rail::after {
    content: ''; position: absolute; top: 0; left: 4px;
    width: 4px; height: 100%;
    background: var(--schnebly);
    transform-origin: top;
    transform: scaleY(var(--scroll-progress, 0));
    pointer-events: none;
  }
  @supports (animation-timeline: scroll(root)) {
    .core-rail::after {
      animation: drill linear forwards;
      animation-timeline: scroll(root);
      transform: none;
    }
    @keyframes drill { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  }
}
/* Индикатор глубины */
/* Глубиномер: на поверхности (hero) и над футером — молчит */
.rail-depth {
  display: none;
  position: fixed; right: 34px; bottom: var(--s-5); z-index: 110;
  font-family: var(--font-mono); font-weight: 480; font-size: var(--mono-xs);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--shale);
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2px 8px;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
  pointer-events: none;
}
.rail-depth.is-visible:not(.is-muted) { opacity: 1; }
.rail-depth.is-pulse { color: var(--schnebly); border-color: var(--schnebly); }
@media (min-width: 68.75rem) { .rail-depth { display: block; } }

/* Мобильный сегментированный ПРОГРЕСС-бар */
.core-rail-mobile {
  position: sticky; top: var(--header-h-condensed); z-index: 89;
  display: flex; height: 5px;
  background: var(--line);
}
.core-rail-mobile span {
  flex-grow: var(--depth, 1);
  background: color-mix(in srgb, var(--layer, var(--sand)) 85%, var(--varnish));
  box-shadow: inset -1px 0 0 rgba(43, 33, 27, 0.28), inset 0 1px 0 rgba(43, 33, 27, 0.16);
}
.core-rail-mobile::after {
  content: ''; position: absolute; inset: 0;
  background: var(--schnebly); opacity: 0.65;
  transform-origin: left;
  transform: scaleX(var(--scroll-progress, 0));
}
@supports (animation-timeline: scroll(root)) {
  .core-rail-mobile::after {
    animation: drill-x linear forwards;
    animation-timeline: scroll(root);
    transform: none;
  }
  @keyframes drill-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}
@media (min-width: 68.75rem) { .core-rail-mobile { display: none; } }

/* ---------- Мобильный booking-бар ---------- */
.booking-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
  background: var(--oxide); color: var(--cream);
  min-height: 56px;
  padding: var(--s-2) var(--s-4);
  padding-bottom: calc(var(--s-2) + env(safe-area-inset-bottom));
  transform: translateY(110%);
  visibility: hidden;
  transition: transform var(--t-bar) var(--ease-out), visibility 0s var(--t-bar);
}
.booking-bar.is-visible { transform: translateY(0); visibility: visible; transition-delay: 0s; }
.bar-call {
  display: inline-flex; align-items: center; min-height: 48px;
  font-family: var(--font-mono); font-weight: 500; font-size: var(--mono-s);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--cream); white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--cream) 40%, transparent); border-radius: var(--radius);
  padding: 0 var(--s-4);
}
.booking-bar .btn {
  background: var(--cream); color: var(--oxide);
  min-height: 48px; font-size: 0.9rem; white-space: nowrap;
  padding: 0 var(--s-4);
}
.booking-bar .btn .arrow { display: none; }
@media (min-width: 68.75rem) { .booking-bar { display: none; } }
@media (max-width: 68.749rem) {
  .site-footer { padding-bottom: calc(var(--s-6) + 72px + env(safe-area-inset-bottom)); }
}

/* Узкие телефоны ≤360px (= zoom 200% ноутбука, WCAG 1.4.10): без hscroll.
   Book уходит из шапки — он живёт в booking-bar и в мобильном меню.
   Блок стоит ПОСЛЕ базовых правил шапки и бара: специфичность равная, порядок решает. */
@media (max-width: 22.5rem) {
  .site-header .container { gap: var(--s-2); }
  .brand-word { font-size: 0.85rem; }
  .site-header .btn { display: none; }
  .booking-bar { padding-inline: var(--s-3); gap: var(--s-3); }
  .bar-call { padding: 0 var(--s-3); letter-spacing: 0.04em; font-size: var(--mono-xs); }
  .booking-bar .btn { padding: 0 var(--s-3); font-size: 0.85rem; }
}

/* ---------- Появление: осадконакопление (триггер — вход в вьюпорт) ----------
   Keyframes, не transition: анимация не трогает transition-свойства детей
   (hover/press живут) и сама снимается по завершении. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal-group]:not(.is-revealed) > * { opacity: 0; }
  .js [data-reveal-group].is-revealed > * {
    animation: sediment var(--t-med) var(--ease-out) both;
    animation-delay: calc(var(--reveal-i, 0) * 70ms);
  }
  @keyframes sediment { from { opacity: 0; transform: translateY(24px); } }
}
@media print {
  [data-reveal-group] > * { opacity: 1 !important; animation: none !important; }
}

/* ---------- Топографические изолинии ---------- */
.topo {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='560' viewBox='0 0 560 560' fill='none' stroke='%236B5A4C' stroke-width='1'%3E%3Cpath d='M60 480c40-90 10-150 70-210s160-30 200-110 130-90 190-60'/%3E%3Cpath d='M20 500c50-100 30-170 90-230s170-40 210-120 140-100 220-70'/%3E%3Cpath d='M100 460c30-80 0-130 60-190s150-20 190-100 120-80 180-50'/%3E%3C/svg%3E");
  background-size: 560px 560px;
}
.topo-caption {
  position: absolute; bottom: var(--s-4); left: var(--gutter);
  font-family: var(--font-mono); font-weight: 450; font-size: var(--mono-xs);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--shale);
  opacity: 0.7;
}

/* ---------- Утилиты ---------- */
.grid-2 { display: grid; gap: var(--s-6); grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); }
.stack > * + * { margin-top: var(--s-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Мобильная раскладка ночи: интервал между колонками в стеке */
@media (max-width: 63.999rem) {
  .night-grid > div + div { margin-top: var(--s-8); }
}

/* Созвездия: прячем Скорпиона на узких экранах (ложится на текст);
   там же прячем ghost-отметку высоты (пересекала legal-строку) */
@media (max-width: 47.999rem) {
  .constellation-scorpius { display: none; }
  .footer-elev { display: none; }
}

/* ============================================================
   DOCUMENT PAGES (legal и другие длинные тексты) · v1.5
   Документ как лист описи керна: номер, дата, нумерованные пласты.
   ============================================================ */

/* Хлебные крошки — mono-регистр описи */
.breadcrumbs {
  font-family: var(--font-mono); font-weight: 450;
  font-size: var(--mono-s); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: var(--s-7);
  display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: baseline;
}
.breadcrumbs a { color: var(--shale); }
.breadcrumbs a:hover { color: var(--schnebly); }
.breadcrumbs [aria-current] { color: var(--varnish); }
.crumb-sep { color: color-mix(in srgb, var(--shale) 55%, var(--cream)); }

/* Шапка документа: крошки — навигационный хром, живут близко к хедеру */
.page-head { background: var(--cream); padding-top: var(--s-5); }
.page-head .breadcrumbs { margin-bottom: var(--s-6); }
.doc-title {
  font-size: clamp(2.3rem, 4.5vw, 3.75rem);
  line-height: 1.05; max-width: 16ch;
  margin-top: var(--s-5);
}
.doc-meta {
  margin-top: var(--s-4);
  font-family: var(--font-mono); font-weight: 450;
  font-size: var(--mono-s); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--shale);
  display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: baseline;
}
.doc-lead { margin-top: var(--s-5); color: var(--shale); }

/* Маркер вычитки: факты, ждущие подтверждения владельца.
   Нарочно вне палитры системы — снимается вместе с <mark> после вычитки */
mark {
  background: linear-gradient(104deg,
    rgba(247, 214, 96, 0) 0.5%,
    rgba(247, 214, 96, 0.9) 3%,
    rgba(247, 214, 96, 0.72) 97%,
    rgba(247, 214, 96, 0) 99.5%);
  color: var(--varnish); /* на жёлтом фоне текст всегда тёмный — и в ночных пластах */
  padding: 0.08em 0.3em;
  margin-inline: -0.12em;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
/* ≤360px: «Accessibility» одним словом влезает в 320 (правило после базы .doc-title) */
@media (max-width: 22.5rem) {
  .doc-title { font-size: 2rem; }
}

/* Раскладка: реестр документов + текст */
.doc-body { padding-block: var(--s-8); }
.legal-layout { display: grid; gap: var(--s-7); }
@media (min-width: 68.75rem) {
  .legal-layout { grid-template-columns: 15rem minmax(0, 1fr); gap: var(--s-8); align-items: start; }
  .legal-nav { position: sticky; top: calc(var(--header-h-condensed) + var(--s-5)); }
}
.legal-nav-list { list-style: none; margin: var(--s-3) 0 0; padding: 0; border-top: 1px solid var(--line); }
.legal-nav-list li { border-bottom: 1px solid var(--line); }
.legal-nav-list a {
  display: flex; gap: var(--s-3); align-items: baseline;
  padding: var(--s-3) var(--s-2);
  font-size: var(--small); line-height: 1.35; color: var(--varnish);
  border-left: 2px solid transparent;
  transition: background-color var(--t-fast) var(--ease-out);
}
.legal-nav-list a:hover { background: color-mix(in srgb, var(--cream) 65%, var(--sand)); }
.legal-nav-list a[aria-current="page"] {
  border-left-color: var(--schnebly);
  background: var(--cream);
  font-weight: 600;
}
.doc-no {
  font-family: var(--font-mono); font-weight: 480;
  font-size: var(--mono-xs); letter-spacing: 0.08em;
  color: var(--shale); flex: none;
}
.legal-nav-list a[aria-current="page"] .doc-no { color: var(--schnebly); }

/* Prose — длинные тексты из markdown */
.prose { max-width: var(--measure); font-size: var(--text-base); line-height: var(--lh-body); }
.prose > * + * { margin-top: var(--s-4); }
.prose h2 {
  font-size: clamp(1.35rem, 2vw, 1.6rem); line-height: 1.25;
  margin-top: var(--s-7);
}
.prose > h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.15rem; margin-top: var(--s-6); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: var(--s-2); }
.prose li::marker { color: var(--schnebly); }
.prose strong { font-weight: 650; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: var(--s-6); }
.prose blockquote {
  border-left: 2px solid var(--line); padding-left: var(--s-4);
  color: var(--shale); font-style: italic;
}

/* Нумерация h2 — отметки глубины (Azeret, как на кернах) */
.prose--doc { counter-reset: doc-section; }
.prose--doc h2 { counter-increment: doc-section; display: flex; align-items: baseline; gap: var(--s-3); }
.prose--doc h2::before {
  content: counter(doc-section, decimal-leading-zero);
  content: counter(doc-section, decimal-leading-zero) / ""; /* скринридер слышит чистый заголовок */
  font-family: var(--font-mono); font-weight: 480;
  font-size: var(--mono-s); letter-spacing: 0.08em;
  color: var(--schnebly); flex: none;
}

/* Контакт внизу документа */
.doc-contact {
  margin-top: var(--s-8); padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6);
  align-items: baseline; justify-content: space-between;
}
.doc-contact-links { font-size: var(--small); }
.doc-contact-links a { color: var(--schnebly); }

/* ============================================================
   CONTACT + 404 · v1.5
   Телефон — главный объект; карта — документальная координатная
   плашка (маршрут не выдумываем); ночь — записка под звёздами.
   ============================================================ */

.tel-hero { margin-top: var(--s-6); font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.05em; line-height: 1.1; }
.tel-hero a { color: var(--varnish); font-size: clamp(2rem, 6vw, 3.4rem); }
.tel-hero a:hover { color: var(--schnebly); }
.contact-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }

.visit-grid { display: grid; gap: var(--s-7); }
@media (min-width: 68.75rem) {
  .visit-grid { grid-template-columns: minmax(0, 1fr) 22rem; gap: var(--s-9); align-items: start; }
}
.visit-nap { font-style: normal; font-size: var(--lead); line-height: 1.5; }
.hours-list { list-style: none; padding: 0; margin-top: var(--s-4); border-top: 1px solid var(--line); max-width: 32rem; }
.hours-list li {
  display: flex; justify-content: space-between; gap: var(--s-4); align-items: baseline;
  padding: var(--s-3) 0; border-bottom: 1px solid var(--line);
}
.hours-list li > span:first-child {
  font-family: var(--font-mono); font-weight: 480; font-size: var(--mono-s);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--shale);
}

/* Координатная плашка — паспорт места, не фейковая карта */
.coord-card {
  position: relative;
  background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s-6); box-shadow: var(--shadow-rest);
}
.coord-compass { position: absolute; top: var(--s-5); right: var(--s-5); color: var(--shale); }
.coord-value {
  margin-top: var(--s-4);
  font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(1.15rem, 2vw, 1.35rem); letter-spacing: 0.06em; line-height: 1.5;
}
.coord-sep { border-top: 1px solid var(--line); margin-block: var(--s-4); }
.coord-cta { margin-top: var(--s-5); }

/* Микрокопия под hero-кнопками */
.actions-note { margin-top: var(--s-3); }

/* Прямые контакты в ночи */
.night-direct { margin-top: var(--s-5); }

/* Отступ CTA в шапке (вместо inline-стиля) */
.header-cta { margin-left: var(--s-4); }

/* Ошибка сервера подсвечивает поле: продакшен говорит на языке aria-invalid
   (styleguide-класс has-error остаётся демо-стейтом спеки) */
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--schnebly); }
.stratum--night .input[aria-invalid="true"],
.stratum--night .textarea[aria-invalid="true"] { border-color: var(--brass); } /* schnebly на midnight — 2.5:1, мало */

/* Успех формы — ночной пласт */
.form-success {
  border: 1px solid var(--night-border); background: var(--night-surface);
  border-radius: var(--radius); padding: var(--s-5);
}
.form-success-title {
  font-family: var(--font-display); font-weight: 650; font-size: var(--h4);
  color: var(--brass); margin-bottom: var(--s-2);
}

/* ---------- Страницы услуг (шаг 3–5): опись керна в полный рост ---------- */
.session-price-row { margin-top: var(--s-5); display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: baseline; }
.session-price {
  font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(1.9rem, 4.5vw, 2.6rem); line-height: 1;
  color: var(--schnebly); letter-spacing: 0.02em;
}
.session-price-meta {
  font-family: var(--font-mono); font-weight: 450; font-size: var(--mono-s);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--shale);
}

.session-grid { display: grid; gap: var(--s-7); }
/* Дети гридов не раздувают колонку своим min-content (mark/кнопки на 320) */
.session-grid > *, .visit-grid > *, .legal-layout > * { min-width: 0; }
@media (min-width: 68.75rem) {
  .session-grid { grid-template-columns: minmax(0, 1fr) 21rem; gap: var(--s-9); align-items: start; }
  .session-card { position: sticky; top: calc(var(--header-h-condensed) + var(--s-5)); }
}
.session-card {
  background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s-6); box-shadow: var(--shadow-rest);
}
.session-rows { list-style: none; margin: var(--s-4) 0 0; padding: 0; border-top: 1px solid var(--line); }
.session-rows li {
  display: flex; justify-content: space-between; gap: var(--s-4); align-items: baseline;
  padding: var(--s-3) 0; border-bottom: 1px solid var(--line);
  font-size: var(--small); line-height: 1.4;
}
.session-rows li > span:first-child {
  font-family: var(--font-mono); font-weight: 480; font-size: var(--mono-xs);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--shale); flex: none;
}
.session-rows li > span:last-child { text-align: right; }
.session-card-cta { margin-top: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.session-card-cta .btn { justify-content: center; }
.session-card-note { margin-top: var(--s-4); }

/* Цитата-FAQ голосом мастера */
.faq-quote { margin: 0; font-style: normal; } /* UA-маргин blockquote (1em 40px) душил цитату на 320 */
.faq-cite {
  margin-top: var(--s-3);
  font-family: var(--font-mono); font-weight: 450; font-size: var(--mono-s);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--shale); font-style: normal;
}

.related-sessions { margin-top: var(--s-9); }
.related-sessions h2 { margin-bottom: var(--s-5); }

/* Линейка цены в карточке: цена и note на одной baseline */
.specimen .cluster { align-items: baseline; }

/* Чужой голос у леджера — точка цены получает социальное доказательство */
.aside-quote { margin: var(--s-6) 0 0; padding-top: var(--s-5); border-top: 1px solid var(--line); }
.aside-quote blockquote { font-size: var(--small); line-height: 1.55; font-style: italic; color: var(--shale); margin: var(--s-2) 0 0; }
.aside-quote .faq-cite { margin-top: var(--s-2); }

.index-group-title { margin-bottom: var(--s-5); }
.night-title { margin-top: var(--s-4); }
.night-cta-col { display: flex; flex-direction: column; gap: var(--s-4); align-items: flex-start; }
@media (min-width: 64rem) { .night-cta-col { justify-content: center; } }

/* ---------- Фото-слоты: градиент-заглушки до прихода фотографий ----------
   Палитра породы, тонкие линии напластования; заменяются <img> с duotone-пресетом.
   Вариант выбирается data-v (order % 3), у группового саунд-бата — ночной. */
.photo-slot {
  position: relative; overflow: hidden;
  margin: 0; /* сброс UA-маргина figure: слот всегда стоит на грид-линии */
  border: 1px solid var(--line); border-radius: var(--radius);
  background:
    repeating-linear-gradient(178deg, transparent 0 30px, rgba(43, 33, 27, 0.06) 30px 31px),
    linear-gradient(160deg, var(--ph-a) 0%, var(--ph-b) 58%, var(--ph-c) 100%);
}
.photo-slot img,
.photo-slot-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-slot--band { aspect-ratio: 21 / 8; box-shadow: var(--shadow-rest); }
.photo-slot--card { aspect-ratio: 3 / 1.6; margin-bottom: var(--s-4); }
.photo-slot--tile { aspect-ratio: 4 / 3; box-shadow: var(--shadow-rest); }
.photo-slot[data-v="0"] { --ph-a: #EFE3D2; --ph-b: #C9986B; --ph-c: #9C3F21; }
.photo-slot[data-v="1"] { --ph-a: #E8D9C3; --ph-b: #A9714B; --ph-c: #7E2D14; }
.photo-slot[data-v="2"] { --ph-a: #D9C6A8; --ph-b: #8A6B52; --ph-c: #3E2A20; }
.photo-slot[data-v="night"] { --ph-a: #241C16; --ph-b: #4A3C30; --ph-c: #8A5A28; }
.photo-slot-cap {
  position: absolute; left: var(--s-3); bottom: var(--s-3);
  font-family: var(--font-mono); font-weight: 480; font-size: var(--mono-xs);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--shale); background: color-mix(in srgb, var(--cream) 92%, transparent);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2px var(--s-2);
}
.session-photo { margin-bottom: var(--s-7); }
.contact-photo { margin-top: var(--s-6); }

/* 404 — гигантский номер отсутствующего пласта */
.notfound { min-height: 62vh; }
.notfound .stratum-num { opacity: 0.1; }

/* ---------- Страница About: биография как стратиграфическая колонка ---------- */
.about-grid { display: grid; gap: var(--s-7); }
.about-grid > * { min-width: 0; }
/* Одна колонка: портрет — первый трастовый актив, выше текста и по центру */
.about-portrait { order: -1; }
.about-portrait .photo-slot--portrait { margin-inline: auto; }
@media (min-width: 68.75rem) {
  .about-grid { grid-template-columns: minmax(0, 1fr) 21rem; gap: var(--s-9); align-items: start; }
  .about-portrait { order: 0; }
  .about-portrait .photo-slot--portrait { margin-inline: 0; }
}
.photo-slot--portrait { aspect-ratio: 3 / 4; box-shadow: var(--shadow-rest); max-width: 22rem; }

/* Опись жизни: era-метка + слой; линии напластования как в леджере */
.bio-record { margin-top: var(--s-8); }
.bio-timeline { list-style: none; margin: var(--s-6) 0 0; padding: 0; border-top: 1px solid var(--line); }
.bio-timeline > li { padding: var(--s-5) 0; border-bottom: 1px solid var(--line); }
.bio-era {
  display: block; margin-bottom: var(--s-2);
  font-family: var(--font-mono); font-weight: 480; font-size: var(--mono-xs);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--shale);
}
.bio-timeline h3 { margin: 0 0 var(--s-2); font-size: 1.2rem; }
.bio-timeline p { margin: 0; max-width: var(--measure); }
.bio-cta { margin-top: var(--s-5); }
@media (min-width: 48rem) {
  .bio-timeline > li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--s-5); }
  .bio-era { margin-bottom: 0; padding-top: 0.35rem; }
}

/* Дисциплины: три ответа мастера своими словами */
.disciplines-grid {
  display: grid; gap: var(--s-5); margin-top: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
}
.disciplines-grid > * { min-width: 0; }
.discipline-card {
  background: var(--sand); border-radius: var(--radius);
  padding: var(--s-6); box-shadow: var(--shadow-rest);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.discipline-card h3 { margin: 0; font-size: 1.15rem; }
.discipline-card blockquote { margin: 0; font-size: var(--small); line-height: 1.55; flex-grow: 1; }
.discipline-card .faq-cite { margin-top: 0; }

/* ---------- Страница Book: разговор вместо чекаута ---------- */
/* Шаги — крупные mono-номера, как отметки глубин */
.steps { list-style: none; margin: var(--s-6) 0 0; padding: 0; display: grid; gap: var(--s-6); }
.steps > * { min-width: 0; }
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s-7); } }
.steps > li { border-top: 2px solid var(--varnish); padding-top: var(--s-4); }
.step-no {
  display: block; margin-bottom: var(--s-3);
  font-family: var(--font-mono); font-weight: 480; font-size: var(--mono-s);
  letter-spacing: 0.08em; color: var(--schnebly);
}
.steps h3 { margin: 0 0 var(--s-2); font-size: 1.15rem; }
.steps p { margin: 0; font-size: var(--small); line-height: 1.55; }

/* Леджер сессий: опись с прямым действием в каждой строке */
.book-ledger { list-style: none; margin: var(--s-6) 0 0; padding: 0; border-top: 1px solid var(--line); }
.ledger-row {
  display: grid; gap: var(--s-2) var(--s-5); align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: var(--s-4) 0; border-bottom: 1px solid var(--line);
}
.ledger-main { min-width: 0; }
.ledger-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.ledger-title a { color: var(--varnish); }
.ledger-meta {
  margin: var(--s-1) 0 0;
  font-family: var(--font-mono); font-weight: 480; font-size: var(--mono-xs);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--shale);
}
.ledger-price {
  margin: 0; font-family: var(--font-mono); font-weight: 560; font-size: 1.05rem;
  color: var(--schnebly); text-align: right; white-space: nowrap;
}
.ledger-price-note { display: block; white-space: normal; font-size: var(--mono-xs); font-weight: 480; color: var(--shale); }
.ledger-action { grid-column: 1 / -1; }
.ledger-action .btn { width: 100%; justify-content: center; }
@media (min-width: 48rem) {
  .ledger-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .ledger-action { grid-column: auto; }
  .ledger-action .btn { width: auto; }
}
.ledger-note { margin-top: var(--s-5); }
.ledger-hint { margin-top: var(--s-3); }

/* ---------- Главная ---------- */
/* Телефон в один тап на первом экране: строка над кнопками */
.hero-tel { margin: var(--s-4) 0 0; font-size: var(--small); }
.hero-tel a { font-family: var(--font-mono); font-weight: 560; font-size: 1.05rem; color: var(--schnebly); }
/* Бар молчит, пока ночной CTA в кадре (IO вешает класс) */
.booking-bar.is-suppressed { opacity: 0; pointer-events: none; }
/* Левое созвездие на мобиле ложится на eyebrow ночной секции */
@media (max-width: 40rem) {
  .constellation-cass { display: none; }
}
/* ≤360px: ужатый hero — CTA и телефон в первом экране */
@media (max-width: 22.5rem) {
  #s-hero { padding-top: var(--s-6); }
  #s-hero h1 { font-size: 2.35rem; }
}

/* Видео-история клиента внутри карточки отзыва.
   contain + max-height: вертикальные ролики (464×848) не растягивают карточку —
   пиллárbox на midnight, горизонтальные живут как есть */
.testimonial-video {
  display: block; width: 100%;
  max-height: 30rem; object-fit: contain;
  border-radius: var(--radius); margin-bottom: var(--s-4);
  background: var(--midnight);
}

/* Отзывы решёткой (не рейлом — ничего не прячем от 45–65) */
.testimonials-grid {
  display: grid; gap: var(--s-5); margin-top: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
  align-items: start;
}
.testimonials-grid > * { min-width: 0; }
.testimonials-grid .testimonial { max-width: none; }
/* 4 длинных отзыва: на десктопе ровно 2×2 — широкая колонка легче для длинного текста */
@media (min-width: 68.75rem) {
  .testimonials-grid--pairs { grid-template-columns: 1fr 1fr; }
}
/* Длинные отзывы — обычным начертанием: стена курсива тяжела для 45–65 */
.testimonials-grid .testimonial blockquote { font-style: normal; }
.testimonials-note { margin-top: var(--s-5); }

/* ---------- Горизонт под hero: Vance на скале — «the rock it stands on» ---------- */
.hero-horizon { margin: var(--s-8) 0 0; position: relative; z-index: 1; }
.hero-horizon + .hero-horizon { margin-top: var(--s-4); }
.hero-horizon img {
  display: block; width: 100%; height: auto; aspect-ratio: 21 / 8; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow-rest);
}
.hero-horizon figcaption { margin-top: var(--s-3); }
@media (min-width: 68.75rem) { .hero-horizon { margin-right: calc(88px + var(--s-6)); } }

/* ---------- Полевая запись: три инструмента со звуком ---------- */
.field-recordings { margin: calc(var(--s-4) - var(--s-7)) 0 var(--s-7); }
.field-recordings-label { color: var(--schnebly); }
.field-recordings-note { margin-top: var(--s-2); }
.fr-list { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-3); }
.fr-play {
  position: relative; overflow: hidden; overflow: clip;
  display: inline-flex; align-items: center; gap: var(--s-3);
  padding: 0.7rem 1rem 0.7rem 0.7rem; min-height: 44px;
  background: var(--cream); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.fr-play:hover, .fr-play:focus-visible { border-color: var(--varnish); box-shadow: var(--shadow-rest); outline: none; }
.fr-play:focus-visible { outline: 2px solid var(--iron); outline-offset: 2px; }
.fr-icon {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--iron); color: var(--cream); flex: none;
}
.fr-icon svg { grid-area: 1 / 1; }
.fr-ico-pause { display: none; }
.fr-play.is-playing .fr-ico-play { display: none; }
.fr-play.is-playing .fr-ico-pause { display: block; }
.fr-name { font-family: var(--font-display); font-weight: 600; }
.fr-time { font-family: var(--font-mono); font-size: var(--mono-xs); letter-spacing: 0.06em; color: var(--shale); }
.fr-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: calc(var(--p, 0) * 100%); background: var(--iron); transition: width 250ms linear; }
.fr-play.is-playing { border-color: var(--iron); }

/* ---------- Главная: синтез ---------- */
.hero-cta { margin-top: var(--s-6); }
.index-more { margin-top: var(--s-6); }

/* ---------- Reduce-гарды «только opacity» — В КОНЦЕ файла, каскад им судья ---------- */
@media (prefers-reduced-motion: reduce) {
  .specimen:hover { transform: none; }
  .btn:hover .arrow { transform: none; }
  .btn:active { transform: none; }
  .core-rail { animation: none; }
}
