/* =========================================================
   hands_that.see — «Атлас дотику»
   Концепція й правила: docs/design-research.md
   ========================================================= */

/* ---------- Шрифти (самохостинг, OFL-1.1) ---------- */

@font-face {
  font-family: "Fixel";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/fixel/FixelText-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Fixel";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/fixel/FixelText-Medium.woff2") format("woff2");
}

/* Piazzolla italic — cyrillic-ext */
@font-face {
  font-family: "Piazzolla";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/piazzolla/piazzolla-italic-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* Piazzolla italic — cyrillic */
@font-face {
  font-family: "Piazzolla";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/piazzolla/piazzolla-italic-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* Piazzolla italic — latin-ext */
@font-face {
  font-family: "Piazzolla";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/piazzolla/piazzolla-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Piazzolla italic — latin */
@font-face {
  font-family: "Piazzolla";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/piazzolla/piazzolla-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Piazzolla normal — cyrillic-ext */
@font-face {
  font-family: "Piazzolla";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/piazzolla/piazzolla-normal-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* Piazzolla normal — cyrillic */
@font-face {
  font-family: "Piazzolla";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/piazzolla/piazzolla-normal-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* Piazzolla normal — latin-ext */
@font-face {
  font-family: "Piazzolla";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/piazzolla/piazzolla-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Piazzolla normal — latin */
@font-face {
  font-family: "Piazzolla";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/piazzolla/piazzolla-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Токени ---------- */

:root {
  --paper: #E9E4D8;        /* сирий папір */
  --ink: #1C1A17;          /* текст, лінії — 13.7:1 */
  --graphite: #5E5A53;     /* другорядний текст — 5.4:1 */
  --hair: rgba(28, 26, 23, .2);
  --cinnabar: #C8341F;     /* графіка, великі акценти */
  --cinnabar-ink: #A52B18; /* посилання, кнопки — 5.6:1, з зерном ≥ 4.7:1 */
  --night: #141210;

  --serif: "Piazzolla", "Iowan Old Style", Georgia, serif;
  --sans: "Fixel", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(20px, 4vw, 56px);
  --gap: clamp(14px, 2vw, 28px);
  --max: 1360px;
  --header-h: 64px;

  --breath: 10s;                          /* 6 циклів на хвилину */
  --ease: cubic-bezier(.45, 0, .55, 1);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .11 0 0 0 0 .1 0 0 0 0 .09 .09 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- База ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper) var(--grain);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.nav-open { overflow: hidden; }

img, svg, canvas { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: .24em;
  transition: text-underline-offset .6s var(--ease), color .4s var(--ease);
}
a:hover { text-underline-offset: .12em; }

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

h1, h2, h3 { margin: 0; font-weight: 400; }
/* при великому шрифті довге слово переноситься, а не вилазить за екран */
h1, h2, h3, p, dd { overflow-wrap: break-word; }
h2 {
  font-size: clamp(2.4rem, 5.2vw, 4.5rem);
  line-height: .98;
  letter-spacing: -.025em;
  font-weight: 380;
  text-wrap: balance;
}
h3 { font-size: 1.375rem; line-height: 1.2; font-weight: 500; letter-spacing: -.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }

.skip {
  position: absolute; left: -9999px; top: .75rem; z-index: 100;
  padding: .6rem 1rem;
  background: var(--ink); color: var(--paper);
  font-family: var(--sans);
}
.skip:focus { left: var(--gutter); }

/* ---------- Сітка ---------- */

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}

/* ---------- Дрібні компоненти ---------- */

.caption {
  font-family: var(--sans);
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--graphite);
  font-variant-numeric: normal;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 3.25rem;
  padding: .9rem 1.25rem;
  background: var(--cinnabar-ink);
  color: var(--paper);
  font: 500 1rem/1.2 var(--sans);
  text-decoration: none;
  transition: background-color .4s var(--ease);
}
.btn::after { content: "→"; content: "→" / ""; transition: transform .6s var(--ease); }
.btn:hover { background: #962613; }
.btn:hover::after { transform: translateX(.3rem); }

.link {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--cinnabar-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.link::after { content: " →"; content: " →" / ""; }

/* Більша зона тапу без зміни верстки: вертикальний padding
   в інлайн-елемента не впливає на висоту рядка */
.link,
.qa dd a,
.before__note a { padding-block: .75rem; }
.contacts a { padding-block: .85rem; }
.footer__bottom a { padding-block: .75rem; margin-block: -.75rem; }

/* Крапки Брайля: 2 × 3, порядок у розмітці 1-4 / 2-5 / 3-6 */
.cell {
  --d: 4px;
  display: inline-grid;
  grid-template-columns: repeat(2, var(--d));
  grid-auto-rows: var(--d);
  gap: 3px;
}
.cell i { border-radius: 50%; }
.cell i.on { background: var(--cinnabar); }

/* Пластина під фото: тонка рамка. Рівний сірий тон видно, лише поки фото вантажиться
   (штрихування-заглушку прибрано: impeccable позначає його як ознаку згенерованого UI) */
.plate { margin: 0; }
.plate__img {
  aspect-ratio: 1;
  border: 1px solid var(--ink);
  background: var(--hair);
}
.plate__img--portrait { aspect-ratio: 3 / 4; }
img.plate__img { display: block; width: 100%; height: auto; object-fit: cover; }
.plate figcaption { margin-top: .6rem; }

/* Легенда: таблиця фактів із тонкими лініями */
.legend {
  border: 1px solid var(--ink);
  background: var(--paper);
  font-family: var(--sans);
}
.legend dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--ink);
}
.legend dl > div { background: var(--paper); padding: .85rem 1rem 1rem; }
.legend dt { font-size: .75rem; color: var(--graphite); margin-bottom: .3rem; }
.legend dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.legend__actions { display: flex; flex-wrap: wrap; border-top: 1px solid var(--ink); }
.legend__actions .btn { flex: 1 1 14rem; }
.legend__tel {
  display: flex;
  align-items: center;
  padding: .9rem 1.25rem;
  border-left: 1px solid var(--ink);
  text-decoration: none;
  font-variant-numeric: normal;
}
.legend__tel:hover { text-decoration: underline; }

/* ---------- Хедер ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  background: var(--paper) var(--grain);
  border-bottom: 1px solid transparent;
  transition: border-color .6s var(--ease);
}
.header.is-scrolled { border-bottom-color: var(--ink); }
.header__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--header-h); }

.mark {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-size: 1.25rem;
  letter-spacing: -.01em;
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 2.25rem);
  font-family: var(--sans);
  font-size: .9375rem;
}
.nav a { color: var(--graphite); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav__n { display: none; }
.nav .nav__book { color: var(--cinnabar-ink); text-decoration: underline; }
.nav .nav__book::after { content: " →"; content: " →" / ""; }

.nav-toggle {
  display: none;
  padding: .5rem 0;
  background: none;
  border: 0;
  color: var(--ink);
  font: 500 .9375rem var(--sans);
  text-decoration: underline;
  text-underline-offset: .24em;
  cursor: pointer;
}

/* ---------- I. Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
  touch-action: pan-y;
}
.hero__field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--cinnabar);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(100deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,.42) 38%, #000 72%);
          mask-image: linear-gradient(100deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,.42) 38%, #000 72%);
}
.hero__grid {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  grid-template-rows: auto 1fr auto auto;
  row-gap: 2rem;
  padding-block: clamp(1.5rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem);
}
.hero__role {
  grid-column: 1 / span 4;
  grid-row: 1;
  margin: 0;
  font-family: var(--sans);
  font-size: .9375rem;
  line-height: 1.45;
  color: var(--graphite);
}
.hero__title {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: end;
  margin-left: -.05em;
  font-size: clamp(3.75rem, 13vw, 12rem);
  line-height: .84;
  letter-spacing: -.04em;
  font-weight: 340;
}
.hero__lead {
  grid-column: 1 / span 5;
  grid-row: 3 / span 2;
  align-self: end;
  max-width: 28ch;
  margin: 0;
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  line-height: 1.35;
}
.hero__legend { grid-column: 6 / -1; grid-row: 3 / span 2; align-self: end; }
.hero__legend dl { grid-template-columns: 1.5fr 1fr; } /* з ціною: 1.5fr 1fr 1fr */

/* ---------- Розділи атласу ---------- */

.chapter {
  border-bottom: 1px solid var(--ink);
  padding-block: clamp(4rem, 9vw, 8rem);
}
.chapter .wrap { row-gap: clamp(2.5rem, 5vw, 4rem); align-items: start; }

.chapter__margin {
  grid-column: 1 / span 3;
  grid-row: 1;
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 1.75rem);
}
.chapter__num {
  display: block;
  font-size: 3.25rem;
  line-height: .9;
  font-style: italic;
  font-weight: 300;
  color: var(--cinnabar);
}
.chapter__label {
  display: block;
  margin-top: .6rem;
  font-family: var(--sans);
  font-size: .875rem;
  color: var(--graphite);
}
.chapter__content {
  grid-column: 4 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: start;
}
.chapter__content > * { grid-column: 1 / -1; }

/* Номери розділів у шаховому порядку: II зліва, III справа, IV зліва, V справа, VI зліва.
   .chapter--right дзеркалить поле: номер у колонках 10–12, зміст у 1–9. На мобільному всі номери зліва. */
@media (min-width: 901px) {
  .chapter--right .chapter__margin { grid-column: 10 / -1; text-align: right; }
  .chapter--right .chapter__content { grid-column: 1 / span 9; }
}
@media (min-width: 1101px) {
  .chapter--right .session__legend { grid-column: 1 / span 9; }
}

/* II. Хто я */
.about__text { grid-column: 1 / span 5; }
.about__plate { grid-column: 7 / -1; margin-top: .5rem; }
/* Аватар з Instagram лише 150×150: більше не розтягуємо, щоб не милився. Портрет після фотосесії — .plate__img--portrait */
.about__avatar { max-width: 150px; }

.pull {
  margin: 1.75rem 0 2rem;
  font-size: clamp(1.4rem, 2.2vw, 1.875rem);
  line-height: 1.3;
  font-style: italic;
  text-indent: -.42em;
}
.pull p { margin: 0; }
.pull p::before { content: "«"; color: var(--cinnabar); }
.pull p::after { content: "»"; color: var(--cinnabar); }

.timeline { margin: 2.25rem 0 0; border-top: 1px solid var(--ink); font-family: var(--sans); }
.timeline > div {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  padding: .8rem 0;
  border-bottom: 1px solid var(--hair);
}
.timeline dt { flex: 0 0 8.5rem; font-size: .875rem; color: var(--graphite); }
.timeline dd { flex: 1 1 12rem; margin: 0; font-size: .9375rem; }

/* IV. Карта звʼязків */
.links__intro { grid-column: 1 / span 6; }
.links__intro p { margin-top: 1.25rem; font-size: 1.25rem; line-height: 1.5; max-width: 38ch; }

.bodymap {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: start;
  margin-top: clamp(2rem, 4vw, 3.5rem);
}
.bodymap__figure {
  grid-column: 1 / span 4;
  grid-row: 1;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.bodymap__svg { height: min(78vh, 680px); width: auto; overflow: visible; }

.bodymap__list {
  grid-column: 5 / -1;
  grid-row: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
}
.bodymap__item { border-bottom: 1px solid var(--hair); }
.bodymap__toggle {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  width: 100%;
  padding: 1.1rem 0;
  background: none;
  border: 0;
  color: var(--graphite);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color .4s var(--ease);
}
.bodymap__toggle:hover, .is-active > .bodymap__toggle { color: var(--ink); }
.bodymap__n {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--cinnabar);
  border-radius: 50%;
  color: var(--cinnabar-ink);
  font: 500 .8125rem/1 var(--sans);
  font-variant-numeric: normal;
  transform: translateY(-.2em);
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
.is-active .bodymap__n { background: var(--cinnabar-ink); color: var(--paper); }
.bodymap__title { font-size: 1.5rem; line-height: 1.2; }

.bodymap__body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .7s var(--ease);
}
.bodymap__body > div { overflow: hidden; padding-left: 2.6rem; }
.bodymap__body p { max-width: 44ch; }
.bodymap__also { font-family: var(--sans); font-size: .875rem; color: var(--graphite); padding-bottom: .4rem; }
.bodymap__also b { font-weight: 500; color: var(--cinnabar-ink); }
.js .bodymap__item:not(.is-active) .bodymap__body { grid-template-rows: 0fr; }

.bodymap__panel { display: none; }

/* SVG-фігура */
.fig-body { fill: none; stroke: var(--ink); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.fig-body .faint { opacity: .45; }
.fig-joints circle { fill: var(--paper); stroke-width: 1; }

.fig-links g { opacity: 0; transition: opacity .5s var(--ease); }
.fig-links g.is-active { opacity: 1; }
.fig-link {
  fill: none;
  stroke: var(--cinnabar);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-dashoffset 1.8s var(--ease);
}
.fig-target, .fig-label { opacity: 0; transition: opacity .6s var(--ease); }
.fig-target { fill: var(--cinnabar); }
.fig-label {
  font: 500 8.5px var(--sans);
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.fig-links g.is-active .fig-target,
.fig-links g.is-active .fig-label { opacity: 1; transition-delay: 1.1s; }

.fig-point { cursor: pointer; }
.fig-point circle { fill: var(--paper); stroke: var(--cinnabar); stroke-width: 1.2; transition: fill .4s var(--ease); }
.fig-point text {
  font: 500 9px var(--sans);
  fill: var(--cinnabar-ink);
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}
.fig-point .fig-pulse { fill: none; opacity: 0; transform-box: fill-box; transform-origin: center; }
.fig-point.is-active circle:not(.fig-pulse) { fill: var(--cinnabar-ink); }
.fig-point.is-active text { fill: var(--paper); }
.fig-point.is-active .fig-pulse { animation: breathe var(--breath) var(--ease) infinite; }

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: .55; }
  50%      { transform: scale(2.1); opacity: .1; }
}

/* V. Сеанс — лінійка */
.session__intro { grid-column: 1 / span 6; }
.session__intro p { margin-top: 1.25rem; font-size: 1.25rem; line-height: 1.5; max-width: 40ch; }

.ruler {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(90, minmax(0, 1fr)); /* 1 колонка = 1 хв */
  grid-template-rows: auto 10px 2.25rem auto;
  font-variant-numeric: tabular-nums;
}
.stage { position: relative; padding: 0 1.25rem 0 .9rem; border-left: 1px solid var(--ink); }
.stage--up { grid-row: 1; align-self: end; padding-bottom: 1.25rem; }
.stage--down { grid-row: 4; align-self: start; padding-top: 1.25rem; }
.stage--down::before {
  content: "";
  position: absolute;
  left: -1px;
  bottom: 100%;
  height: 2.25rem;
  border-left: 1px solid var(--ink);
}
.stage__time { display: block; margin-bottom: .35rem; font: 500 .8125rem var(--sans); color: var(--graphite); }
.stage h3 { margin-bottom: .35rem; font-size: clamp(1.25rem, 1.8vw, 1.625rem); }
.stage p { margin: 0; max-width: 30ch; font-size: 1rem; line-height: 1.45; color: var(--graphite); }
.stage--main h3 { color: var(--cinnabar-ink); }

.ruler__seg { grid-row: 2; margin-right: 2px; background: var(--ink); }
.ruler__seg--main { background: var(--cinnabar); }

.ruler__scale {
  grid-row: 3;
  grid-column: 1 / -1;
  position: relative;
  background:
    linear-gradient(var(--ink), var(--ink)) right top / 1px 12px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px calc(100% / 6)) left top / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px calc(100% / 18)) left top / 100% 6px no-repeat;
}
.ruler__scale span {
  position: absolute;
  top: 14px;
  padding-left: 4px;
  font: .75rem/1 var(--sans);
  color: var(--graphite);
  white-space: nowrap;
}
.ruler__scale .is-end { transform: translateX(-100%); padding: 0 4px 0 0; }

.session__legend { grid-column: 4 / -1; }
.session__legend dl { grid-template-columns: 1fr 2fr; } /* з ціною: 1fr 1fr 2fr */

/* VI. Відгуки */
.chapter--voices { padding-block: clamp(3rem, 6vw, 5rem); }
.voices { grid-column: 1 / span 6; }
.voices p { margin-top: 1.25rem; font-size: 1.25rem; line-height: 1.5; max-width: 42ch; }

/* VI. Перед записом: номер і заголовок в одній липкій колонці, без поля */
.before__side {
  grid-column: 1 / span 5;
  grid-row: 1;
  position: sticky;
  top: calc(var(--header-h) + 1.75rem);
}
.before__side h2 { margin-top: 1rem; font-size: clamp(2.2rem, 4vw, 3.5rem); }
.before__note { margin: 1.75rem 0 0; max-width: 30ch; font-family: var(--sans); font-size: 1rem; color: var(--graphite); }
.before__note a { color: var(--cinnabar-ink); }

.qa { grid-column: 7 / -1; grid-row: 1; margin: 0; border-top: 1px solid var(--ink); }
.qa > div { padding: 1.15rem 0 1.35rem; border-bottom: 1px solid var(--hair); }
.qa dt { font-size: 1.25rem; line-height: 1.3; font-weight: 500; }
.qa dd { margin: .45rem 0 0; }

/* III. Як знайти: адреса на всю ширину, номер аркуша справа, карта від краю до краю */
.chapter .find__head { row-gap: 1rem; align-items: end; }
.find__head h2 {
  grid-column: 1 / span 9;
  grid-row: 1;
  margin-left: -.04em;
  font-size: clamp(2.8rem, 9.5vw, 8.5rem);
  line-height: .88;
  letter-spacing: -.04em;
}
.find__addr { grid-column: 1 / span 9; grid-row: 2; margin: 0; font-family: var(--sans); font-size: 1rem; color: var(--graphite); }
/* Номер III липне, як .chapter__margin в інших розділах. Рейця накриває адресу й карту,
   тож номер їде до низу карти. Фон прозорий: номер лежить прямо на карті */
.find__top { position: relative; }
.find__rail { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.find__rail .wrap { height: 100%; }
.find__plate {
  grid-column: 10 / -1;
  justify-self: end;
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 1.75rem);
  text-align: right;
}

.find__stage {
  position: relative;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  border-block: 1px solid var(--ink);
}
.find__map { position: absolute; inset: 0; }
.find__map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(1) sepia(.12) contrast(.92);
}
/* Шар над картою не перехоплює мишу: карту можна тягати, клікається лише відео */
.find__overlay { position: relative; padding-block: clamp(2rem, 4vw, 3.5rem); pointer-events: none; }
.find__reel { grid-column: 1 / span 3; pointer-events: auto; }

/* Reel: власне відео; клік по постеру одразу запускає.
   Паперове паспарту відокремлює відео від карти, як вклеєне фото */
.reel { position: relative; border: 1px solid var(--ink); background: var(--ink); box-shadow: 0 0 0 8px var(--paper); }
.reel__video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  transition: filter .4s ease;
}
.reel__start {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.reel__start[hidden] { display: none; }
.reel:has(.reel__start:not([hidden])) .reel__video { filter: saturate(.7) sepia(.1); }
.reel:has(.reel__start:is(:hover, :focus-visible)) .reel__video { filter: none; }
.reel__start:focus-visible { outline-offset: -4px; }
.reel__play {
  position: absolute;
  left: .75rem;
  bottom: .75rem;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .5rem .8rem .5rem .65rem;
  background: var(--paper);
  border: 1px solid var(--ink);
  font-family: var(--sans);
  font-size: .875rem;
  line-height: 1;
}
.reel__play::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: .4em 0 .4em .65em;
  border-color: transparent transparent transparent var(--cinnabar);
}

.find__contacts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
  padding-top: .5rem;
}
.find__contacts .btn { grid-column: 10 / -1; }
.contacts {
  grid-column: 1 / span 9;
  display: grid;
  grid-template-columns: subgrid;
  margin: 0;
  font-family: var(--sans);
}
.contacts > div {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .85rem 0;
}
.contacts dt { font-size: .875rem; color: var(--graphite); }
.contacts dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: normal; }
.contacts a { text-decoration: none; }
.contacts a:hover { text-decoration: underline; }

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

.footer {
  padding: clamp(2rem, 4vw, 3rem) 0 2rem;
  background: var(--night);
  color: var(--paper);
}
.footer .wrap { row-gap: 1.5rem; }
.footer .wrap > * { grid-column: 1 / -1; margin: 0; }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--sans);
  font-size: .875rem;
  color: rgba(233, 228, 216, .72);
  font-variant-numeric: normal;
}
.footer__credit {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(233, 228, 216, .25);
  font-family: var(--sans);
  font-size: .75rem;
  color: rgba(233, 228, 216, .65);
  text-align: center;
}
.footer__credit a { color: rgba(233, 228, 216, .72); text-underline-offset: .2em; }
.footer__credit a:hover { color: var(--paper); }

/* ---------- Смуга запису (мобільні) ---------- */

.fab {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  justify-content: space-between;
  align-items: center;
  padding: 1rem var(--gutter) calc(1rem + env(safe-area-inset-bottom));
  background: var(--cinnabar-ink);
  color: var(--paper);
  font: 500 1rem var(--sans);
  text-decoration: none;
  transition: transform .6s var(--ease);
}
.fab.is-hidden { transform: translateY(100%); }

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

@media (max-width: 1100px) {
  .hero__lead { grid-column: 1 / span 7; grid-row: 3; }
  .hero__legend { grid-column: 1 / -1; grid-row: 4; }
  .about__text { grid-column: 1 / span 6; }
  .about__plate { grid-column: 7 / -1; }
  .session__legend { grid-column: 1 / -1; }
}

/* Лінійка сеансу: на 90 хв колонка останнього етапу надто вузька, тож нижче 1100px — вертикально */
@media (max-width: 1100px) {
  .ruler { display: block; margin-left: .3rem; border-left: 1px solid var(--ink); }
  .ruler__seg, .ruler__scale { display: none; }
  .stage, .stage--up, .stage--down { border-left: 0; padding: 0 0 1.75rem 1.25rem; }
  .stage::after {
    content: "";
    position: absolute;
    left: -3.5px;
    top: .3rem;
    width: 6px;
    height: 6px;
    background: var(--ink);
  }
  .stage--main::after { background: var(--cinnabar); height: 2.5rem; }
  .stage--down::before { display: none; }
}

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 49;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem var(--gutter) 2rem;
    background: var(--paper) var(--grain);
    border-top: 1px solid var(--ink);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s var(--ease), visibility .4s;
  }
  .nav.is-open { opacity: 1; visibility: visible; }
  .nav a {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--hair);
    font-family: var(--serif);
    font-size: 1.75rem;
    color: var(--ink);
  }
  .nav__n { display: inline-block; width: 2.5rem; font-size: 1rem; font-style: italic; color: var(--cinnabar); }
  .nav .nav__book { display: block; margin-top: 1.5rem; border: 0; font-family: var(--sans); font-size: 1.125rem; }
}

@media (max-width: 900px) {
  .wrap > *,
  .chapter__content > * { grid-column: 1 / -1; grid-row: auto; }

  .hero__field {
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.3) 70%, rgba(0,0,0,.2));
            mask-image: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.3) 70%, rgba(0,0,0,.2));
  }

  .chapter__margin { position: static; display: flex; align-items: baseline; gap: .75rem; }
  .chapter__num { font-size: 2.25rem; }
  .chapter__label { margin: 0; }
  .chapter .wrap { row-gap: 2rem; }

  .about__plate { max-width: 26rem; }

  .bodymap { display: block; }
  .bodymap__list { display: flex; flex-wrap: wrap; gap: .5rem; border: 0; }
  .bodymap__item { border: 0; }
  .bodymap__toggle {
    align-items: center;
    gap: .5rem;
    padding: .4rem .8rem .4rem .4rem;
    border: 1px solid var(--ink);
  }
  .bodymap__n { width: 1.4rem; height: 1.4rem; transform: none; }
  .bodymap__title { font-family: var(--sans); font-size: .9375rem; }
  .is-active > .bodymap__toggle { background: var(--ink); color: var(--paper); }
  .js .bodymap__body { display: none; }
  .bodymap__figure { margin-top: 1.5rem; }
  .bodymap__svg { height: min(52vh, 440px); }
  .js .bodymap__panel { display: block; min-height: 9rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--ink); }
  .bodymap__panel h3 { margin-bottom: .5rem; }

  .before__side { position: static; }

  .chapter .find__head > * { grid-column: 1 / -1; grid-row: auto; }
  .find__rail { position: static; }
  .find__plate { position: static; display: flex; align-items: baseline; gap: .75rem; justify-self: start; text-align: left; margin-bottom: 1rem; }
  .find__plate .chapter__label { margin: 0; }
  .find__stage { display: flex; flex-direction: column; gap: 2rem; margin-top: 2rem; border: 0; }
  .find__map { position: static; order: 2; margin-inline: var(--gutter); aspect-ratio: 4 / 3; border: 1px solid var(--ink); }
  .find__overlay { padding: 0; pointer-events: auto; }
  .find__reel { justify-self: center; width: min(100%, 22rem); }
  .find__contacts { display: flex; flex-direction: column; align-items: stretch; gap: 1.75rem; padding-top: 2rem; }
  .contacts { display: block; border-top: 1px solid var(--ink); }
  .contacts > div {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--hair);
  }
  .contacts dd { margin-left: auto; text-align: right; }
}

@media (max-width: 760px) {
  body { font-size: 1.0625rem; }

  .hero__grid { min-height: calc(100svh - var(--header-h)); row-gap: 1.5rem; }
  .hero__title { font-size: clamp(3.5rem, 18vw, 6.5rem); }
  .hero__legend dl { grid-template-columns: 1.4fr 1fr; }
  .session__legend dl { grid-template-columns: 1fr; }
  .legend__tel { border-left: 0; border-top: 1px solid var(--ink); flex: 1 1 100%; }

  .fab { display: flex; }
  .footer { padding-bottom: 6rem; }
}

/* Найвужчі телефони (320–400): адреса й тривалість не влазять у дві колонки */
@media (max-width: 400px) {
  .hero__legend dl { grid-template-columns: 1fr; }
}

/* Режим високої контрастності (Windows): фони зникають, тож повертаємо
   межі кнопок, активний стан і крапки Брайля */
@media (forced-colors: active) {
  .btn, .fab { border: 1px solid LinkText; }
  .is-active > .bodymap__toggle,
  .is-active .bodymap__n { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .cell i.on { forced-color-adjust: none; background: CanvasText; box-shadow: none; }
  .ruler__seg { forced-color-adjust: none; background: CanvasText; }
  .ruler__seg--main, .stage--main::after { forced-color-adjust: none; background: Highlight; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation: none !important;
  }
}
